Skip to content
Monologue
Esc
navigateopen⌘Jpreview

Create a client token

Mint a short-lived token for a browser, mobile, or desktop client. Call this endpoint only from a trusted server.

POST/v1/enterprise/client-tokens
Authorization
X-API-KeyAPI key · headerrequired
Long-lived Enterprise API credential provisioned for trusted servers.
Request body
requiredapplication/json
originstring<uri>
Exact browser origin to bind to the token. Use this or client_app_id, not both.
client_app_idstring
Stable native client identifier. Use this or origin, not both.
max length 255
client_user_idstring
Optional user correlation ID.
max length 255
client_session_idstring
Optional session correlation ID.
max length 255
ttl_secondsinteger
Requested lifetime. Values above 120 are capped at 120 seconds.
min 1 · default: 60
Responses
201Client token created.
client_tokenstringrequired
Short-lived bearer token beginning with mlg_ent_client_.
expires_atstring<date-time>required
401The credential is missing, invalid, expired, or revoked.
errorstring
codestring
request_idstring
Request
curl -X POST "https://go.monologue.to/v1/enterprise/client-tokens" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "origin": "https://app.example.com",
  "client_user_id": "user_123",
  "client_session_id": "session_456",
  "ttl_seconds": 60
}'
Response
{
  "client_token": "string",
  "expires_at": "2024-01-01T00:00:00Z"
}