NinjaChat Webhooks API
The Webhooks API from NinjaChat — 3 operation(s) for webhooks.
The Webhooks API from NinjaChat — 3 operation(s) for webhooks.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ninjachat-ai:ninjachat-ai-webhooks-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: NinjaChat Webhooks API
version: 1.0.0
description: Clean-break NinjaChat v1. Chat and Responses bill actual token usage; images and videos use catalog unit pricing.
servers:
- url: https://www.ninjachat.ai/api/v1
tags:
- name: Webhooks
paths:
/webhooks:
get:
summary: List webhooks
description: 'List HTTPS endpoints registered for video completion and spend-alert callbacks. Console: https://www.ninjachat.ai/developers/webhooks'
security:
- bearerAuth: []
responses:
'200':
description: Registered webhook endpoints.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookListResponse'
'400':
description: Invalid or unsupported request parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'402':
description: Insufficient balance or project spend limit reached.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Gateway error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-codeSamples:
- lang: javascript
label: TypeScript SDK
source: 'import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const endpoints = await client.webhooks.list();
console.log(endpoints);'
- lang: python
label: Python SDK
source: 'import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
endpoints = client.webhooks.list()
print(endpoints)'
x-ninjachat-status: current
tags:
- Webhooks
operationId: getWebhooks
x-operation-id-source: derived
post:
summary: Create a webhook
description: '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'
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookCreateRequest'
responses:
'201':
description: Webhook created. The signing secret is returned once (used only by generic receivers).
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookCreateResponse'
'400':
description: Invalid or unsupported request parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'402':
description: Insufficient balance or project spend limit reached.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Gateway error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-codeSamples:
- lang: javascript
label: TypeScript SDK
source: "import { NinjaChat } from \"@ninjachat/sdk\";\n\nconst client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });\nconst endpoint = await client.webhooks.create({\n url: \"https://example.com/webhooks/ninjachat\",\n events: [\"video.completed\", \"video.failed\"],\n});\n\nconsole.log(endpoint.secret); // Store once, then redact it from logs."
- lang: python
label: Python SDK
source: "import os\nfrom ninjachat import NinjaChat\n\nclient = NinjaChat(api_key=os.environ[\"NINJACHAT_API_KEY\"])\nendpoint = client.webhooks.create(\n url=\"https://example.com/webhooks/ninjachat\",\n events=[\"video.completed\", \"video.failed\"],\n)\n\nprint(endpoint[\"secret\"]) # Store once, then redact it from logs."
x-ninjachat-status: current
tags:
- Webhooks
operationId: postWebhooks
x-operation-id-source: derived
patch:
summary: Manage webhook subscriptions and delivery
description: '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.'
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookActionRequest'
responses:
'200':
description: Action completed. Rotation returns the new secret once.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookActionResponse'
'400':
description: Invalid or unsupported request parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'402':
description: Insufficient balance or project spend limit reached.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Gateway error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-ninjachat-status: current
tags:
- Webhooks
operationId: patchWebhooks
x-operation-id-source: derived
delete:
summary: Delete a webhook
security:
- bearerAuth: []
responses:
'200':
description: Webhook deleted.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookDeleteResponse'
'400':
description: Invalid or unsupported request parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'402':
description: Insufficient balance or project spend limit reached.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Gateway error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-codeSamples:
- lang: javascript
label: TypeScript SDK
source: 'import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
await client.webhooks.delete("webhook_endpoint_id");'
- lang: python
label: Python SDK
source: 'import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
client.webhooks.delete("webhook_endpoint_id")'
x-ninjachat-status: current
tags:
- Webhooks
operationId: deleteWebhooks
x-operation-id-source: derived
/webhooks/deliveries:
get:
summary: List webhook deliveries
description: Recent delivery attempts for one endpoint, newest first.
security:
- bearerAuth: []
responses:
'200':
description: Recent webhook deliveries.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookDeliveriesResponse'
'400':
description: Invalid or unsupported request parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'402':
description: Insufficient balance or project spend limit reached.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Gateway error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-codeSamples:
- lang: javascript
label: TypeScript SDK
source: "import { NinjaChat } from \"@ninjachat/sdk\";\n\nconst client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });\nconst deliveries = await client.webhooks.listDeliveries({\n endpointId: \"webhook_endpoint_id\",\n limit: 20,\n});\n\nconsole.log(deliveries);"
- lang: python
label: Python SDK
source: "import os\nfrom ninjachat import NinjaChat\n\nclient = NinjaChat(api_key=os.environ[\"NINJACHAT_API_KEY\"])\ndeliveries = client.webhooks.list_deliveries(\n endpoint_id=\"webhook_endpoint_id\",\n limit=20,\n)\n\nprint(deliveries)"
x-ninjachat-status: current
tags:
- Webhooks
operationId: getWebhooksDeliveries
x-operation-id-source: derived
/webhooks/test:
post:
summary: Send a test webhook
description: Send one synthetic event immediately to check your Discord/Slack channel or generic receiver signature handling before relying on live jobs.
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookTestRequest'
responses:
'200':
description: Immediate test delivery result.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookTestResponse'
'400':
description: Invalid or unsupported request parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'402':
description: Insufficient balance or project spend limit reached.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Gateway error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-codeSamples:
- lang: javascript
label: TypeScript SDK
source: 'import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const result = await client.webhooks.test("webhook_endpoint_id");
console.log(result);'
- lang: python
label: Python SDK
source: 'import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
result = client.webhooks.test("webhook_endpoint_id")
print(result)'
x-ninjachat-status: current
tags:
- Webhooks
operationId: postWebhooksTest
x-operation-id-source: derived
components:
schemas:
WebhookActionRequest:
oneOf:
- type: object
properties:
action:
type: string
enum:
- update
endpoint_id:
type: string
pattern: ^[a-fA-F0-9]{24}$
events:
type: array
items:
$ref: '#/components/schemas/WebhookEvent'
minItems: 1
maxItems: 13
required:
- action
- endpoint_id
- events
additionalProperties: false
- type: object
properties:
action:
type: string
enum:
- rotate_secret
endpoint_id:
type: string
pattern: ^[a-fA-F0-9]{24}$
required:
- action
- endpoint_id
additionalProperties: false
- type: object
properties:
action:
type: string
enum:
- retry
delivery_id:
type: string
pattern: ^[a-fA-F0-9]{24}$
required:
- action
- delivery_id
additionalProperties: false
WebhookTestRequest:
type: object
properties:
endpoint_id:
type: string
minLength: 1
maxLength: 128
required:
- endpoint_id
additionalProperties: false
WebhookActionResponse:
type: object
properties:
updated:
type: boolean
queued:
type: boolean
secret:
type: string
additionalProperties: false
ErrorResponse:
type: object
properties:
error:
type: object
properties:
message:
type: string
type:
type: string
code:
type: string
param:
type:
- string
- 'null'
required:
- message
- type
- code
additionalProperties: false
required:
- error
additionalProperties: false
WebhookEndpoint:
type: object
properties:
id:
type: string
url:
type: string
format: uri
destination:
type: string
enum:
- webhook
- discord
- slack
events:
type: array
items:
$ref: '#/components/schemas/WebhookEvent'
secret_hint:
type: string
created_at:
type: string
format: date-time
required:
- id
- url
- events
- secret_hint
- created_at
additionalProperties: false
WebhookDelivery:
type: object
properties:
id:
type: string
endpoint_id:
type:
- string
- 'null'
event:
type: string
status:
type: string
enum:
- delivered
- retrying
- dead
- pending
attempts:
type: integer
minimum: 0
delivered_at:
type:
- string
- 'null'
format: date-time
next_attempt_at:
type: string
format: date-time
last_error:
type:
- string
- 'null'
created_at:
type: string
format: date-time
request_id:
type:
- string
- 'null'
required:
- id
- endpoint_id
- event
- status
- attempts
- delivered_at
- next_attempt_at
- last_error
- created_at
- request_id
additionalProperties: false
WebhookListResponse:
type: object
properties:
endpoints:
type: array
items:
$ref: '#/components/schemas/WebhookEndpoint'
required:
- endpoints
additionalProperties: false
WebhookCreateRequest:
type: object
properties:
url:
type: string
maxLength: 2000
format: uri
events:
type: array
items:
$ref: '#/components/schemas/WebhookEvent'
minItems: 1
default:
- video.completed
- video.failed
- pipeline.completed
- pipeline.failed
- budget.alert
- balance.low
required:
- url
additionalProperties: false
WebhookEvent:
type: string
enum:
- video.completed
- video.failed
- pipeline.completed
- pipeline.failed
- request.failed
- budget.alert
- balance.low
- balance.exhausted
- credits.added
- auto_recharge.failed
- key.created
- key.revoked
- budget.updated
WebhookDeliveriesResponse:
type: object
properties:
deliveries:
type: array
items:
$ref: '#/components/schemas/WebhookDelivery'
required:
- deliveries
additionalProperties: false
WebhookTestResponse:
type: object
properties:
delivered:
type: boolean
detail:
type:
- string
- 'null'
required:
- delivered
- detail
additionalProperties: false
WebhookCreateResponse:
type: object
properties:
id:
type: string
url:
type: string
format: uri
destination:
type: string
enum:
- webhook
- discord
- slack
events:
type: array
items:
$ref: '#/components/schemas/WebhookEvent'
secret:
type: string
message:
type: string
required:
- id
- url
- events
- secret
- message
additionalProperties: false
WebhookDeleteResponse:
type: object
properties:
id:
type: string
disabled:
type: boolean
enum:
- true
required:
- id
- disabled
additionalProperties: false
securitySchemes:
managementKey:
type: http
scheme: bearer
bearerFormat: nj_mk_...
description: Account-scoped management credential created by the account owner after email verification. Inference keys cannot access these endpoints; management keys cannot run inference.
anthropicApiKey:
type: apiKey
in: header
name: x-api-key
description: NinjaChat API key accepted by the Anthropic Messages compatibility endpoint.
bearerAuth:
type: http
scheme: bearer
bearerFormat: NinjaChat API key
description: Use an API key created in the NinjaChat developer console.
x-ninjachat-contract-sha256: df530775ec7be5779917a6c4c5b6015b760809e62fd002827541bf6cac66310e