Skip to main content

Endpoint

POST /api/v1/keys/{id}/revoke
Host: api.driftguard.dev
Revoking a key sets is_active to false. Any request made with a revoked key will immediately return 401. The key is not deleted — it can be reactivated at any time via POST /api/v1/keys//activate.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe key ID to revoke — from GET /api/v1/keys

Request

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

Response

{
  "id": "your_key_id_here",
  "is_active": false,
  "environment": "live",
  "key_preview": "dg_live_xxxxxxxx"
}

Response Fields

FieldTypeDescription
idstringThe key that was revoked
is_activebooleanAlways false after a successful revoke
environmentstringlive or test
key_previewstringFirst 16 characters of the key for identification
Revoke is reversible. If you need to permanently remove a key, use DELETE /api/v1/keys/ after revoking it.

Error Responses

StatusMeaning
401Missing or invalid X-API-Key
404Key not found, or belongs to a different user
429Rate limit exceeded — 100 req/min per key

Activate Key

Reactivate a previously revoked key.

Delete Key

Permanently delete a revoked key.