> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.labric.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.labric.co/_mcp/server.

# Revert a job execution

POST https://platform.labric.co/api/v1/job-executions/{execution_id}/revert

Revert a job execution by deleting the rows it created.

Deletes the execution's created objects and their linked raw rows in one
transaction, for undoing a test write that failed validation. Updates and
deletes cannot be reversed and are reported as warnings in the result.

Requires an API key with the `write` scope.

Reference: https://docs.labric.co/api-reference/labric-api/jobs/revert

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `execution_id` (string, required)

## Response

### 200

OK

- `deleted_count` (integer, required)
- `raws_deleted_count` (integer, required)
- `skipped_count` (integer, required)
- `warnings` (list of string, required)

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (string, required)

### 401 Unauthorized Error

Unauthorized

- `detail` (string, required)

### 403 Forbidden Error

Forbidden

- `detail` (string, required)

### 404 Not Found Error

Not Found

- `detail` (string, required)

### 422 Unprocessable Entity Error

Unprocessable Content

- `detail` (list of map from string to any, required)

### 500 Internal Server Error

Internal Server Error

- `detail` (string, required)

## Examples

**Response**

```json
{
  "deleted_count": 12,
  "raws_deleted_count": 24,
  "skipped_count": 3,
  "warnings": [
    "Update operations cannot be reverted and were skipped.",
    "Delete operations detected and skipped during revert."
  ]
}
```

**SDK Code**

```python
from labric import Labric

client = Labric(
    api_key="YOUR_TOKEN_HERE",
)

client.jobs.revert(
    execution_id="7d4a1f2b-3c5e-4d6f-8a9b-0c1d2e3f4a5b",
)

```