API · Dashboard keys
Revoke a key. It stops working at once; revoking twice is a no-op.
DELETE /v1/accounts/{id}/keys/{key_id}
| |
|---|
| Request | DELETE /v1/accounts/{id}/keys/{key_id} |
| Operation id | keys.revoke |
| Cost | Free |
| Auth | Dashboard session: Authorization: Bearer <session_token>. API keys are refused. |
| Name | Type | Required | Description |
|---|
id | string | yes | Example: acct_01J…. |
key_id | string | yes | |
| Status | Meaning | Schema |
|---|
200 | The revoked key. | ApiKey |
401 | Not signed in, or an API key was sent (keys cannot manage keys). | Error |
403 | Members can’t revoke keys; owners and admins can. | Error |
404 | No such account among yours, or no such key on it. | Error |
| Field | Type | Description |
|---|
id | string | |
name | string | |
display_prefix | string | The key’s first characters, to tell keys apart. |
source | "dashboard" | "agent_signup" | "cli" | "oauth" | |
scopes | string[] | |
daily_spend_cap_credits | integer | null | |
monthly_spend_cap_credits | integer | null | |
spent_today_credits | integer | |
spent_this_month_credits | integer | |
last_used_at | string | null | |
expires_at | string | null | |
revoked_at | string | null | |
created_at | string | |
Errors use one shape everywhere; see Errors for every code and what to do.