APTalkmoji Public API
Docs›Developers

Public API

Everything the dashboard does with your content, from your own code, Zapier or Make. Included with paid plans.

💡

The machine-readable description is at /api/v1/openapi.json (OpenAPI 3.1). Import it into Postman, Insomnia, or a code generator.

1. Create a key

In the app: Account → API keys. Name the key, choose exactly what it may do, optionally limit it to one chatbot and give it an expiry. The key looks like tm_live_… and is shown once; we keep only a fingerprint. Revoke it any time.

Send it on every request:

curl https://YOUR-DOMAIN/api/v1/chatbots \
  -H "Authorization: Bearer tm_live_XXXXXXXXXXXXXXXX"

2. Permissions

PermissionLets the key
chatbots:readList and read chatbots
chatbots:writeCreate chatbots; change name, greeting, instructions, fallback, reply language
knowledge:readList what a chatbot knows
knowledge:writeAdd website pages and Q&A answers; remove items
conversations:readRead conversations and transcripts
leads:read / leads:writeRead leads / add leads and change their status
chatSend a message and get the answer (counts toward your message limit)
webhooks:writeSubscribe a URL to events (used by Zapier and Make)

No key can reach billing, team members, account settings or other keys. Those need a person signed in.

3. Endpoints

Method and pathWhat it does
GET /api/v1/meWho the key belongs to and its permissions
GET /api/v1/chatbotsList chatbots (?page=&limit=)
POST /api/v1/chatbotsCreate a chatbot (respects your plan's chatbot limit)
GET|PATCH /api/v1/chatbots/{id}Read or change a chatbot
GET /api/v1/chatbots/{id}/knowledgeWhat it knows
POST /api/v1/chatbots/{id}/knowledge/urlsAdd up to 20 website pages
POST /api/v1/chatbots/{id}/knowledge/qaAdd a question and its answer
DELETE /api/v1/chatbots/{id}/knowledge/{itemId}Remove an item
GET /api/v1/chatbots/{id}/conversationsList conversations (?since= epoch ms)
GET /api/v1/chatbots/{id}/conversations/{conversationId}One conversation with its messages
GET /api/v1/leads · GET /api/v1/chatbots/{id}/leadsList leads (?complete=, ?status=)
POST /api/v1/chatbots/{id}/leadsAdd a lead
PATCH /api/v1/leads/{id}Change a lead's status or follow-up date
POST /api/v1/chatbots/{id}/chatAsk a question, get the answer and its sources
GET /api/v1/events · GET /api/v1/events/{type}/sampleEvent types, and an example payload for each
GET|POST|DELETE /api/v1/webhooksSubscribe a URL to events (see Event webhooks)

Timestamps are epoch milliseconds. Lists return total, page and limit.

4. Examples

Chat with a chatbot

curl -X POST https://YOUR-DOMAIN/api/v1/chatbots/CHATBOT_ID/chat \
  -H "Authorization: Bearer tm_live_…" -H "Content-Type: application/json" \
  -d '{"message": "Do you deliver on Sundays?", "visitorId": "customer-42"}'
# {"answer":"Yes — …","conversationId":"…","sources":[{"name":"Delivery FAQ","url":null,"kind":"qa"}]}

Pass the returned conversationId back to continue the same conversation. visitorId is your own id for the person; when the chatbot has visitor memory on it remembers them by it.

Teach it an answer

curl -X POST https://YOUR-DOMAIN/api/v1/chatbots/CHATBOT_ID/knowledge/qa \
  -H "Authorization: Bearer tm_live_…" -H "Content-Type: application/json" \
  -d '{"question": "What are your opening hours?", "answer": "9–5, Monday to Friday."}'

Read new leads

curl "https://YOUR-DOMAIN/api/v1/leads?complete=true&status=new" -H "Authorization: Bearer tm_live_…"

5. Errors and limits

Every error is { "error": "…", "code": "…" }. The code is stable; switch on it, not on the text.

HTTPcodeMeaning
401missing_api_key, invalid_api_key, api_key_expiredKey missing, wrong, revoked or expired
403insufficient_scope, account_suspended, chatbot_disabledThe key lacks the permission, or the account/chatbot is switched off
402plan_limit_reached, message_limit_reachedYour plan's limit is used up
400 / 404invalid_request, not_foundBad input, or it does not exist (another account's chatbot also answers 404)
429rate_limited120 requests a minute per key (30 a minute for chat). Failed authentication is limited per address

Chat messages count toward your plan's monthly messages exactly like website visitors' do.