API Reference
Complete reference for the Support Gateway API and the 4 endpoints your host application must implement.
Gateway API
These endpoints are served by the Support Gateway. The widget calls them automatically. You can also call them directly for custom integrations.
/api/healthNoneHealth check endpoint. Returns the gateway status and version.
/api/casesBearer JWTCreate a new support case. The gateway generates a Support Context Snapshot, calls your 4 endpoints, and sends the first AI response.
Parameters
messagestringrequiredInitial user messagecontextobjectOptional context metadataRequest Body
{
"message": "I can't upload files larger than 50MB",
"context": { "page": "/projects/1/files" }
}/api/cases/:caseIdBearer JWTRetrieve a support case with all its messages, including evidence and suggested actions.
Parameters
caseIdstringrequiredCase ID (cas_xxx)/api/cases/:caseId/messagesBearer JWTSend a follow-up message to an active case. Returns the AI response with evidence.
Parameters
caseIdstringrequiredCase IDRequest Body
{ "content": "How do I increase my upload limit?" }/api/cases/:caseId/feedbackBearer JWTSubmit user feedback (thumbs up/down) for a case.
Request Body
{ "feedback": "positive" }/api/cases/:caseId/closeBearer JWTClose a support case with resolution status and optional rating.
Request Body
{
"resolution": "resolved",
"rating": 9
}/api/cases/:caseId/escalateBearer JWTEscalate a case to your ticketing system (Zendesk, Jira, etc.). Creates a ticket with full context.
Request Body
{ "reason": "Need manual account adjustment" }Client Integration Endpoints
Your host application must implement these 4 endpoints. The Support Gateway calls them server-to-server to build the Support Context Snapshot for each case.
/support/user-stateService TokenReturns the current state of a user: roles, plan, enabled features, active resources, errors, and limits. This is the primary context source for AI diagnosis.
Parameters
userIdstringrequiredUser ID to look up/support/user-historyService TokenReturns recent user activity events and click timeline within the specified time window. Used to understand what the user was doing before contacting support.
Parameters
userIdstringrequiredUser IDwindowHoursnumberLookback window (default: 72)/support/user-logsService TokenReturns backend request logs, background job states, and errors for the user. Provides the 'server side' of the story to correlate with user-visible errors.
Parameters
userIdstringrequiredUser IDwindowHoursnumberLookback window (default: 72)/support/business-rulesService TokenReturns your application's business rules and error catalog. Provides the AI with domain knowledge about what limits, rules, and error resolutions exist.