> 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.

# Update a job

PATCH https://platform.labric.co/api/v1/jobs/{job_id}
Content-Type: application/json

Change a job's name, description, or code, or archive it.

Only the fields passed are changed. New code is stored as a new version of
the job's script, so earlier executions keep the version they ran. To
create a job, use create_job instead.

Requires an API key with the `write` scope.

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

## Authentication

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

## Request

### Path parameters

- `job_id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional, nullable) — New name for the job.
- `description` (string, optional, nullable) — New description for the job. Pass an empty string to clear it.
- `code` (string, optional, nullable) — New Python source for the job's script, stored as a new script version. Declare dependencies inline in a PEP 723 `# /// script` block.
- `archived` (boolean, optional, nullable) — True archives the job, hiding it from the active job list; false restores it.

## Response

### 200

OK

- `id` (string, required) — Pass this as job_id to the job execution tools.
- `name` (string, required)
- `archived` (boolean, required)
- `description` (string, optional, nullable)

## 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)

### 409 Conflict Error

Conflict

- `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

**Request**

```json
{
  "description": "Reduces each uploaded tensile test to its peak load and elongation at break. Skips specimens that slipped in the grips."
}
```

**Response**

```json
{
  "id": "8f1c2d3e-4b5a-4c6d-9e7f-0a1b2c3d4e5f",
  "name": "Tensile curve summary",
  "archived": false,
  "description": "Reduces each uploaded tensile test to its peak load and elongation at break. Skips specimens that slipped in the grips."
}
```

**SDK Code**

```python
from labric import Labric

client = Labric(
    api_key="YOUR_TOKEN_HERE",
)

client.jobs.update(
    job_id="8f1c2d3e-4b5a-4c6d-9e7f-0a1b2c3d4e5f",
    description="Reduces each uploaded tensile test to its peak load and elongation at break. Skips specimens that slipped in the grips.",
)

```