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

# Create a webhook endpoint

`POST /api/v1/webhooks`

## Request

- Base URL: `https://api.dmarc-examiner.com`
- URL: `https://api.dmarc-examiner.com/api/v1/webhooks`
- Auth: API key in header `X-API-Key`

URL must be HTTPS. Returns `422 Unprocessable Entity` if the organization
has reached the maximum number of active webhooks.

## Request body

- CreateWebhookRequest
  - `url` string, uri, required: Must start with `https://`.
  - `name` string, required

## Response `201`

Webhook created

- Webhook
  - `id` string, uuid, required
  - `url` string, uri, required: HTTPS URL events are delivered to.
  - `name` string, required
  - `secret` string, required: Shared secret used to sign deliveries (HMAC-SHA256). Verify the `X-Signature` header on each incoming POST.
  - `is_active` boolean, required
  - `last_triggered_at` string, date-time, nullable
  - `last_status` integer, nullable: HTTP status code of the most recent delivery attempt.
  - `failure_count` integer, required: Consecutive failure count. Resets on a successful delivery.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Request payload, body field, or query parameter is missing, malformed, outside documented bounds, or fails type/enum validation. Two body shapes can occur: - **Body validation errors** (e.g. missing `name`, wrong type) come from the controller and have the form `{"message": "..."}`. - **Query parameter errors** (e.g. `limit` out of range, `auth_failure` off-enum, `domain_id` not a UUID) flow through the API exception subscriber and add an `error: "bad_request"` machine-readable code: `{"error": "bad_request", "message": "Query parameter \"limit\" must be between 1 and 100, got 999"}`.
- `401`: Authentication failed. Two shapes are possible depending on cause: - **Invalid or revoked key** — body is `{"message": "..."}` only. - **Missing `X-API-Key` header** — body adds an `error: "unauthorized"` machine-readable code. Clients should treat both as the same outcome and read `message` for display.
- `403`: The organization's current plan does not include the feature required by this endpoint (e.g. `apiAccess`, `forensicReports`, `advancedAlerts`). Distinct from `PlanLimitExceeded` (HTTP 402), which signals a *quota* exhausted on a feature the plan does include. If a customer downgrades to Free, all `/api/v1/*` requests will start returning this response.
- `422`: Maximum webhooks reached
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/dmarc-examiner/apis/dmarc-examiner-api.md) · [All operations](https://skmtc.dev/dmarc-examiner/apis/dmarc-examiner-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dmarc-examiner/apis/dmarc-examiner-api/revisions/92f3f57969f5?raw)
