Reference

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.

GET/api/healthNone

Health check endpoint. Returns the gateway status and version.

POST/api/casesBearer JWT

Create a new support case. The gateway generates a Support Context Snapshot, calls your 4 endpoints, and sends the first AI response.

Parameters

messagestringrequiredInitial user message
contextobjectOptional context metadata

Request Body

{
  "message": "I can't upload files larger than 50MB",
  "context": { "page": "/projects/1/files" }
}
GET/api/cases/:caseIdBearer JWT

Retrieve a support case with all its messages, including evidence and suggested actions.

Parameters

caseIdstringrequiredCase ID (cas_xxx)
POST/api/cases/:caseId/messagesBearer JWT

Send a follow-up message to an active case. Returns the AI response with evidence.

Parameters

caseIdstringrequiredCase ID

Request Body

{ "content": "How do I increase my upload limit?" }
POST/api/cases/:caseId/feedbackBearer JWT

Submit user feedback (thumbs up/down) for a case.

Request Body

{ "feedback": "positive" }
POST/api/cases/:caseId/closeBearer JWT

Close a support case with resolution status and optional rating.

Request Body

{
  "resolution": "resolved",
  "rating": 9
}
POST/api/cases/:caseId/escalateBearer JWT

Escalate 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.

Important: These endpoints are called server-to-server by the Support Gateway using the service token you provided during tenant setup. They must return JSON.
GET/support/user-stateService Token

Returns 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
GET/support/user-historyService Token

Returns 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 ID
windowHoursnumberLookback window (default: 72)
GET/support/user-logsService Token

Returns 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 ID
windowHoursnumberLookback window (default: 72)
GET/support/business-rulesService Token

Returns your application's business rules and error catalog. Provides the AI with domain knowledge about what limits, rules, and error resolutions exist.