POST/m2m_tokens/verify

Verify an M2M token

Verifies an M2M token and returns its token details when valid. Supply the token in the token field. A Machine Secret Key can verify a token only when it grants access to that machine, while a Clerk Secret Key can verify any token in the instance.

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

1 body field

The M2M token to verify.

tokenstringrequired
The M2M token value to verify.

3 status codes
200Returns the M2M token object, including its identifier, machine subject, scopes, revocation and expiration status, and timestamps.
objectstringrequired
Allowed:machine_to_machine_token
idstringrequired
subjectstringrequired
claimsunknownoptional
scopesarray<string>optional
Default:[]
revokedbooleanrequired
revocation_reasonstringrequired
expiredbooleanrequired
expirationnumberrequired
The timestamp for when the token will expire, in milliseconds
last_used_atnumberrequired
The timestamp for when the token was last used, in milliseconds
created_atnumberrequired
The timestamp for when the token was created, in milliseconds
updated_atnumberrequired
The timestamp for when the token was last updated, in milliseconds
400Returned when the request is invalid or the token field is missing.
errorsarray<object>required
404Returned when the token cannot be found.
errorsarray<object>required

Error handling

A 400 is returned when the request is invalid, and a 404 when the token cannot be found. The token field is required. When authenticating with a Machine Secret Key, the token must grant access to the associated machine.