# REST API: Jobs

> The 3 operations of the area Jobs, with parameters, bodies and responses.

Source: https://pithyx.org/docs/reference/api/jobs/
Markdown: https://pithyx.org/docs/reference/api/jobs.md

Generated from the daemon's OpenAPI document. Conventions, sign-in, the CSRF header and the WebSocket are on [API](https://pithyx.org/docs/developers/daemon/api/).

## GET /api/jobs

The signed-in user's 100 most recent jobs, newest first. Finished jobs are kept for 7 days. Live progress comes on the topic jobs/{id}.

**Responses**

- 200: `application/json`: [Job](https://pithyx.org/docs/reference/api/schemas/#job)[]

Any failure answers with problem details (`application/problem+json`) and a stable code from the [error reference](https://pithyx.org/docs/reference/errors/).

## GET /api/jobs/{id}

A job of the signed-in user; administrators can read every job. Others get 404 jobs.job.not_found.

**Parameters**

| Name | In   | Type            | Required | Description |
| ---- | ---- | --------------- | -------- | ----------- |
| `id` | path | integer (int64) | yes      |             |

**Responses**

- 200: `application/json`: [Job](https://pithyx.org/docs/reference/api/schemas/#job)

Any failure answers with problem details (`application/problem+json`) and a stable code from the [error reference](https://pithyx.org/docs/reference/errors/).

## POST /api/jobs/{id}/cancel

Cancels a queued job right away and asks a running one to stop; it ends as cancelled once its work gives up. Cancelling a finished job changes nothing.

**Parameters**

| Name | In   | Type            | Required | Description |
| ---- | ---- | --------------- | -------- | ----------- |
| `id` | path | integer (int64) | yes      |             |

**Responses**

- 204

Any failure answers with problem details (`application/problem+json`) and a stable code from the [error reference](https://pithyx.org/docs/reference/errors/).
