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

# Subscribe Webhook

> Register a new CrowdChange webhook subscription pointing at your target URL to start receiving event payloads from the fundraising platform.

## Body

<ParamField body="url" type="string" required>
  URL to subscribe. Provided URL should return 200 HTTP-code in order to be subscribed.
</ParamField>

<ParamField body="lang" type="string">
  Webhook locale. Allowed values: `en`, `fr` Default: `en`
</ParamField>

<ParamField body="events" type="string[]">
  Events for subscription.
</ParamField>

## Response

<ResponseField name="id" type="integer">
  Webhook ID.
</ResponseField>

<ResponseField name="url" type="string">
  Webhook URL.
</ResponseField>

<ResponseField name="signing_secret" type="string">
  Webhook-specific secret used to verify `CrowdChange-Webhook-Signature` on outbound deliveries. Store this value securely.
</ResponseField>

<ResponseField name="language" type="string">
  Webhook language. Allowed values: `en`, `fr`
</ResponseField>

<ResponseField name="created_at" type="string">
  Webhook creation date.
</ResponseField>

<ResponseField name="events" type="object[]">
  List of subscribed events.

  <Expandable title="properties">
    <ResponseField name="id" type="integer">
      Event ID.
    </ResponseField>

    <ResponseField name="name" type="string">
      Event name
    </ResponseField>

    <ResponseField name="created_at" type="string">
      Event creation date.
    </ResponseField>
  </Expandable>
</ResponseField>

**Other responses**

| Status | Description                                          |
| ------ | ---------------------------------------------------- |
| `400`  | URL is not available (does not return 200 HTTP-code) |
| `403`  | Forbidden                                            |

<ResponseExample>
  ```json theme={null}
  {
    "id": 1,
    "url": "https://demo.crowdchange.test/webhooks/handle",
    "signing_secret": "whsec_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ab",
    "language": "en",
    "created_at": "2024-01-01 16:00:03",
    "events": [
      {
        "id": 1,
        "name": "fundraiser_created",
        "created_at": "string"
      }
    ]
  }
  ```
</ResponseExample>
