---
title: "Manage webhook subscriptions and delivery"
method: PATCH
path: "/webhooks"
---

# Manage webhook subscriptions and delivery

`PATCH /webhooks`

## Request

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

Explicit action: update events, rotate_secret (immediate replacement, returned once), or retry a failed delivery. No automatic mutation retries. Existing subscriptions are not expanded automatically.

## Request body

- union
  - object
    - `action` 'update', required
    - `endpoint_id` string, required
    - `events` WebhookEvent[], required
  - object
    - `action` 'rotate_secret', required
    - `endpoint_id` string, required
  - object
    - `action` 'retry', required
    - `delivery_id` string, required

## Response `200`

Action completed. Rotation returns the new secret once.

- WebhookActionResponse
  - `updated` boolean
  - `queued` boolean
  - `secret` string

## Other responses

- `400`: Invalid or unsupported request parameter.
- `401`: Missing or invalid API key.
- `402`: Insufficient balance or project spend limit reached.
- `429`: Rate limit exceeded.
- `500`: Gateway error.

---

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