Skip to main content
DELETE
Delete API key
Deleting a key revokes it immediately. Darwin retains non-secret metadata for audit history, so the operation returns the revoked key record.

Manage API keys in Darwin

Create a replacement key before revoking a key that is still in use.

Authorizations

__Secure-better-auth.session_token
string
cookie
required

The HTTP-only Darwin account session cookie set after sign-in. Local development uses better-auth.session_token without the __Secure- prefix.

Path Parameters

apiKeyId
string
required

The API-key ID returned by Create API key or List API keys. This is not the secret key value.

Required string length: 1 - 200

Response

The revoked API-key metadata.

id
string
required

Stable non-secret identifier for the API key.

name
string
required

Human-readable key name supplied at creation.

prefix
string
required

Non-secret prefix you can use to identify the key in logs and settings.

scopes
string[]
required

Permissions granted to the key. Every API operation still enforces its required scope.

requestCount
integer
required

Lifetime number of requests authenticated with this key.

Required range: x >= 0
lastUsedAt
string<date-time> | null
required

When Darwin most recently authenticated a request with this key, or null if unused.

expiresAt
string<date-time> | null
required

When the key expires, or null when it has no scheduled expiration.

revokedAt
string<date-time> | null
required

When the key was revoked, or null while it has not been revoked.

createdAt
string<date-time>
required

When the key was created.

Last modified on September 21, 2026