Purge (hard-delete) an SSH certificate — erase all DB trace of a mis-issued cert
const url = 'https://pki.example.com/api/v1/ssh/certs/example';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://pki.example.com/api/v1/ssh/certs/example \ --header 'Authorization: Bearer <token>'Permanently deletes the certificate row and every DB trace of it. Use this to undo a certificate
that was created by mistake and never left the server — NOT to decommission a deployed host
(offboard the host instead). Always writes an ssh.cert.purge audit_log entry.
A certificate is a self-contained signed credential: once issued, copies may exist outside this database (on hosts, in ~/.ssh, in backups, or in an attacker’s hands). Deleting the row does NOT recall those copies. The KRL — which is rebuilt from DB state — is the only thing that stops a still-valid copy. Behaviour therefore depends on the cert’s state:
• active (never revoked): PURE PURGE. Its serial was never in the KRL, so removal is KRL-neutral.
This is the intended case. force is not required.
• revoked + still valid: requires force=true. By DEFAULT the serial is preserved in the KRL (via a
standalone directive) so it stays revoked until it expires — the record is gone, the kill-switch
survives. Add dropRevocation=true to ALSO remove it from the KRL, which RE-ENABLES any copy still
in the wild — only safe if the certificate truly never left the server.
• expired: purged freely; the clock already rejects it.
Idempotent: purging an unknown id returns 404. Reason (optional) may be sent as { "reason": "..." }.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Certificate id to purge
Query Parameters
Section titled “Query Parameters”Required to purge a certificate that is revoked AND still within its validity window.
With force, also removes the serial from the KRL (re-enabling any copy in the wild). Ignored for active/expired certs. DANGEROUS — only when the cert never left the server.
Responses
Section titled “Responses”Default Response
object
Example generated
{}Default Response
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}Default Response
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}Default Response
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}