> ## 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.

# POST /Webhooks

> Subscribe to a new NowBookIt webhook event.

Subscribe to a new NowBookIt webhook event. NowBookIt will POST a payload to your `webhookUrl` when the event occurs.

<ParamField header="X-API-KEY" type="string" required>Your API key</ParamField>
<ParamField header="Content-Type" type="string" required>Must be `application/json`</ParamField>

<ParamField body="event" type="string" required>Event to subscribe to. Valid values: `BOOKING_CREATED`, `BOOKING_UPDATED`, `GIFTCARDS_CREATED`, `GIFTCARDS_UPDATED`, `GIFTCARDS_CANCELLED`, `GIFTCARDS_REDEEMED`</ParamField>
<ParamField body="webhookUrl" type="string" required>Your endpoint URL where NowBookIt will POST the event payload</ParamField>
<ParamField body="securityKey" type="string">Auth key sent in the webhook request header</ParamField>
<ParamField body="securityToken" type="string">Auth token sent alongside `securityKey`</ParamField>

<CodeGroup>
  ```shell curl theme={null}
  curl --location '[BASE_URL]/Webhooks' \
  --header 'X-API-KEY: your_api_key_here' \
  --header 'Content-Type: application/json' \
  --data '{ "event": "BOOKING_CREATED", "webhookUrl": "https://your-system.com/webhooks/nbi/booking-created" }'
  ```
</CodeGroup>

**Example 200 Response**

```json theme={null}
{
  "event": "BOOKING_CREATED",
  "webhookUrl": "https://your-system.com/webhooks/nbi/booking-created",
  "locationId": "loc-9",
  "errorMessage": null
}
```

| Status | Description                                                 |
| ------ | ----------------------------------------------------------- |
| `200`  | Subscription created                                        |
| `400`  | API key not associated with a venue                         |
| `400`  | `No Venue Subscribed to your App.`                          |
| `400`  | `Giftcard Webhook Request Failed Verification.`             |
| `400`  | `request does not contain a valid Event and/or webhook Url` |
| `401`  | X-API-KEY missing or invalid                                |


## OpenAPI

````yaml POST /Webhooks
openapi: 3.0.4
info:
  title: NowBookIt IPOS Partner API
  description: >-
    REST API for integrating your POS or external system with NowBookIt's
    reservation, sales, and gift card platform.
  version: v1
  contact:
    email: platform.integrations@nowbookit.com
servers:
  - url: https://ipos.dev.nowbookit.com
    description: Development
  - url: https://ipos.nowbookit.com
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /Webhooks:
    post:
      tags:
        - Webhooks
      summary: Create Webhook
      operationId: createWebhook
      parameters:
        - name: X-API-KEY
          in: header
          description: API Key authentication header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEventRequest'
      responses:
        '200':
          description: Create new Webhook Events
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    WebhookEventRequest:
      required:
        - event
        - webhookUrl
      type: object
      properties:
        webhookUrl:
          minLength: 1
          type: string
          description: A valid URL that can receive POST requests with NBI events.
          format: uri
        securityKey:
          type: string
          description: The key used in the webhook authentication.
          nullable: true
        securityToken:
          type: string
          description: The token used in the webhook authentication.
          nullable: true
        event:
          minLength: 1
          type: string
          description: The event that this webhook will subscribe to
      additionalProperties: false
    WebhookResponse:
      type: object
      properties:
        event:
          type: string
          nullable: true
        webhookUrl:
          type: string
          nullable: true
        locationId:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````