Webhooks
Webhooks
Section titled “Webhooks”Webhooks send an HTTP POST to your server when something happens on your SIPSTACK account. Use them instead of polling the API.
You can receive events for:
- SMS messages: sent, delivered, failed, and received.
- Calls: answered, missed, and outbound calls that did not connect.
- Aura AI voice-agent calls: started and completed.
- SMS opt-out and consent changes.
- Campaign completion.
- Messages in public team chat channels.
- Flow events sent by webhook nodes in your Aura AI voice-agent flows:
sales.leadandflow.*.
This page is the reference for every event: what triggers it, when it is sent, and every field in the body. It is written so that a developer or an AI coding agent can build an integration from this page alone.
How webhooks work
Section titled “How webhooks work”- You register an endpoint URL and subscribe it to one or more events.
- When a subscribed event happens, SIPSTACK sends a
POSTrequest to your URL with a JSON body. - Your server answers with any
2xxstatus within 10 seconds. - If delivery fails, SIPSTACK retries. An endpoint that keeps failing is disabled automatically.
Who can use webhooks
Section titled “Who can use webhooks”Creating a webhook endpoint requires a Flare plan, or Nova Pro or higher. Nova Core does not include webhooks.
Account owners can always manage webhooks. Other team members can manage them once an owner grants the Manage API Keys & Webhooks permission. That one permission covers the Switchboard page and the API.
Configuring webhooks
Section titled “Configuring webhooks”In Switchboard
Section titled “In Switchboard”Go to Account → Integrations → Webhooks. From there you can register an endpoint, choose its events, view its delivery log, and send a test event.
With a portal session
Section titled “With a portal session”Authenticate with a portal session that carries the Manage API Keys & Webhooks permission (flare.api_keys.manage). See Authentication.
| Action | Endpoint |
|---|---|
| List endpoints | GET /v2/portal/webhooks |
| Create an endpoint | POST /v2/portal/webhooks with { "url": "https://...", "events": ["call.completed"] } |
| Delete an endpoint | DELETE /v2/portal/webhooks/{id} |
| View delivery log | GET /v2/portal/webhooks/{id}/deliveries |
| Send a test event | POST /v2/portal/webhooks/{id}/test |
With an API key
Section titled “With an API key”Use an API key (x-api-key header) and the /api/v2/webhooks alias. This suits server-to-server setup.
| Action | Endpoint |
|---|---|
| List endpoints | GET /api/v2/webhooks |
| Create an endpoint | POST /api/v2/webhooks with { "url": "https://...", "events": ["call.completed"] } |
| Delete an endpoint | DELETE /api/v2/webhooks/{id} |
| List valid event names | GET /api/v2/events |
Subscription rules
Section titled “Subscription rules”- The
eventsarray selects which events the endpoint receives. ["*"]subscribes to every event in the public catalog, including catalog events added later. It never includes internal platform events, which SIPSTACK never delivers to your endpoints.- An unknown event name is rejected with a
400that lists the valid names. GET /api/v2/eventsreturns the live list of event names and descriptions.- The endpoint URL must be a public
https://URL. - The create response includes the endpoint’s signing secret. It is shown only once. Store it securely. You need it to verify signatures.
See the API Reference for full request and response shapes.
The request SIPSTACK sends
Section titled “The request SIPSTACK sends”Every delivery is an HTTP POST with a JSON body.
Headers
Section titled “Headers”| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | SIPSTACK-Webhook/1.0 |
X-Webhook-Event | The event name, for example call.completed |
X-Sipstack-Timestamp | The time SIPSTACK signed this attempt, in Unix seconds (an integer). New on every attempt. |
X-Sipstack-Signature | v1= followed by the lowercase hex HMAC-SHA256 of <timestamp>.<raw body>, keyed with your endpoint’s secret. New on every attempt. See Verifying signatures. |
X-Webhook-Signature | Deprecated. sha256= followed by the hex HMAC-SHA256 of the raw body only. Still sent during a 90-day deprecation period. See The legacy signature header. |
X-Idempotency-Key | The body’s idempotency_key. Sent only on events whose body has one. The value is the same on every retry. |
Body shape
Section titled “Body shape”The body is a flat JSON object. It is not wrapped in a data object.
eventis always the first key and holds the event name.- The event’s own fields follow at the top level.
- Most events also include
occurred_atandidempotency_key(see each event below).
{ "event": "message.delivered", "messageId": 12345, "status": "delivered", "to": "+15555550100", "from": "+15555550200", "campaignId": null, "direction": "outbound", "body": "Running 10 minutes late, see you soon.", "userId": "8f2c6d1a-3b4e-4f5a-9c7d-1e2f3a4b5c6d", "userName": "Dana Rivera", "extension": "101", "occurred_at": "2026-11-20T15:04:05.123Z", "idempotency_key": "message.delivered:12345"}Common fields
Section titled “Common fields”| Field | Type | Meaning |
|---|---|---|
event | string | The event name. Same value as the X-Webhook-Event header. |
occurred_at | string (ISO-8601, UTC) | When the event happened. For end-of-call events this is the time the call ended. |
idempotency_key | string | A stable key for this event. Use it to de-duplicate retries. Format: <event>:<id>. |
Rules for parsing
Section titled “Rules for parsing”- Ignore fields you do not recognize. SIPSTACK adds new fields to existing events without notice. Existing fields keep their names.
- Treat IDs (
callId,messageId, and so on) as opaque strings or numbers. Do not parse them. - Phone numbers are sent as SIPSTACK received them, usually in E.164 format (
+15555550100). - A field documented as nullable can be
null. Check fornullbefore you use it.
Events at a glance
Section titled “Events at a glance”| Event | Product | Fires when | Timing |
|---|---|---|---|
message.sent | Flare, Nova 1:1 texting | The carrier accepted an outbound message | Real time |
message.delivered | Flare, Nova 1:1 texting | The carrier confirmed delivery to the handset | Real time |
message.failed | Flare, Nova 1:1 texting | An outbound message failed or was undeliverable | Real time |
message.received | Flare, Nova 1:1 texting | An inbound SMS or MMS arrived on your number | Real time |
campaign.completed | Flare | A campaign finished sending | Real time |
call.completed | Nova | A call was answered and has ended (inbound or outbound) | After the call, usually within about 15 minutes |
call.missed | Nova | An inbound call ended without being answered | After the call, usually within about 15 minutes |
call.unanswered | Nova | An outbound call ended without connecting | After the call, usually within about 15 minutes |
call.inbound | Nova | A call is arriving (before it is answered) | Not yet available |
call.ringing | Nova | A call started ringing | Not yet available |
call.answered | Nova | A call was answered | Not yet available |
call.hangup | Nova | A call ended | Not yet available |
aura.call.started | Aura | An Aura agent answered a call | Real time |
aura.call.completed | Aura | An Aura agent call ended | Shortly after the call |
contact.opted_out | Flare | A number was added to your SMS opt-out list | Within about a minute — rolling out |
contact.opted_in | Flare | A number was removed from your SMS opt-out list | Within about a minute — rolling out |
contact.consent_changed | Flare | A contact’s SMS consent changed | Within about a minute — rolling out |
chat.message.created | Team chat | A message was posted in a public channel | Real time |
chat.message.updated | Team chat | A message in a public channel was edited | Real time |
chat.message.deleted | Team chat | A message in a public channel was deleted | Real time |
sales.lead | Aura | An Aura voice-agent flow captured a sales lead | During the call |
flow.callback_requested | Aura | An Aura voice-agent flow recorded that the caller asked for a callback | During the call |
flow.message_taken | Aura | An Aura voice-agent flow took a message for your team | During the call |
flow.custom | Aura | A custom milestone marked by a webhook node in an Aura voice-agent flow | During the call |
test | — | You asked SIPSTACK to send a test event | On demand |
“Rolling out” means you can subscribe now, but deliveries start only once SIPSTACK turns the feature on for the platform. Do not build a flow that depends on a rolling-out event until you see deliveries in your delivery log.
Call events
Section titled “Call events”Which call event do I subscribe to?
Section titled “Which call event do I subscribe to?”Each external call sends at most one end-of-call event. Which one depends on the direction and the result.
| Call | Result | Event | outcome |
|---|---|---|---|
| Inbound | Answered by a person, a voicemail box, or any other destination | call.completed | answered |
| Inbound | Not answered (no answer or busy) | call.missed | missed |
| Outbound | Answered (including by the far end’s voicemail) | call.completed | answered |
| Outbound | Did not connect | call.unanswered | unanswered |
| Internal (extension to extension, or both ends on SIPSTACK) | Any | None | — |
Common goals:
| You want to… | Subscribe to |
|---|---|
| Log every call that connected, both directions, to a CRM | call.completed |
| Call back people who called you and got no answer | call.missed |
| Track outbound calls that did not reach anyone, and why | call.unanswered |
| Log every external call attempt | call.completed, call.missed, and call.unanswered |
Rules that apply to all three end-of-call events:
- They are built from the call record after the call ends. They usually arrive within about 15 minutes of the call ending. They are not real-time.
occurred_atis the time the call ended, not the time the event was sent.- Calls where both ends are on SIPSTACK (internal or on-net calls) do not send any of these events.
- If the caller hangs up while the outbound call is still ringing, the event is
call.unansweredwithreasonno_answer. - If an outbound call is answered by the far end’s voicemail, the event is
call.completed. The carrier does not tell SIPSTACK whether a person or a voicemail system answered. - An inbound call that a user declined does not send
call.missed. idempotency_keyis<event>:<callId>. Retries of the same event carry the same key.
Call event fields
Section titled “Call event fields”call.completed, call.missed, and call.unanswered carry the same fields. A field that is unknown for a call is null, never missing. call.unanswered adds one field, reason.
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | call.completed, call.missed, or call.unanswered |
callId | string | No | Unique ID of the call. Opaque — do not parse it. |
from | string | Yes | The calling number. For outbound calls, this is the caller ID number SIPSTACK presented (your number). |
to | string | Yes | The called number. |
direction | string | No | inbound or outbound. |
outcome | string | No | answered (call.completed), missed (call.missed), or unanswered (call.unanswered). |
disposition | string | Yes | The raw call result, for example ANSWERED, NO ANSWER, BUSY, FAILED, CONGESTION. Prefer outcome and reason for logic. |
duration | number | Yes | Total call length in seconds, including ringing. |
billsec | number | Yes | Talk time in seconds after the call was answered. 0 when the call was not answered. |
extension | string | Yes | The SIPSTACK Nova PBX extension number on the call, for example "101". Outbound (call.completed, call.unanswered): the extension that placed the call, even when several extensions share the same outbound caller ID number. Inbound call.completed: the extension that answered. call.missed: always null. Also null when SIPSTACK cannot attribute the call to one extension. See The extension field. |
did | string | Yes | Your SIPSTACK number on the call. Inbound: the number that was dialled (same as to). Outbound: the caller ID number (same as from). |
startedAt | string (ISO-8601) | Yes | When the call started. |
answeredAt | string (ISO-8601) | Yes | When the call was answered. null when it was never answered. |
endedAt | string (ISO-8601) | Yes | When the call ended. Same instant as occurred_at. |
ringSeconds | number | Yes | Seconds of ringing. Answered calls: from startedAt to answeredAt. Unanswered calls: from startedAt to endedAt. |
callerIdName | string | Yes | The caller ID name supplied by the carrier. This is not a directory (CNAM) lookup. null when the caller withheld it or none was supplied. |
sipCode | number | Yes | The final SIP response code for the call, for example 200, 486, 603. Uses the carrier’s code when SIPSTACK has it. |
sipReason | string | Yes | The text that goes with sipCode, for example Busy Here. |
reason | string | No | call.unanswered only. Why the call did not connect: no_answer, busy, failed, or declined. See the mapping below. |
occurred_at | string (ISO-8601) | No | When the call ended. |
idempotency_key | string | No | <event>:<callId>, for example call.completed:4f9c2a7e1b3d. |
The extension field
Section titled “The extension field”extension is the extension number only, for example "101". It is never the full SIP endpoint name.
| Event | extension |
|---|---|
call.completed, outbound | The extension that placed the call. This holds even when several extensions share one outbound caller ID number. |
call.unanswered | The extension that placed the call. |
call.completed, inbound | The extension that answered the call. |
call.missed | Always null. Nobody answered. |
extension is null when SIPSTACK cannot attribute the call to a single extension. For example:
- The number rings straight to an external destination, with no Nova PBX extension involved.
- The call was answered by voicemail, an auto attendant, or another destination that is not an extension.
- In rare cases, the phone system’s record of the call was not available when the event was sent.
Treat extension as optional: a string or null. Do not use it to identify a user across systems. Extension numbers can be reassigned.
call.completed
Section titled “call.completed”Trigger: a call was answered and has ended. Covers inbound and outbound calls.
When: after the call ends, from the finalized call record. Usually within about 15 minutes.
Notes:
- An inbound call counts as answered when any destination picks it up, including a voicemail box or a forward.
- An outbound call answered by the far end’s voicemail is sent as
call.completed. - Internal and on-net calls never send this event.
Inbound example:
{ "event": "call.completed", "callId": "4f9c2a7e1b3d4c5e8a9b0c1d2e3f4a5b", "from": "+15555550123", "to": "+15555550100", "direction": "inbound", "outcome": "answered", "disposition": "ANSWERED", "duration": 187, "billsec": 172, "extension": "102", "did": "+15555550100", "startedAt": "2026-11-20T14:58:12.000Z", "answeredAt": "2026-11-20T14:58:27.000Z", "endedAt": "2026-11-20T15:01:19.000Z", "ringSeconds": 15, "callerIdName": "JANE EXAMPLE", "sipCode": 200, "sipReason": "OK", "occurred_at": "2026-11-20T15:01:19.000Z", "idempotency_key": "call.completed:4f9c2a7e1b3d4c5e8a9b0c1d2e3f4a5b"}Outbound example:
{ "event": "call.completed", "callId": "9a8b7c6d5e4f40312a1b2c3d4e5f6a7b", "from": "+15555550100", "to": "+15555550188", "direction": "outbound", "outcome": "answered", "disposition": "ANSWERED", "duration": 94, "billsec": 81, "extension": "101", "did": "+15555550100", "startedAt": "2026-11-20T16:10:03.000Z", "answeredAt": "2026-11-20T16:10:16.000Z", "endedAt": "2026-11-20T16:11:37.000Z", "ringSeconds": 13, "callerIdName": null, "sipCode": 200, "sipReason": "OK", "occurred_at": "2026-11-20T16:11:37.000Z", "idempotency_key": "call.completed:9a8b7c6d5e4f40312a1b2c3d4e5f6a7b"}call.missed
Section titled “call.missed”Trigger: an inbound call ended without being answered. The call record shows no answer or busy.
When: after the call ends, from the finalized call record. Usually within about 15 minutes.
Notes:
- Inbound only. An outbound call that does not connect sends
call.unansweredinstead. - A call that a user declined does not send
call.missed. extensionandansweredAtare alwaysnull.billsecis0.call.missedhas noreasonfield. Usedisposition(NO ANSWER,RINGNOANSWER, orBUSY) if you need the detail.
{ "event": "call.missed", "callId": "1c2d3e4f5a6b47788990aabbccddeeff", "from": "+15555550145", "to": "+15555550100", "direction": "inbound", "outcome": "missed", "disposition": "NO ANSWER", "duration": 32, "billsec": 0, "extension": null, "did": "+15555550100", "startedAt": "2026-11-20T17:20:00.000Z", "answeredAt": null, "endedAt": "2026-11-20T17:20:32.000Z", "ringSeconds": 32, "callerIdName": "ACME PLUMBING", "sipCode": 480, "sipReason": "Temporarily Unavailable", "occurred_at": "2026-11-20T17:20:32.000Z", "idempotency_key": "call.missed:1c2d3e4f5a6b47788990aabbccddeeff"}call.unanswered
Section titled “call.unanswered”Trigger: an outbound call ended without connecting.
When: after the call ends, from the finalized call record. Usually within about 15 minutes.
Notes:
- Outbound only. Internal and on-net calls never send this event.
extensionis the extension that placed the call, for example"101", ornullwhen SIPSTACK cannot attribute the call to one extension.answeredAtisnull.billsecis0.reasontells you why the call did not connect.
reason values
Section titled “reason values”reason | Meaning |
|---|---|
no_answer | The far end rang but nobody answered, or the caller hung up while it was ringing. |
busy | The far end was busy. |
declined | The far end rejected the call. |
failed | The call could not be completed for another reason, such as an invalid number, a network error, or a timeout. |
How reason is chosen
Section titled “How reason is chosen”SIPSTACK uses the final SIP response code from the carrier when it has one. Otherwise it uses the call’s disposition.
| Final SIP code | reason |
|---|---|
486 Busy Here, 600 Busy Everywhere | busy |
603 Decline | declined |
480 Temporarily Unavailable, 408 Request Timeout, 487 Request Terminated (caller hung up while ringing) | no_answer |
Any other 4xx, 5xx, or 6xx code, or a timeout | failed |
disposition (used when there is no SIP code) | reason |
|---|---|
BUSY | busy |
NO ANSWER, RINGNOANSWER, CANCEL | no_answer |
FAILED, CONGESTION, CHANUNAVAIL, or anything else | failed |
{ "event": "call.unanswered", "callId": "7e6d5c4b3a2948576655443322110000", "from": "+15555550100", "to": "+15555550177", "direction": "outbound", "outcome": "unanswered", "reason": "busy", "disposition": "BUSY", "duration": 6, "billsec": 0, "extension": "103", "did": "+15555550100", "startedAt": "2026-11-20T18:02:41.000Z", "answeredAt": null, "endedAt": "2026-11-20T18:02:47.000Z", "ringSeconds": 6, "callerIdName": null, "sipCode": 486, "sipReason": "Busy Here", "occurred_at": "2026-11-20T18:02:47.000Z", "idempotency_key": "call.unanswered:7e6d5c4b3a2948576655443322110000"}Real-time call events
Section titled “Real-time call events”When live, these events are sent within moments of the PBX seeing the change, for example so a CRM can show a caller’s record while the phone rings. They come from the PBX, not the call record, so they carry fewer fields than the end-of-call events.
Fields on all four real-time events:
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | The event name |
callId | string | No | Unique ID of the call. Opaque. |
from | string | Yes | The calling number |
to | string | Yes | The called number |
direction | string | Yes | inbound, outbound, or internal |
extension | string | — | The extension involved. Present only when known. |
channel | string | — | The PBX channel name. Present only when known. |
occurred_at | string (ISO-8601) | No | When the PBX saw the change |
idempotency_key | string | No | <event>:<callId> |
call.inbound
Section titled “call.inbound”Trigger: a call is arriving on one of your numbers, before it is answered. Not yet available.
Fields: the real-time fields above.
{ "event": "call.inbound", "callId": "1732118400.1234", "from": "+15555550123", "to": "+15555550100", "direction": "inbound", "extension": "1001", "occurred_at": "2026-11-20T15:00:00.000Z", "idempotency_key": "call.inbound:1732118400.1234"}call.ringing
Section titled “call.ringing”Trigger: a call started ringing. Not yet available.
Fields: the real-time fields above. The body has the same shape as the call.inbound example, with "event": "call.ringing".
call.answered
Section titled “call.answered”Trigger: a call was answered. Not yet available.
Fields: the real-time fields above. The body has the same shape as the call.inbound example, with "event": "call.answered".
call.hangup
Section titled “call.hangup”Trigger: a call ended. Sent for every direction, including internal calls. Not yet available.
Extra fields:
| Field | Type | Nullable | Meaning |
|---|---|---|---|
answered | boolean | No | Whether the call was answered |
duration | number | Yes | Total call length in seconds |
billsec | number | Yes | Talk time in seconds |
disposition | string | Yes | The raw call result, for example ANSWERED |
outcome | string | Yes | declined when a user declined the call; otherwise null |
{ "event": "call.hangup", "callId": "1732118400.1234", "from": "+15555550123", "to": "+15555550100", "direction": "inbound", "extension": "1001", "answered": true, "duration": 187, "billsec": 172, "disposition": "ANSWERED", "outcome": null, "occurred_at": "2026-11-20T15:03:07.000Z", "idempotency_key": "call.hangup:1732118400.1234"}If you subscribe to both call.hangup and the end-of-call events, you receive two signals for the same call. Handle the end of a call once, keyed on the call, and treat whichever arrives second as a duplicate.
Messaging events
Section titled “Messaging events”Message status fields
Section titled “Message status fields”message.sent, message.delivered, and message.failed carry the same fields. They fire for outbound messages sent from Flare (conversations and campaigns) and for 1:1 texts your team sends from Nova numbers, for example from Pulse.
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | The event name |
messageId | number or string | No | ID of the message |
status | string | No | The new status: sent, delivered, failed, or undelivered |
to | string | No | The recipient’s number |
from | string | No | Your sending number |
campaignId | number or string | Yes | The campaign the message belongs to. null for a conversational message. |
direction | string | No | Always outbound. |
body | string | No | The message text. An empty string for a picture or file sent without text. Not included if your account has HIPAA mode on. |
userId | string | Yes | ID of the SIPSTACK user who sent the message. null when no user sent it, for example a message sent with an API key, an auto-response, or a campaign with no sender recorded. |
userName | string | Yes | That user’s name. null when userId is null or the user has no name set. |
extension | string | Yes | The Nova PBX extension number linked to that user, for example "101". null when the user has no extension, or has more than one. |
occurred_at | string (ISO-8601) | No | When SIPSTACK processed the status change |
idempotency_key | string | No | <event>:<messageId> |
If your account has HIPAA mode on, message events don’t include the message body.
extension is the extension number only, never the SIP endpoint name. It is the extension linked to the user when the event is sent. Extensions can be reassigned, so use userId, not extension, to match a user across messages.
A message usually produces message.sent and then message.delivered or message.failed. The second event can arrive within seconds of the first, and events are not guaranteed to arrive in order. Use status and occurred_at rather than arrival order.
message.sent
Section titled “message.sent”Trigger: the carrier accepted an outbound message for delivery. For a message between two SIPSTACK numbers, which is delivered inside SIPSTACK without a carrier, it fires when the message is handed to the receiving number. It fires once per message. Fields: message status fields.
{ "event": "message.sent", "messageId": 12345, "status": "sent", "to": "+15555550100", "from": "+15555550200", "campaignId": null, "direction": "outbound", "body": "Running 10 minutes late, see you soon.", "userId": "8f2c6d1a-3b4e-4f5a-9c7d-1e2f3a4b5c6d", "userName": "Dana Rivera", "extension": "101", "occurred_at": "2026-11-20T15:04:01.000Z", "idempotency_key": "message.sent:12345"}message.delivered
Section titled “message.delivered”Trigger: the carrier confirmed the message reached the handset. Fields: message status fields.
{ "event": "message.delivered", "messageId": 12345, "status": "delivered", "to": "+15555550100", "from": "+15555550200", "campaignId": null, "direction": "outbound", "body": "Running 10 minutes late, see you soon.", "userId": "8f2c6d1a-3b4e-4f5a-9c7d-1e2f3a4b5c6d", "userName": "Dana Rivera", "extension": "101", "occurred_at": "2026-11-20T15:04:05.000Z", "idempotency_key": "message.delivered:12345"}message.failed
Section titled “message.failed”Trigger: an outbound message failed to send or was undeliverable. status is failed or undelivered. Fields: message status fields.
{ "event": "message.failed", "messageId": 12346, "status": "undelivered", "to": "+15555550101", "from": "+15555550200", "campaignId": 42, "direction": "outbound", "body": "Spring sale: 20% off this weekend. Reply STOP to opt out.", "userId": null, "userName": null, "extension": null, "occurred_at": "2026-11-20T15:05:10.000Z", "idempotency_key": "message.failed:12346"}message.received
Section titled “message.received”Trigger: an inbound SMS or MMS arrived on one of your numbers.
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | message.received |
messageId | number or string | No | ID of the message |
from | string | No | The sender’s number |
to | string | No | Your number that received it |
body | string | No | The message text. Not included if your account has HIPAA mode on. |
direction | string | No | Always inbound. |
userId | string | Yes | ID of the SIPSTACK user the number is assigned to, when the number routes texts to one user. null when texts go to a shared team inbox. |
userName | string | Yes | That user’s name. null when userId is null or the user has no name set. |
extension | string | Yes | The Nova PBX extension number linked to that user, for example "101". null when the user has no extension, or has more than one. |
aura_capture | boolean | No | true when the text is a caller’s reply to an Aura agent that asked them, during a call, to text their email address. These replies are saved to the conversation but skip your auto-replies and team notifications. false for every other text. |
occurred_at | string (ISO-8601) | No | When SIPSTACK received the message |
idempotency_key | string | No | message.received:<messageId> |
{ "event": "message.received", "messageId": 12400, "from": "+15555550123", "to": "+15555550200", "body": "Is my appointment still at 3pm?", "direction": "inbound", "userId": "8f2c6d1a-3b4e-4f5a-9c7d-1e2f3a4b5c6d", "userName": "Dana Rivera", "extension": "101", "aura_capture": false, "occurred_at": "2026-11-20T15:06:00.000Z", "idempotency_key": "message.received:12400"}Campaign events
Section titled “Campaign events”campaign.completed
Section titled “campaign.completed”Trigger: a messaging campaign finished handing all its messages to the carrier. Delivery receipts can still arrive after this event.
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | campaign.completed |
campaignId | string | No | ID of the campaign |
name | string | No | The campaign name |
messagesSent | number | No | Number of messages sent |
occurred_at | string (ISO-8601) | No | When the campaign completed |
idempotency_key | string | No | campaign.completed:<campaignId> |
{ "event": "campaign.completed", "campaignId": "42", "name": "November appointment reminders", "messagesSent": 250, "occurred_at": "2026-11-20T16:00:00.000Z", "idempotency_key": "campaign.completed:42"}Aura AI voice-agent events
Section titled “Aura AI voice-agent events”These events come from Aura agent calls. They are separate from the events a flow sends (see Flow events).
aura.call.started
Section titled “aura.call.started”Trigger: an Aura agent answered a call and began handling it.
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | aura.call.started |
callId | string | No | ID of the call |
agentId | string | No | ID of the Aura agent |
agentName | string | No | The agent’s name |
from | string | No | The calling number |
to | string | No | The called number |
direction | string | No | inbound or outbound |
startedAt | string (ISO-8601) | No | When the agent started handling the call |
occurred_at | string (ISO-8601) | No | When the event was created |
idempotency_key | string | No | aura.call.started:<callId> |
{ "event": "aura.call.started", "callId": "a1b2c3d4e5f60718293a4b5c6d7e8f90", "agentId": "3d1f6b2a-9c4e-4a7b-8e21-5f0c9d3a7b16", "agentName": "Front desk", "from": "+15555550123", "to": "+15555550100", "direction": "inbound", "startedAt": "2026-11-20T15:10:00.000Z", "occurred_at": "2026-11-20T15:10:00.120Z", "idempotency_key": "aura.call.started:a1b2c3d4e5f60718293a4b5c6d7e8f90"}aura.call.completed
Section titled “aura.call.completed”Trigger: an Aura agent call ended. Includes the outcome and the post-call summary.
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | aura.call.completed |
callId | string | No | ID of the call |
agentId | string | No | ID of the Aura agent |
agentName | string | No | The agent’s name |
from | string | No | The calling number |
to | string | No | The called number |
direction | string | No | inbound or outbound |
billsec | number | No | Seconds the agent was on the call |
outcome | string | No | How the call ended: completed, transferred, hangup, caller_hangup, or error |
transferTarget | string | Yes | Where the call was transferred. null when it was not transferred. |
summary | string | Yes | A short AI summary of the call. null when no summary was produced. |
sentiment | string | Yes | The caller’s overall sentiment, for example Positive. null when not produced. |
extractedFields | object | Yes | Values the agent was configured to collect, keyed by field name. null when none. |
occurred_at | string (ISO-8601) | No | When the event was created |
idempotency_key | string | No | aura.call.completed:<callId> |
{ "event": "aura.call.completed", "callId": "a1b2c3d4e5f60718293a4b5c6d7e8f90", "agentId": "3d1f6b2a-9c4e-4a7b-8e21-5f0c9d3a7b16", "agentName": "Front desk", "from": "+15555550123", "to": "+15555550100", "direction": "inbound", "billsec": 142, "outcome": "transferred", "transferTarget": "1001", "summary": "Caller asked to reschedule Friday's appointment and was transferred to the front desk.", "sentiment": "Positive", "extractedFields": { "preferred_day": "Monday" }, "occurred_at": "2026-11-20T15:12:25.000Z", "idempotency_key": "aura.call.completed:a1b2c3d4e5f60718293a4b5c6d7e8f90"}Contact consent events
Section titled “Contact consent events”These events keep a CRM or your own suppression list in step with SIPSTACK’s SMS opt-out list and consent records.
Consent event fields
Section titled “Consent event fields”Every consent event carries these fields:
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | The event name |
event_id | string (UUID) | No | Unique ID for this change. Your de-duplication key. |
phone_number | string | No | The number, in E.164 format |
contact_ids | array of string (UUID) | No | Your contacts with this number. Can be empty or list several. |
method | string | No | How the change was made: sms, web, admin, api, system, and others |
actor | object | Yes | Who made it: { "type": "recipient" | "user" | "api_key" | "system" | "integration" }. An integration actor also has provider. null when unknown. |
occurred_at | string (ISO-8601) | No | When the change happened |
idempotency_key | string | No | <event>:<event_id> |
Rules:
- Opt-out events are per number, not per contact. One number shared by three contacts sends one
contact.opted_outthat lists all three IDs incontact_ids. - Opting out a number that is already on the list sends nothing.
- Payloads never include message text (including the STOP message), opt-out reasons, or notes.
- Consent events are delivered within about a minute of the change.
- Events for different numbers can arrive out of order. Compare
occurred_atif order matters.
contact.opted_out
Section titled “contact.opted_out”Trigger: a number was added to your SMS opt-out list. The recipient texted STOP, the number was opted out in the portal or through the API, or a message hard-bounced. Fields: consent event fields.
{ "event": "contact.opted_out", "event_id": "3f6c1a2e-8b4d-4c1e-9f0a-5d2b7e9c1a44", "phone_number": "+15555550100", "contact_ids": ["2489e9ad-2ee2-4e00-8ec9-32d5f69181c0"], "method": "sms", "actor": { "type": "recipient" }, "occurred_at": "2026-11-20T14:03:12.418Z", "idempotency_key": "contact.opted_out:3f6c1a2e-8b4d-4c1e-9f0a-5d2b7e9c1a44"}contact.opted_in
Section titled “contact.opted_in”Trigger: a number was removed from your SMS opt-out list. The recipient texted START, or the number was opted back in in the portal or through the API.
Extra field:
| Field | Type | Nullable | Meaning |
|---|---|---|---|
previous_opt_out_methods | array of string | No | How the number had been opted out |
{ "event": "contact.opted_in", "event_id": "9b2d4f61-0c3a-4e8b-a1d7-6f5e2c8b3a90", "phone_number": "+15555550100", "contact_ids": ["2489e9ad-2ee2-4e00-8ec9-32d5f69181c0"], "method": "sms", "actor": { "type": "recipient" }, "previous_opt_out_methods": ["sms"], "occurred_at": "2026-11-20T09:41:57.006Z", "idempotency_key": "contact.opted_in:9b2d4f61-0c3a-4e8b-a1d7-6f5e2c8b3a90"}contact.consent_changed
Section titled “contact.consent_changed”Trigger: a contact’s SMS consent status or consent basis changed (implied, express, or none).
Extra fields:
| Field | Type | Nullable | Meaning |
|---|---|---|---|
consent_status | object | No | { "from": "<old>", "to": "<new>" } |
consent_method | string | Yes | How consent was obtained, for example web_form |
consent_obtained_at | string (ISO-8601) | Yes | When consent was obtained |
implied_consent_basis | string | — | Present only when the change involves implied consent |
implied_consent_basis_date | string | — | Present only when the change involves implied consent |
channel | string | Yes | Where the change came from, for example api_contact_update |
{ "event": "contact.consent_changed", "event_id": "c7a85e13-4d2f-4b6a-8e19-0f3d5a7b2c68", "phone_number": "+15555550100", "contact_ids": ["2489e9ad-2ee2-4e00-8ec9-32d5f69181c0"], "method": "api", "actor": { "type": "api_key" }, "consent_status": { "from": "implied", "to": "express" }, "consent_method": "web_form", "consent_obtained_at": "2026-11-20T13:55:00.000Z", "channel": "api_contact_update", "occurred_at": "2026-11-20T13:55:02.731Z", "idempotency_key": "contact.consent_changed:c7a85e13-4d2f-4b6a-8e19-0f3d5a7b2c68"}To backfill or reconcile, poll GET /api/v2/opt-outs?since= for the current opt-out list and GET /api/v2/contacts?updated_since= for changed contacts (including is_opted_out). A number that is opted back in leaves the opt-out list, so use the contact.opted_in event or is_opted_out on the contact to see removals. See the API Reference.
Team chat events
Section titled “Team chat events”These events fire for messages in public team chat channels only. Messages in private channels and direct messages never send an event. A flow cannot send these events.
Chat message fields
Section titled “Chat message fields”chat.message.created, chat.message.updated, and chat.message.deleted carry the same fields:
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | The event name |
message_id | string (UUID) | No | ID of the message |
channel_id | string (UUID) | No | ID of the channel |
channel_name | string | Yes | The channel name |
sender_kind | string | No | user (a person), integration (an incoming webhook), or system (a SIPSTACK system post) |
sender_user_id | string | Yes | The sender’s user ID. Set only when sender_kind is user. |
sender_name | string | No | The person’s name, the incoming webhook’s name, or SIPSTACK |
body | string | No | The message text. Empty for chat.message.deleted. |
parent_message_id | string | Yes | The parent message, for a thread reply. null otherwise. |
created_at | string (ISO-8601) | No | When the message was posted |
edited_at | string (ISO-8601) | Yes | When the message was last edited. null if never edited. |
occurred_at | string (ISO-8601) | No | When the change happened |
idempotency_key | string | No | <event>:<message_id>. For chat.message.updated it also includes the edit time, so each edit has its own key. |
chat.message.created
Section titled “chat.message.created”Trigger: a message was posted in a public channel. Fields: chat message fields.
{ "event": "chat.message.created", "message_id": "5b0d2a4e-7c1f-4e8a-9d3b-2f6a1c8e4b70", "channel_id": "0f8e2c6a-3b5d-4a1e-8c7f-9d2b4e6a1c30", "channel_name": "dispatch", "sender_kind": "integration", "sender_user_id": null, "sender_name": "Build monitor", "body": "Build 42 passed", "parent_message_id": null, "created_at": "2026-11-19T15:04:05.000Z", "edited_at": null, "occurred_at": "2026-11-19T15:04:05.012Z", "idempotency_key": "chat.message.created:5b0d2a4e-7c1f-4e8a-9d3b-2f6a1c8e4b70"}chat.message.updated
Section titled “chat.message.updated”Trigger: a message in a public channel was edited. The body has the new body and edited_at. Fields: chat message fields.
chat.message.deleted
Section titled “chat.message.deleted”Trigger: a message in a public channel was deleted. body is an empty string. Fields: chat message fields.
Flow events
Section titled “Flow events”Aura AI voice-agent flows can include webhook nodes. When a call reaches a webhook node, SIPSTACK sends the node’s event to your subscribed endpoints, with the payload you defined in the flow.
A webhook node can send only these flow events:
| Event | When | Payload fields |
|---|---|---|
sales.lead | A lead-qualifier flow captured a sales lead | Defined by the flow. See sales.lead |
flow.callback_requested | An Aura AI voice agent’s flow recorded that the caller asked for a callback | Defined by the flow |
flow.message_taken | An Aura AI voice agent’s flow took a message for your team | Defined by the flow |
flow.custom | A custom milestone marked by a webhook node in one of your Aura AI voice-agent flows | Defined by the flow |
- You cannot save a flow whose webhook node uses any other event name.
- A flow can never send a platform event (
call.*,message.*,contact.*,aura.*,campaign.*,chat.*ortest). A platform event you receive always came from SIPSTACK itself. - Testing a flow in the Switchboard flow builder never sends webhooks. The builder simulates each webhook node as a success, so the test continues down the success path.
Every flow event carries the fields your flow defines, plus these system fields. The flow cannot override them:
| Field | Type | Nullable | Meaning |
|---|---|---|---|
source | string | No | Always "aura_flow" |
idempotency_key | string | No | <event>:<call id>:<node id>:<n>. Also sent as the X-Idempotency-Key header. n counts how many times this call has reached the node, starting at 1. If a flow loops back through the same node, each pass gets its own key. Retries of one delivery keep the same key. |
occurred_at | string (ISO-8601) | No | When the node ran |
call | object | No | The call that reached the node: { "id", "from", "to", "agentId" } |
{ "event": "flow.callback_requested", "name": "Dana Reyes", "best_time": "after 3pm", "source": "aura_flow", "idempotency_key": "flow.callback_requested:1732114800.42:node_7:1", "occurred_at": "2026-11-20T15:04:05.012Z", "call": { "id": "1732114800.42", "from": "+14165550100", "to": "+16135550200", "agentId": "4c1e9f0a-5d2b-4e9c-8a44-3f6c1a2e8b4d" }}In this example, name and best_time come from the flow. The other fields come from SIPSTACK.
sales.lead
Section titled “sales.lead”Trigger: a lead-qualifier flow captured a sales lead.
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | sales.lead |
| (flow fields) | — | — | The fields you defined in the flow’s webhook node. The Sales Lead Qualifier template sends name, company, need, timeline, and contact. |
source, idempotency_key, occurred_at, call | — | No | The system fields every flow event carries. See Flow events. |
{ "event": "sales.lead", "name": "Jane Example", "company": "Example Dental", "need": "Phone system for 3 locations", "timeline": "Next month", "contact": "jane@example.com", "source": "aura_flow", "idempotency_key": "sales.lead:1732118400.5678:node_3:1", "occurred_at": "2026-11-20T15:04:05.012Z", "call": { "id": "1732118400.5678", "from": "+15555550123", "to": "+15555550100", "agentId": "3d1f6b2a-9c4e-4a7b-8e21-5f0c9d3a7b16" }}Test event
Section titled “Test event”Trigger: you called POST /v2/portal/webhooks/{id}/test, or sent a test event from the Webhooks page in Switchboard.
The test event goes only to the endpoint you tested, whichever events it subscribes to. No other endpoint receives it.
| Field | Type | Nullable | Meaning |
|---|---|---|---|
event | string | No | test |
message | string | No | This is a test webhook delivery |
occurred_at | string (ISO-8601) | No | When the test was requested |
idempotency_key | string | No | test:<id of the endpoint you tested>:<random id>. Each test has a new key, so your receiver never drops a second test as a duplicate. |
{ "event": "test", "message": "This is a test webhook delivery", "occurred_at": "2026-11-20T15:00:00.000Z", "idempotency_key": "test:17:0b6f3c2e-9a41-4d7e-8c15-2f4a6e1d9b30"}Verifying signatures
Section titled “Verifying signatures”Verify every request before you trust the body. A valid signature proves the request came from SIPSTACK and was not changed. The timestamp check stops an attacker from recording a real delivery and sending it to you again later (a replay).
Each delivery carries two headers:
X-Sipstack-Timestamp: the Unix time, in seconds, when SIPSTACK signed this attempt.X-Sipstack-Signature:v1=followed by the lowercase hex HMAC-SHA256 of the signed payload, keyed with your endpoint’s signing secret.
The signed payload is the timestamp, a dot (.), and the raw request body:
<X-Sipstack-Timestamp>.<raw request body>To verify a request:
- Read both headers. If either is missing, reject the request.
- Check the timestamp. If it is more than 5 minutes (300 seconds) from your server’s current time, in either direction, reject the request. Keep your server clock in sync (NTP).
- Compute the HMAC-SHA256 of
<timestamp>.<raw body>with your signing secret, as lowercase hex, and add thev1=prefix. - Compare your value with
X-Sipstack-Signatureusing a constant-time comparison. If they differ, reject the request.
Reject a failed check with 401. Do not process the body.
Retries carry a fresh signature
Section titled “Retries carry a fresh signature”Each retry is signed again at the time it is sent. On every attempt:
X-Sipstack-TimestampandX-Sipstack-Signatureare new.- The body is byte-for-byte the same as the first attempt.
X-Idempotency-Keyis the same as the first attempt.
So a retry that arrives 6 minutes after the first attempt still passes the 5-minute check. Do not use the signature or the timestamp to spot a repeat. De-duplicate on X-Idempotency-Key (see Idempotency and de-duplication).
Node.js (Express)
Section titled “Node.js (Express)”const crypto = require('crypto');const express = require('express');const app = express();
const TOLERANCE_SECONDS = 300;
function verifySipstackWebhook(rawBody, timestampHeader, signatureHeader, secret) { if (!timestampHeader || !signatureHeader) return false; if (!/^\d+$/.test(timestampHeader)) return false;
const timestamp = Number(timestampHeader); const now = Math.floor(Date.now() / 1000); if (Math.abs(now - timestamp) > TOLERANCE_SECONDS) return false;
const signedPayload = Buffer.concat([Buffer.from(`${timestampHeader}.`, 'utf8'), rawBody]); const expected = 'v1=' + crypto.createHmac('sha256', secret).update(signedPayload).digest('hex');
const a = Buffer.from(signatureHeader, 'utf8'); const b = Buffer.from(expected, 'utf8'); return a.length === b.length && crypto.timingSafeEqual(a, b);}
// express.raw() keeps the body as bytes. Verify against those bytes,// not a re-serialized copy of the parsed JSON.app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => { const ok = verifySipstackWebhook( req.body, req.get('x-sipstack-timestamp'), req.get('x-sipstack-signature'), process.env.SIPSTACK_WEBHOOK_SECRET, ); if (!ok) { return res.status(401).send('Invalid signature'); }
const event = JSON.parse(req.body.toString('utf8')); // Respond fast, then process in the background (queue, job, etc.). res.status(200).send('OK'); handleEvent(event);});Python (Flask)
Section titled “Python (Flask)”import hashlibimport hmacimport jsonimport osimport time
from flask import Flask, abort, request
app = Flask(__name__)SECRET = os.environ["SIPSTACK_WEBHOOK_SECRET"].encode()TOLERANCE_SECONDS = 300
def verify_sipstack_webhook(raw: bytes, timestamp: str, signature: str) -> bool: if not timestamp or not signature or not timestamp.isdigit(): return False if abs(int(time.time()) - int(timestamp)) > TOLERANCE_SECONDS: return False signed_payload = timestamp.encode() + b"." + raw expected = "v1=" + hmac.new(SECRET, signed_payload, hashlib.sha256).hexdigest() return hmac.compare_digest(signature, expected)
@app.post("/webhook")def webhook(): raw = request.get_data() # raw bytes, before any JSON parsing ok = verify_sipstack_webhook( raw, request.headers.get("X-Sipstack-Timestamp", ""), request.headers.get("X-Sipstack-Signature", ""), ) if not ok: abort(401)
event = json.loads(raw) # Respond fast, then process in the background. return "OK", 200If you use the @sipstack/sdk package for Node.js, call verifyWebhook(rawBody, headers, secret). Pass the raw body and the request headers. When X-Sipstack-Timestamp is present, it checks only the timestamped v1= signature, with a 5-minute tolerance. constructEvent(rawBody, headers, secret) runs the same check, then parses the body, and throws if the signature does not match. To pass the two header values yourself, use verifyTimestampedSignature(rawBody, timestamp, signature, secret). verifySignature checks only the legacy body-only header.
import express from "express";import { verifyWebhook } from "@sipstack/sdk";
const app = express();
app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => { if (!verifyWebhook(req.body, req.headers, process.env.SIPSTACK_WEBHOOK_SECRET)) { return res.status(401).end(); } const event = JSON.parse(req.body.toString("utf8")); res.status(200).end();});The legacy signature header
Section titled “The legacy signature header”Older integrations verify X-Webhook-Signature. Its value is sha256= followed by the hex HMAC-SHA256 of the raw body only. It has no timestamp, so it does not protect you against replays.
- SIPSTACK still sends
X-Webhook-Signatureon platform webhook deliveries, next to the new headers, during a 90-day deprecation period. - After that period, SIPSTACK stops sending it. We notify endpoint owners before it is removed.
- Webhooks sent by Aura AI voice agents (post-call, flow, and escalation webhooks) never carry it. They only use the timestamped headers.
Migrate now. Switch your verifier to X-Sipstack-Timestamp and X-Sipstack-Signature. Both headers are sent today with the same secret, so you can deploy the new check without changing anything in SIPSTACK.
Aura AI voice-agent webhooks
Section titled “Aura AI voice-agent webhooks”Some webhooks are sent by an Aura AI voice agent, not by a platform webhook endpoint:
- The webhook post-call action (sent when a call ends).
- A Send message node in a flow with the webhook channel (sent during the call).
- The escalation webhook (sent when the agent escalates by webhook).
These use the same X-Sipstack-Timestamp and X-Sipstack-Signature headers and the same check as above. The secret is the agent’s webhook signing secret, not an endpoint secret. Each agent has one signing secret for all of its webhooks. SIPSTACK creates it when you save an agent that has a webhook, and shows it once. To get a new one, rotate it in the agent’s settings. The old secret stops working right away.
See Building & Editing Agents for the per-webhook transcript setting.
Trusting the event
Section titled “Trusting the event”A valid signature proves SIPSTACK sent the request. It does not tell you who wrote the payload. Check the event name too:
- Platform events (
call.*,message.*,contact.*,aura.*,campaign.*,chat.*,test) always come from SIPSTACK itself. A flow can never send them. - Flow events (
sales.lead,flow.*) come from a webhook node in one of your Aura AI voice-agent flows. Anyone who can edit your flows controls their payload fields. Treat those fields as input from that person. The system fields (source,idempotency_key,occurred_at,call) are always set by SIPSTACK. - Internal platform events are never delivered to your endpoints, even with a
["*"]subscription.
Delivery, retries, and auto-disable
Section titled “Delivery, retries, and auto-disable”- Your endpoint must answer with a
2xxstatus within 10 seconds. Answer first, then process the event in the background. - A non-
2xxstatus, a timeout, or a connection error counts as a failed attempt. - A failed delivery is retried up to 2 more times. Attempt 2 is about 1 minute after the first failure. Attempt 3 is about 5 minutes after attempt 2. That is at most 3 attempts per event.
- Redirects are not followed. A
3xxstatus counts as a failure. - Every attempt is logged with the event type, HTTP status, response time, and attempt number. Read the log with
GET /v2/portal/webhooks/{id}/deliveries. - If you delete or disable an endpoint while retries are pending, the pending retries are skipped.
- When an event fails all 3 attempts, the endpoint’s failure count goes up by one. After 10 events in a row fail all their attempts, the endpoint is disabled automatically. Any successful delivery resets the count to zero.
- To recover from auto-disable, fix your server, then recreate the endpoint or contact support. Use the delivery log to find events you missed.
- Events are not guaranteed to arrive in order. Use
occurred_atto order them.
Idempotency and de-duplication
Section titled “Idempotency and de-duplication”Delivery is at-least-once. Your endpoint can receive the same event more than once, for example after a timeout on a request you actually processed.
- De-duplicate on
idempotency_key(also sent as theX-Idempotency-Keyheader). Store keys you have processed and skip repeats. - For contact consent events you can also use
event_id. - Flow events always carry an
idempotency_key. It is new on each pass through a webhook node, so a flow that loops back through the same node sends a new key each time.
Integration checklist
Section titled “Integration checklist”Use this list when you build or review an integration, by hand or with an AI coding agent:
- Create the endpoint with an explicit
eventslist. Store the signing secret from the create response. - Read the raw body. Check that
X-Sipstack-TimestampandX-Sipstack-Signatureare present, that the timestamp is within 5 minutes, and that thev1=signature matches (constant-time). Reject a failed check with401. Do not build new code on the deprecatedX-Webhook-Signature. - Answer
200within 10 seconds. Do slow work in the background. - Branch on the
eventfield (or theX-Webhook-Eventheader). - De-duplicate on
idempotency_key(X-Idempotency-Key). Retries carry a new timestamp and signature, so never de-duplicate on those. - Ignore fields you do not recognize. Check nullable fields for
null. - For calls, subscribe to
call.completed,call.missed, andcall.unansweredas needed. Do not depend on the real-time call events until they are live. - Send a
testevent and confirm it appears in your logs and in the delivery log.
The event catalog grows with the platform. If you need an event that is not listed, tell support.