# Create a webhook

`POST https://api.airtable.com/v0/bases/{baseId}/webhooks`

Creates a new webhook in the specified base. Payloads may be generated and the notification URL (if given)
will get a ping shortly after this completes.

The number of webhooks per base is limited to 10. A single OAuth integration can create up to 2 webhooks per base.

Each webhook created with OAuth or personal access token will expire and be disabled after 7 days. The webhook life can be
extended while it is still active by calling [refresh webhook](https://airtable.com/developers/web/api/refresh-a-webhook.md) or [list webhook payloads](https://airtable.com/developers/web/api/list-webhook-payloads.md).
After a webhook has expired and been disabled, the webhook's metadata and past payloads can be accessed for an additional 7 days.

**Creator level permissions are required in order to register a webhook.**

## Requirements

- **Authentication:** [Personal access token](https://airtable.com/developers/web/api/authentication.md#types-of-token), [OAuth integration](https://airtable.com/developers/web/api/authentication.md#types-of-token)
- **Scope:** Scopes depend on the subscribed [dataTypes](https://airtable.com/developers/web/api/model/webhooks-specification.md#filters-datatypes), more details [here](https://airtable.com/developers/web/api/webhooks-overview.md#authorization)
- **User role:** Base creator
- **Billing plans:** All plans

## Path parameters

- `baseId: string`

## Request body

- `notificationUrl: string` — optional

  An optional url that can receive notification pings. [See notification delivery](https://airtable.com/developers/web/api/webhooks-overview.md#webhook-notification-delivery).

- `specification: object` — required

  A JSON object that describe the types of changes the webhook is interested in.

  - `options: Webhooks-specification` — required

## Response format

- `id: string` — required

  An identifier for the webhook (WebhookId).

- `macSecretBase64: string` — required

  A MAC secret. The client should store this value to authenticate webhook pings.
  There is no way to retrieve this value after the initial creation of the webhook.

- `expirationTime: string` — optional

  The time when the webhook expires and is disabled in the ISO format. The webhook will not expire
  if this is null (in the case User API keys are used)

### Example — Success response

```sh
curl -X POST "https://api.airtable.com/v0/bases/{baseId}/webhooks" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "notificationUrl": "https://foo.com/receive-ping",
    "specification": {
      "options": {
        "filters": {
          "dataTypes": [
            "tableData"
          ],
          "recordChangeScope": "tbltp8DGLhqbUmjK1"
        }
      }
    }
  }'
```

```json
{
  "expirationTime": "2023-01-20T00:00:00.000Z",
  "id": "ach00000000000000",
  "macSecretBase64": "someBase64MacSecret"
}
```
