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

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

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

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

## Webhook map

* `lists`
  * `listChanged` (`lists.listChanged`)

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

## Lists

### List Changed

`lists.listChanged`

A SharePoint list item was created, updated, or deleted

**Payload**

| Name    | Type       | Required | Description |
| ------- | ---------- | -------- | ----------- |
| `value` | `object[]` | Yes      | —           |

<AccordionGroup>
  <Accordion title="value full type">
    ```ts theme={null}
    {
      subscriptionId: string,
      clientState?: string | null,
      expirationDateTime?: string,
      resource: string,
      tenantId: string,
      siteUrl: string,
      webId: string
    }[]
    ```
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Response data full type">
    ```ts theme={null}
    {
      subscriptionId: string,
      resource: string,
      siteUrl: string,
      webId: string,
      tenantId: string,
      receivedAt: Date
    }
    ```
  </Accordion>
</AccordionGroup>

**`webhookHooks` example**

```ts theme={null}
sharepoint({
    webhookHooks: {
        lists: {
            listChanged: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***
