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

# Create Webhook Destination

> Register a new endpoint to receive Contra events.

## Request

```bash theme={null}
curl -X POST https://identity.contra.id/v1/webhook-destinations \
  -H "x-api-key: $CONTRA_KEY" -H "Content-Type: application/json" \
  -d '{
    "url":     "https://yourapp.com/contra/webhook",
    "version": "v3",
    "events":  ["session.status_changed", "agent.revoked"]
  }'
```

| Body      | Type      | Required | Description                             |
| --------- | --------- | -------- | --------------------------------------- |
| `url`     | url       | **yes**  | HTTPS endpoint that will receive POSTs. |
| `version` | enum      | no       | `v3` *(recommended)* · `v2` · `v1`.     |
| `events`  | string\[] | no       | Subscribe to a subset; omit for all.    |

## Response · 201

```json theme={null}
{
  "uuid":   "whd_b3f1…",
  "url":    "https://yourapp.com/contra/webhook",
  "secret": "whsec_a1b2c3d4e5f6g7h8i9j0…",
  "version":"v3",
  "active": true
}
```

<Warning>The `secret` is shown **once**. Store it — Contra signs every payload with HMAC-SHA256 using this key.</Warning>
