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

# Create a webhook subscription

`POST /v1/webhooks`

## Request

- Base URL: `https://api.masko.ai`
- URL: `https://api.masko.ai/v1/webhooks`
- Auth: HTTP bearer

Creates a webhook subscription. Returns 201 with the subscription record including a one-time `secret` used to verify future HMAC signatures - store it immediately, it is never returned again. No credit cost.

Select Masko-API-Version: 2026-09-26 (or api_version=2026-09-26) for the canonical mascot contract shown first. Existing unversioned clients keep legacy collection fields. A mascot_id query filter also selects the canonical contract. Mixing identifier names returns 400.

## Query parameters

- `api_version` '2026-09-26' | 'legacy'

## Headers

- `Idempotency-Key` string
- `Masko-API-Version` '2026-09-26' | 'legacy'

## Request body

- CreateWebhookBody
  - `url` string, uri, required: HTTPS URL that receives webhook POSTs as JSON. Each delivery includes Masko-Signature (t=<unix-seconds>,v1=<hmac-hex of "<t>.<body>">), X-Masko-Signature (sha256=<hmac-hex of body>), X-Masko-Timestamp, X-Masko-Event, and Masko-Event-Id headers. The body carries a stable event id that every retry reuses. A non-2xx response or network error is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, and 12 hours. Auto-disables after 100 consecutive failed attempts.
  - `events` string[]: Event types to subscribe to. Omit for all events. Available events: job.completed, job.failed.

## Response `201`

Created webhook

- WebhookResponse
  - `data` Webhook, required
    - `object` 'webhook': Resource type. Always "webhook".
    - `id` string, uuid, required
    - `url` string, uri, required
    - `events` string[], required
    - `active` boolean, required
    - `consecutive_failures` number, required
    - `created_at` string, required

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict

---

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