# Add a webhook endpoint

`POST /webhook-endpoints`

Relaypoint sends an HTTPS POST to this URL for each event you choose. The response includes the signing secret once.

Server: `https://api.relaypoint.example/v1`

Authentication: bearerAuth (http bearer)

## Request body (required)

`application/json` · object

- `url` · string<uri> · required
- `events` · array<string> · required — Event names, or `*` for all events.

## Example request (curl)

```shell
curl https://api.relaypoint.example/v1/webhook-endpoints \
  --request POST \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "url": "https://example.com/hooks/relaypoint",
    "events": [
      "conversation.created",
      "conversation.closed"
    ]
  }'
```

## Responses

### 201 — The new endpoint, with its signing secret.

`application/json` · object

- `id` · string
- `url` · string<uri>
- `events` · array<string>
- `status` · string —  One of: `"active"`, `"paused"`.
- `created_at` · string<date-time>
- `signing_secret` · string — Shown once. Use it to check the `Relaypoint-Signature` header.

```json
{
  "id": "whe_7c1n4r",
  "url": "https://example.com/hooks/relaypoint",
  "events": [
    "conversation.created",
    "conversation.closed"
  ],
  "status": "active",
  "created_at": "2026-11-27T10:15:00Z",
  "signing_secret": "YOUR_SECRET"
}
```

### 400 — A parameter is missing or wrong. `error.field` names it.

`application/json` · Error

- `error` · object
  - `code` · string
  - `message` · string
  - `field` · string
