M2M Tokens
Get M2M Tokens
Fetches M2M tokens for a specific machine.
Only tokens created with the opaque token format are returned by this endpoint. JWT-format M2M tokens are stateless and are not stored.
This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key.
- When fetching M2M tokens with a Machine Secret Key, only tokens associated with the authenticated machine can be retrieved.
- When fetching M2M tokens with a Clerk Secret Key, tokens for any machine in the instance can be retrieved.
get/m2m_tokens
Query parameters
subjectstring required
revokedboolean nullable
expiredboolean nullable
limitnumber
offsetnumber nullable
Response
200 OK
Example response
{
"m2m_tokens": [
{
"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
}
]
}