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

# Recover Failed Deliveries

POST https://api.captain.dev/v2/webhooks/endpoints/{endpoint_id}/recover
Content-Type: application/json

Re-send every message that failed to reach this endpoint since a given time, at most 7 days ago. Use it after a receiver outage, or after re-enabling an endpoint that was disabled for delivery failures.

Recovery runs in the background and this request returns immediately. Follow progress with the deliveries endpoint.

Reference: https://docs.captain.dev/reference/webhooks/deliveries/recover

## Request

### Path parameters

- `endpoint_id` (string, required) — The endpoint's id (`whe_...`).

### Body (application/json)

This endpoint expects a WebhookRecoverRequest.

- `since` (string, required) — Re-send every message that failed to reach the endpoint since this time. ISO 8601; must be in the past and within the last 7 days. A time without a zone is read as UTC.

## Response

### 202

Successful Response

- `endpoint_id` (string, required)
- `since` (string, required) — The recovery start time, in UTC.
- `recovering` (boolean, required)

## 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.

### 403 Forbidden Error

The connection is read-only and cannot change webhooks (MCP connections without write access).

- `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.

### 422 Unprocessable Entity Error

A value was rejected. A route check returns `HTTP_ERROR` and names the value in `message`, for example `url must start with https://`. A malformed body returns `VALIDATION_ERROR` with one entry per field in `details`.

- `error` (string, required) — `HTTP_ERROR` when a route check rejected a value, `VALIDATION_ERROR` when the body is malformed.
- `message` (string, required) — What went wrong. For `HTTP_ERROR`, names the rejected value.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code. Present only on `HTTP_ERROR`.
- `details` (list of V2WebhooksEndpointsEndpointIdRecoverPostResponsesContentApplicationJsonSchemaDetailsItems, optional) — Present only on `VALIDATION_ERROR`: one entry per invalid field, with `type`, `loc` and `msg`.

### 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

### V2WebhooksEndpointsEndpointIdRecoverPostResponsesContentApplicationJsonSchemaDetailsItems

## Examples

**Request**

```json
{
  "since": "2026-09-22T08:00:00Z"
}
```

**Response**

```json
{
  "endpoint_id": "whe_3f9a1c7e5b2d4a6c8e0f1a2b",
  "since": "2026-09-22T08:00:00Z",
  "recovering": true
}
```

**SDK Code**

```python Python
import requests

BASE_URL = "https://api.captain.dev"
API_KEY = "your_api_key"
ENDPOINT_ID = "whe_3f9a1c7e5b2d4a6c8e0f1a2b"

response = requests.post(
    f"{BASE_URL}/v2/webhooks/endpoints/{ENDPOINT_ID}/recover",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "since": "2026-09-22T08:00:00Z"
    },
    timeout=30.0,
)
response.raise_for_status()
data = response.json()
print(f"Recovering failed deliveries since {data['since']}")

```

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

const response = await fetch(`${BASE_URL}/v2/webhooks/endpoints/${ENDPOINT_ID}/recover`, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "since": "2026-09-22T08:00:00Z"
  }),
});
if (!response.ok) throw new Error(`Request failed: ${response.status} ${await response.text()}`);
const data = await response.json();
console.log(`Recovering failed deliveries since ${data.since}`);

```