# Webhook endpoints

> The owner's own endpoints (D354) and their deliveries, with webhooks:write.

| Operation | Method and path | Scope |
|---|---|---|
| [List webhook endpoints](https://docs.kaizenaflow.com/reference/admin-api/webhook-endpoints#webhooks-list) | `GET /webhooks` | [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write) |
| [Add a webhook endpoint](https://docs.kaizenaflow.com/reference/admin-api/webhook-endpoints#webhooks-create) | `POST /webhooks` | [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write) |
| [Change a webhook endpoint](https://docs.kaizenaflow.com/reference/admin-api/webhook-endpoints#webhooks-update) | `PATCH /webhooks/{id}` | [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write) |
| [Remove a webhook endpoint](https://docs.kaizenaflow.com/reference/admin-api/webhook-endpoints#webhooks-delete) | `DELETE /webhooks/{id}` | [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write) |
| [List an endpoint's deliveries](https://docs.kaizenaflow.com/reference/admin-api/webhook-endpoints#webhooks-deliveries) | `GET /webhooks/{id}/deliveries` | [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write) |
| [Send a delivery again](https://docs.kaizenaflow.com/reference/admin-api/webhook-endpoints#webhooks-resend) | `POST /webhooks/{id}/deliveries/{delivery_id}/resend` | [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write) |

## List webhook endpoints {#webhooks-list}

`GET https://kaizenaflow.com/api/admin/v1/webhooks`

The owner's endpoints, each with how its deliveries go; never an address or a secret.

- **Operation:** `webhooks.list`
- **Scope:** [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write)
- **Answers:** `200`, the answer under `data`.

### Answer {#webhooks-list-answer}

| Field | Type | Description |
|---|---|---|
| `data` | list of objects |   |
| `data[].id` | string (uuid) |   |
| `data[].name` | string |   |
| `data[].hint` | string | The address's host, to tell endpoints apart: the address itself is kept encrypted and never answered. |
| `data[].topics` | list of string |   |
| `data[].enabled` | boolean |   |
| `data[].disabled_reason` | one of `failing`, `owner` or null | failing: switched off after three days of failed deliveries. |
| `data[].failing_since` | string (date-time) or null |   |
| `data[].last_delivery` | object or null |   |
| `data[].last_delivery.status` | one of `pending`, `delivered`, `failed` |   |
| `data[].last_delivery.at` | string (date-time) |   |
| `data[].recent_failures` | integer | Deliveries that failed in the last 7 days. |

### Errors {#webhooks-list-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#webhooks-list-example}

**curl**

```shell
curl 'https://kaizenaflow.com/api/admin/v1/webhooks' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## Add a webhook endpoint {#webhooks-create}

`POST https://kaizenaflow.com/api/admin/v1/webhooks`

Adds an endpoint, on, through the Integrations page's own writer (an HTTPS address on a public host, checked again at every send). Its signing secret is answered this once, never again (a replay of the request answers it as null).

- **Operation:** `webhooks.create`
- **Scope:** [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write)
- **Answers:** `201`, made: the answer under `data`.
- **Once only:** with an [`Idempotency-Key`](https://docs.kaizenaflow.com/reference/admin-api#idempotency) header.

### Body {#webhooks-create-body}

JSON, with `Content-Type: application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string, 1 to 80 characters | yes |   |
| `url` | string, at most 2,000 characters | yes | An HTTPS address on a public host. |
| `topics` | list of one of `order.paid`, `order.sent`, `order.cancelled`, `order.refunded`, `customer.created`, `subscription.started`, `subscription.cancelled`, `return.requested`, `withdrawal.received`, `product.created`, `product.updated`, `stock.low`, `discount.created`, `inventory.updated`, `product.archived`, `order.created`, `order.updated`, `fulfilment.created`, `fulfilment.updated`, `refund.created`, `return.updated`, `quote.requested`, `draft.sent`, `customer.updated`, `customer.erased`, `subscription.renewed`, `subscription.payment_failed`, `gift_card.issued`, `review.created`, `experiment.answered`, `contract.sent`, `contract.signed`, `contract.declined`, `form.response`, `support.waiting`, `deal.created`, `deal.stage_changed`, `deal.won`, `deal.lost`, `subscriber.subscribed`, `subscriber.unsubscribed`, `conversation.ended`, `conversation.rated`, `review.published`, `checkout.abandoned`, `work_client.created`, `work_invoice.sent`, `work_invoice.paid`, `work_invoice.credited`, `email.bounced`, `email.complained`, `broadcast.sent`, `marketing.paused`, `activity.created`, `activity.done`, `lead.dismissed`, `lead.deal_made`, `domain.failing`, `domain.recovered`, 1 to 40 items | yes |   |

### Answer {#webhooks-create-answer}

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.id` | string (uuid) |   |
| `data.name` | string |   |
| `data.hint` | string | The address's host, to tell endpoints apart: the address itself is kept encrypted and never answered. |
| `data.topics` | list of string |   |
| `data.enabled` | boolean |   |
| `data.disabled_reason` | one of `failing`, `owner` or null | failing: switched off after three days of failed deliveries. |
| `data.failing_since` | string (date-time) or null |   |
| `data.last_delivery` | object or null |   |
| `data.last_delivery.status` | one of `pending`, `delivered`, `failed` |   |
| `data.last_delivery.at` | string (date-time) |   |
| `data.recent_failures` | integer | Deliveries that failed in the last 7 days. |
| `data.secret` | string or null | The signing secret, this once. |

### Errors {#webhooks-create-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 409 | [`conflict`](https://docs.kaizenaflow.com/reference/errors#conflict) | Nothing was done: it clashes with how things are now (nothing left to send), or an `Idempotency-Key` is in use or was used for another request. |
| 422 | [`invalid`](https://docs.kaizenaflow.com/reference/errors#invalid) | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#webhooks-create-example}

**curl**

```shell
curl -X POST 'https://kaizenaflow.com/api/admin/v1/webhooks' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example","url":"https://example.com","topics":["order.paid"]}'
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Example",
    "url": "https://example.com",
    "topics": [
      "order.paid"
    ]
  }),
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "name": "Example",
        "url": "https://example.com",
        "topics": [
            "order.paid",
        ],
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## Change a webhook endpoint {#webhooks-update}

`PATCH https://kaizenaflow.com/api/admin/v1/webhooks/{id}`

Changes its name, address or topics, or switches it on or off.

- **Operation:** `webhooks.update`
- **Scope:** [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write)
- **Answers:** `200`, the answer under `data`.

### Path parameters {#webhooks-update-path}

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | yes | The thing's id in this store. |

### Body {#webhooks-update-body}

JSON, with `Content-Type: application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string, 1 to 80 characters | no |   |
| `url` | string, at most 2,000 characters | no | A new address; the one there stays when left out. |
| `topics` | list of one of `order.paid`, `order.sent`, `order.cancelled`, `order.refunded`, `customer.created`, `subscription.started`, `subscription.cancelled`, `return.requested`, `withdrawal.received`, `product.created`, `product.updated`, `stock.low`, `discount.created`, `inventory.updated`, `product.archived`, `order.created`, `order.updated`, `fulfilment.created`, `fulfilment.updated`, `refund.created`, `return.updated`, `quote.requested`, `draft.sent`, `customer.updated`, `customer.erased`, `subscription.renewed`, `subscription.payment_failed`, `gift_card.issued`, `review.created`, `experiment.answered`, `contract.sent`, `contract.signed`, `contract.declined`, `form.response`, `support.waiting`, `deal.created`, `deal.stage_changed`, `deal.won`, `deal.lost`, `subscriber.subscribed`, `subscriber.unsubscribed`, `conversation.ended`, `conversation.rated`, `review.published`, `checkout.abandoned`, `work_client.created`, `work_invoice.sent`, `work_invoice.paid`, `work_invoice.credited`, `email.bounced`, `email.complained`, `broadcast.sent`, `marketing.paused`, `activity.created`, `activity.done`, `lead.dismissed`, `lead.deal_made`, `domain.failing`, `domain.recovered`, 1 to 40 items | no |   |
| `enabled` | boolean | no |   |

### Answer {#webhooks-update-answer}

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.id` | string (uuid) |   |
| `data.name` | string |   |
| `data.hint` | string | The address's host, to tell endpoints apart: the address itself is kept encrypted and never answered. |
| `data.topics` | list of string |   |
| `data.enabled` | boolean |   |
| `data.disabled_reason` | one of `failing`, `owner` or null | failing: switched off after three days of failed deliveries. |
| `data.failing_since` | string (date-time) or null |   |
| `data.last_delivery` | object or null |   |
| `data.last_delivery.status` | one of `pending`, `delivered`, `failed` |   |
| `data.last_delivery.at` | string (date-time) |   |
| `data.recent_failures` | integer | Deliveries that failed in the last 7 days. |

### Errors {#webhooks-update-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | [`not_found`](https://docs.kaizenaflow.com/reference/errors#not-found) | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 422 | [`invalid`](https://docs.kaizenaflow.com/reference/errors#invalid) | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#webhooks-update-example}

**curl**

```shell
curl -X PATCH 'https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example"}'
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Example"
  }),
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
    method="PATCH",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "name": "Example",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## Remove a webhook endpoint {#webhooks-delete}

`DELETE https://kaizenaflow.com/api/admin/v1/webhooks/{id}`

Removes the endpoint; what it still has waiting is not sent.

- **Operation:** `webhooks.delete`
- **Scope:** [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write)
- **Answers:** `200`, the answer under `data`.

### Path parameters {#webhooks-delete-path}

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | yes | The thing's id in this store. |

### Answer {#webhooks-delete-answer}

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.id` | string (uuid) |   |
| `data.deleted` | `true` |   |

### Errors {#webhooks-delete-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | [`not_found`](https://docs.kaizenaflow.com/reference/errors#not-found) | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#webhooks-delete-example}

**curl**

```shell
curl -X DELETE 'https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
    method="DELETE",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## List an endpoint's deliveries {#webhooks-deliveries}

`GET https://kaizenaflow.com/api/admin/v1/webhooks/{id}/deliveries`

The endpoint's latest deliveries (kept 30 days), newest first, with how each went.

- **Operation:** `webhooks.deliveries`
- **Scope:** [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write)
- **Answers:** `200`, the answer under `data`.

### Path parameters {#webhooks-deliveries-path}

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | yes | The thing's id in this store. |

### Query parameters {#webhooks-deliveries-query}

| Name | Type | Required | Description |
|---|---|---|---|
| `limit` | integer, 1 to 100 | no | Rows a page holds, at most 100; 50 when left out. A larger number gives 100. |

### Answer {#webhooks-deliveries-answer}

| Field | Type | Description |
|---|---|---|
| `data` | list of objects |   |
| `data[].id` | string (uuid) |   |
| `data[].topic` | string |   |
| `data[].status` | one of `pending`, `delivered`, `failed` |   |
| `data[].attempts` | integer |   |
| `data[].last_status` | integer or null | The receiver's last HTTP status. |
| `data[].last_error` | string or null |   |
| `data[].created_at` | string (date-time) |   |
| `data[].next_attempt_at` | string (date-time) |   |

### Errors {#webhooks-deliveries-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | [`not_found`](https://docs.kaizenaflow.com/reference/errors#not-found) | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 422 | [`invalid`](https://docs.kaizenaflow.com/reference/errors#invalid) | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#webhooks-deliveries-example}

**curl**

```shell
curl 'https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## Send a delivery again {#webhooks-resend}

`POST https://kaizenaflow.com/api/admin/v1/webhooks/{id}/deliveries/{delivery_id}/resend`

Sends a delivery that ended (failed or delivered) again, with the same payload and id, to an endpoint that is on.

- **Operation:** `webhooks.resend`
- **Scope:** [`webhooks:write`](https://docs.kaizenaflow.com/reference/scopes#webhooks-write)
- **Answers:** `200`, the answer under `data`.
- **Once only:** with an [`Idempotency-Key`](https://docs.kaizenaflow.com/reference/admin-api#idempotency) header.

### Path parameters {#webhooks-resend-path}

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | yes | The thing's id in this store. |
| `delivery_id` | string (uuid) | yes | The delivery. |

### Body {#webhooks-resend-body}

JSON, with `Content-Type: application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `body` | object | yes | Nothing: send `{}` or no body. |

### Answer {#webhooks-resend-answer}

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.queued` | `true` |   |

### Errors {#webhooks-resend-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | [`not_found`](https://docs.kaizenaflow.com/reference/errors#not-found) | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | [`conflict`](https://docs.kaizenaflow.com/reference/errors#conflict) | Nothing was done: it clashes with how things are now (nothing left to send), or an `Idempotency-Key` is in use or was used for another request. |
| 422 | [`invalid`](https://docs.kaizenaflow.com/reference/errors#invalid) | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#webhooks-resend-example}

**curl**

```shell
curl -X POST 'https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries/e583bf4d-ab8b-4f0a-b95e-482664f6a6ed/resend' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries/e583bf4d-ab8b-4f0a-b95e-482664f6a6ed/resend", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries/e583bf4d-ab8b-4f0a-b95e-482664f6a6ed/resend",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({}).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

---

https://docs.kaizenaflow.com/reference/admin-api/webhook-endpoints · made from the API contract 1.57
