# Webhook tester

HTML: https://www.app2email.com/docs/api/webhooks/tester · Index: https://www.app2email.com/docs/api/llms.txt

Send a signed test event to any https URL, or make a test URL that keeps what is posted to it. On the page: log in as the owner or an admin of the number, or paste an API key with `webhooks:manage`.

## Send to a URL

```shell
curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/webhooks/test-url \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-server.example.com/whatsapp-events", "type": "message.received"}'
```

| Field | Notes |
| --- | --- |
| `url` | https, at most 500 characters (required) |
| `type` | `ping` (default) or a number event type (not the Partner group): its sample is sent |
| `data` | your own event data (at most 16 KB), in the normal envelope |
| `raw` | a JSON object sent as the whole body instead of an envelope |
| `secret` | the secret to sign with; left out = a new random one (returned) |
| `format` | `app2email` (default) or `meta` |
| `headers` | custom headers, the same rules as a saved webhook |

Answer: `sent` (method, url, every header incl. both signatures, the exact body, the secret) and `result` (`ok`, `stage`: `response` | `dns` | `connect` | `tls` | `timeout` | `blocked_address`, `status`, `ms`, `headers`, `body`: the first 1,000 characters).
Limits: 30 tests an hour per number (shared with the saved-webhook test; 429 `too_many_tests` with `Retry-After`), and a limit per target host.

Reference: [Send a test event to any URL](https://www.app2email.com/docs/api/webhooks/test-webhook-url.md)

## Test URL

```shell
curl -X POST https://api.app2email.com/v1/YOUR_NUMBER/webhooks/catchers -H "Authorization: Bearer YOUR_API_KEY"
curl "https://api.app2email.com/v1/YOUR_NUMBER/webhooks/catchers/TOKEN?after=0" -H "Authorization: Bearer YOUR_API_KEY"
```

`https://api.app2email.com/hooks/catch/<token>` keeps what is posted to it: 1 hour, 50 requests of at most 64 KB, 3 per number. Use it as a webhook URL or as `url` above.

Reference: [Get a temporary URL that keeps what it receives](https://www.app2email.com/docs/api/webhooks/create-webhook-catcher.md)

Verify code (Node.js, Python, PHP): https://www.app2email.com/docs/api/webhooks.md
