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

# Configuration

> One URL, many events. Register as many endpoints as you need and choose what each one receives.

Zapfy uses a **subscription** model: instead of a single global URL that receives
everything, you register **endpoints** and each one **subscribes to the set of
events** it wants.

* Want everything in one place → 1 endpoint with all events.
* Want them split (e.g. message status to one service, connection to another) →
  separate endpoints, each with its own filter.

<Note>
  Limit of **5 endpoints per instance**. Each endpoint is a delivery target per
  event; the cap prevents accidental amplification.
</Note>

## From the dashboard

Open the instance → **Settings** → **Webhooks**:

1. **Add webhook**.
2. Enter the **destination URL** (HTTPS).
3. Check the **events** that endpoint should receive.
4. Save. Use the **Enabled** toggle to pause delivery without deleting the endpoint.

## From the API

<ParamField path="url" type="string" required>
  HTTPS destination URL. Maximum of 2048 characters.
</ParamField>

<ParamField path="events" type="string[]" required>
  List of subscribed events. At least one. Valid values in [Events](/en/webhooks/events).
</ParamField>

<ParamField path="enabled" type="boolean" default="true">
  Whether the endpoint receives deliveries.
</ParamField>

### Create

```bash theme={null}
curl -X POST https://api.zapfy.io/v1/instances/{instanceId}/webhooks \
  -H "Authorization: Bearer zpfy_acct_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.com/webhooks",
    "events": ["MESSAGE_RECEIVED", "MESSAGE_STATUS"]
  }'
```

### List, update and delete

```bash theme={null}
# list
curl https://api.zapfy.io/v1/instances/{instanceId}/webhooks \
  -H "Authorization: Bearer zpfy_acct_xxxxxxxxxxxx"

# update (partial)
curl -X PATCH https://api.zapfy.io/v1/instances/{instanceId}/webhooks/{webhookId} \
  -H "Authorization: Bearer zpfy_acct_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": false }'

# delete
curl -X DELETE https://api.zapfy.io/v1/instances/{instanceId}/webhooks/{webhookId} \
  -H "Authorization: Bearer zpfy_acct_xxxxxxxxxxxx"
```

## Delivery

* Zapfy sends a `POST` to each subscribing endpoint when the event happens.
* Reply `2xx` to acknowledge. Without `2xx`, the event is retried.
* Delivery is **at-least-once** — deduplicate using the event's `id` field.
