Renew device certificate
const url = 'http://localhost:3000/api/v1/devices/550e8400-e29b-41d4-a716-446655440000/certificates/550e8400-e29b-41d4-a716-446655440001/renew';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"validityDays":365}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/devices/550e8400-e29b-41d4-a716-446655440000/certificates/550e8400-e29b-41d4-a716-446655440001/renew \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "validityDays": 365 }'Extends the expiry of a device certificate. WFM-internal bookkeeping only; does not require the device to re-onboard.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
550e8400-e29b-41d4-a716-446655440000Device UUID
Example
550e8400-e29b-41d4-a716-446655440001Certificate UUID
Request Bodyrequired
Section titled “Request Bodyrequired”object
Number of days to extend the certificate validity from today
Example
365Responses
Section titled “Responses”Certificate renewed successfully
object
Unique certificate identifier (UUID)
Device ID this certificate belongs to
SHA-256 fingerprint of the certificate
Certificate subject (Distinguished Name)
Certificate issuer (Distinguished Name)
Certificate validity start date
Certificate validity end date (expiration)
Whether the certificate has been revoked
Date when the certificate was revoked
Reason for certificate revocation
Timestamp when the certificate was issued
Example
{ "id": "550e8400-e29b-41d4-a716-446655440000", "deviceId": "550e8400-e29b-41d4-a716-446655440001", "fingerprint": "A1:B2:C3:D4:E5:F6:A1:B2:C3:D4:E5:F6:A1:B2:C3:D4:E5:F6:A1:B2:C3:D4:E5:F6:A1:B2:C3:D4:E5:F6:A1:B2", "subject": "CN=edge-device-001,O=Margo WFM,OU=Devices", "issuer": "CN=Margo Root CA,O=Margo WFM,OU=Certificate Authority", "notBefore": "2024-01-01T00:00:00Z", "notAfter": "2025-01-01T00:00:00Z", "revoked": false, "revokedAt": "2024-06-01T00:00:00Z", "revokeReason": "Key compromise", "createdAt": "2024-01-01T00:00:00Z"}Bad Request - Cannot renew a revoked certificate
Unauthorized - Invalid or missing authentication
Forbidden - Insufficient permissions (operator or admin)
Device or certificate not found