Skip to content

Revoke a specific API key

DELETE /api/v1/api-keys/{id}

DELETE /maas/api/v1/api-keys/{id}

Revokes a specific API key by changing its status to 'revoked'. The key will no longer be valid for authentication but remains visible in API key lists for audit purposes.

Authorization

Parameters

Name In Type Required Description
id path string Yes

ID of the API key to revoke

Responses

Status Description Response body
200 OK

OK. Key successfully revoked.

ApiKey

application/json

401 Unauthorized

Unauthorized response.

None
403 Forbidden

Forbidden. User trying to revoke another user's key.

None
404 Not Found

Not Found. API key not found.

None
500 Internal Server Error

Internal Server Error

None

Example request

curl -X DELETE "/maas/api/v1/api-keys/{id}" \
  -H "Authorization: Bearer $TOKEN"

Example response

200 OK, application/json

{
  "id": "key_abc123",
  "name": "my-production-key",
  "creationDate": "2024-01-15T10:30:00Z",
  "status": "revoked"
}