> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# List Delivery Attempts

GET https://api.filesearch.dev/v2/webhooks/endpoints/{endpoint_id}/deliveries/{message_id}/attempts

List every attempt to deliver one message to one endpoint, with the HTTP status the receiver returned, how long it took, and whether the attempt was an automatic retry (`scheduled`) or a resend or recovery (`manual`). The receiver's response body is not included.

`message_id` is the delivery's `message_id`, or the event's `id` (`evt_` followed by the job id).

Reference: https://docs.runcaptain.com/reference/webhooks/deliveries/attempts

## Request

### Path parameters

- `endpoint_id` (string, required) — The endpoint's id (`whe_...`).
- `message_id` (string, required) — The delivery's `message_id`, or the event's `id` (`evt_` followed by the job id).

### Query parameters

- `limit` (integer, optional, default: 25) — Rows per page (1-100). Defaults to 25.
- `cursor` (string, optional, nullable) — `next_cursor` from the previous page.

## Response

### 200

Successful Response

- `attempts` (list of WebhookDeliveryAttempt, required)
- `next_cursor` (string, required, nullable) — Pass as `cursor` for the next page. `null` on the last page.

## Errors

### 401 Unauthorized Error

Missing or invalid API key.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

### 404 Not Found Error

`Webhook endpoint not found.` The id does not exist, or belongs to another organization.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

### 429 Too Many Requests Error

`Too many webhook management requests. Try again shortly.` Retry after the `Retry-After` header.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

### 503 Service Unavailable Error

Webhooks are temporarily unavailable. Retry shortly.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

## Types

### WebhookDeliveryAttempt

One attempt to deliver a message. The receiver's response body is not included.

- `attempt_id` (string, required)
- `message_id` (string, required)
- `status` (enum, required)
  - Allowed values: `succeeded`, `failed`, `pending`, `sending`
- `response_status_code` (integer, required) — The HTTP status the receiver returned. `0` when no response arrived.
- `response_duration_ms` (integer, required) — How long the receiver took to respond, in milliseconds.
- `trigger` (enum, required) — `scheduled` for the first attempt and automatic retries, `manual` for a resend or recovery.
  - Allowed values: `scheduled`, `manual`
- `timestamp` (string, required) — When the attempt was made.

## Examples

**Response**

```json
{
  "attempts": [
    {
      "attempt_id": "atmpt_2mXqB7nV3cK8tR1wY5zD9fH2Lj",
      "message_id": "msg_2mXq8vTn4bK9cR1sZp7Lw3YhJd",
      "status": "succeeded",
      "response_status_code": 204,
      "response_duration_ms": 84,
      "trigger": "scheduled",
      "timestamp": "2026-09-23T10:05:18Z"
    },
    {
      "attempt_id": "atmpt_2mXq9sT4wE1rY7uI3oP6aS0dF",
      "message_id": "msg_2mXq8vTn4bK9cR1sZp7Lw3YhJd",
      "status": "failed",
      "response_status_code": 502,
      "response_duration_ms": 1210,
      "trigger": "scheduled",
      "timestamp": "2026-09-23T10:05:13Z"
    }
  ],
  "next_cursor": null
}
```

**SDK Code**

```python Python
import requests

BASE_URL = "https://api.filesearch.dev"
API_KEY = "your_api_key"
ENDPOINT_ID = "whe_3f9a1c7e5b2d4a6c8e0f1a2b"
MESSAGE_ID = "msg_2mXq8vTn4bK9cR1sZp7Lw3YhJd"

response = requests.get(
    f"{BASE_URL}/v2/webhooks/endpoints/{ENDPOINT_ID}/deliveries/{MESSAGE_ID}/attempts",
    headers={"Authorization": f"Bearer {API_KEY}"},
    timeout=30.0,
)
response.raise_for_status()
data = response.json()
for attempt in data["attempts"]:
    print(
        f"{attempt['timestamp']} {attempt['trigger']}: {attempt['status']} "
        f"(HTTP {attempt['response_status_code']}, {attempt['response_duration_ms']} ms)"
    )

```

```typescript TypeScript
const BASE_URL = "https://api.filesearch.dev";
const API_KEY = "your_api_key";
const ENDPOINT_ID = "whe_3f9a1c7e5b2d4a6c8e0f1a2b";
const MESSAGE_ID = "msg_2mXq8vTn4bK9cR1sZp7Lw3YhJd";

const response = await fetch(`${BASE_URL}/v2/webhooks/endpoints/${ENDPOINT_ID}/deliveries/${MESSAGE_ID}/attempts`, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${API_KEY}`,
  },
});
if (!response.ok) throw new Error(`Request failed: ${response.status} ${await response.text()}`);
const data = await response.json();
interface Attempt {
  timestamp: string;
  trigger: string;
  status: string;
  response_status_code: number;
  response_duration_ms: number;
}

for (const attempt of data.attempts as Attempt[]) {
  console.log(
    `${attempt.timestamp} ${attempt.trigger}: ${attempt.status} ` +
      `(HTTP ${attempt.response_status_code}, ${attempt.response_duration_ms} ms)`,
  );
}

```