clerk.create_m2m_token
Create an M2M token in a connected Clerk instance.
Sensitive — the returned token is a high-privilege secret; do not log or expose it.
Call clerk.get_connected_accounts first. Pass clerk_instance_id to target a specific connection, or omit it to use the default account.
Returns the created M2M token.
Cost = 15 tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| claims | No | Optional custom claims embedded in the token. | |
| token_format | No | Token format: "opaque" (default) or "jwt". | |
| clerk_instance_id | No | Clerk instance id (ins_...) from clerk.get_connected_accounts. Omit to use the default connected account. | |
| machine_secret_key | Yes | Machine secret key (msk_...) used to authenticate the create request. | |
| seconds_until_expiration | No | Token lifetime in seconds. | |
| min_remaining_ttl_seconds | No | For opaque tokens, reuse an existing token with at least this TTL remaining. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| m2m_token | No | Created M2M token from the Backend API. |