---
title: "Create webhook"
method: POST
path: "/api/webhooks"
tags: ["Webhooks"]
---

# Create webhook

`POST /api/webhooks`

## Request

- Base URL: `https://domani.run`
- URL: `https://domani.run/api/webhooks`
- Auth: HTTP bearer

Register a new HTTPS webhook endpoint. Optional Authorization or X-API-Key values are encrypted at rest and included in every delivery. The signing secret is returned only once. Maximum 5 webhooks per account. A webhook created by a mailbox-confined token is confined to the same mailboxes: it receives no mail event from any other mailbox.

## Request body

- object
  - `url` string, uri, required: HTTPS URL that will receive webhook POST requests
  - `events` string[], required: Event types to subscribe to. Use GET /api/webhooks/events to list available types.
  - `headers` object: Optional encrypted auth headers. Only Authorization and X-API-Key are accepted.

## Response `200`

Webhook created. Secret is included only in this response.

- object
  - `id` string
  - `url` string, uri
  - `events` string[]
  - `secret` string: HMAC-SHA256 signing secret (shown once)
  - `active` boolean
  - `header_names` string[]: Configured auth header names; values are never returned
  - `created_at` string, date-time
  - `hint` string

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `429`: Rate limit exceeded - wait and retry

---

[API](https://skmtc.dev/domani/apis/domani-run-api.md) · [All operations](https://skmtc.dev/domani/apis/domani-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/domani/apis/domani-run-api/revisions/7679f8159533?raw)
