---
title: "Subscribe to events (REST Hooks)"
method: POST
path: "/api/v1/webhooks"
tags: ["Webhooks"]
---

# Subscribe to events (REST Hooks)

`POST /api/v1/webhooks`

## Request

- Base URL: `https://mailinapp.com`
- URL: `https://mailinapp.com/api/v1/webhooks`
- Auth: HTTP bearer

Rate limit: 30 requests/minute per key. At most 50 subscriptions per account. The returned `secret` signs every delivery and is shown only here. An endpoint answering 410 Gone is unsubscribed automatically; revoking the API key disables the subscriptions it made.

## Request body

- object
  - `url` string, uri, required: A public http(s) URL.
  - `events` WebhookEventType[]
  - `event` 'interaction.received' | 'form.submitted' | 'contact.created' | 'contact.updated' | 'lead.hot' | 'lead.new' | 'booking.created' | 'booking.cancelled' | 'deal.created' | 'deal.stage_changed' | 'purchase.completed' | 'journey.completed' | 'experiment.decided' | 'experiment.completed'
  - `source` 'zapier' | 'n8n'

## Response `201`

Subscribed

- object
  - `id` string, required
  - `secret` string, required: whsec_…, shown once.
  - `subscription` WebhookSubscription, required
    - `id` string, required
    - `apiKeyId` string
    - `url` string, uri, required
    - `events` WebhookEventType[], required
    - `createdVia` 'dashboard' | 'api' | 'zapier' | 'n8n', required
    - `status` 'active' | 'disabled', required
    - `disabledReason` 'gone' | 'api-key-revoked'
    - `createdAt` integer, required
    - `lastDeliveryAt` integer
    - `lastFailureAt` integer
    - `lastError` string

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `409`: The account already has 50 subscriptions
- `429`: Too many requests for this key

---

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