Revoke device certificate
const url = 'http://localhost:3000/api/v1/devices/550e8400-e29b-41d4-a716-446655440000/certificates/550e8400-e29b-41d4-a716-446655440001/revoke';const options = { method: 'POST', headers: { 'x-user-id': 'example', 'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json' }, body: '{"reason":"Key compromise","notes":"Device was stolen from warehouse"}'};
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/revoke \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --header 'x-user-id: example' \ --data '{ "reason": "Key compromise", "notes": "Device was stolen from warehouse" }'Revokes a device certificate. This action cannot be undone.
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
Header Parameters
Section titled “Header Parameters ”Request Body required
Section titled “Request Body required ”object
Reason for revoking the certificate
Example
Key compromiseAdditional notes about the revocation (required if reason is “Other”)
Example
Device was stolen from warehouseResponses
Section titled “ Responses ”Certificate revoked 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 - Invalid revocation reason
Unauthorized - Invalid or missing authentication
Forbidden - Insufficient permissions (operator or admin)
Device or certificate not found, or certificate already revoked