Developers
Webhooks
Receive Hitapo events on your own server as signed HTTP POST requests: event list, body, signature verification, retries and testing.
A webhook is a signed POST request that Hitapo sends to your server when something happens (e.g. a new message arrives).
Adding a webhook
- Step 1: In Settings › Developer › Webhooks, click Add webhook.
- Step 2: Enter the Address (URL) of your endpoint (e.g.
https://example.com/webhooks/hitapo). - Step 3: Pick the events you want to listen to from the Events list.
- Step 4: Save. Store the Signing secret (
whsec_…) that's shown somewhere safe. - Step 5: Check your endpoint with Send test event and see the result in Delivery history.
Events
| Event | When? | data contents |
|---|---|---|
message.received | A message arrived from a customer. | message, conversation, contact, isNewConversation |
message.sent | An agent, the AI or the system sent a message (private notes included; check message.isPrivate). | message, conversation |
conversation.created | A new conversation started. | conversation, contact |
conversation.updated | A field such as status, assignee, priority or mode changed. | conversation, changes, byUserId |
conversation.resolved | A conversation was resolved. | conversation |
conversation.completed | A conversation was resolved and its AI summary is ready — a single package for your CRM. | conversation (summary, topic, tags, link), contact, channel, assignee, team, messages (full transcript). See Sending to your CRM. |
contact.created | A new contact was created. | contact (including externalId and lists), origin |
contact.updated | A contact's name, email, phone, tags, custom fields, İYS consents, externalId or list memberships changed. | contact, changes (names of the changed fields), origin |
contact.deleted | A contact was erased under KVKK (Turkey's data protection law), from the dashboard, with DELETE /contacts/:id or with POST /contacts/sync/delete. | contact (as it was before deletion, including lists), origin |
contact.merged | Two contact records were merged into one profile (by hand or automatically). The source contact is deleted; all its channels and conversations move to the target. | contact (target), sourceContactId, kind, trigger, matchedOn, mergedById |
In contact events, origin tells you where the change came from: dashboard, api, import (CSV), sync (POST /contacts/sync) or source (a scheduled contact source). To stop changes you send from your own system from coming back to you, see Contact sync.
Sending conversations to your CRM
The conversation.completed event sends everything at once after a conversation is resolved and its AI summary is ready: contact details, channel, assigned agent and team, the AI summary, the topic (intent, a key from the topic list), sentiment, tags, handoff details and the full message transcript including internal notes (marked with isPrivate). No extra API call is needed: just find the contact in your CRM and add the conversation as a note or activity. Up to the last 1,000 messages are sent (truncated: true means there are older ones).
{
"conversation": {
"id": "6f1c…", "status": "resolved", "summary": "The customer asked about returns; we explained they can return items within 14 days.",
"intent": "refund", "sentiment": "neutral", "tags": ["return"], "csatScore": null,
"createdAt": "…", "resolvedAt": "…", "url": "https://hitapo.com/app/inbox?c=6f1c…"
},
"contact": { "id": "…", "name": "Mehmet Yılmaz", "firstName": "Mehmet", "lastName": "Yılmaz", "email": "mehmet@example.com", "phone": "+905321234567", "…": "…" },
"channel": { "id": "…", "type": "whatsapp", "name": "WhatsApp" },
"assignee": { "id": "…", "name": "Ayşe Kaya", "email": "ayse@company.com" },
"team": { "id": "…", "name": "Support" },
"messageCount": 6,
"truncated": false,
"messages": [
{ "senderType": "contact", "author": "Mehmet Yılmaz", "content": "How do I return an item?", "isPrivate": false, "createdAt": "…" },
{ "senderType": "ai", "author": "AI", "content": "Within 14 days…", "isPrivate": false, "createdAt": "…" }
]
}Request format
POST /webhooks/hitapo HTTP/1.1
Content-Type: application/json
User-Agent: Hitapo-Webhooks/1.0
X-Hitapo-Event: conversation.resolved
X-Hitapo-Delivery: 2b7d…
X-Hitapo-Webhook-Id: 91ac…
X-Hitapo-Signature: sha256=5d41402abc4b2a76b9719d911017c592…
{
"event": "conversation.resolved",
"data": { "conversation": { "id": "6f1c…", "status": "resolved", "csatScore": null, "…": "…" } },
"timestamp": "2026-10-14T09:30:00.000Z"
}Verifying the signature
The X-Hitapo-Signature header is an HMAC-SHA256 of the raw request body, computed with the signing secret (sha256=<hex>). Verify the body exactly as it arrived, before parsing it as JSON.
import crypto from "node:crypto";
import express from "express";
const app = express();
app.post("/webhooks/hitapo", express.raw({ type: "application/json" }), (req, res) => {
const expected = "sha256=" + crypto.createHmac("sha256", process.env.HITAPO_WEBHOOK_SECRET).update(req.body).digest("hex");
const given = req.get("X-Hitapo-Signature") ?? "";
const ok = given.length === expected.length && crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
if (!ok) return res.status(401).end();
const { event, data } = JSON.parse(req.body.toString("utf8"));
// event: "message.received", data.message.content …
res.status(200).end();
});Delivery and retries
- Your endpoint must return
2xxwithin 5 seconds. Queue heavy work and reply right away. - Failed deliveries are retried after 1, 5 and 25 seconds (4 attempts in total).
4xxresponses (except408and429) aren't retried. - Redirects (
3xx) aren't followed. - The same event may arrive more than once; use the
X-Hitapo-Deliveryvalue to drop duplicates. - For security, webhooks are never sent to local or private network addresses.
- Delivery history shows the last 50 attempts for each webhook.
Rotating the signing secret
If you think the secret has leaked, send {"rotateSecret": true} to PATCH /api/v1/developer/webhooks/:id from a dashboard session (not with an API key). The new secret comes back in the response. Requests signed with the old secret stop arriving.
Last updated: