REST API
Use AnTalkChat from your own servers.
The REST API lets your servers chat with an assistant, read conversations and export them. Base URL:
https://antalkchat.com/v1
Authentication
Create a key in Settings → Workspaces → API keys (Owner only). Send it as a bearer token:
Authorization: Bearer sk_live_…
sk_test_… keys give real answers within a small daily limit and do not count toward your monthly answers. Never
put a secret key in a web page or app — use it from your server.
Chat
curl https://antalkchat.com/v1/assistants/ast_pub_YOUR_ID/chat \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{"message": "Do you deliver outside Dhaka?"}'
The answer includes the text, its status, the sources and — when the assistant could not answer — your contact
details. Send "stream": true to receive the answer as server-sent events, and the returned conversation_id to
continue a conversation.
Conversations and exports
GET /v1/conversations— newest first, withfrom,to,assistant_idandchannelfilters and cursor paging.GET /v1/conversations/{id}— one conversation with its messages.POST /v1/exports— build a CSV or Excel export in the background, then download it.
Visitor details are masked unless the key has the conversations:read_pii scope.
Knowledge sources
With the sources:read and sources:write scopes your system can keep an assistant's content up to date:
GET /v1/assistants/{assistant}/sourcesandGET /v1/sources/{id}— sources and whether answers use them (state:processing,readyorfailed, with the reason).POST /v1/assistants/{assistant}/sources— add pasted text (type: text,title,content) or a web page (type: url,url,confirm_rights: true, confirmed in the name of the person who created the key). It is processed in the background; the assistant keeps answering from what it had until the new source is ready.POST /v1/sources/{id}/refresh— fetch a web page again;DELETE /v1/sources/{id}— remove a source.
Files are added in the dashboard (they are checked for viruses there). Your plan's source limit applies.
Webhooks
On the API keys page you can add up to five https addresses and choose the events each one hears:
source.published, source.failed, lead.created, booking.created and order.created. Each event is a POST
with a JSON body {id, type, created_at, data}. Check the X-AnTalkChat-Signature header
(t=<time>,v1=<signature>): the signature is the HMAC-SHA256 of <time>.<body> with the address's signing secret,
which is shown once when you add it. Answer with any 2xx within 10 seconds; otherwise the event is sent again after
1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours. Use X-AnTalkChat-Delivery to ignore repeats. Leads, bookings
and orders include the visitor's contact details. Send a test event sends a ping.
Errors and limits
Errors use RFC 9457 problem details with a stable code. Rate limits answer 429 with Retry-After. Creating
requests accept an Idempotency-Key header.
Full reference
The complete OpenAPI 3.1 description is at https://antalkchat.com/docs/openapi.yaml.