---
title: "Create a webhook"
method: POST
path: "/webhooks"
---

# Create a webhook

`POST /webhooks`

## Request

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

Register an HTTPS URL. Generic receivers get signed JSON; Discord and Slack incoming webhook URLs are detected automatically and receive rich alerts without NinjaChat signing-secret setup. Platform URL credentials are redacted in responses. New events require explicit subscription; omitted events retain the six original defaults. Console: https://www.ninjachat.ai/developers/webhooks

## Request body

- WebhookCreateRequest
  - `url` string, uri, required
  - `events` WebhookEvent[]

## Response `201`

Webhook created. The signing secret is returned once (used only by generic receivers).

- WebhookCreateResponse
  - `id` string, required
  - `url` string, uri, required
  - `destination` 'webhook' | 'discord' | 'slack'
  - `events` WebhookEvent[], required
  - `secret` string, required
  - `message` string, required

## 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)
