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

# Webhooks

> Airtable incoming webhooks: event paths, payloads, and response data.

The Airtable plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/airtable/overview) for setup context and the exact URL shape).

<Info>
  **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks).
</Info>

## Webhook map

* `events`
  * `event` (`events.event`)

## HTTP handler setup

```ts app/api/webhook/route.ts theme={null}
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";

export async function POST(request: Request) {
    const headers = Object.fromEntries(request.headers);
    const body = await request.json();
    const result = await processWebhook(corsair, headers, body);
    return result.response;
}
```

## Events

## Events

### Event

`events.event`

On new Airtable event — fires when records or tables change

**Payload**

| Name             | Type     | Required | Description |
| ---------------- | -------- | -------- | ----------- |
| `base`           | `object` | Yes      | —           |
| `webhook`        | `object` | Yes      | —           |
| `timestamp`      | `string` | Yes      | —           |
| `actionMetadata` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="base full type">
    ```ts theme={null}
    {
      id: string
    }
    ```
  </Accordion>

  <Accordion title="webhook full type">
    ```ts theme={null}
    {
      id: string
    }
    ```
  </Accordion>

  <Accordion title="actionMetadata full type">
    ```ts theme={null}
    {
      source?: string,
      sourceMetadata?: {
        user?: {
          id: string,
          email?: string,
          name?: string
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Response data full type">
    ```ts theme={null}
    {
      base: {
        id: string
      },
      webhook: {
        id: string
      },
      timestamp: string,
      actionMetadata?: {
        source?: string,
        sourceMetadata?: {
          user?: {
            id: string,
            email?: string,
            name?: string
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

**`webhookHooks` example**

```ts theme={null}
airtable({
    webhookHooks: {
        events: {
            event: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***
