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

# Create Webhook

> Creates a webhook endpoint that receives signed event notifications

Available on agency plans. The API token must belong to the agency owner.

The response includes the signing secret **once**. Store it immediately; it cannot be retrieved later. See [Outbound Webhooks](/docs/agency/webhooks) for the payload format, signature verification, and retry behavior.

## Headers

| Name            | Type   | Description        |
| --------------- | ------ | ------------------ |
| Accept\*        | String | application/json   |
| Authorization\* | String | Bearer {api_token} |
| Content-Type\*  | String | application/json   |

## Body Parameters

| Name   | Type   | Description                                                                                                                 |
| ------ | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| url\*  | String | The HTTPS endpoint to deliver events to.                                                                                    |
| events | Array  | Event types to subscribe to: `lead.captured`, `escalation.created`. Omit to receive all events, including ones added later. |

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.sitespeak.ai/v1/agency/webhooks" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://yourapp.com/webhooks/sitespeak",
      "events": ["lead.captured"]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.sitespeak.ai/v1/agency/webhooks', {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      url: 'https://yourapp.com/webhooks/sitespeak',
      events: ['lead.captured']
    })
  });

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

## Response

<Tabs>
  <Tab title="201 Created">
    ```json theme={null}
    {
      "webhook": {
        "id": "4e1d795f-16b5-412a-b324-5f34779829a7",
        "team_id": "92754e3f-c05a-401e-9436-112990d0ce04",
        "url": "https://yourapp.com/webhooks/sitespeak",
        "events": ["lead.captured"],
        "active": true,
        "created_at": "2026-08-18T11:41:52.000000Z",
        "updated_at": "2026-08-18T11:41:52.000000Z"
      },
      "secret": "whsec_JIF5QiBtKjgDSvuGWifX6mtFICkIR1Y6mKDU1bot"
    }
    ```
  </Tab>

  <Tab title="422 Validation Error">
    ```json theme={null}
    {
      "message": "The url field must start with one of the following: https://.",
      "errors": {
        "url": ["The url field must start with one of the following: https://."]
      }
    }
    ```
  </Tab>
</Tabs>
