POST/api_keys/verify

Verify an API key

Verifies an API key using its secret. Supply the key in the secret field to retrieve its metadata and status. The response includes whether the key is revoked or expired and its associated subject and scopes.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 body field

The API key secret to verify.

secretstringrequired
The secret value of the API key to verify.

3 status codes
200Returns the API key object, including its identifier, type, subject, claims, scopes, revocation and expiration status, and timestamps.
objectstringrequired
Allowed:api_key
idstringrequired
typestringrequired
subjectstringrequired
namestringrequired
descriptionstringoptional
claimsunknownrequired
scopesarray<string>required
revokedbooleanrequired
revocation_reasonstringrequired
expiredbooleanrequired
expirationnumberrequired
The timestamp for when the API key will expire, in milliseconds
created_bystringrequired
last_used_atnumberrequired
The timestamp for when the API key was last used, in milliseconds
created_atnumberrequired
The timestamp for when the API key was created, in milliseconds
updated_atnumberrequired
The timestamp for when the API key was last updated, in milliseconds
400Returned when the request is invalid.
errorsarray<object>required
404Returned when the API key cannot be found.
errorsarray<object>required

Error handling

A 400 is returned when the request is invalid, and a 404 when the API key cannot be found. The secret field is required and must contain the API key secret.