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

# Create a Webhook Endpoint

> Creates a webhook endpoint subscribed to one or more events.

Requires the `webhooks:write` scope.

<Warning>The **creation response is the only time the signing `secret` is returned.** Store it securely — you'll need it to [verify signatures](/api-reference/webhooks/overview#verifying-signatures), and it can't be retrieved again.</Warning>

### Body

<ParamField body="url" type="string" required>
  The endpoint URL to deliver events to. Must be HTTPS.
</ParamField>

<ParamField body="events" type="array[string]" required>
  The events to subscribe to. Must be a non-empty list of valid event names — see [List Available Events](/api-reference/webhooks/events).
</ParamField>

### Response

Returns `201 Created` with the endpoint, including the one-time `secret`.

<Snippet file="webhooks/endpoint-fields.mdx" />

<ResponseField name="secret" type="string">
  The HMAC signing secret, returned **only** in this creation response. Store it securely.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.audienceful.com/v2/webhooks' \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <your-api-key>' \
  --data-raw '{
      "url": "https://example.com/webhooks/audienceful",
      "events": ["person.created", "person.updated"]
  }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.audienceful.com/v2/webhooks"
  headers = {
      "Content-Type": "application/json",
      "X-Api-Key": "<your-api-key>",
  }
  payload = {
      "url": "https://example.com/webhooks/audienceful",
      "events": ["person.created", "person.updated"],
  }

  response = requests.post(url, headers=headers, json=payload)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.audienceful.com/v2/webhooks", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-Api-Key": "<your-api-key>",
    },
    body: JSON.stringify({
      "url": "https://example.com/webhooks/audienceful",
      "events": [
        "person.created",
        "person.updated"
      ]
    }),
  });
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "wYt3nKq8Zs4pLm9vRb2xJc",
    "url": "https://example.com/webhooks/audienceful",
    "events": ["person.created", "person.updated"],
    "is_active": true,
    "disabled_reason": null,
    "disabled_at": null,
    "consecutive_failures": 0,
    "created_at": "2026-07-04T12:00:00Z",
    "updated_at": "2026-07-04T12:00:00Z",
    "secret": "whsec_9f2c1a7e5b8d4f31a0c6e2d9b7a4f108ef01a2b3c4d5e6f708192a3b4c5d6ef0"
  }
  ```
</ResponseExample>
