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

# Create a webhook

`POST /webhooks`

## Request body

- object
  - `url` string, uri, required — HTTPS URL to receive events
  - `events` string[], required

## Response `201`

Webhook created. The secret is only returned once at creation.

- object
  - `data` object
    - `id` string
    - `url` string, uri — URL to receive webhook events
    - `events` string[] — Events to subscribe to
    - `is_active` boolean
    - `last_triggered_at` string, date-time
    - `failure_count` integer — Consecutive delivery failures since the last success. Resets to 0 on any successful delivery, so 0 means currently healthy.
    - `last_failure` object, nullable — Details of the most recent failed delivery. Not cleared on success, so it persists as the last known problem even when failure_count is 0. Null if no delivery has ever failed.
      - `at` string, date-time — When the failure was recorded
      - `status` integer, nullable — HTTP status your endpoint returned, or null for a network error/timeout
      - `error` string — Human-readable reason (e.g. "Endpoint responded with HTTP 404", "No response within 10s (timeout)")
      - `attempts` integer — Number of delivery attempts made before giving up
    - `created_at` string, date-time
    - `secret` string — Webhook signing secret (only shown once)
  - `message` string

## Other responses

- `400` — Validation error

---

[API](https://skmtc.dev/omnisocials/apis/omnisocials-api.md) · [All operations](https://skmtc.dev/omnisocials/apis/omnisocials-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/omnisocials/omnisocials-api/revisions/e53b89af0b98/schema)
