Skip to main content

Endpoint

DELETE /api/v1/keys/{id}
Host: api.driftguard.dev
Permanently removes a key from your account. This action is irreversible — the key cannot be recovered or reactivated after deletion.
A key must be revoked before it can be deleted. Attempting to delete an active key will return a 400 error. Revoke it first via POST /api/v1/keys//revoke, then delete it.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe key ID to delete — must already be revoked

Request

# Step 1 — revoke first
curl -s -X POST https://api.driftguard.dev/api/v1/keys/your_key_id_here/revoke \
  -H "X-API-Key: $DRIFTGUARD_KEY"

# Step 2 — then delete
curl -s -X DELETE https://api.driftguard.dev/api/v1/keys/your_key_id_here \
  -H "X-API-Key: $DRIFTGUARD_KEY"

Response

{
  "id": "your_key_id_here",
  "deleted": true
}

Response Fields

FieldTypeDescription
idstringThe key that was permanently deleted
deletedbooleanAlways true on a successful delete

Error Responses

StatusMeaning
400Key is still active — revoke it before deleting
401Missing or invalid X-API-Key
404Key not found, or belongs to a different user
429Rate limit exceeded — 100 req/min per key

Revoke Key

Revoke a key before deleting it.

Create Key

Create a replacement key after deleting the old one.