Create Clerk M2M token
Create a machine-to-machine token in a connected Clerk instance.
← All Clerk endpoints · Capability overview
/v1/clerk/m2m-tokenshttps://api.vee3.io/v1/clerk/m2m-tokens
Create a machine-to-machine token in a connected Clerk instance.
Authorization
Send your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
MCP
The same capability is available as an MCP tool on Vee3 hosted MCP.
Tool name
clerk.create_m2m_tokenParameters6 fields
clerk_instance_idstringOptionalClerk instance id (ins_...) from clerk.get_connected_accounts. Omit to use the default connected account.
machine_secret_keystringRequiredMachine secret key (msk_...) used to authenticate the create request.
token_formatstringOptionalToken format: "opaque" (default) or "jwt".
seconds_until_expirationnumberOptionalToken lifetime in seconds.
min 0
claimsobjectOptionalOptional custom claims embedded in the token.
min_remaining_ttl_secondsintegerOptionalFor opaque tokens, reuse an existing token with at least this TTL remaining.
min 0
Response9 fields
m2m_tokenobject8 fieldsCreated M2M token from the Backend API.
m2m_tokenobjectidstringM2M token id (mt_...).
subjectstringMachine id (mch_...) that created or owns the token.
tokenstringM2M token secret when returned on creation. Treat as high-privilege — do not log.
revokedbooleanWhether the token has been revoked.
expiredbooleanWhether the token has expired.
expirationintegerUnix timestamp in milliseconds when the token expires.
created_atintegerUnix timestamp in milliseconds when the token was created.
updated_atintegerUnix timestamp in milliseconds when the token was last updated.
HTTP errors: clerk_connection_required, clerk_connection_not_found, clerk_connection_invalid, validation_error, unauthorized, payment_required