# Create a webhook

Creates a webhook, an address on your server where finished transcripts are posted.

`POST /v1/webhooks` on `https://api.eu.vatis.tech`

> **Admin key only.** A Member key gets `403` `admin_only`. Roles: [Authentication and API keys](https://platform.vatis.tech/docs/authentication).

> **Deliveries need batch transcription.** A webhook delivers the transcripts of files, so deliveries come once batch is open on your workspace ([Batch transcription](https://platform.vatis.tech/docs/batch)).

## Headers

| header | values | default | meaning |
|---|---|---|---|
| `Authorization` | `Bearer <api key>` | required | An Admin key ([Roles](https://platform.vatis.tech/docs/authentication#roles)). A Member key gets `403` `admin_only`. |

## Body fields (`application/json`)

| field | values | default | meaning |
|---|---|---|---|
| `url` | `http://` or `https://`, up to 2048 characters | required | Where deliveries go. The API must reach it from the internet: loopback, link-local and private network addresses are refused (`400` `invalid_parameter`). |
| `name` | up to 200 characters, or `null` |  | A name for your own use. |
| `headers` | a JSON object of strings |  | Your own headers, sent with each delivery: at most 20, names up to 256 characters, values of printable ASCII up to 4096 characters. Not `Content-Type`, `Content-Length`, `Host`, `Vatis-Signature`, `Transfer-Encoding`, `Connection`, `Keep-Alive`, `Upgrade`, `TE`, `Trailer`, `Expect`, or any `Proxy-` header. |
| `retry` | `true`, `false` | `true` | Retry failed deliveries. |
| `events` | a JSON list of `transcript.completed`, `transcript.failed` or both | both | Which ends of a batch job it gets: `transcript.completed` carries the transcript, `transcript.failed` the error. Each once; an empty list or another name is `400` `invalid_parameter`. |

## Response fields

| field | when | meaning |
|---|---|---|
| `id` |  | `wh_` and 16 hex digits. |
| `url` |  | Where deliveries go. |
| `name` |  | Your name for it, or `null`. |
| `enabled` |  | Whether deliveries go out. A new webhook is on. |
| `retry` |  | Whether failed deliveries are retried. |
| `headers` |  | Your own headers for each delivery, `{}` when there are none. |
| `events` |  | The events it gets: `transcript.completed`, `transcript.failed` or both, in that order. |
| `created_at` |  | ISO 8601, UTC. |
| `secret` | only in this answer | `whsec_...`: the key that signs each delivery. Keep it with your receiver ([Check the signature](https://platform.vatis.tech/docs/batch/webhooks#check-the-signature)). |

## Responses

`201`: The webhook with its `secret`, shown only here.

```json
{
  "id": "wh_a97581d905c54b46",
  "url": "https://crm.example.com/vatis",
  "name": "crm",
  "enabled": true,
  "retry": true,
  "headers": {},
  "events": [
    "transcript.completed",
    "transcript.failed"
  ],
  "created_at": "2026-11-12T09:14:03Z",
  "secret": "whsec_..."
}
```

`400` `missing_parameter`: No `url`.

`400` `invalid_parameter`: A field that is unknown (`enabled` too) or not valid, or a query parameter. The `param` names it.

```json
{
  "error": {
    "code": "invalid_parameter",
    "message": "Unknown parameter 'enabled'.",
    "param": "enabled",
    "request_id": "req_bf2fed760ba5437ba0933a57"
  }
}
```

`400` `invalid_request`: A body that is not a JSON object, or a 51st webhook.

`401` `unauthorized`: No key, or a wrong, revoked or expired one.

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid, revoked or expired key.",
    "param": null,
    "request_id": "req_bf2fed760ba5437ba0933a57"
  }
}
```

`403` `admin_only`: A Member key.

`413` `request_too_large`: A JSON body over 64 KB.

`503` `unavailable`: The service is busy for a moment. Send the request again after the seconds of the `Retry-After` header.

## Notes

- **`url`:** a name that leads to a refused address passes here, and its deliveries then fail without a retry.
- **At most 50 webhooks** in a workspace: the 51st is `400` `invalid_request`.
- **A new webhook is on.** `enabled` is not a field here: turn it off with [Update a webhook](https://platform.vatis.tech/docs/endpoints/update-a-webhook).
- **The secret cannot be changed:** create a new webhook, move your receiver to its secret, then delete the old one.
- **`events`:** a job that names a webhook without its event sends it nothing, and is not refused for it (how the job ends is not known when it is sent).
- What a delivery holds, and when it is retried: [Deliveries](https://platform.vatis.tech/docs/batch/webhooks#deliveries).
