---
title: Webhooks
description: Register a webhook endpoint, choose its events, send a test event and understand retries.
section: Events and webhooks
order: 2
---

# Webhooks

You will register an HTTPS endpoint, choose the events it receives, test it, and know what a delivery looks like.

## How it works

A webhook endpoint is an HTTPS address. When an event of a type you chose happens, Nurish'd sends it to the endpoint as a `POST` with a JSON body. The body is the [event](/docs/events/events). Each delivery is signed with the endpoint's signing secret.

- A company can have at most 10 endpoints per environment. The 11th answers `409 webhook_endpoint_limit_reached`.
- An endpoint belongs to one environment. A Sandbox endpoint receives only Sandbox events.
- Each endpoint has its own signing secret, `nk-whsec-` followed by 64 hex characters.

## What a delivery looks like

- The method is `POST`. The body is the compact JSON of the public event shape, the same object the event list returns. See [Events](/docs/events/events).
- The `Content-Type` is `application/json`. The `User-Agent` is `Nurishd-Connect-Webhooks/1.0`.
- The `Nurishd-Signature` header signs the raw body: `t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">`. During the 24 hours after you roll a secret it carries a second `v1=` value. Check it as shown in [Verifying signatures](/docs/events/verifying-signatures).
- Events are thin. Fetch the object with your key.

## Create an endpoint

Create one in the console under **Webhooks**, or with the API. The URL must be public: `https` only, no user name or password, no fragment, no `localhost` or private IP address. Choose at least one event type, each once. You cannot choose `ping`. Your key's scopes must let it see every type you choose, otherwise the call answers `403 scope_not_granted`.

`POST /developer/v1/webhook-endpoint/create/document`:

```bash
curl -X POST https://api.dev.nurishd.ca/developer/v1/webhook-endpoint/create/document \
  -H "X-Partner-API-Key: $NURISHD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/nurishd",
    "events": ["connection.approved", "connection.revoked"],
    "description": "Connections for the back office"
  }'
```

```javascript
const res = await fetch(
	'https://api.dev.nurishd.ca/developer/v1/webhook-endpoint/create/document',
	{
		method: 'POST',
		headers: {
			'X-Partner-API-Key': process.env.NURISHD_API_KEY,
			'Content-Type': 'application/json',
		},
		body: JSON.stringify({
			url: 'https://hooks.example.com/nurishd',
			events: ['connection.approved', 'connection.revoked'],
			description: 'Connections for the back office',
		}),
	},
);
const created = await res.json();
```

```python
import os
import requests

res = requests.post(
    "https://api.dev.nurishd.ca/developer/v1/webhook-endpoint/create/document",
    headers={"X-Partner-API-Key": os.environ["NURISHD_API_KEY"]},
    json={
        "url": "https://hooks.example.com/nurishd",
        "events": ["connection.approved", "connection.revoked"],
        "description": "Connections for the back office",
    },
)
created = res.json()
```

The answer is `201`. The signing secret is in `secret` and is shown here. You can read it again in the console. Store it like an API key.

```json
{
	"endpoint": {
		"endpoint_id": "whe-01JD2ZQ4M8K7R5T3V9X1B6C0HN",
		"company_id": "company-0001",
		"mode": "test",
		"url": "https://hooks.example.com/nurishd",
		"events": ["connection.approved", "connection.revoked"],
		"description": "Connections for the back office",
		"is_enabled": true,
		"secret_last_four": "e5f6",
		"previous_secret_expires_at": null,
		"created_at": "2026-11-30T15:04:05Z",
		"updated_at": "2026-11-30T15:04:05Z"
	},
	"secret": "nk-whsec-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}
```

## List, change and delete

| Route                                                                   | What it does                                                                                        |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `GET /developer/v1/webhook-endpoint/query/documents`                    | List endpoints in your key's mode, newest first. The secret is not listed, only `secret_last_four`. |
| `PUT /developer/v1/webhook-endpoint/{endpoint_id}/update/document`      | Change `url`, `events`, `description` or `is_enabled`. Fields you leave out stay as they are.       |
| `PUT /developer/v1/webhook-endpoint/{endpoint_id}/secret/roll/document` | Make a new signing secret. See [Verifying signatures](/docs/events/verifying-signatures).           |
| `DELETE /developer/v1/webhook-endpoint/{endpoint_id}/delete/document`   | Delete an endpoint. Events are no longer sent to it.                                                |

## Pause and resume

Send `is_enabled: false` to pause deliveries. Send `is_enabled: true` to start again. Sending `description: null` clears the description. `events` replaces the whole list.

```bash
curl -X PUT https://api.dev.nurishd.ca/developer/v1/webhook-endpoint/whe-01JD2ZQ4M8K7R5T3V9X1B6C0HN/update/document \
  -H "X-Partner-API-Key: $NURISHD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"is_enabled": false}'
```

```javascript
const res = await fetch(
	'https://api.dev.nurishd.ca/developer/v1/webhook-endpoint/whe-01JD2ZQ4M8K7R5T3V9X1B6C0HN/update/document',
	{
		method: 'PUT',
		headers: {
			'X-Partner-API-Key': process.env.NURISHD_API_KEY,
			'Content-Type': 'application/json',
		},
		body: JSON.stringify({ is_enabled: false }),
	},
);
```

```python
import os
import requests

res = requests.put(
    "https://api.dev.nurishd.ca/developer/v1/webhook-endpoint/whe-01JD2ZQ4M8K7R5T3V9X1B6C0HN/update/document",
    headers={"X-Partner-API-Key": os.environ["NURISHD_API_KEY"]},
    json={"is_enabled": False},
)
```

The answer is the endpoint, with the same fields as in the create answer and no `secret`. `previous_secret_expires_at` is set for 24 hours after you roll the secret and is `null` otherwise. An endpoint of the other environment answers `404 not_found`.

## Send a test event

In the console, select **Send test event** on an endpoint. Nurish'd sends a signed `ping`. Use it to test your signature check before any real event.

## Retries

Your endpoint has 5 seconds to answer. A `2xx` answer is success. Any other answer, a timeout or a connection error is a failure, and Nurish'd retries with backoff for up to three days. Nurish'd does not follow redirects, so a `301` or `302` counts as a failure: register the final URL. Answer fast with a `2xx` and do your work after. Make your handler safe to run twice for the same event id.

Keep polling the event list as a safety net. See [Events](/docs/events/events).

## Next

- [Verifying signatures](/docs/events/verifying-signatures): check every delivery.
- [Events](/docs/events/events): the event object and types.
- [Managing keys](/docs/console/managing-keys): who can manage endpoints.
