Naturali Webhooks API
Subscribe an endpoint to a project's events, and audit what was delivered.
Subscribe an endpoint to a project's events, and audit what was delivered.
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/naturali-ai:naturali-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: naturali.ai Webhooks API
version: 1.0.0
description: The naturali.ai API. This document is the merge of every per-resource spec under openapi/v1/ — the single wire contract for all v1 endpoints.
contact:
name: naturali.ai
url: https://naturali.ai
servers:
- url: https://api.naturali.ai
description: Host of your naturali.ai deployment; every path carries the /v1 prefix.
security:
- bearerAuth: []
- oauth2:
- mcp:access
tags:
- name: Webhooks
description: Subscribe an endpoint to a project's events, and audit what was delivered.
paths:
/v1/projects/{project_id}/webhooks:
parameters:
- $ref: '#/components/parameters/ProjectId'
get:
tags:
- Webhooks
summary: List webhooks
description: The endpoints registered in the project, newest first.
operationId: listWebhooks
parameters:
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Cursor'
responses:
'200':
description: A page of webhooks.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Page'
- properties:
data:
type: array
items:
$ref: '#/components/schemas/Webhook'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
post:
tags:
- Webhooks
summary: Create a webhook
description: 'Register an endpoint and subscribe it to one or more event types.
The response carries `secret` — the signing key, in plaintext. **This is the only time it is returned.** Store it where your receiver can read it; if you lose it, rotate rather than re-create, so the endpoint keeps its delivery history. Send `secret` yourself to sign with a key your receiver already holds; the response then returns that one.
A project holds at most 20 webhooks, inactive ones included; the 21st is refused with `409 webhook_limit_reached`.
Returns `501` on a deployment with no credential-sealing key configured, since the secret could not then be stored safely.'
operationId: createWebhook
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookCreate'
responses:
'201':
description: Webhook created. The signing secret is included, once.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookWithSecret'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/WebhookLimitReached'
'501':
$ref: '#/components/responses/SealingKeyNotConfigured'
/v1/projects/{project_id}/webhooks/{webhook_id}:
parameters:
- $ref: '#/components/parameters/ProjectId'
- $ref: '#/components/parameters/WebhookId'
get:
tags:
- Webhooks
summary: Get a webhook
description: 'The endpoint, the events it is subscribed to and whether deliveries are attempted. The signing secret is not returned: it is shown once by `POST /v1/projects/{project_id}/webhooks` and again by `POST /v1/projects/{project_id}/webhooks/{webhook_id}:rotate-secret`.'
operationId: getWebhook
responses:
'200':
description: The webhook.
content:
application/json:
schema:
$ref: '#/components/schemas/Webhook'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
patch:
tags:
- Webhooks
summary: Update a webhook
description: 'Change the destination, the subscription, the label, the signing secret or whether deliveries are attempted at all. At least one field is required. A `secret` sent here is never returned.
Setting `active: false` is the reversible half of `DELETE`: deliveries stop, the endpoint and its history stay. It is what to reach for while a receiver is being repaired.'
operationId: updateWebhook
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookUpdate'
responses:
'200':
description: Webhook updated.
content:
application/json:
schema:
$ref: '#/components/schemas/Webhook'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags:
- Webhooks
summary: Delete a webhook
description: 'Removes the endpoint and its delivery records. To stop deliveries while keeping the audit trail, `PATCH` it to `active: false` instead.'
operationId: deleteWebhook
responses:
'204':
description: Webhook deleted.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/v1/projects/{project_id}/webhooks/{webhook_id}:rotate-secret:
parameters:
- $ref: '#/components/parameters/ProjectId'
- $ref: '#/components/parameters/WebhookId'
post:
tags:
- Webhooks
summary: Rotate the signing secret
description: 'Issues a new signing secret for the same endpoint and returns it — the second and last time a secret is ever returned. This is the `…:rotate-secret` action; the path segment is `{webhook_id}:rotate-secret`.
The change takes effect on the next delivery, including retries of deliveries already queued, so roll the new secret out to your receiver promptly. There is no overlap window in which both secrets verify.'
operationId: rotateWebhookSecret
responses:
'200':
description: A new signing secret was issued.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookWithSecret'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'501':
$ref: '#/components/responses/SealingKeyNotConfigured'
/v1/projects/{project_id}/webhook-deliveries:
parameters:
- $ref: '#/components/parameters/ProjectId'
get:
tags:
- Webhooks
summary: List webhook deliveries
description: 'Every delivery attempted in the project, newest first — what was sent, where, how many times, and what came back. Filter by endpoint, by lifecycle status, or by event type.
Deliveries are per (event, endpoint): an event matching two subscribed endpoints produces two rows, retried and observed independently.
A `success` or `failed` delivery is deleted 30 days after it was created, and can no longer be read or redelivered. A `pending` one is kept until it settles.'
operationId: listWebhookDeliveries
parameters:
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Cursor'
- name: webhook_id
in: query
required: false
description: Only deliveries addressed to this endpoint.
schema:
type: string
example: whk_V1StGXR8Z5jdHi6B
- name: status
in: query
required: false
description: Only deliveries in this state.
schema:
type: string
enum:
- pending
- success
- failed
- name: type
in: query
required: false
description: Only deliveries of this event type.
schema:
type: string
example: generation.completed
responses:
'200':
description: A page of deliveries.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Page'
- properties:
data:
type: array
items:
$ref: '#/components/schemas/WebhookDelivery'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/v1/projects/{project_id}/webhook-deliveries/{delivery_id}:
parameters:
- $ref: '#/components/parameters/ProjectId'
- $ref: '#/components/parameters/DeliveryId'
get:
tags:
- Webhooks
summary: Get a webhook delivery
description: One delivery, including the exact payload that was signed and sent.
operationId: getWebhookDelivery
responses:
'200':
description: The delivery.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookDelivery'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/v1/projects/{project_id}/webhook-deliveries/{delivery_id}:redeliver:
parameters:
- $ref: '#/components/parameters/ProjectId'
- $ref: '#/components/parameters/DeliveryId'
post:
tags:
- Webhooks
summary: Redeliver an event
description: 'Queue the same event at the same endpoint again — the recovery path for a delivery that failed, or one your receiver dropped. This is the `…:redeliver` action; the path segment is `{delivery_id}:redeliver`.
A **new** delivery is created and returned; the original record is left untouched, because its attempt history is the evidence you redelivered on. The event''s `id` is carried over unchanged, so a receiver deduping on the event sees the same event twice while one deduping on `X-Naturali-Delivery` sees a distinct delivery.
An inactive webhook is refused with `409 webhook_inactive`.'
operationId: redeliverWebhookDelivery
responses:
'202':
description: A new delivery was queued.
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookDelivery'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/WebhookInactive'
components:
responses:
Unauthorized:
description: Missing or invalid credentials.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
NotFound:
description: The resource does not exist (existence is not leaked).
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
WebhookLimitReached:
description: 'The project already holds 20 webhooks (`webhook_limit_reached`); `details.limit` carries the ceiling.
'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
BadRequest:
description: The request was malformed or failed validation.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
SealingKeyNotConfigured:
description: 'The requested path is not enabled on this deployment — a webhook secret cannot be stored where no credential-sealing key is configured.
'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
WebhookInactive:
description: 'The delivery''s webhook is inactive (`webhook_inactive`).
'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Forbidden:
description: The credential is scoped to a different project, or the caller's role in the project does not carry this action.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
schemas:
Webhook:
type: object
required:
- id
- project_id
- url
- events
- description
- active
- created_at
- updated_at
properties:
id:
type: string
description: Public webhook ID (whk_ prefix).
example: whk_V1StGXR8Z5jdHi6B
project_id:
type: string
description: The owning project.
x-naturali-ref: project
example: proj_V1StGXR8Z5jdHi6B
url:
type: string
format: uri
description: 'Where deliveries are POSTed: an `https://` URL on a public internet host. A host that is, or resolves to, a loopback, private or link-local address is refused, at save and at each delivery; redirects are not followed.'
example: https://example.com/hooks/naturali
events:
$ref: '#/components/schemas/EventSubscription'
description:
type:
- string
- 'null'
description: Operator-facing label.
example: billing service
active:
type: boolean
description: Whether deliveries are attempted.
example: true
created_at:
type: string
format: date-time
example: '2026-07-31T00:00:00.000Z'
updated_at:
type: string
format: date-time
example: '2026-07-31T00:00:00.000Z'
ErrorResponse:
type: object
required:
- error
properties:
error:
type: object
description: Structured error. Every error response uses this shape, so `code` can be read without first checking the type of `error`.
required:
- code
- message
properties:
code:
type: string
description: 'Machine-readable error code: lower_snake for an error naturali raises (`access_denied`), UPPER_SNAKE for one the runtime reports (`RESOURCE_NOT_FOUND`).'
example: access_denied
message:
type: string
description: Human-readable explanation.
example: Your role in this project does not carry this action.
details:
type: object
additionalProperties: true
description: Structured context for an error naturali raises, such as the `resource` and `limit` of a `plan_limit_reached`.
meta:
type: object
description: Structured context for an error the runtime reports.
WebhookSecret:
type: string
minLength: 32
maxLength: 256
pattern: ^\S+$
description: 'A signing key of your choosing, 32 to 256 characters with no whitespace. Omit it on create to have one generated.
'
example: my-receiver-signing-key-0123456789ab
Page:
type: object
description: One page of a list. Rows inserted or removed between two calls neither repeat nor skip a row on the next page.
required:
- data
- next_cursor
properties:
data:
type: array
description: This page's items, in the list's order.
items: {}
next_cursor:
type:
- string
- 'null'
description: Pass as `cursor` to fetch the next page; `null` on the last page.
WebhookWithSecret:
allOf:
- $ref: '#/components/schemas/Webhook'
- type: object
required:
- secret
properties:
secret:
type: string
description: 'The signing key, returned only by create and rotate. A generated one carries the `whsec_` prefix; a chosen one is returned as sent. Never readable afterwards.
'
example: whsec_V1StGXR8Z5jdHi6BQe4kL2mN
EventType:
type: string
description: 'A naturali event type. Its values are what this API emits — deliberately only the events it can itself cause, so no declared name is one that never fires. It grows as modules land.
'
enum:
- conversation.started
- message.received
- generation.completed
- generation.failed
- usage.threshold_crossed
- project.paused
- project.resumed
- decision.completed
- decision.failed
- task.created
- task.transitioned
- task.closed
- task.migrated
- task.stalled
- task.paused
- task.resumed
- task.approval_failed
- task.automation_retrying
- task.automation_rejected
- task.automation_unrouted
- task.unblocked
- approval.created
- approval.approved
- approval.rejected
- approval.expired
- exception.created
example: conversation.started
WebhookUpdate:
type: object
description: At least one field is required.
properties:
url:
type: string
format: uri
example: https://example.com/hooks/naturali-v2
events:
$ref: '#/components/schemas/EventSubscription'
description:
type:
- string
- 'null'
example: billing service (staging)
active:
type: boolean
example: false
secret:
$ref: '#/components/schemas/WebhookSecret'
WebhookDelivery:
type: object
description: One event addressed to one endpoint, and everything that happened to it.
required:
- id
- project_id
- webhook_id
- event_id
- type
- payload
- status
- status_code
- attempts
- next_attempt_at
- last_attempt_at
- response_body
- created_at
- updated_at
properties:
id:
type: string
description: 'Public delivery ID (whd_ prefix). Sent with the request as `X-Naturali-Delivery`.
'
example: whd_V1StGXR8Z5jdHi6B
project_id:
type: string
description: The owning project.
x-naturali-ref: project
example: proj_V1StGXR8Z5jdHi6B
webhook_id:
type: string
description: The endpoint the delivery is addressed to.
x-naturali-ref: webhook
example: whk_V1StGXR8Z5jdHi6B
event_id:
type: string
description: The event's id; shared by every delivery and redelivery of it.
example: evt_V1StGXR8Z5jdHi6B
type:
$ref: '#/components/schemas/EventType'
payload:
$ref: '#/components/schemas/Event'
status:
type: string
enum:
- pending
- success
- failed
description: '`pending` until a 2xx is received (`success`) or the attempts are exhausted (`failed`). A failed delivery can be replayed with `…:redeliver`.
'
example: success
status_code:
type:
- integer
- 'null'
description: 'The receiver''s HTTP status on the last attempt; null when the attempt never got a response (DNS, TLS, refused, timed out).
'
example: 200
attempts:
type: integer
description: Attempts made so far.
example: 1
next_attempt_at:
type:
- string
- 'null'
format: date-time
description: When the next retry is due; null once the delivery is terminal.
example: null
last_attempt_at:
type:
- string
- 'null'
format: date-time
example: '2026-07-31T00:00:01.000Z'
response_body:
type:
- string
- 'null'
description: 'A truncated snippet of the receiver''s response, or the transport error when there was no response.
'
example: ok
created_at:
type: string
format: date-time
example: '2026-07-31T00:00:00.000Z'
updated_at:
type: string
format: date-time
example: '2026-07-31T00:00:01.000Z'
Event:
type: object
description: 'The envelope POSTed to your endpoint. It is also what a delivery''s `payload` holds, byte for byte, so the signed body and the recorded one are the same document.
'
required:
- id
- type
- project_id
- resource_type
- resource_id
- data
- created_at
properties:
id:
type: string
description: 'Unique per event (`evt_` prefix), and stable across redeliveries — dedupe on this if your receiver must process an event exactly once.
'
example: evt_V1StGXR8Z5jdHi6B
type:
$ref: '#/components/schemas/EventType'
project_id:
type: string
x-naturali-ref: project
example: proj_V1StGXR8Z5jdHi6B
resource_type:
type: string
description: What the event is about.
enum:
- conversation
- message
- generation
- usage_threshold
- project
- decision
- task
- approval
- exception
example: conversation
resource_id:
type: string
description: The id of that resource, in the form its own API uses.
example: conv_V1StGXR8Z5jdHi6B
data:
type: object
additionalProperties: true
description: 'The resource, shaped exactly as its own API returns it — a `generation.completed` payload carries the same object `getGeneration` would.
'
created_at:
type: string
format: date-time
example: '2026-07-31T00:00:00.000Z'
WebhookCreate:
type: object
required:
- url
- events
properties:
url:
type: string
format: uri
description: 'An `https://` endpoint on a public internet host. A host that is, or resolves to, a loopback, private or link-local address is refused, here and again at each delivery; redirects are not followed.
'
example: https://example.com/hooks/naturali
events:
$ref: '#/components/schemas/EventSubscription'
description:
type:
- string
- 'null'
example: billing service
active:
type: boolean
default: true
example: true
secret:
$ref: '#/components/schemas/WebhookSecret'
EventSubscription:
type: array
minItems: 1
description: 'Which events this endpoint receives. Each entry is an exact type (`generation.completed`), a resource wildcard (`generation.*`), or `*` for everything. A bare resource name (`generation`) matches nothing and is rejected.
'
items:
type: string
example:
- generation.*
- message.received
parameters:
Cursor:
name: cursor
in: query
required: false
description: The previous page's `next_cursor`; omit it for the first page. A cursor this list did not issue is `400`.
schema:
type: string
DeliveryId:
name: delivery_id
in: path
required: true
description: Delivery public ID (whd_ prefix).
schema:
type: string
example: whd_V1StGXR8Z5jdHi6B
Limit:
name: limit
in: query
required: false
description: Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.
schema:
type: integer
minimum: 1
maximum: 100
default: 50
ProjectId:
name: project_id
in: path
required: true
description: Project public ID (proj_ prefix).
schema:
type: string
example: proj_V1StGXR8Z5jdHi6B
WebhookId:
name: webhook_id
in: path
required: true
description: Webhook public ID (whk_ prefix).
schema:
type: string
example: whk_V1StGXR8Z5jdHi6B
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: A naturali API key (nat_sk_…) or a session JWT.
oauth2:
type: oauth2
description: 'A connected app''s OAuth access token, issued by this API''s authorization server (discovery: /.well-known/oauth-authorization-server). Its one scope carries every operation, confined to the projects the user chose when approving the app.'
flows:
authorizationCode:
authorizationUrl: https://api.naturali.ai/authorize
tokenUrl: https://api.naturali.ai/token
refreshUrl: https://api.naturali.ai/token
scopes:
mcp:access: Every operation this API serves, on the projects the grant covers.