> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sluice.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /api/jobs/:id/retry

> Retry a single failed or cancelled job.

Re-queues a job that has failed or been cancelled. The job's state changes to `retrying` and it will be picked up by a worker.

## Authentication

Session cookie (dashboard).

## Path parameters

| Parameter | Type     | Description      |
| --------- | -------- | ---------------- |
| `id`      | `string` | Sluice job UUID. |

## Allowed states

A job can only be retried if its current state is `failed` or `cancelled`. Attempting to retry a job in any other state returns `400`.

## How it works

Sluice re-dispatches the task to Celery via `send_task()` using the original task name, arguments, and queue. The attempt counter is incremented so you can track how many times a job has been retried. The job transitions to `retrying` immediately and moves to `queued` once the broker accepts the message.

<Note>
  The retry uses the original arguments stored at ingestion time. If your task arguments included references to external state that has since changed, the retried execution will use the original values.
</Note>

## Response

<CodeGroup>
  ```json 200 — Success theme={null}
  {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "state": "retrying",
    "message": "Job queued for retry."
  }
  ```

  ```json 400 — Invalid state theme={null}
  {
    "error": {
      "code": "INVALID_STATE",
      "message": "Job cannot be retried from state 'active'. Retryable states: failed, cancelled.",
      "docs_url": "https://docs.sluice.sh/troubleshooting/api-errors"
    }
  }
  ```

  ```json 404 — Not found theme={null}
  {
    "error": {
      "code": "NOT_FOUND",
      "message": "Job not found.",
      "docs_url": "https://docs.sluice.sh/troubleshooting/api-errors"
    }
  }
  ```
</CodeGroup>
