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

# Webhooks

> Get a signed HTTPS request whenever a booking changes, instead of polling.

NowBookIt sends your system an HTTPS `POST` whenever a booking changes at your venue. Gift card events are coming soon. Each request is signed, so you can check it came from NowBookIt.

## Setting up

There are two ways to get a webhook:

* **With your API key:** create one with [Create a Webhook](https://api-docs.nowbookit.com/platform/webhooks/create-webhook.md). Your key needs the `webhooks:manage` permission, plus `reservations:read` for booking events and `giftcards:read` for gift card events (coming soon).
* **From the venue:** the venue's staff add a webhook in NowBookIt and give you its signing secrets.

> [!NOTE]
>
> Webhooks must be switched on for the venue's organisation. Until they are, every webhook endpoint returns `404`. Contact NowBookIt to switch them on.

## Your endpoint

Your endpoint must:

* use `https://` on a public address. Private, loopback and link-local addresses are refused.
* answer with any `2xx` status within **10 seconds**. Answer first and process afterwards: queue the event, reply `200`, then do the work.
* be the final URL. Redirects are not followed.

## Signing secrets

A secret is `whsec_` followed by 43 characters. It is shown only once, when it is created or rotated. Store it like a password and always use the **whole** secret, `whsec_` included.

* **Per venue:** each venue has its own secret. Webhooks created with your API key are always this kind. When a venue's staff set up one webhook for several venues, there is one secret per venue: pick the secret for the event's `nbiVenueId` before checking the signature.
* **Group:** a venue's staff can instead set up one webhook for a group of venues with **one** secret for all of them. Check every request with that secret, whatever its `nbiVenueId`.

See [Verifying signatures](https://api-docs.nowbookit.com/platform/webhooks/verify-signatures.md).

## Order and duplicates

* **Events can arrive out of order,** and a retried event can arrive after newer ones. Keep the latest `occurredAt` you've applied for each `bookingId` (or `giftCardId`), and ignore anything older.
* **An event can arrive more than once,** even after you've answered `2xx`. Skip an `eventId` you've already handled, and still answer `2xx` so it isn't retried.

## Ignoring your own changes

You receive every change, including the ones your system made through the NowBookIt API. To ignore your own, skip events whose `source.integrationId` is your integration's id.

## Retries

A delivery that doesn't get a `2xx` within 10 seconds is retried up to 6 more times over about 3 days: after 5 minutes, 30 minutes, 2 hours, 8 hours, 24 hours and 36 hours. Each gap varies by up to 10%. Every attempt is signed again with a fresh timestamp and keeps the same `eventId`. After the last attempt the event is not sent again.

## Testing

[Send a Test Event](https://api-docs.nowbookit.com/platform/webhooks/send-test-event.md) sends one signed `webhook.test` event to your endpoint straight away and returns your endpoint's answer. Use it to check your signature verification before real events arrive.

## Endpoints

> [card] [List Event Types](https://api-docs.nowbookit.com/platform/webhooks/list-events.md)
>
> `GET` the events you can subscribe to

> [card] [List Webhooks](https://api-docs.nowbookit.com/platform/webhooks/list-webhooks.md)
>
> `GET` your webhooks at a venue

> [card] [Create a Webhook](https://api-docs.nowbookit.com/platform/webhooks/create-webhook.md)
>
> `POST` a webhook and get its secret

> [card] [Get a Webhook](https://api-docs.nowbookit.com/platform/webhooks/get-webhook.md)
>
> `GET` one webhook

> [card] [Delete a Webhook](https://api-docs.nowbookit.com/platform/webhooks/delete-webhook.md)
>
> `DELETE` a webhook

> [card] [Add an Endpoint](https://api-docs.nowbookit.com/platform/webhooks/add-endpoint.md)
>
> `POST` another URL with the same secret

> [card] [Update an Endpoint](https://api-docs.nowbookit.com/platform/webhooks/update-endpoint.md)
>
> `PATCH` an endpoint's events or switch it off

> [card] [Delete an Endpoint](https://api-docs.nowbookit.com/platform/webhooks/delete-endpoint.md)
>
> `DELETE` one URL

> [card] [Rotate the Secret](https://api-docs.nowbookit.com/platform/webhooks/rotate-secret.md)
>
> `POST` for a new signing secret

> [card] [Send a Test Event](https://api-docs.nowbookit.com/platform/webhooks/send-test-event.md)
>
> `POST` a signed test event now


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