Endpoint
Authentication
Requires your publishable widget key in theAuthorization header:
org_id is derived from the widget key. You do not need to pass it in the request body.
Request Body
The user’s message. Max 10,000 characters.
The user’s external ID. Set to
"anonymous" or omit for unauthenticated users.JWT signed with your Identity Secret (HS256) for identity verification. Must include a
user_id claim matching the user_id field. May include additional trusted claims (email, name, role, plan, company_id). Required if identity verification is enabled. See Identity Verification.Session identifier for continuing a conversation. If omitted, a new session ID is generated and returned in the response. Pass the same
session_id across messages to maintain conversation continuity.The company’s external ID. Used to look up company data if the user isn’t already linked to a company.
One of
"chat", "voice", "video", or "livehelp".Target a specific agent for this request. If omitted, Halo routes to your active agent. Use this when you have multiple agents (e.g. a sales agent and a support agent) and want to pin the conversation to one of them.
Optional array of image URLs (or
data: URLs) to attach to the user message. Used for multimodal chat (screenshots, photos). Stored alongside the message in the transcript.Key-value user traits sent with this request. Merged with DB traits (request wins on conflicts).
Structured context entries. Each key maps to a
ContextEntry with label, optional type, and value. Merged with DB context (request wins on conflicts). See Context Entries.Previous messages for multi-turn context. Each item should have
speaker/role and text/content fields.Behavioral data about the user’s session (page views, clicks, frustration signals). Max 5,000 characters.
Response
The AI agent’s response text.
Unique session identifier for this conversation. Pass this back in subsequent requests to maintain continuity.
The ID of the agent that handled the request.
Actions triggered by the AI (highlights, ticket creation, etc.).
Confidence score (0-1). Based on knowledge base coverage, tool usage, and escalation signals.
Present when the message was routed directly to a team instead of being answered by the AI (direct-to-team chat routing). Shape:
{ action: string, ticket_id?: string }. When this is set, text contains the routing acknowledgement copy and no further AI generation runs for the message.