Skip to main content
PATCH
/
v1
/
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" } }

Authorizations

X-API-Key
string
header
required

API key for authentication

Path Parameters

api_key_id
string
required

API key resource ID (ULID, 26 characters)

Pattern: ^[0-9A-Z]{26}$

Body

application/json

Update the status of an API key.

status
enum<string>
required

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"

reason
string | null

Reason for the status change (for audit purposes)

Maximum string length: 2000
Example:

"Key compromised, revoking as a precaution"

Response

API key status updated successfully

api_key
object
required

API key resource. Key values are masked except during creation.