Skip to content
English
  • There are no suggestions because the search field is empty.

Revoke API key

DELETE /api/v1/api-keys/{keyId} Select code sample Fetch cURL
const url = 'https://localhost:8080/api/v1/api-keys/example';const options = {  method: 'DELETE',  headers: {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: 
  
   ' \ --header 'Content-Type: application/json' \ --data '{ "reason": "Key compromised" }'
  

Revoke one of the authenticated user’s API keys, optionally recording a revocation reason

Authorizations

Section titled “Authorizations ”

Parameters

Section titled “ Parameters ”

Path Parameters

Section titled “Path Parameters ” keyId required string

API Key ID

Request Body

Section titled “Request Body ”

Optional revocation reason

Media type application/json object reason string
Example
Key compromised

Responses

Section titled “ Responses ”

200

Section titled “200 ”

API key revoked successfully

Media type application/json object message string
Example
{  "message": "Operation completed successfully"}

400

Section titled “400 ”

Bad request - Invalid key ID

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

401

Section titled “401 ”

Unauthorized - Authentication required

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

403

Section titled “403 ”

Forbidden - Can only revoke own API keys

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

404

Section titled “404 ”

API key not found

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

409

Section titled “409 ”

API key already revoked

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

500

Section titled “500 ”

Internal server error

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}
Previous
Get API key details
Next
Get JSON Web Key Set for token validation