Delete API Key
Delete an API key. The key stops working for authentication immediately.
DELETE
You can only delete keys that belong to you. Another user's key, or a workspace service key, returns 404.
Your role needs the api_keys:delete permission. Otherwise the request fails with 403 {"error": "Insufficient permissions", ...}. Connected apps (OAuth tokens) get 403 {"error": "API keys cannot be managed by connected apps."}.
Headers
x-workspace-idstringrequiredThe workspace used for the permission check.
Path Parameters
idstringrequiredThe key record's _id (not the key itself).
Response Fields
successbooleantrue when the key was deleted.
Errors
| Status | Body | When |
|---|---|---|
403 | {"error": "Insufficient permissions", ...} | Your role lacks api_keys:delete |
403 | {"error": "API keys cannot be managed by connected apps."} | The request used an OAuth (connected app) token |
404 | {"error": "API key not found"} | No key with that ID belongs to you |
500 | {"error": "Internal server error", "message": "..."} | Unexpected server error |
{
"success": true
}Last updated on