Skip to main content

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.

ReferenceWhat it coversBase URL
REST APIEmail, Support (chat), Payments, API keys and webhooks: every endpoint with parameters, request and response schemas, code samples and a "Try it" consolehttps://api.hatang.dev
Chat gateway APIWhat the website widget, the mobile SDKs and the agent apps call: bootstrap, conversations, uploads, devices, the agent APIhttps://chat.hatang.dev
Webhook eventsEvery event with its payloadyour endpoint
Realtime protocolThe visitor websocket: every frame, field and limitwss://chat.hatang.dev/ws
ErrorsEvery error code of the API, the realtime protocol and the SMTP relay
LimitsRate limits and size limits

SDK references​

Generated from the doc comments in each SDK's source, one site per SDK (English only):

SDKReference
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 on name.
  • Pagination. List endpoints take limit and after, and answer with has_more and next_cursor. See Pagination.
  • Idempotency. POST /emails, POST /payments and posting chat messages accept an Idempotency-Key header. See Idempotency.

Machine-readable specs​

Use them with any OpenAPI tool (Postman, Insomnia, code generators) or import them into your own tests.

View this page as Markdown