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

# Set up webhooks

> Receive real-time notifications in your systems when campaigns send, open, click, bounce, or unsubscribe.

Webhooks push campaign events to your endpoint as they happen — no polling.

## Supported events

`campaign_sent` · `campaign_opened` · `campaign_clicked` · `unsubscribe` · `campaign_error` · `spam` · `hard_bounce`

## Create a webhook

```bash theme={null}
curl --request POST \
  --url https://cloudapi.mailercloud.com/v1/webhooks \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "CRM sync",
    "url": "https://yourapp.com/hooks/mailercloud",
    "events": ["campaign_sent", "campaign_opened", "hard_bounce", "unsubscribe"]
  }'
```

Your endpoint should return a `2xx` status quickly; do any heavy processing asynchronously.

## Test it

Fire a sample payload at your endpoint before going live with [Test webhook](/api-reference/webhooks/test-webhook), and pause/resume delivery any time with [Toggle webhook status](/api-reference/webhooks/toggle-webhook-status).

## Typical uses

* Sync unsubscribes and hard bounces back to your CRM so you stop emailing dead addresses everywhere
* Trigger in-app flows when a customer opens or clicks a campaign
* Alert your team on `campaign_error` events
