Webhooks push Natural events to your server as they happen, so you don’t have to poll. Natural signs every delivery with the Standard Webhooks spec — verify it before trusting the payload. See the event catalog for every event type and its full payload.Documentation Index
Fetch the complete documentation index at: https://docs.natural.co/llms.txt
Use this file to discover all available pages before exploring further.
1. Register an endpoint
POST /webhooks registers your URL and subscribes it to event types. The signing secret is returned once in the response — store it immediately.
enabledEvents accepts any event type from the event catalog, or the wildcard "*" (which must be the only entry). description and tags are optional.
2. The event payload
Every delivery is a POST with this envelope as the JSON body. The resource snapshot lives atdata.object:
| Header | Description |
|---|---|
webhook-id | The event ID (evt_...) — stable across retries. Use for idempotency. |
webhook-timestamp | Unix epoch seconds when the delivery was signed. |
webhook-signature | One or more space-separated v1,<base64> signatures. |
3. Verify the signature
Always verify before trusting a payload. Use the officialstandardwebhooks library (Python and Node) — construct it with your whsec_ secret and pass the raw body plus headers. verify returns the parsed event, or raises on a bad signature:
webhook-timestamp is outside a tolerance window (replay defense), and it accepts a delivery if any of the space-separated signatures verifies — which is what lets a secret rotation overlap two valid secrets.
Verify manually, without the library
Verify manually, without the library
The signed content is the string
{webhook-id}.{webhook-timestamp}.{body}. Strip the whsec_
prefix from the secret, base64-decode the remainder for the HMAC key, compute HMAC-SHA256, and
base64-encode the result. Compare it against each space-separated v1,<sig> entry.4. Delivery, retries & failures
Natural treats any 2xx response as success. The delivery request times out after 30 seconds. Failed deliveries (non-2xx, network error, or timeout) are retried up to 7 attempts total with jittered backoff (~20% jitter):| Attempt | Delay after previous |
|---|---|
| 1 | immediate |
| 2 | 5 seconds |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
| 6 | 8 hours |
| 7 | 12 hours |
An endpoint that fails every attempt for 5 consecutive events is automatically disabled. Re-enable
it with
PUT /webhooks/{webhookId} once your endpoint is healthy.Best practices
- Return 2xx fast. Acknowledge as soon as the signature verifies, then process the event asynchronously — slow handlers risk the 30-second timeout and trigger retries.
- Deduplicate on
webhook-id. Retries reuse the samewebhook-id, and Natural may deliver an event more than once — record processed IDs and skip duplicates. - Store the
whsec_secret in a secrets manager, never in source control. Rotate it withPOST /webhooks/{webhookId}/rotate-secret; the previous secret stays valid for the grace period you specify, so both signatures arrive during the overlap. - Don’t depend on event ordering. Retries and independent delivery mean events can arrive out of order — use the
versionfield on the resource snapshot, or refetch the resource, when ordering matters.
Next steps
Event catalog
Every event type and its full payload
Idempotency
Make request handling idempotent