GET/m2m_tokens

List M2M tokens for a machine

Lists stored opaque-format M2M tokens for a specific machine; stateless JWT-format tokens are not included. Use revoked and expired to filter the results, and limit and offset to control pagination. Authenticate with a Machine Secret Key to retrieve tokens for its machine, or a Clerk Secret Key to retrieve tokens for any machine in the instance.

5 parameters
subjectstringrequired
Machine identifier to list tokens for. Must match `mch_` followed by 27 word characters.
revokedbooleanoptional
Filter by whether tokens have been revoked. Defaults to false when omitted.
Default:false
expiredbooleanoptional
Filter by whether tokens have expired. Defaults to false when omitted.
Default:false
limitnumberoptional
Maximum number of tokens to return, from 1 to 100. Defaults to 10 when omitted.
Default:10
offsetnumberoptional
Number of tokens to skip before returning results. Must be 0 or greater. Defaults to 0 when omitted.
Default:0

4 status codes
200Returns an array of M2M token objects and the total number of matching tokens. The list includes stored opaque-format tokens only.
m2m_tokensarray<object>required
total_countnumberrequired
400Returned when a query parameter has an invalid value.
errorsarray<object>required
403Returned when the credentials do not authorize access to the requested machine's tokens.
errorsarray<object>required
404Returned when the specified machine cannot be found.
errorsarray<object>required

Error handling

A 400 is returned when a query value is invalid, a 403 when the credentials do not authorize access to the requested machine's tokens, and a 404 when the machine cannot be found. subject must match the machine identifier format mch_ followed by 27 word characters; limit must be between 1 and 100, and offset must be 0 or greater.