---
title: Webhooks
section: features
updated: '2026-11-02'
summary: 'Receive signed HTTP events when your customers, signups and leads change. Setup, the envelope and headers, signature verification, every event with its payload, retries and the delivery log.'
tags:
  - partner
  - webhooks
  - integrations
related_forms:
  - partner_integrations
---

> A **webhook** is an https address on your side that cockpit calls, with a signed JSON message, every time one of your customers, signups or leads changes.

## Overview

A webhook is an [integration](partner_integrations.md) of type **Webhook**. You choose the events it receives, and cockpit sends each of them to your URL in the background, signed with a secret only you and cockpit know. Failed deliveries are retried for about a day, and each webhook's deliveries are listed from its **Deliveries** action. Each row also offers **Edit**, **Send test event** and **Delete**, and **Back to all** on a webhook's form brings you back to the tab.

Each webhook receives your organization's **own** customers, signups and leads only. A distributor does not receive the events of its resellers, and a reseller does not receive its distributor's. A signup whose phone system belongs to another partner is never sent, live or by [Send all existing](#send-all-existing).

This page is written for the developer who builds the receiver.

## Setting up a webhook

1. Open **Settings**, go to the **Webhooks** tab (after **API keys**) and select **Add webhook**. You need the *manage partner integrations* permission to see the tab.
2. The **Type** is already **Webhook**. The type cannot be changed after the integration is created. To switch to another type, create a new integration.
3. Enter the **URL**. It must be `https` and resolve to a public address. Private, local and plain `http` addresses are refused.
4. Tick the **Events to send**, at least one.
5. Save. The signing secret is created at that moment.

You can have up to **10 webhooks**, each with its own URL and its own events. A deleted webhook does not count toward the limit. An inactive webhook receives nothing. Switch a webhook on or off with the **Enabled** toggle on its row in the **Webhooks** tab of Settings, without opening it.

### The signing secret

The edit page shows the webhook's **Signing secret** (it starts with `whsec_`). **Reveal** shows it, **Copy** puts it on your clipboard, and **Rotate secret** replaces it. After a rotation the previous secret keeps signing alongside the new one for **24 hours**, so you can deploy the new secret without missing an event. See [Verifying the signature](#verifying-the-signature).

### Send test event

**Send test event** on the webhook's row, or on its edit page, sends a signed `ping` event to your URL right away and shows the HTTP status, the time it took and the start of your response. Use it to prove your signature check before real events flow. The test event is not retried and does not appear in the delivery log.

```json
{
  "id": "9b2f6c1e-4d7a-4b8e-a0f3-1c5d2e7f8a90",
  "event": "ping",
  "occurred_at": "2026-10-27T10:00:00+00:00",
  "api_version": "2026-10-27",
  "partner_id": "3f1e2d4c-5b6a-4978-8a1b-2c3d4e5f6a7b",
  "data": {}
}
```

## The envelope and headers

Every event is an HTTP `POST` with a JSON body. The body is always the same envelope, with the event's payload in `data`.

| Field | Type | Notes |
|---|---|---|
| `id` | string (UUID) | The delivery id. The same value as the `X-Voxbi-Delivery` header, and unchanged across retries. |
| `event` | string | The event name, for example `customer.created`. |
| `occurred_at` | string (ISO 8601) | When the event happened. For a replayed record, when it was sent. |
| `api_version` | string | The payload version, currently `2026-10-27`. Fields may be added within a version, never renamed or removed. |
| `partner_id` | string (UUID) | Your organization's id. |
| `replay` | boolean | Present, and `true`, only on deliveries sent by [Send all existing](#send-all-existing). Absent otherwise. |
| `data` | object | The resource. Its shape depends on the event, see below. |

The request carries these headers:

| Header | Value |
|---|---|
| `Content-Type` | `application/json` |
| `X-Voxbi-Event` | The event name, the same as `event` in the body. |
| `X-Voxbi-Delivery` | The delivery id, the same as `id` in the body. Use it to drop duplicates. |
| `X-Voxbi-Signature` | `t=<unix timestamp>,v1=<hex signature>`, see below. |

## Verifying the signature

Verify every request before you trust it. The `X-Voxbi-Signature` header looks like this:

```
X-Voxbi-Signature: t=1793095200,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
```

- `t` is the Unix time of the attempt. Each retry is signed again with its own time.
- `v1` is the hex HMAC-SHA256 of the string `<t>.<raw body>`, keyed with the webhook's signing secret (the full value, including `whsec_`).
- During the 24 hours after a rotation the header carries **two** `v1` values, one per secret. Accept the request if **any** of them matches the one you compute.

To verify:

1. Read the raw request body exactly as received, before any JSON parsing.
2. Split the header on `,`. Take `t` and every `v1` value.
3. Compute `HMAC-SHA256(secret, t + "." + raw body)` as lowercase hex.
4. Compare it with each `v1` value using a constant-time comparison.
5. Reject the request if `t` is more than **5 minutes** away from your clock. This stops an old request from being replayed.

### PHP

```php
function voxbiSignatureIsValid(string $rawBody, string $header, string $secret, int $tolerance = 300): bool
{
    $timestamp = null;
    $signatures = [];

    foreach (explode(',', $header) as $part) {
        [$key, $value] = array_pad(explode('=', trim($part), 2), 2, '');
        if ($key === 't') {
            $timestamp = (int) $value;
        } elseif ($key === 'v1') {
            $signatures[] = $value;
        }
    }

    if ($timestamp === null || abs(time() - $timestamp) > $tolerance) {
        return false;
    }

    $expected = hash_hmac('sha256', $timestamp.'.'.$rawBody, $secret);

    foreach ($signatures as $signature) {
        if (hash_equals($expected, $signature)) {
            return true;
        }
    }

    return false;
}

$rawBody = file_get_contents('php://input');
$valid = voxbiSignatureIsValid($rawBody, $_SERVER['HTTP_X_VOXBI_SIGNATURE'] ?? '', getenv('VOXBI_WEBHOOK_SECRET'));
```

### Node.js

```js
const crypto = require('crypto');

function voxbiSignatureIsValid(rawBody, header, secret, tolerance = 300) {
  let timestamp = null;
  const signatures = [];

  for (const part of (header || '').split(',')) {
    const [key, value = ''] = part.trim().split('=', 2);
    if (key === 't') timestamp = Number(value);
    if (key === 'v1') signatures.push(value);
  }

  if (!timestamp || Math.abs(Date.now() / 1000 - timestamp) > tolerance) {
    return false;
  }

  const expected = Buffer.from(
    crypto.createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex')
  );

  return signatures.some((signature) => {
    const given = Buffer.from(signature);
    return given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
}

// Express: keep the raw body, parse JSON only after the check.
app.post('/voxbi/webhooks', express.raw({ type: 'application/json' }), (req, res) => {
  if (!voxbiSignatureIsValid(req.body.toString('utf8'), req.get('X-Voxbi-Signature'), process.env.VOXBI_WEBHOOK_SECRET)) {
    return res.sendStatus(400);
  }
  res.sendStatus(204);
  // Process JSON.parse(req.body) asynchronously.
});
```

> [!WARNING]
> Compute the signature over the raw body. A body that was parsed and serialized again can differ by one space or one escaped slash, and the check then fails.

## Customers

| Event | When it is sent |
|---|---|
| `customer.created` | A customer is created in cockpit, in the partner portal or by a completed signup. Not sent for a customer your own CRM sync created. |
| `customer.updated` | One of these changes: `external_id`, name, company flag, email, phone number, street, number, postal code, city or country. Also sent when the carrier profile of one of the customer's PBXes is created or refused by the carrier. Not sent for changes made by your own CRM sync. |
| `customer.deleted` | The customer is deleted. Not sent again if the customer is later removed permanently. |

Moving a customer to another partner and restoring a deleted customer send nothing.

### Customer data

| Field | Type | Notes |
|---|---|---|
| `id` | string (UUID) | The customer's id in cockpit. |
| `external_id` | string or null | The customer's id in your CRM, when it is linked. |
| `name` | string | |
| `is_company` | boolean | |
| `email` | string or null | |
| `phone_number` | string or null | |
| `address.street` | string or null | |
| `address.no` | string or null | House number. |
| `address.postal_code` | string or null | |
| `address.city` | string or null | |
| `address.country` | string or null | ISO 3166-1 alpha-2 code, for example `LU`. |
| `pbxes` | array | The customer's PBXes that are not deleted and belong to you (or to no partner), oldest first. `[]` when there are none. |
| `pbxes[].id` | string (UUID) | |
| `pbxes[].name` | string or null | |
| `pbxes[].carrier.status` | string | `created`, `failed`, `pending` or `not_applicable`. See [Carrier status](#carrier-status). |
| `pbxes[].carrier.profile_id` | integer or null | The PBX's customer profile at the carrier, once it exists. |
| `created_at` | string (ISO 8601) | |
| `updated_at` | string (ISO 8601) | |

### Carrier status

The carrier status tells you whether the customer's profile at the carrier, which numbers are ordered through, exists yet. The first row that matches wins.

| Status | Meaning |
|---|---|
| `created` | The PBX has a carrier profile. `profile_id` holds it. |
| `failed` | The latest attempt to create the carrier profile was refused by the carrier. |
| `pending` | No profile yet, and an attempt is in progress, being retried or has an unclear result. Also used for a PBX that came from a signup or a Voxbi One order and has no attempt yet, but only while automatic carrier customer creation is switched on. |
| `not_applicable` | None of the above. The PBX does not order through the carrier, for example a PBX created by hand. |

A change from `pending` to `created` or `failed` sends a `customer.updated`.

### Example: customer.created

```json
{
  "id": "0c8a5e2b-7f14-4d6e-9b3a-5e1f2a4c6d80",
  "event": "customer.created",
  "occurred_at": "2026-10-27T10:00:00+00:00",
  "api_version": "2026-10-27",
  "partner_id": "3f1e2d4c-5b6a-4978-8a1b-2c3d4e5f6a7b",
  "data": {
    "id": "7d4c2a10-9e3b-4f58-b6a1-2c8e5f0d3b97",
    "external_id": "42",
    "name": "Borsalino SARL",
    "is_company": true,
    "email": "info@borsalino.lu",
    "phone_number": "+35227123456",
    "address": {
      "street": "Avenue de la Gare",
      "no": "12",
      "postal_code": "1611",
      "city": "Luxembourg",
      "country": "LU"
    },
    "pbxes": [
      {
        "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
        "name": "Borsalino",
        "carrier": {
          "status": "created",
          "profile_id": 4242
        }
      }
    ],
    "created_at": "2026-10-27T10:00:00+00:00",
    "updated_at": "2026-10-27T10:00:00+00:00"
  }
}
```

`customer.updated` and `customer.deleted` carry the same `data`, as it stands at the moment of the event.

## Signups

A signup is a visitor going through your [customer onboarding](partner_customer_onboarding.md) link. Each milestone is sent **once per signup**, the first time it is reached. Going back, verifying again or resuming later sends nothing more. If the signup moves to another reseller, the milestones it already reached are not sent again to the new one. Nothing is sent before the email address is verified, and nothing is sent for a signup that did not come through a reseller.

In the rare case that a milestone could not even be recorded for delivery because of an internal error, it is not sent later. Use [Send all existing](#send-all-existing) to resync.

| Event | When it is sent |
|---|---|
| `signup.email_verified` | The visitor proves their email address, by code or by signing in with Google or Microsoft. |
| `signup.phone_verified` | The visitor verifies their mobile number with an SMS code. |
| `signup.address_completed` | The visitor confirms the business address step. Carries the address as confirmed. |
| `signup.committed` | The order is confirmed and the phone system starts being built. Confirmed by the visitor, by you finishing the signup for them, or by an automatic retry after a capacity wait. |
| `signup.provisioned` | Provisioning of the phone system has ended, completely, partly or not at all. Check `provisioning_state` to tell them apart. |

### Signup data

All five events carry the same fields. Every key is always present, and a value that is not known yet is `null`.

| Field | Type | Notes |
|---|---|---|
| `id` | string (UUID) | The signup's id. Stable across all five events. |
| `email` | string | |
| `phone_number` | string or null | |
| `locale` | string | The language the visitor used. |
| `signup_ip` | string or null | |
| `milestone` | string | `email_verified`, `phone_verified`, `address_completed`, `committed` or `provisioned`. |
| `reached_at` | string (ISO 8601) | When this milestone was first reached. A later re-verification does not change it. |
| `business_name` | string or null | `null` until the address step is confirmed, like the address. |
| `address.street` | string or null | Every address field is `null` until the business address step is confirmed. |
| `address.no` | string or null | House number. |
| `address.postal_code` | string or null | |
| `address.city` | string or null | |
| `address.country` | string or null | ISO 3166-1 alpha-2 code. |
| `package` | string or null | The plan slug, for example `free_trial`. |
| `numbers.mode` | string or null | `new` (new numbers) or `port` (bring existing numbers). |
| `numbers.quantity` | integer or null | How many numbers the order uses. It follows the visitor's answer until the order is confirmed, then stays fixed. `0` is a real answer, `null` means not answered yet. |
| `committed_at` | string (ISO 8601) or null | |
| `provisioned_at` | string (ISO 8601) or null | When provisioning ended. |
| `provisioning_state` | string or null | `done`, `partial` or `failed`. `null` until provisioning ends. |
| `customer_id` | string (UUID) or null | Set once the phone system exists. The same id as in the customer events. |
| `pbx_id` | string (UUID) or null | Set once the phone system exists. |
| `created_at` | string (ISO 8601) | When the signup started. |

Signups carry no user agent, because the funnel does not store one.

### Example: signup.committed

```json
{
  "id": "5e9d1c3a-2b4f-4a6e-8d7c-9f0a1b2c3d4e",
  "event": "signup.committed",
  "occurred_at": "2026-10-27T10:05:00+00:00",
  "api_version": "2026-10-27",
  "partner_id": "3f1e2d4c-5b6a-4978-8a1b-2c3d4e5f6a7b",
  "data": {
    "id": "c4f8e2a6-1d3b-4c5e-9a7f-0b2d4e6f8a1c",
    "email": "anna@borsalino.lu",
    "phone_number": "+352621123456",
    "locale": "fr",
    "signup_ip": "203.0.113.7",
    "milestone": "committed",
    "reached_at": "2026-10-27T10:05:00+00:00",
    "business_name": "Borsalino SARL",
    "address": {
      "street": "Avenue de la Gare",
      "no": "12",
      "postal_code": "1611",
      "city": "Luxembourg",
      "country": "LU"
    },
    "package": "free_trial",
    "numbers": {
      "mode": "new",
      "quantity": 2
    },
    "committed_at": "2026-10-27T10:05:00+00:00",
    "provisioned_at": null,
    "provisioning_state": null,
    "customer_id": "7d4c2a10-9e3b-4f58-b6a1-2c8e5f0d3b97",
    "pbx_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "created_at": "2026-10-27T09:50:00+00:00"
  }
}
```

The other milestones carry the same `data`, with their own `milestone` and `reached_at` and whatever was known at that point. On `signup.email_verified`, for example, `business_name`, `address`, `customer_id` and `pbx_id` are still `null`. On `signup.provisioned`, `provisioning_state` is set.

For older signups that ended provisioning before webhooks existed, `provisioned_at` and the `reached_at` of `signup.provisioned` come from the provisioning steps, or else from the commit time.

## Leads

| Event | When it is sent |
|---|---|
| `lead.created` | A visitor from a country cockpit does not serve yet leaves their email address and a short message. Sent once per email address and country. A repeat sends nothing. |

### Lead data

| Field | Type | Notes |
|---|---|---|
| `id` | string (UUID) | |
| `email` | string | |
| `country_iso` | string | ISO 3166-1 alpha-2 code. `ZZ` means the visitor's country was not in the list, which you can find on older leads. |
| `country_name` | string | The country's name in English, whatever language the visitor used. `Other country` for `ZZ`. |
| `locale` | string or null | The language the visitor used. |
| `plan_id` | string (UUID) or null | The plan the visitor wanted: the plan of your signup link, else the plan your link would have given. `null` when none could be determined. |
| `plan_name` | string or null | The name of that plan when the lead arrived. |
| `signup_ip` | string or null | |
| `user_agent` | string or null | The visitor's browser. |
| `message` | string or null | What the visitor wrote on the form. Untrusted text: escape it before rendering. `null` on older leads. |
| `created_at` | string (ISO 8601) | |

### Example: lead.created

```json
{
  "id": "e7a3c5b9-0f2d-4e6a-8b1c-3d5f7a9b1c2e",
  "event": "lead.created",
  "occurred_at": "2026-10-27T11:20:00+00:00",
  "api_version": "2026-10-27",
  "partner_id": "3f1e2d4c-5b6a-4978-8a1b-2c3d4e5f6a7b",
  "data": {
    "id": "b8d0f2a4-6c8e-4a1b-9d3f-5a7c9e1b3d5f",
    "email": "jan@example.nl",
    "country_iso": "NL",
    "country_name": "Netherlands",
    "locale": "en",
    "plan_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "plan_name": "Business Trial",
    "signup_ip": "198.51.100.23",
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15",
    "message": "We are opening an office in Amsterdam and need 10 lines.",
    "created_at": "2026-10-27T11:20:00+00:00"
  }
}
```

## What is never sent

- The names and email addresses of the team members a signup brings across.
- Greeting audio.
- Verification codes and their hashes.
- Provisioning internals.
- A user agent for signups (it is not stored).
- Records of another partner, including your resellers' or your distributor's.

## Delivery, retries and the delivery log

Events are sent in the background, shortly after they happen. Cockpit waits **15 seconds** for your answer (5 seconds to connect). Any `2xx` status means delivered. Anything else, including a redirect, a timeout or no answer, counts as a failed attempt. Redirects are not followed.

A failed delivery is retried after **3 minutes, 10 minutes, 1 hour, 6 hours and 1 day**. If the last retry fails too, the delivery ends as **Failed**. A delivery to a webhook that was deactivated or deleted in the meantime is **Canceled** without a request. In the rare case Cockpit cannot queue a delivery at all, it shows as **Failed** right away, and **Retry** sends it.

The payload is fixed at the moment of the event. The URL and the secret are read again at each attempt, so correcting the URL also fixes the deliveries that are still waiting for a retry.

Each webhook's row in the **Webhooks** tab shows when it last delivered and a **success rate**, for example **98% succeeded**. The rate counts delivered against failed deliveries of the last 30 days. Deliveries still waiting for a retry, or canceled, are not counted.

Choose **Deliveries** on a webhook's row to see its most recent deliveries with time, event, response code, number of attempts and status. **Retry failed** on a row sends a failed delivery again with the same payload and delivery id, up to 30 attempts in total.

The log is kept for **30 days**.

## Send all existing

**Send all existing** on the webhook's edit page sends your existing records to **that webhook only**, for the events it subscribes to:

- `customer.created` for each of your customers.
- `lead.created` for each of your leads.
- For each signup, every milestone it has reached, in order.

`customer.updated` and `customer.deleted` are never replayed. A signup whose provisioning has ended replays `signup.provisioned`, whether it ended `done`, `partial` or `failed`. Each delivery carries `"replay": true` in the envelope. Its `occurred_at` is the moment it was sent, while the real moment stays in the data's `created_at` or `reached_at`.

> [!IMPORTANT]
> Replayed signup milestones can arrive out of order. Order them by `data.reached_at`, not by arrival.

The deliveries appear in the delivery log like any other delivery. They are spread out, each batch of 20 held back 2 seconds more than the previous one, so a large account does not flood your receiver.

- The webhook must be active. Switching it off stops a running export.
- One export runs at a time per webhook, and per partner.
- The next export can start **10 minutes** after the last delayed delivery of the previous one is due.
- An export of more than **50,000** records is refused with a message.
- If the export cannot be started, the page says so and nothing is sent.

## Good receiver practices

- **Verify the signature** of every request and reject a stale `t`, as shown in [Verifying the signature](#verifying-the-signature).
- **Drop duplicates on `X-Voxbi-Delivery`.** A retry, a manual **Retry** or **Send all existing** can bring the same event again. Store the delivery ids you have processed.
- **Answer `2xx` fast and process later.** Put the event on your own queue and answer at once. A slow answer becomes a timeout and a retry.
- **Do not rely on order.** A retried or replayed delivery can arrive after a newer one. Use `reached_at`, `updated_at` and `occurred_at` to decide what is newest.
- **Treat every text field as untrusted input.** Names, addresses, email addresses and user agents are typed by visitors and customers. Escape them before you display them and never execute them.

> [!CAUTION]
> Keep the signing secret out of source control and logs. Anyone who has it can forge events that your receiver will accept. If it leaks, rotate it.

## See also

- [Settings](partner_settings.md) - the Webhooks tab, where a webhook is created.
- [Customer onboarding](partner_customer_onboarding.md) - the funnel the signup events come from.
- [Customers](partner_customers.md) - the records the customer events describe.
