> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Recover failed deliveries (beta)

`POST /api/v1/trigger-delivery/endpoints/{endpoint_id}:recover`

This endpoint is in beta. Its request and response may change.

Resends every event whose delivery to this endpoint failed between `since` and `until`, once your endpoint is working again. Leave out `until` to recover up to now. The window is at most 14 days, and one call recovers at most 10,000 events, so cover a long outage with several narrower windows. The recovery runs in the background; the response only confirms it started. Calling again resends events that are still failed. Up to 6 requests a minute per environment.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `endpoint_id` | string | Yes | ID of your delivery endpoint (`ep_...`), the URL on your server that you added under **Developers** > **Trigger Delivery**. [Look up a delivery](https://docs.scalekit.com/agentkit/reference/triggers/look-up-a-delivery/) returns it as `endpoint_id` on each attempt. |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `since` | string | Yes | Start of the window, inclusive: events with a failed attempt to this endpoint at or after this instant are recovered. Must not be in the future, and must be at most 14 days before `until`, or before now when `until` is omitted. |
| `until` | string | No | End of the window, exclusive. Omit it to recover up to now. Must be after `since`, must not be in the future, and must be at most 14 days after `since`. |

**Response (200)**

| Name | Type | Description |
| --- | --- | --- |
| `status` | string | The recovery's state when this call returned. `running` in practice: the recovery continues after the response, and its later state is not reported. |
| `task_id` | string | Identifies this recovery in Scalekit's logs; quote it when contacting support. It cannot be looked up or polled through the API. |

**Errors**

- `400`: Invalid request, no recovery started - `endpoint_id` is not an endpoint ID (`ep_` followed by 1 to 64 letters or digits); `since` is missing, or `since` or `until` is not a valid timestamp; `since` is in the future; `until` is in the future; `until` is not after `since`; or `until` is more than 14 days after `since`, measured to now when `until` is omitted, so the period must be split into several calls
- `404`: Not found - the endpoint is not one of this environment's trigger delivery endpoints, or Triggers isn't turned on for your environment. No recovery started
- `429`: Too many requests - this environment has started too many recoveries in a short period, or requests are being refused for volume. No recovery started; retry after a short wait
- `500`: Internal error - the recovery was not confirmed. Either it could not be started, or the request timed out or failed after it may already have been accepted, in which case the error message says it may be running. In that case look for new manual attempts with [List deliveries](https://docs.scalekit.com/agentkit/reference/triggers/list-deliveries/) before calling again, because a second call can queue a second attempt for the same event

**Request**

```bash
curl -sS -X POST \
  "$SCALEKIT_ENVIRONMENT_URL/api/v1/trigger-delivery/endpoints/ep_2qGv8XHk3mT5bJr9LwNc7pZeYfA:recover" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "since": "2026-10-28T09:00:00Z"
  }'
```

**Response**

```json
{
  "task_id": "qtask_2qGvB3mKd9XcV1nTq6RpW4sLhZe",
  "status": "running"
}
```

**Python SDK:** `scalekit_client.actions.triggers.recover_deliveries`

Resend every message that failed to reach an endpoint in a time range. Not retried on `UNAVAILABLE`. A `ScalekitInternalServerException` here means the recovery may be running anyway: check the endpoint's deliveries before calling again.

```python
scalekit_client.actions.triggers.recover_deliveries(
    endpoint_id: str,
    since: datetime,
    until: datetime | None = None,
) -> RecoverTriggerDeliveriesResponse
```

Example:

```python
from datetime import datetime, timezone

result = scalekit_client.actions.triggers.recover_deliveries(
    endpoint_id="ep_2qGv8XHk3mT5bJr9LwNc7pZeYfA",
    since=datetime(2026, 10, 28, 9, 0, tzinfo=timezone.utc),
)
```

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `endpoint_id` | `str` | Yes | ID of your delivery endpoint (`ep_...`), the URL on your server that you added under **Developers** > **Trigger Delivery**. [Look up a delivery](https://docs.scalekit.com/agentkit/reference/triggers/look-up-a-delivery/) returns it as `endpoint_id` on each attempt. |
| `since` | `datetime` | Yes | Start of the range, an aware instant not in the future. |
| `until` | `datetime \| None` | No | End of the range (default now), at most 14 days after `since`. |

Returns `RecoverTriggerDeliveriesResponse`: The recovery task and its status (`"running"` or `"finished"`).


Part of [Triggers](https://docs.scalekit.com/agentkit/reference/triggers/) in the [AgentKit API reference](https://docs.scalekit.com/agentkit/reference/). Authentication: https://docs.scalekit.com/agentkit/reference/authentication.md. Errors and rate limits: https://docs.scalekit.com/agentkit/reference/errors.md. Pagination: https://docs.scalekit.com/agentkit/reference/pagination.md


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
