> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nixflex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Receive and verify webhook events

> Receive Nixflex call and booking events. Verify raw-body signatures, handle duplicate delivery and fetch private recording links when playback is needed.

**FIXED · organisation** **MUST** With organisations enabled, each organisation has one signing secret. Send the human Owner to the dashboard. Never ask for it in chat or expose it to AI tools.\
An authorised server can use an Owner session or the organisation API credential. Admin and Member sessions cannot retrieve it. Store it on the receiving server. Without organisations, the webhook signing secret is only the owning credential’s `KEY_SECRET` part. In either mode pass the webhook signing secret as `keySecret` to the Node verifier.

**NOT OFFERED → do this instead · number** call.bookings has no account field or per-number secret. After signature verification, look up number in your own tenant table. It is the business to number inbound and from number outbound.

**YOU CAN CHANGE · number** Set delivery destinations per number. Pre-call settings can be scoped to an agent or number. Keep the delivery destination and your signature-verification secret separate.

**SCOPE · operation** Verify X-Nixflex-Signature (`t=<timestamp>,v1=<hex>`) with HMAC-SHA256 over timestamp + "." + the original raw request body. Compare the digest in constant time and enforce a freshness policy before trusting the payload.

[Read the compact AI rules](https://docs.nixflex.com/ai-rules.md#webhooks)

Verify signed Nixflex events before storing their results or running a business action.

Guide: **API reference** · Topic: **Webhook events**

**The important part**

* Verify the exact body bytes before parsing or taking action.
* Delivery can be delayed, duplicated or missed; keep a reconciliation path.

[Business guide](https://docs.nixflex.com/guides/business/integrations.md) · [Developer guide](https://docs.nixflex.com/advanced/webhooks.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

Receive events at your HTTPS endpoint using the [first webhook](https://docs.nixflex.com/api-reference/integration-settings/put-integrations-webhook-number-phoneNumber.md) and optional [second webhook](https://docs.nixflex.com/api-reference/integration-settings/put-integrations-webhook2-number-phoneNumber.md) settings. Each slot is independent.

## Events and payloads

| Event or callback | Body and handling |
| - | - |
| Pre-call `call.inbound` | `event`, `from`, `to` and `call_id`. An explicit `action: reject` blocks the call; invalid or missing replies let it continue. This is a synchronous decision hook, not a post-call result. |
| `call.started` | Flat call object, scheduled after connection. Late delivery can contain later call fields. |
| `call.completed` | Flat call object with identifiers, direction, times, transcript, summary, bookings and recording metadata. No nested `call` wrapper. |
| [`call.bookings`](https://docs.nixflex.com/api-reference/call-bookings) | Post-call confirmed mutation `timeline` and one `final` result per booking UID. Count active final rows, not actions. Queued after completed, but arrival order is not guaranteed. |
| `sms.booking` | `event`, `from`, `to`, `agent_id`, `conversation`, `booking` and `at`. A `call_id` is not promised. |
| Dashboard `webhook.test` | Reachability sample. This path is unsigned and does not confirm a real signed event works. |

The `call.started` and `call.completed` payloads include `call_id`, `agent_id`, `direction`, `from`, `to`, `status`, `ended_reason`, `started_at`, `ended_at`, `duration_seconds`, `transcript`, `summary`, `sentiment`, `successful`, `extracted`, `bookings`, `recording_url`, `recording_duration_seconds`, `voicemail_detected`, `campaign_id` and `avg_latency_ms`. Missing values can be null; `bookings` is an array. Accept additive fields. The new `call.bookings` event has its own payload described on its reference page.

With private recording access, `recording_url` is null and `recording_status` and `recording_endpoint` are added. Save the call ID and [request recording access](https://docs.nixflex.com/api-reference/calls/get-calls-id-recording.md) when playback is needed. Do not treat a webhook as a permanent recording URL or final billing receipt.

## Verify the signature

The header format is `X-Nixflex-Signature: t=UNIX_SECONDS,v1=HEX_HMAC`. Calculate HMAC-SHA256 over the timestamp, a dot, and the **exact raw request body**. Preserve those bytes before parsing JSON.

With organisations enabled, use the stable organisation webhook signing secret. The organisation API credential on your server or a human Owner can retrieve it. Rotating the API key leaves that secret valid. Without organisations, use only the owning credential’s `KEY_SECRET` part. Rotation changes that verifier secret. Never pass the full `KEY_ID:KEY_SECRET` or a key ID to the verifier. See [retrieve the organisation webhook signing secret](https://docs.nixflex.com/api-reference/organisation/get-organisation-signing-secret.md).

Check the timestamp against a short tolerance, then compare equal-length digests in constant time. Reject or quarantine missing and invalid signatures for business events. Legacy paths can produce an unsigned delivery if signing material is missing; do not bypass verification. `call.bookings` requires a signature and retries instead of sending unsigned.

Use the [Node and Python verification examples](https://docs.nixflex.com/advanced/webhooks.md#3-verify-exact-request-bytes) in the Developer guide to build your receiver.

Custom-function GET signatures cover an empty body, not the query arguments. Prefer a signed non-GET request for consequential arguments. See [custom functions](https://docs.nixflex.com/api-reference/integration-settings/get-integrations-custom-functions-number-phoneNumber.md) and [pre-call settings](https://docs.nixflex.com/api-reference/integration-settings/get-integrations-precall-number-phoneNumber.md) for their distinct contracts.

## Delivery and duplicates

Persist a validated queued event before returning a successful 2xx response. Delivery can be duplicated, delayed or missed. For `call.started`, `call.completed` and `call.bookings`, deduplicate within each receiver by `(account, event, call_id)`, with account identity from trusted configuration. Call ID alone would discard completed or booking results after a started event. Use an atomic insert or unique constraint; quarantine a missing required identifier instead of guessing it. The synchronous pre-call hook instead needs its decision reply within the hook's deadline.

`sms.booking` has no call ID or universal event ID. It carries `from`, `to`, `agent_id`, `conversation`, `booking` and `at`. Deduplicate exact verified deliveries separately, and protect each downstream booking action against repetition. A booking UID alone is insufficient because the same booking can be moved or cancelled later.

Queued delivery has up to five queue attempts. A transport failure can also be retried within an attempt. Network failures, 408, 429 and 5xx can be retried; other 4xx are permanent failures. The queue treats 3xx as delivered, so return 2xx directly instead of redirecting. Post-call events normally start after 60 seconds; retry delays are five minutes, five minutes, five minutes, then sixty minutes. Retention and account state can stop delivery; this is not a guaranteed schedule.

Reconcile missed call events using [call reads](https://docs.nixflex.com/api-reference/calls/get.md). Store caller data only where your application needs it and keep webhook bodies out of ordinary logs.

## Booking object

Both `call.completed.bookings[]` and the `booking` property of `sms.booking` use the same public object. All keys shown below are present.

The new [call.bookings event](https://docs.nixflex.com/api-reference/call-bookings.md) uses that object plus receipt time in its timeline, and a separate final-result array. Existing completed and SMS shapes are unchanged. There is no new delayed aggregate event for SMS threads.

```json theme={"dark"}
{"action":"created","booking_uid":"event_example","start":"2030-11-04T10:00:00.000Z","end":"2030-11-04T10:30:00.000Z","attendee_name":"Test Person","attendee_email":"test@example.test","service":"appointment","timezone":"Europe/London"}
```

| Field | Type and meaning |
| - | - |
| `action` | `created`, `rescheduled` or `cancelled` |
| `booking_uid` | String or null; Google event ID or Cal.com booking UID |
| `start`, `end` | Date-time or null; actual provider interval, never a guessed end |
| `attendee_name`, `attendee_email` | String or null |
| `service` | String, number or null; older Cal.com event types can be numeric |
| `timezone` | String or null |

Google creation and move include actual end time; cancellation includes the looked-up interval and person. Older or upstream omissions remain null. An already-existing booking lookup is not a new public mutation event, so it must not trigger a second booking-created automation. The payload does not confirm email or SMS delivery.

## Next steps

* [API overview](https://docs.nixflex.com/api-reference/introduction.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md)
* [Retry rules](https://docs.nixflex.com/api-reference/retries.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.