Chat
Create Session
Open a new chat session with an agent.
POST
Create session
Every endpoint on this page requires either a Clerk-issued JWT (
Authorization: Bearer <token>) or
an organization API key (x-api-key: pk_…). Anonymous calls return 401 Unauthorized. See
Authentication for the full setup.Code examples
Sample response
Store the session
id — you’ll pass it as {sessionId} in every subsequent message call.Authorizations
Body
application/json
The agent to chat with.
Example:
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Originating platform. Affects session tagging and analytics.
Available options:
SDK, WEB, WHATSAPP, VOICE Arbitrary key-value pairs attached to the session (max 4096 characters total). Useful for storing user IDs, locale, etc.
Contact information to associate with this session.
Create session