# Create a webhook subscription

`POST https://app.whatsetter.com/api/v1/webhooks`

Subscribes an https endpoint to events. The response contains the
signing `secret`, shown **once**. Store it now.
Requires scope `webhooks:manage`.

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes |  |
| `events` | array | yes |  |
| `description` | string | no |  |

```json
{
  "url": "",
  "events": [
    "contact.qualified"
  ],
  "description": ""
}
```

## Example request

```bash
curl --request POST \
  --url 'https://app.whatsetter.com/api/v1/webhooks' \
  --header 'Authorization: Bearer ws_live_…'
  --header 'Content-Type: application/json' \
  --data '{"url":"","events":["contact.qualified"],"description":""}'
```

## Responses

### 201: Created, note the one-time `secret`

```json
{
  "data": ""
}
```

### 401: Missing, unknown or revoked API key

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 422: Invalid parameter or body (also an invalid or expired `cursor`)

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```


Source: https://docs.whatsetter.com/api-reference/operations/createwebhook/
