Base URL
All HaloAgents SDK endpoints live under a single base URL:Authentication
Most endpoints require your publishable widget key in theAuthorization header:
ab_live_... value is embedded in your install snippet under Setup > Install. It identifies your organization on each request. It is designed to be public (like Stripe’s pk_live_), not a server-only secret.
A dedicated server-only API key class is on the roadmap. This page will be updated when it ships. Until then, prefer calling the REST API from your backend. Routes that scope data by
user_id require Identity Verification: without an Identity Secret, identified requests are rejected with 403.The Config endpoint is the only exception — it is unauthenticated and uses an
org_id query parameter instead. This allows the widget to load agent configuration before authentication is established.Identity Verification (JWT)
Identity verification prevents user impersonation and is required for any request that names a user. Your backend signs a JWT containing theuser_id (and optional trusted claims like email, role, plan) using your Identity Secret (ha_secret_...), and passes it as user_token in chat requests. Anonymous requests (no user_id, or user_id: "anonymous") need no token.
user_id is provided without a valid user_token, the request is rejected with a 403 error. Workspaces that have not generated an Identity Secret yet receive the same 403 for identified requests (the server fails closed rather than trusting an unverifiable user_id). See Identity Verification for full setup instructions.
CORS
All endpoints support CORS withAccess-Control-Allow-Origin: *. You can call them from any domain.
Preflight (OPTIONS) requests are handled automatically.
Rate Limits
Common Response Format
Successful responses return JSON with relevant data. Error responses follow this format:200— Success400— Invalid request (missing fields, validation failure)401— Missing or invalid API key403— Identity verification failed (invalid or expireduser_token)404— Resource not found (no active agent, etc.)500— Server error
Endpoints
POST /chat
Send a message and get a complete AI response.
POST /chat/stream
Send a message and get a streaming AI response.
POST /tickets/create
Create a support ticket programmatically.
POST /events
Send behavioral tracking events.
POST /users/identify
Create or update an end user record.
POST /companies/identify
Create or update a company record.
POST /series
Enroll or remove users from email series.
GET /config
Get the active agent configuration for an org.