# Resurrect Run

Reopen an aborted run and resume scraping from where it stopped

Reopen an aborted run in place, resetting only the tasks that were interrupted back to `pending`. Tasks already marked `done` are untouched — the run picks up from where the abort cut it off rather than starting over.

## Headers

<ParamField header="Authorization" type="string" required>
  Your API authentication token. Value: `Token YOUR_API_KEY`
</ParamField>

## Path Parameters

<ParamField path="run_key" type="string" required>
  Hash ID of the aborted run to resurrect. Retrieve this from the [List Runs](https://staging.docs.lobstr.io/docs/list-runs) endpoint.
</ParamField>

## Constraints

- Only runs with `done_reason: "aborted"` can be resurrected. Any other completed run returns a `RunNotAborted` error.

## Code Examples

<CodeGroup>
```bash cURL
curl -X POST "https://api.lobstr.io/v1/runs/RUN_HASH/resurrect" \
  -H "Authorization: Token YOUR_API_KEY"
```

```python Python
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.lobstr.io/v1"
headers = {"Authorization": f"Token {API_KEY}"}

run_hash = "RUN_HASH"

response = requests.post(f"{BASE_URL}/runs/{run_hash}/resurrect", headers=headers)
print(response.json())
```
</CodeGroup>

## Response

```json 200
{
  "id": "RUN_HASH",
  "status": "PENDING",
  "is_done": false,
  "done_reason": null
}
```

## Error Responses

```json 400 RunNotAborted
{
  "error": "RunNotAborted",
  "message": "Only aborted runs can be resurrected."
}
```
