APTalkmoji Event Webhooks
Docs›Developers

Event Webhooks

Get a signed POST to your own URL when something happens in a chatbot. Several endpoints per chatbot, each with its own secret.

Add an endpoint

Chatbot → Settings → Webhooks & actions → Event webhooks: paste a URL, tick the events you want, add. Use Send test event to check it. Zapier and Make add endpoints for you through the API (POST /api/v1/webhooks).

Events

typeSent when
lead.completedA visitor finished the lead form (or a lead was added with the API)
message.createdA visitor sent a message
conversation.endedA conversation went quiet for a few minutes and was summarised (includes sentiment and summary)
handoff.requestedA visitor asked for a human
booking.createdThe chatbot booked an appointment (Cal.com or Google Calendar)
csat.submittedA visitor gave a thumbs up or down
unanswered.recordedA question the chatbot could not answer was logged for the first time

What you receive

{
  "id": "evt_5f1c0e7a2b8d4c3e9a6b1d2c3e4f5a6b",
  "type": "lead.completed",
  "apiVersion": "2026-11-25",
  "createdAt": 1764000000000,
  "chatbot": { "id": "…", "publicId": "abc123", "name": "Support bot" },
  "data": { "leadId": "…", "sessionId": "…", "data": { "name": "Sam", "email": "sam@example.com" } }
}

Headers: X-Avatar-Signature, X-Avatar-Event (the type) and X-Avatar-Delivery-Id (the same on every retry of one delivery). GET /api/v1/events/{type}/sample returns an example of each.

Verify the signature

Compute HMAC-SHA256 of the raw request body with the endpoint's signing secret (whsec_…, shown next to the endpoint) and compare it, in constant time, with the header.

const crypto = require('crypto');
function verify(rawBody, header, secret) {
  const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  const a = Buffer.from(expected), b = Buffer.from(header || '');
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
import hmac, hashlib
def verify(raw_body: bytes, header: str, secret: str) -> bool:
    expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, header or "")

Delivery, retries and switching off

  • Answer with any 2xx within 5 seconds. Anything else is retried: immediately, then after 30 seconds, 2 minutes, 10 minutes and 30 minutes.
  • Events can arrive more than once. Use id (or X-Avatar-Delivery-Id) to ignore repeats.
  • An endpoint that fails 15 deliveries in a row (after all retries) is switched off, with the reason shown. Turn it back on once it works.
  • Only public https:// addresses are accepted.
💡

The older single Webhook URL (Message webhook) still works and still receives only the original message and lead events, exactly as before. See Zapier & CRM Integration.