curl --request PATCH \
--url https://api.coval.dev/v1/api-keys/{api_key_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"status": "REVOKED",
"reason": "Key compromised, revoking as a precaution"
}
'
{
"api_key": {
"id": "01HX2ABC3DEF4GHI5JKL6MNO7P",
"organization_id": "caf26438",
"api_key": "****-****-****-o5p6",
"key_type": "SERVICE",
"status": "REVOKED",
"name": "Production Service Key",
"description": "Primary key for production backend service authentication",
"permissions": [],
"create_time": "2025-10-14T12:00:00Z",
"update_time": "2025-10-23T16:45:00Z",
"last_used_at": "2025-10-16T09:15:00Z"
}
}
API Keys
Update API key status
Update the status of an API key. REVOKED is a terminal state.
PATCH
/
api-keys
/
{api_key_id}
curl --request PATCH \
--url https://api.coval.dev/v1/api-keys/{api_key_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"status": "REVOKED",
"reason": "Key compromised, revoking as a precaution"
}
'
{
"api_key": {
"id": "01HX2ABC3DEF4GHI5JKL6MNO7P",
"organization_id": "caf26438",
"api_key": "****-****-****-o5p6",
"key_type": "SERVICE",
"status": "REVOKED",
"name": "Production Service Key",
"description": "Primary key for production backend service authentication",
"permissions": [],
"create_time": "2025-10-14T12:00:00Z",
"update_time": "2025-10-23T16:45:00Z",
"last_used_at": "2025-10-16T09:15:00Z"
}
}
Path Parameters
Body
application/json
Update the status of an API key.
Current status of the API key.
- ACTIVE: Key is active and can be used for authentication
- REVOKED: Key has been permanently revoked (terminal state)
- SUSPENDED: Key is temporarily disabled and can be reactivated
- EXPIRED: Key has expired and can be reactivated
Available options:
ACTIVE, REVOKED, SUSPENDED, EXPIRED Example:
"ACTIVE"
Was this page helpful?