Create client token

Create a new client token for browser-to-API communication. Returns the plain token value once.

Authentication

AuthorizationBearer
API key or Clerk session token

Request

This endpoint expects an object.
allowedOriginslist of stringsRequired
Allowed request origins for this token. Each entry is an exact origin (https://app.example.com), a wildcard subdomain (https://*.example.com), '*' for all origins, or the literal 'native' — a sentinel that admits requests carrying NO Origin header (native mobile apps). A token with 'native' has effectively no origin protection and relies on its capability scope.
namestringRequired1-255 characters
agentIdslist of stringsOptionalDefaults to []
configmap from strings to anyOptionalDefaults to {}
defaultFlowIdstringOptional
environmentenumOptionalDefaults to live
Allowed values:
flowIdslist of stringsOptionalDefaults to []
maxMessagesPerSessiondoubleOptional1-1000Defaults to 100
pinToVersionstringOptionalDefaults to latest
productSurfaceIdstringOptional
rateLimitPerHourdoubleOptional1-10000Defaults to 100
rateLimitPerMinutedoubleOptional1-1000Defaults to 10
sessionIdleTimeoutMinutesdoubleOptional1-1440Defaults to 30

Response

Created client token
clientTokenobject
tokenstring
warningslist of objects

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error