# Run extraction against a stored snapshot without fetching

POST /v1/programs/{id}/versions/{n}/replay: Run extraction against a stored snapshot without fetching

```http
POST /v1/programs/{id}/versions/{n}/replay
```

|  |  |
|---|---|
| Operation id | `replayProgramVersion` |
| Key scope | `run`: keys that run jobs (and `admin` keys) |
| Section | [Programs](https://docs.kaab.ist/reference/api#programs) |

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | min length 1 |
| `n` | path | integer | yes | ≥ 1 |

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `snapshot` | string or `"ground_truth"` | yes |  |

## Example request

```bash
curl -X POST "https://api.kaab.ist/v1/programs/{id}/versions/{n}/replay" \
  -H "Authorization: Bearer $KAAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"snapshot":"ground_truth"}'
```

## Responses

### 200

Replay result

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | map of any | yes |  |
| `raw` | map of any | yes |  |
| `warnings` | object[] | yes |  |
| `warnings[].code` | enum (19 values) | yes | one of `"null_marker"`, `"parse_failed"`, `"out_of_range"`, `"required_missing"`, `"list_short"`, `"fill_rate_drop"`, `"escalated"`, `"healed_locator_used"`, `"obstacle_dismissed"`, `"field_empty"`, `"step_skipped"`, `"cache_hit"`, `"byo_fallback_used"`, `"pdf_source_not_extractable"`, `"pdf_no_text"`, `"pdf_pages_truncated"`, `"redirect_not_followed"`, `"pagination_incomplete"`, `"captcha_inject_navigated"` |
| `warnings[].field` | string or null |  |  |
| `warnings[].raw` | string or null |  |  |
| `warnings[].step` | string or null |  |  |
| `warnings[].message` | string |  |  |
| `warnings[].detail` | string |  |  |
| `warnings[].count` | integer |  | ≥ 1 |
| `warnings[].of` | integer |  | ≥ 0 |
| `warnings[].hint` | object |  |  |
| `warnings[].hint.date_format` | string |  |  |
| `warnings[].hint.date_formats` | string[] |  |  |
| `warnings[].hint.ambiguous` | `true` |  |  |
| `warnings[].hint.locale` | string |  |  |

## Errors

Every error answers with the [error envelope](https://docs.kaab.ist/reference/api/schemas/error-response); its `code` is one of the [error codes](https://docs.kaab.ist/reference/codes#errors).

| Status | When |
|---|---|
| 400 | `request_invalid`: request validation failed |
| 401 | Missing or invalid API key |
| 402 | `insufficient_credits`: top up to continue |
| 403 | The key's scope does not cover this operation |
| 404 | Resource not found |
| 409 | Conflicting state (see `error.code`) |
| 422 | Semantically invalid request (see `error.code`) |
| 429 | Rate limited; see `Retry-After` |
| 500 | `internal`: unexpected server error |
