# List deliveries

GET /v1/webhook-endpoints/{endpointId}/deliveries. Lists an endpoint's deliveries, newest first.

`GET https://api.chatwise.so/v1/webhook-endpoints/{endpointId}/deliveries`

Lists an endpoint's deliveries, newest first. Deliveries are kept for 30 days.

The API key needs the `webhooks:read` scope. See [authentication and scopes](https://chatwise.so/docs/authentication.md).

## Example

**curl**:

```bash
curl 'https://api.chatwise.so/v1/webhook-endpoints/we_01JE2Z3K8Q9V7W5X4Y3Z2A1B0C/deliveries?limit=25&status=RETRY' \
  -H "Authorization: Bearer $CHATWISE_API_KEY"
```

**Node.js**:

```js
const response = await fetch("https://api.chatwise.so/v1/webhook-endpoints/we_01JE2Z3K8Q9V7W5X4Y3Z2A1B0C/deliveries?limit=25&status=RETRY", {
  headers: {
    Authorization: `Bearer ${process.env.CHATWISE_API_KEY}`,
  },
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${body.message}`);
console.log(body.data);
```

**Python**:

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

request = urllib.request.Request(
    "https://api.chatwise.so/v1/webhook-endpoints/we_01JE2Z3K8Q9V7W5X4Y3Z2A1B0C/deliveries?limit=25&status=RETRY",
    headers={
        "Authorization": f"Bearer {os.environ['CHATWISE_API_KEY']}",
    },
)
with urllib.request.urlopen(request) as response:
    print(json.load(response)["data"])
```

## Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `endpointId` | string | **Required.** The endpoint's id (`we_…`). |

## Query parameters

| Name | Type | Description |
| --- | --- | --- |
| `limit` | integer | How many to return, from 1 to 100. Default: `50`. |
| `cursor` | string | The previous page's `pagination.nextCursor`. Repeat the same filters and order with it. At most 512 characters. |
| `status` | string | Only deliveries with this status. One of `PENDING`, `PROCESSING`, `RETRY`, `DELIVERED`, `FAILED`, `CANCELLED`. |
| `eventType` | string | Only deliveries of this event. One of `message.received`, `message.sent`, `message.delivered`, `message.read`, `message.failed`, `comment.received`. |

Unknown query parameters are refused with a 400.

## Response

**200.** A page of deliveries.

```json
{
  "data": [
    {
      "id": "wd_3f1c0a9b5d7e42688c1f0e2d4b6a8c90",
      "eventId": "evt_01JE2Z3QK4T8M6N2R5S7V9W1X3",
      "eventType": "message.received",
      "occurredAt": "2026-11-12T09:25:36.000Z",
      "status": "RETRY",
      "attempts": 1,
      "lastStatusCode": 503,
      "lastError": "http_503",
      "lastDurationMs": 214,
      "nextAttemptAt": "2026-11-12T09:25:47.000Z",
      "deliveredAt": null,
      "createdAt": "2026-11-12T09:25:37.000Z"
    }
  ],
  "pagination": {
    "nextCursor": null
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `data[].id` | string | The delivery's id, also sent as the `X-Chatwise-Delivery` header. |
| `data[].eventId` | string | The event's id, also sent as the `webhook-id` header. |
| `data[].eventType` | string | The event's name. One of `message.received`, `message.sent`, `message.delivered`, `message.read`, `message.failed`, `comment.received`. |
| `data[].occurredAt` | string | When the event happened. ISO 8601, in UTC. |
| `data[].status` | string | `PENDING` (waiting), `PROCESSING` (being sent), `RETRY` (waiting for its next attempt), `DELIVERED`, `FAILED` or `CANCELLED`. |
| `data[].attempts` | integer | Attempts so far. Redelivering starts again from 0. |
| `data[].lastStatusCode` | integer or null | The HTTP status the last attempt got. Null when there was no answer. |
| `data[].lastError` | string or null | Why the last attempt failed, such as `http_500` or `timeout`. `retry_exhausted` once the last of all attempts failed. |
| `data[].lastDurationMs` | integer or null | How long the last attempt took, in milliseconds. |
| `data[].nextAttemptAt` | string or null | When it is next due to be sent, while it is `PENDING` or `RETRY`. Otherwise null. ISO 8601, in UTC. |
| `data[].deliveredAt` | string or null | When it was delivered. ISO 8601, in UTC. |
| `data[].createdAt` | string | When the delivery was created. ISO 8601, in UTC. |
| `pagination.nextCursor` | string or null | Send it as `cursor` for the next page. Null on the last page. |

## Errors

| Status | Message | What it means |
| --- | --- | --- |
| 400 | Validation failed | A parameter or body field is missing, unknown or malformed. `errors` lists each one. |
| 400 | Invalid cursor or cursor does not match this request | The cursor isn't one this route returned, or the filters or order changed since. |
| 401 | A valid Bearer API key is required | The `Authorization` header is missing or isn't `Bearer <API key>`. |
| 401 | Invalid or revoked API key | The key doesn't exist, was revoked, or has expired. |
| 401 | Invalid API key | Chatwise couldn't check the key. Try again. |
| 403 | API key does not have the required scope: webhooks:read | The key lacks the route's scope. Create a key that has it. |
| 404 | Webhook endpoint not found | No endpoint with this id in the key's workspace. |
| 429 | API key rate limit exceeded | Wait the number of seconds in the `Retry-After` header. |
| 500 | Internal server error | Something failed in Chatwise. Retry reads with backoff. |

The body of an error is described in [errors](https://chatwise.so/docs/errors.md).
