Revoke API key
const url = 'https://localhost:8080/api/v1/api-keys/example';const options = { method: 'DELETE', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"reason":"Key compromised"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://localhost:8080/api/v1/api-keys/example \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "reason": "Key compromised" }'Revoke one of the authenticated user’s API keys, optionally recording a revocation reason. JWT/session only — API keys cannot manage API keys
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”API Key ID
Request Body
Section titled “Request Body ”Optional revocation reason
object
Defaults to “Revoked by user”
Example
Key compromisedResponses
Section titled “ Responses ”API key revoked successfully
Confirmation body for endpoints that return no resource
object
Example
{ "message": "Operation completed successfully"}Bad request - Invalid key ID
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Unauthorized - Authentication required
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Forbidden - API keys cannot manage API keys, or can only revoke own API keys
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}API key not found
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}API key already revoked
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Internal server error
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}