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

# Create a subscription

`POST /api/v1/webhooks`

## Request

- Base URL: `https://mailcheer.com`
- URL: `https://mailcheer.com/api/v1/webhooks`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`

Permission required: `webhooks:write`. The response carries the `secret` — store it like a password, it is what verifies every call.

## Request body

- WebhookRequest
  - `name` string, required
  - `url` string, uri, required: `https` required, and never a private-network address.
  - `events` string[], required

## Response `201`

Created.

- Webhook
  - `object` 'webhook'
  - `id` string
  - `name` string: The name you give it.
  - `url` string, uri
  - `events` string[]
  - `enabled` boolean
  - `secret` string: The signing secret (`whsec_…`). Returned on creation, when reading one specific subscription, and after a secret rotation — **never in the list**, which we log in full without a second thought.
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `401`: Key missing, unknown or revoked.
- `403`: The key does not have the requested permission, or the workspace cannot send: `sending_blocked` (suspended, blocked or banned — nothing goes out, through any channel), `commitment_required` (the anti-spam commitment is not accepted), `reputation_blocked` (too many bounces or complaints).
- `422`: Malformed field, unverified domain, or recipient on the suppression list.

---

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