Skip to main content
API Keys

Revoke the current API key

Revokes the API key that you send with this request. Use it when a key leaks (for example in a git commit, a log, or a chat message), or when a script or integration no longer needs its key.

DELETE
/v2/api_keys/self

The key stops working at once. The next request with it returns 403. You cannot undo this: create a new key in the dashboard under Settings → API.

Every API key can call this endpoint, on every plan. This includes docs-only CI keys. The audit log records the revocation (action api_key.deleted, actor: the revoked key).

A repeated call with the same key returns 403, because the key is no longer valid.

Response

{
  "id": "507f1f77bcf86cd799439011",
  "object": "api_key",
  "deleted": true
}

Authentication

Use an organization API key. OAuth access tokens (MCP connectors) cannot call this endpoint: revoke them with POST /oauth/revoke (RFC 7009), or disconnect the client in the dashboard.

Version Availability

This endpoint is available in every API version.

Authorizationstringheaderrequired

API key as Bearer token. Use: Authorization: Bearer sk_...

Featurebase-Versionenum<string>header

API version for this request. Defaults to your organization's configured API version if not specified.

Available options: 2026-08-19.orbit, 2026-01-01.nova, 2025-12-12.clover
Example: 2026-08-19.orbit

Response

application/json

Success

deletedenum<boolean>required

Indicates the API key was revoked

Available options: true
Example: true
idstringrequired

Unique identifier of the revoked API key

Example: 507f1f77bcf86cd799439011
objectenum<string>required

Object type identifier

Available options: api_key
Example: api_key