Outgoing webhooks: how they work
SendApp calls your server when something happens in your account: a message arrives or leaves, WhatsApp updates the status of a message, a campaign starts or ends, a WhatsApp template is approved or rejected, an appointment is booked. Set it up in Settings → Webhook: up to 10 addresses, each with its own AI account and its own events.
Every call is a POST request with a JSON body and the headers
X-SendApp-Event, X-SendApp-Delivery (the unique id of the delivery), X-SendApp-Attempt and X-SendApp-Signature.Check the signature:
X-SendApp-Signature is t=<timestamp>,v1=<HMAC-SHA256 of "timestamp.body">, computed with the webhook's secret (Settings → Webhook → Show signing secret). Refuse requests with a timestamp older than 5 minutes.Answer with a 2xx code within 10 seconds: otherwise we try again after 1, 5 and 30 minutes. A 4xx code (except 408 and 429) is not retried. After 20 failed deliveries in a row the webhook is switched off: turn it back on in Settings → Webhook.
Every delivery has a unique
delivery_id, the same in every attempt: use it to ignore duplicates. The order of arrival is not guaranteed: to put the events in order use occurred_at (and timestamp for the statuses).The body always contains
event, occurred_at, account_ref, training_token (the AI account) and delivery_id. account_ref identifies your account and is not a key: the body never contains your API key. Photos, audio, videos and documents arrive as links, never as files.From Settings → Webhook you can send a test of every event: it arrives with
"test": true. The log shows every delivery with the body sent and the answer of your server.Parameters
8 · 0 required
message.received
optional
A customer writes to you, on any channel.
message.sent
optional
A message leaves: AI, operator, campaign, automation, API.
message.status
optional
A WhatsApp message was delivered, read or not delivered (with Meta's error code).
campaign.started
optional
A campaign starts sending.
campaign.completed
optional
A campaign has finished, with its numbers.
campaign.failed
optional
A campaign stopped because of an error.
template.status_changed
optional
A WhatsApp template was approved, rejected, paused or disabled, with the reason.
booking.* / voice.*
optional
The Agenda's appointments and the Voice AI calls: same addresses, same signature.
Need help with the integration? info@sendapp.live