Skip to content

Revoke API key

DELETE
/api/v1/api-keys/{keyId}
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

keyId
required
string

API Key ID

Optional revocation reason

Media type application/json
object
reason

Defaults to “Revoked by user”

string
Example
Key compromised

API key revoked successfully

Media type application/json

Confirmation body for endpoints that return no resource

object
message
string
Example
{
"message": "Operation completed successfully"
}

Bad request - Invalid key ID

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

Unauthorized - Authentication required

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

Forbidden - API keys cannot manage API keys, or can only revoke own API keys

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

API key not found

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

API key already revoked

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

Internal server error

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}