- API Reference
- Box API
- API keys
Delete an API key
Use this to remove a key for good. It stops working at once, so every bot or rotation link that still uses it is refused with invalid_token. An expired key can be deleted. Available from XProxy v21.3.61.
/v2/api_keys/deleteRequest body application/json · required
Key number from GET /v2/api_keys.
Authentication
Needs the admin login (HTTP Basic, or the panel session). An API key cannot manage API keys: any key sent here, even a valid Full access key, is refused with HTTP 401 invalid_token, also from the LAN. A browser request whose Origin is not the panel's own address is refused with HTTP 403 cross_origin; requests without an Origin header (curl, scripts) are not affected.
How authentication works: login, API keys, LAN and 401 answers →
Responses
Deleted, or the reason it was refused.
Either an API key was sent and refused (invalid_token), or no key was sent and the caller is not trusted and sent no valid Basic credentials (the same refusals as other routes). invalid_token is the same body for an unknown, expired, deleted, regenerated, malformed or wrong-type key, so it never tells which. It is answered from every address, including the LAN, loopback, a whitelisted IP and Tailscale. Also sent with WWW-Authenticate and Cache-Control: no-store.
A browser request from another origin.
Errors returned in msg
| msg | Meaning | What to do |
|---|---|---|
not_found | No key has this id, or id is not a whole number (code field, HTTP 200). | Take the id from GET /v2/api_keys. |
invalid_token | An API key was sent. Keys cannot manage keys (HTTP 401). | Call this with the admin login and no key. |
cross_origin | The request came from a browser page on another origin (HTTP 403, in the code field). | Open the panel itself |