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

# Create webhook

`POST /v1/webhooks`

## Request

- Base URL: `https://smtpfa.st/api`
- URL: `https://smtpfa.st/api/v1/webhooks`
- Auth: HTTP bearer

Register a new webhook endpoint. SMTPfast will POST event payloads to this URL when the specified events occur.

## Request body

- CreateWebhookRequest
  - `url` string, uri, required: The URL that will receive webhook POST requests
  - `events` string[], required: List of event types to subscribe to. Legacy unprefixed email aliases are accepted and normalized to Resend-style email.* event names.
  - `format` 'standard' | 'discord' | 'slack': Payload format. standard is the signed JSON envelope; discord and slack post readable messages to a chat webhook URL. Detected from the URL when left out.

## Response `201`

Webhook created

- Webhook: List and read responses also carry createdAt and updatedAt in camelCase for older clients.
  - `id` string, required
  - `url` string, uri, required
  - `events` string[], required
  - `active` boolean, required
  - `format` 'standard' | 'discord' | 'slack'
  - `secret` string: The signing secret. Returned once, in the create response.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time

## Other responses

- `400`: Bad request - check your payload
- `401`: Invalid or missing API key
- `402`: Plan limit reached - upgrade the plan to add more
- `403`: Forbidden - domain not verified or insufficient permissions
- `429`: Rate limit exceeded - retry after the period indicated in the Retry-After header
- `500`: Internal server error

---

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