Skip to content

Purge (hard-delete) an SSH certificate — erase all DB trace of a mis-issued cert

DELETE
/ssh/certs/{id}
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": "..." }.

id
required
string

Certificate id to purge

force
boolean

Required to purge a certificate that is revoked AND still within its validity window.

dropRevocation
boolean

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.

Default Response

Media typeapplication/json
object
key
additional properties
any

Example generated

{}

Default Response

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
key
additional properties
any
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

Default Response

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
key
additional properties
any
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

Default Response

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
key
additional properties
any
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}