Developers
REST API reference
Endpoints and curl examples for conversations, messages, contacts, canned replies, team, channels, AI knowledge base, topics, campaigns and reports.
Every request needs the Authorization: Bearer hp_… header and sends and receives JSON. Below, replace $API with https://api.hitapo.com/api/v1. For all fields and schemas, see the OpenAPI schema.
Conversations
| Endpoint | Description |
|---|---|
GET /conversations | List. Parameters: status (open, pending, snoozed, resolved, all; default open), assignee (me, unassigned or a user ID), teamId, channelType, channelId, handlingMode, priority, tag, handoffCategory, intent (topic key, see Topics), contactId, q, cursor, limit. |
GET /conversations/counts | View counts. |
GET /conversations/:id | A single conversation. |
PATCH /conversations/:id | status, priority (low, normal, high, urgent), handlingMode (ai, human), assigneeId, teamId, tags, snoozedUntil. |
POST /conversations/:id/read | Mark as read. |
GET /conversations/:id/messages | Messages. before and limit (up to 200). |
POST /conversations/:id/messages | Send a message or a private note: content (up to 10,000 characters), isPrivate, attachments. |
POST /conversations | Start a new conversation with a contact, or write into their open one: contactId, channelId, content or the WhatsApp template fields (below), subject. If the contact has no record on that channel, their phone / email is used. |
GET /conversations/start-options | Which channels can be used for a contactId, and whether WhatsApp needs a template. |
curl -X POST $API/conversations/<CONVERSATION_ID>/messages \
-H "Authorization: Bearer $HITAPO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"Hi {{contact.firstName}}, your order shipped today."}'curl -X PATCH $API/conversations/<CONVERSATION_ID> \
-H "Authorization: Bearer $HITAPO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":"resolved"}'Contacts
| Endpoint | Description |
|---|---|
GET /contacts | List. q, tag, duplicates=1 (only possible duplicates), cursor, limit (up to 200). |
GET /contacts/:id | A single contact: channel IDs, conversations across all channels and merge history (merges). An old ID from a merged contact returns the remaining contact (redirectedFrom). |
GET /contacts/:id/duplicates | Possible duplicates: contact, confidence (high / medium / low) and reasons in items[]. |
POST /contacts/:id/merge | Merges contact { sourceContactId } into contact :id; the source is deleted and its channels and conversations move over. |
POST /contacts/:id/duplicates/dismiss | { otherContactId }: marks the two contacts as “different people” and hides the suggestion. |
POST /contacts | Create: firstName, lastName, gender, salutationByName, email, phone, language, tags, attributes. One of name, email or phone is required. The display name (name) becomes “First Last”. |
gender · salutationByName | gender: female, male or null (Not specified). We never guess it from the name. genderSource tells you who set it: manual (team or API), import (CSV or sync), suggested (a suggestion an admin approved), customer (the contact told the AI assistant). Automatic sources don't overwrite a manual value. With salutationByName: true, the AI assistant addresses the person by first name only. For contacts whose name you entered and whose gender is known, the AI assistant uses the Turkish courtesy forms “Ayşe Hanım” (Ms.) and “Mehmet Bey” (Mr.). |
GET /contacts/gender-suggestions · POST /contacts/gender-suggestions/apply | Gender suggestions (Owner / Admin): contacts with no gender whose first name clearly belongs to one gender (items[]: contact, gender). Nothing is saved automatically; the ones you approve with { contactIds } are saved with genderSource: "suggested". |
PATCH /contacts/:id | Update. If the new email/phone already belongs to another contact, the two contacts are merged and the response includes mergedInto. If you send firstName / lastName, the display name becomes “First Last”. |
name (legacy) | If you only send name, we split it into first and last name: the last word becomes the last name and the rest the first name. A single word stays as the first name. For usernames (@ayse_k, ayse.k), phone numbers or names with digits, first and last name stay empty and the display name is kept; names that look like companies (Ltd, A.Ş., Şti, Inc, GmbH…) aren't split. nameSource tells you where the first and last name came from: auto, channel or manual. Channels never overwrite a manual name. |
DELETE /contacts/:id | Permanently delete the contact, their conversations and messages (KVKK, Turkey's data protection law). |
POST /contacts/import | Bulk import: up to 5,000 contacts; merges by email/phone. Each row can take firstName, lastName or name; an existing contact's name is kept. gender (female / male) fills in contacts with no gender and doesn't overwrite one the team entered by hand. Optional İYS consent fields (Turkey's national consent registry): iys_mesaj, iys_arama, iys_eposta (ONAY / RET) and iys_alici_tipi (BIREYSEL / TACIR, individual / merchant); listId adds the contacts to a list (Owner / Admin). Returns { total, created, updated, skipped, errors }. |
PATCH /contacts/:id · consents | İYS consents: {"consents": {"MESAJ": {"status": "ONAY", "recipientType": "BIREYSEL"}, "ARAMA": null}} (null clears a consent). Owner / Admin. |
GET /segments · POST /segments | Smart lists (kind: "dynamic", rules: {match: "all"|"any", conditions}) and plain lists (kind: "static"). POST /segments/preview gives a live count for a rule. |
GET /segments/:id/contacts | Contacts in a smart list or plain list, paginated (limit, offset). You can also use GET /contacts?segmentId= on the contact list. |
POST /segments/:id/members · /members/remove | Add / remove contacts in a list: {contactIds}. |
GET /contacts/export.csv | Download contacts as CSV (Owner / Admin). Same filters as GET /contacts: q, tag, segmentId, rules, duplicates. UTF-8 (BOM), ;-separated; column names follow the Accept-Language language. |
GET /contacts/:id/export | KVKK data export (JSON). |
curl -X POST $API/contacts/import \
-H "Authorization: Bearer $HITAPO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contacts":[{"firstName":"Ayşe","lastName":"Yılmaz","email":"ayse@example.com","phone":"+905551112233","tags":["vip"],"attributes":{"city":"Izmir"}}]}'Team and business
| Endpoint | Description |
|---|---|
GET /users | Team members. |
POST /users/invite | Invite: email, name, role (owner, admin, agent). Sends an invitation email; the response includes user. The link is valid for 7 days and goes only to the invitee's email address. The caller's email must be verified. Works only with a dashboard session, not with an API key. |
POST /users/:id/resend-invite | Resends a pending invitation with a new link; the previous link stops working. Not available with an API key. |
PATCH /users/:id | role, name, capacity (concurrent conversation limit for auto-assign, 0–1000). Not available with an API key; when the role changes, the person's open sessions are signed out. |
GET /teams, POST /teams, PATCH /teams/:id, DELETE /teams/:id | Teams: name, memberIds. |
GET /canned-responses, POST, PATCH /:id, DELETE /:id | Canned replies: shortcut, title, content. |
GET /organization, PATCH /organization | Business name and settings (default language, business hours, auto-translate, CSAT). |
GET /search?q= | Search conversations, contacts and messages (at least 2 characters). |
POST /uploads | Upload a file (multipart, up to 25 MB). Use the returned URL in a message attachment. |
Channels
| Endpoint | Description |
|---|---|
GET /channels | Connected channels. Secrets are never returned. |
GET /channels/:id/embed | Web chat install code. |
PATCH /channels/:id | Channel settings. For web chat, options that aren't in the dashboard are set here too; see the JavaScript API. |
GET /channels/:id/whatsapp/templates | Approved WhatsApp templates. |
POST /channels/:id/simulate-inbound | Test message: from, name, content. |
AI
| Endpoint | Description |
|---|---|
GET /ai/agents | AI assistants. |
GET /ai/knowledge, POST /ai/knowledge | Knowledge sources. Text: {title, content}; FAQ: {title, items:[{q,a}]}; website: {url, title, crawl, refresh}; API: {type: "api", title, url, headers, recordsPath, titleField, refresh} (admin). |
PATCH /ai/knowledge/:id | Update a text or FAQ source (it's reprocessed); for a website source, set how often it refreshes automatically with refresh: off | hourly | daily | weekly. |
POST /ai/knowledge/:id/resync | Resync a source. |
POST /ai/knowledge/search | Search the knowledge base: query, agentId, limit. |
POST /ai/agents/:id/test | Test an AI assistant: messages: [{role, content}]. The first 100 tests each month are free; after that, each test costs 1 AI credit. |
curl -X POST $API/ai/knowledge \
-H "Authorization: Bearer $HITAPO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Shipping FAQ","items":[{"q":"How much is shipping?","a":"Shipping is free on orders over $50."}]}'Topics
The AI sorts every conversation into one of the topics on your business's topic list and writes that topic's key into the conversation's intent field (e.g. order_status). The key stays the same even if the topic is renamed. If you haven't edited the list, the default list is used (custom: false). complaint, greeting, thanks and other exist in every business and can't be changed.
| Endpoint | Description |
|---|---|
GET /conversation-topics | { topics, custom, retired, system }: your own list ([{key, label, description?}]), the last names of deleted topics, and the fixed keys. Every role can read it. |
PUT /conversation-topics | Replace the whole list: { topics: [{key?, label, description?}] }. If you send the key of an existing topic, it's renamed; without a key, a new key is generated from the name. { topics: null } restores the default list. Owner / Admin or an API key. |
- Up to 20 topics; names up to 40 characters, descriptions up to 160.
- The fixed topics (Complaint, Greeting, Thanks, Other) can't be added to the list. The same name can't be used twice; differences in case and Turkish characters don't count.
- A topic removed from the list stays in
retiredwith its last name, so older conversations still show it. If you add it back with the same name, it gets its old key back.
curl -X PUT $API/conversation-topics \
-H "Authorization: Bearer $HITAPO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"topics":[{"key":"order_status","label":"Order tracking"},{"label":"Scholarships","description":"Scholarship applications and discounts"}]}'Campaigns and reports
| Endpoint | Description |
|---|---|
POST /broadcasts/preview-audience | Audience preview: channelId, kind, tags, contactIds, segmentIds, listIds, channelIds, lastConversationWithinDays, lastConversationOlderThanDays. Along with count, it returns optedOut, iysExcluded and windowExcluded (the Instagram/Messenger 24-hour rule). |
POST /broadcasts | Create a draft: channelId, name, kind (commercial is the default and needs İYS consent; informational doesn't), content, template (template and variable mapping, below), audience: {tags, contactIds, segmentIds, listIds, channelIds, lastConversationWithinDays, lastConversationOlderThanDays}, scheduledAt. The older templateName field is still accepted ({{1}} = contact name). |
POST /broadcasts/:id/send | Send now, or schedule with scheduledAt. |
POST /broadcasts/:id/cancel | Stop sending and turn it back into a draft. |
GET /broadcasts/:id/recipients | Recipients and their statuses. |
GET /analytics/overview | Report summary: from, to, channelId, teamId. |
GET /analytics/export.csv | Download conversations as CSV. |
WhatsApp template fields
Endpoints that send templates (POST /conversations, POST /reminders, POST /broadcasts) all use the same format. Short form: templateName, language (if empty, the template's own language), variables ({"1": "Ayşe"}), headerVariables, headerMedia ({type: "image"|"video"|"document", url}), buttonVariables (button index → end of the dynamic URL). Values can be plain text or a source read from the contact: {source: "field", field: "firstName"}, {source: "attribute", key: "appointment_date", format: "datetime"}, {source: "static", value: "…"}. In campaigns, the same structure goes in a template: {name, language, body, header, headerMedia, buttons} object and is filled in separately for each recipient.
curl -X POST $API/conversations \
-H "Authorization: Bearer $HITAPO_API_KEY" -H "Content-Type: application/json" \
-d '{
"contactId": "6f1c…",
"channelId": "2b9e…",
"templateName": "order_status",
"variables": { "1": { "source": "field", "field": "firstName" }, "2": "A-1042" }
}'On WhatsApp, if the customer hasn't written in the last 24 hours, a request without a template returns 422 template_required. If the template can't be found you get template_not_found; if it isn't approved, template_not_approved; if the mapping is incomplete, template_mapping_incomplete; if the contact is missing a value, template_values_missing. GET /conversations/start-options?contactId= tells you which channels you can use to write to a contact.
Reminders (scheduled single messages)
Your appointment, booking or order system can schedule a single message to a contact for a specific time. The message is sent when the time comes and shows up in the inbox; if the customer replies, the conversation continues.
| Endpoint | Description |
|---|---|
POST /reminders | Schedule: channelId, sendAt (ISO 8601 with time zone), contactId or contact: {phone, email, name} (the contact is created if it doesn't exist), the template fields or (on channels other than WhatsApp) content, optional externalId. |
GET /reminders | List: status, contactId, externalId, limit. |
GET /reminders/:id | A single record and its status: pending, sending, sent, failed, skipped, cancelled. |
DELETE /reminders/:id | Cancel a pending reminder. |
curl -X POST $API/reminders \
-H "Authorization: Bearer $HITAPO_API_KEY" -H "Content-Type: application/json" \
-d '{
"channelId": "2b9e…",
"contact": { "phone": "+905321234567", "name": "Ayşe Yılmaz" },
"sendAt": "2026-10-14T14:30:00+03:00",
"templateName": "appointment_reminder",
"variables": { "1": "Ayşe", "2": "15 October 14:30", "3": "Kadıköy branch" },
"externalId": "appointment-8812"
}'- Deduplication: if you call again with the same
externalId, no new record is created; the pending reminder is updated instead (so it's safe to resend when the appointment time changes). If it has already been sent, you get409. - WhatsApp reminders require an approved template; variables are checked when the reminder is created.
- Reminders are sent in 30-second cycles. If the server restarts, a message is never sent twice; reminders more than 12 hours late become
skipped. - If you want reminders generated automatically from a contact field, use the Before / after a date automation instead of the API.
Last updated: