Base URL
/api/v1/public. Self-hosted? Use your own server’s address. The paths are the same.
Endpoints
| Method | Path | What it does |
|---|---|---|
POST | /knowledge-bases/:knowledgeBaseId/chat | Stream an answer (SSE) |
POST | /threads/:threadId/chat | Ask a follow-up |
GET | /knowledge-bases/:knowledgeBaseId/ws | Chat over WebSocket |
POST | /knowledge-bases/:knowledgeBaseId/search | Search |
POST | /knowledge-bases/:knowledgeBaseId/form-deflect | Answer a support form |
POST | /deflections/:id/outcome | Report that the ticket was filed anyway |
POST | /feedback | Rate an answer |
DELETE | /feedback/:messageId | Withdraw a rating |
GET | /knowledge-bases/:knowledgeBaseId/widget-config | Settings the widget reads on load |
GET | /widget-integrations/:widgetId/config | A saved widget’s settings |
GET | /form-deflectors/:deflectorId/config | A saved form deflector’s settings |
GET | /knowledge-bases/:knowledgeBaseId/suggested-questions | Starter questions |
POST | /knowledge-bases/:knowledgeBaseId/related | Related articles |
POST | /knowledge-bases/:knowledgeBaseId/events | Record that the widget was opened: {"event": "opened", "end_user_id": "..."}. Returns 202 |
:knowledgeBaseId must be the knowledge base your key belongs to. Any other id returns 403.
Conventions
- Request and response bodies are JSON. Chat streams Server-Sent Events.
- Bodies are capped at 4 MB.
- Questions on chat, search and WebSocket are capped at 4,000 characters.
- Restricted documents are never returned.
group_ids(chat, search, form-deflect, WebSocket) limits answers to some source groups. Each id must be a source group of this knowledge base, or you get403.
Errors
Errors are JSON with a matching HTTP status:codeis what to branch on.erroris a sentence you can log or show.error_codeis the same class in lower case. Most errors carry it.retryablesays whether the same request can work later.request_idis also sent as theX-Request-IDheader. Quote it when you contact support.
| Status | When |
|---|---|
400 | Bad body, missing field, question too long |
401 | Missing or wrong credentials (UNAUTHORIZED) |
403 | Origin not allowed, key for another knowledge base, CAPTCHA missing or failed (CAPTCHA_REQUIRED, CAPTCHA_FAILED), an internal knowledge base (KNOWLEDGE_BASE_INTERNAL), or a source group outside this knowledge base |
404 | Thread, message or deflector not found |
413 | Body over 4 MB |
429 | Rate limit reached (RATE_LIMITED). See rate limits |