Skip to main content

Endpoint

GET /api/v1/keys
Host: api.driftguard.dev

Request

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

Response

[
  {
    "id": "your_key_id_here",
    "key_preview": "dg_live_xxxxxxxx",
    "environment": "live",
    "is_active": true,
    "created_at": "2026-03-01T12:00:00Z",
    "last_used_at": "2026-03-01T18:00:00Z"
  },
  {
    "id": "your_second_key_id_here",
    "key_preview": "dg_test_xxxxxxxx",
    "environment": "test",
    "is_active": false,
    "created_at": "2026-02-15T09:00:00Z",
    "last_used_at": "2026-02-20T14:00:00Z"
  }
]

Response Fields

FieldTypeDescription
idstringUnique identifier for this key — use it for revoke, activate, and delete operations
key_previewstringFirst 16 characters of the key — for identification only
environmentstringlive or test
is_activebooleanWhether this key can currently authenticate requests
created_atstringISO 8601 timestamp of when the key was created
last_used_atstringISO 8601 timestamp of the last successful request made with this key
Full key values are never returned by this endpoint. The complete key is only shown once at creation via POST /api/v1/keys. If you have lost a key, revoke it and create a new one.

Error Responses

StatusMeaning
401Missing or invalid X-API-Key
429Rate limit exceeded — 100 req/min per key

Create Key

Generate a new API key for your account.

Revoke Key

Deactivate a key to stop it authenticating requests.