References
The references describe every endpoint, event and frame exactly as the servers implement them. They are generated from the code and the published OpenAPI specs, so they change when the API changes. For step-by-step explanations, start with the Guides.
| Reference | What it covers | Base URL |
|---|---|---|
| REST API | Email, Support (chat), Payments, API keys and webhooks: every endpoint with parameters, request and response schemas, code samples and a "Try it" console | https://api.hatang.dev |
| Chat gateway API | What the website widget, the mobile SDKs and the agent apps call: bootstrap, conversations, uploads, devices, the agent API | https://chat.hatang.dev |
| Webhook events | Every event with its payload | your endpoint |
| Realtime protocol | The visitor websocket: every frame, field and limit | wss://chat.hatang.dev/ws |
| Errors | Every error code of the API, the realtime protocol and the SMTP relay | |
| Limits | Rate limits and size limits |
SDK references
Generated from the doc comments in each SDK's source, one site per SDK (English only):
| SDK | Reference |
|---|---|
Node (@hatang/sdk) | TypeDoc |
Flutter (hatang_chat) | dartdoc |
iOS (HatangChat, HatangChatCore) | DocC |
Android (dev.hatang:chat, dev.hatang:chat-core) | Dokka |
Conventions
- Authentication. REST calls send
Authorization: Bearer ht_.... See Authentication for scopes and test keys. - Format. JSON in and out, UTF-8. Timestamps are ISO 8601 in UTC; amounts in Vietnamese đồng are integers.
- Errors. Every error is
{ "statusCode", "name", "message" }; branch onname. - Pagination. List endpoints take
limitandafter, and answer withhas_moreandnext_cursor. See Pagination. - Idempotency.
POST /emails,POST /paymentsand posting chat messages accept anIdempotency-Keyheader. See Idempotency.
Machine-readable specs
-
REST API:
openapi.json(OpenAPI 3.1, including thewebhookssection) -
Chat gateway:
openapi.json -
Realtime protocol: JSON Schemas for visitor frames, server frames, HTTP and protocol constants
-
The whole hub for AI agents and LLM tools:
llms.txt(an index),llms-full.txt(every page in one file), and a Markdown copy of each page at its URL plus.md, such as/docs/reference/overview.md
Use them with any OpenAPI tool (Postman, Insomnia, code generators) or import them into your own tests.