> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.drazill.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.drazill.com/_mcp/server.

# Webhooks overview

Webhooks push events to your backend the moment they happen — an order fills, a market
resolves, a wallet balance changes — so you don't have to poll for state that only
Drazill knows.

> **Note**
>
> Webhooks are a **notification** channel. They never gate money movement or trading; a
> delivery failure never affects your balance, orders, or positions. Treat every event as
> a signal to re-read authoritative state over REST.

## Manage endpoints

Register an endpoint and the events you want in the
[developer dashboard](https://drazill.com/developers), or over the API with a key that has
the `webhooks:write` scope (reads need `webhooks:read`). Replace `$KEY` with your key.

```bash
# Create an endpoint subscribed to fills. The plaintext signing secret is
# returned ONCE, in the `secret` field — store it now; it is never shown again.
curl -sS https://api.drazill.com/api/v1/webhooks \
  -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://your-app.example.com/hooks/drazill",
       "subscribed_events":["order.filled","trade.executed"]}'

# Send yourself a webhook.test delivery to confirm reachability.
curl -sS -X POST https://api.drazill.com/api/v1/webhooks/$ID/test -H "X-API-Key: $KEY"

# Rotate the signing secret (old + new both sign during a grace window).
curl -sS -X POST https://api.drazill.com/api/v1/webhooks/$ID/rotate-secret -H "X-API-Key: $KEY"

# Inspect deliveries and replay a failed one.
curl -sS https://api.drazill.com/api/v1/webhooks/$ID/deliveries -H "X-API-Key: $KEY"
curl -sS -X POST https://api.drazill.com/api/v1/webhooks/deliveries/$DELIVERY_ID/replay -H "X-API-Key: $KEY"

# Ask whether the endpoint is healthy.
curl -sS https://api.drazill.com/api/v1/webhooks/$ID/health -H "X-API-Key: $KEY"
```

**How many you can have.** Endpoints are capped per user by your API-key tier — 3 on Free,
10 on Pro, 25 on Enterprise — because every event is delivered once per subscribed
endpoint. See [Endpoint health & suspension](/webhooks/health).

**URL requirements.** In production your URL must be `https://`. Hosts that resolve to
private, loopback, link-local, or cloud-metadata addresses are rejected at registration
**and** re-checked at delivery time (DNS-rebinding defense), and redirects are not followed.

## The request Drazill sends

Each delivery is a `POST` with a compact, sorted-key JSON body (the signed bytes) and these
headers:

| Header                           | Meaning                                               |
| -------------------------------- | ----------------------------------------------------- |
| `Drazill-Webhook-Id`             | Delivery id — **your idempotency key** (dedupe on it) |
| `Drazill-Webhook-Event`          | The event type, e.g. `order.filled`                   |
| `Drazill-Webhook-Timestamp`      | Unix seconds when the delivery was signed             |
| `Drazill-Webhook-Attempt`        | 1-based attempt counter                               |
| `Drazill-Webhook-Secret-Version` | The active secret version used                        |
| `Drazill-Webhook-Signature`      | One or more comma-separated `v1=` HMACs               |

Every delivery also carries `Content-Type: application/json` and
`User-Agent: Drazill-Webhooks/1.0`.

The JSON body is the event envelope:

```json
{
  "id": "…", "type": "order.filled", "version": "2026-05-08",
  "api_version": "v1", "livemode": true, "created_at": "…",
  "data": { "order_id": "…", "market_id": "…", "status": "FILLED", … },
  "request_id": null, "correlation_id": null
}
```

`data` carries **only** the fields declared by that event's schema — payloads are validated
against their schema and re-serialized before signing, so no internal or personal field can
ever leak, and money is always a decimal **string** (never a float).

## Read next

#### [Event catalog](/webhooks/events/overview)

Every event type, generated from its committed JSON Schema.

#### [Signing & verification](/webhooks/signing)

The `v1=` HMAC scheme, SDK helpers, and a raw recipe.

#### [Delivery & retries](/webhooks/delivery)

At-least-once, dedupe, the retry ladder, the dead-letter queue, and retention.

#### [Endpoint health & suspension](/webhooks/health)

Is my endpoint healthy — and what happens when it stops answering.

#### [Rotating secrets](/webhooks/rotation)

Roll a signing secret with zero dropped deliveries.