---
title: "Rollback Job"
method: PATCH
path: "/v2/jobs/{job_id}/rollback"
tags: ["jobs"]
---

# Rollback Job

`PATCH /v2/jobs/{job_id}/rollback`

Rollback a completed/failed indexing job — removes all indexed data (RDS + Turbopuffer).

Behavior:
- If job is RUNNING: returns 409 Conflict — cancel it first
- If job is in terminal state (SUCCEEDED/FAILED/ABORTED/TIMED_OUT): deletes all data
- If job not found: returns 404

Returns:
- job_id: The job identifier
- status: "rolled_back" or "error"
- files_removed: List of file names that were removed
- rolled_back_at: Timestamp of rollback

Authentication: Requires Bearer token in Authorization header

## Path parameters

- `job_id` string, required

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- JobRollbackResponse
  - `files_removed` string[], nullable
  - `job_id` string, required
  - `message` string, nullable
  - `rolled_back_at` string, nullable
  - `status` string, required

---

[API](https://skmtc.dev/runcaptain/apis/api-reference.md) · [All operations](https://skmtc.dev/runcaptain/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runcaptain/api-reference/revisions/fe4649e3f4aa/schema)
