---
title: "Create a webhook"
method: POST
path: "/v1/webhooks"
tags: ["Webhook management"]
---

# Create a webhook

`POST /v1/webhooks`

## Request

- Base URL: `https://api.vatnode.dev`
- URL: `https://api.vatnode.dev/v1/webhooks`
- Auth: one of:
  - API key in cookie `better-auth.session_token`
  - HTTP bearer

Registers a new webhook endpoint. The URL must be a publicly
reachable HTTPS endpoint (validated against SSRF). The signing
`secret` is returned exactly once in this response. New webhooks start
`disabled` and are activated only after a successful test delivery
(`POST /v1/webhooks/{id}/test`).

## Request body

- object
  - `url` string, uri, required: Publicly reachable HTTPS endpoint.

## Response `201`

The created webhook, including the signing secret (shown once).

- WebhookCreated
  - `id` string, required
  - `url` string, uri, required
  - `status` 'disabled', required: New webhooks start disabled until a test delivery succeeds.
  - `secret` string, required: HMAC signing key. Returned only once, at creation.
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: The request body, query string or path parameters failed structural validation (wrong type, missing required field, out-of-range length, malformed enum, etc.). Returns the standard error envelope with code `INVALID_REQUEST`. This is distinct from a semantically well-formed request that is rejected later (e.g. `INVALID_FORMAT` for a VAT ID that parses but is not a valid VAT number).
- `401`: No valid session (`UNAUTHORIZED`), or the account has been deleted (`ACCOUNT_DELETED`).
- `422`: The URL is not a safe public HTTPS endpoint (`INVALID_URL`), or the plan’s webhook limit has been reached / webhooks are unavailable on the plan (`WEBHOOK_LIMIT_REACHED`).
- `500`: Webhook creation failed (`INTERNAL_ERROR`).
- `503`: The database is temporarily unavailable (`DB_UNAVAILABLE`).

---

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