v13

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-04237161688.6 KB
M2M Tokens

Revoke a M2M Token

Revokes a M2M Token.

This endpoint only revokes stored opaque-format M2M tokens. JWT-format M2M tokens are stateless and cannot be revoked.

This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key.

  • When revoking a M2M Token with a Machine Secret Key, the token must managed by the Machine associated with the Machine Secret Key.
  • When revoking a M2M Token with a Clerk Secret Key, any token on the Instance can be revoked.
post/m2m_tokens/{m2m_token_id}/revoke

Path parameters

m2m_token_idstring required

Request body

revocation_reasonstring nullable

Response

200 OK

object'machine_to_machine_token' required
idstring required
subjectstring required
{"stackTrail":"paths:/m2m_tokens/{m2m_token_id}/revoke:post:responses:200:content:application/json:schema:properties:claims","oasType":"schema","type":"unknown","example":{"important_metadata":"Some useful data"},"nullable":true}
scopesstring[]
revokedboolean required
revocation_reasonstring nullable required
expiredboolean required
expirationnumber nullable required

The timestamp for when the token will expire, in milliseconds

last_used_atnumber nullable required

The timestamp for when the token was last used, in milliseconds

created_atnumber required

The timestamp for when the token was created, in milliseconds

updated_atnumber required

The timestamp for when the token was last updated, in milliseconds

Example response

{
  "id": "mt_f7f0ba8c3b4843ce7d85fcdd5e71853e",
  "subject": "mch_2xhFjEI5X2qWRvtV13BzSj8H6Dk",
  "claims": {
    "important_metadata": "Some useful data"
  },
  "scopes": [
    "mch_2xhFjEI5X2qWRvtV13BzSj8H6Dk",
    "mch_2yGkLpQ7Y3rXSwtU24CzTk9I7Em"
  ],
  "revocation_reason": "Revoked by user",
  "expiration": 1716883200000,
  "last_used_at": 1716883200000,
  "created_at": 1716883200000,
  "updated_at": 1716883200000
}