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

# Create a webhook handler

> **Required scope:** write

**Required scope:** `write`

### Request body

`CreateWebhookRequest`

**description** `string`

**events** `string[]` *required*

Event slugs to subscribe to. Use `['*']` for all events.

**url** `string` *required*

### Response

`CreateWebhookResponse`

**created\_at** `string` *required*

**description** `string`

**events** `string[]` *required*

**id** `string` *required*

**is\_active** `boolean` *required*

**secret\_shown\_once** `boolean` *required*

Redaction warning — this full secret is shown ONLY at creation.

**signing\_secret** `string` *required*

**url** `string` *required*

### Status codes

| Code | Meaning |
| - | - |
| `201` | Endpoint registered; signing secret returned ONCE |
| `400` | Invalid URL or events |
| `401` | Unauthorized |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.nsr.stateset.com/api/v1/webhooks' \
  --header "X-API-Key: $STATESET_NSR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "Two-person tent, green — replacement for damaged pole set.",
  "events": [
    "string"
  ],
  "url": "https://example.com/webhooks/stateset"
}'
```

```json 201 theme={null}
{
  "created_at": "2026-08-31T14:22:05Z",
  "description": "Two-person tent, green — replacement for damaged pole set.",
  "events": [
    "string"
  ],
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "is_active": true,
  "secret_shown_once": true,
  "signing_secret": "YOUR_API_KEY",
  "url": "https://example.com/webhooks/stateset"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.