---
title: "Read an agent computer job – Superbot API"
canonical_url: "https://superbot.gg/developers/devices/getAgentJob"
summary: "The job and, once it is `done` or `failed`, its result. `wait` (seconds, at most 25) parks the read until the job settles. A job lost to a Superbot restart answers 410 `job_lost_in_restart` (`retryable: true`, `kind`): it may have run on the agent computer, so check before repeating anything that changes state, then send it again. An id nobody minted, another account's, or older than the 600 s job lifetime is 404 `job_not_found`."
---

> Markdown of https://superbot.gg/developers/devices/getAgentJob. Site index: /llms.txt.

# Read an agent computer job

`GET /v1/devices/{device_id}/jobs/{job_id}`

The job and, once it is `done` or `failed`, its result. `wait` (seconds, at most 25) parks the read until the job settles. A job lost to a Superbot restart answers 410 `job_lost_in_restart` (`retryable: true`, `kind`): it may have run on the agent computer, so check before repeating anything that changes state, then send it again. An id nobody minted, another account's, or older than the 600 s job lifetime is 404 `job_not_found`.

- Operation id: `getAgentJob`
- Group: [Devices](https://superbot.gg/developers/devices.md)
- Auth: A caller key holding `devices:read` (`Authorization: Bearer sbc_…` or `x-api-key: sbc_…`), or a signed-in session.
- Scopes: `devices:read`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `device_id` | string | required | An agent computer (`agt_…`) on your account. |
| `job_id` | string | required | The job id the enqueue answered. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `wait` | string | optional | Seconds to wait for the job to settle, 0-25. |

## Response 200

The job.

`application/json`: AgentJobView.

- `job_id` (string, required)
- `device_id` (string, required)
- `kind` (AgentJobKind, required): The device-shell job kinds a first-party device may run on an agent computer. One of `bash`, `bash_write`, `bash_output`, `bash_kill`, `bash_resize`, `read`, `write`, `glob`, `grep`.
- `state` (AgentJobState, required): `queued_asleep`: the agent computer has no open poll; the job waits for its next poll inside the 600 s TTL. `expired`: the TTL ran out before a result. One of `queued`, `queued_asleep`, `claimed`, `done`, `failed`, `expired`.
- `created_at` (string, required)
- `expires_at` (string, required)
- `result` (AgentJobResult): Present once the state is `done` or `failed`.
  - `ok` (boolean, required)
  - `content` (any)
  - `error` (object)
    - `code` (string, required)
    - `message` (string, required)

## Errors

Every refusal carries `error`, `message`, `doc_url` and `request_id`; the gateway routes answer in the dialect you dialed.

| Status | Codes | When |
| --- | --- | --- |
| 400 | [`invalid_request`](https://superbot.gg/developers#errors-invalid_request) | The request is malformed or a parameter is invalid; `param` names the field. |
| 401 | [`unauthorized`](https://superbot.gg/developers#errors-unauthorized) | The bearer is missing, malformed or unknown. |
| 403 | [`insufficient_scope`](https://superbot.gg/developers#errors-insufficient_scope) | The key lacks a scope (insufficient_scope), is revoked, or may not call this route. |
| 404 | [`not_found`](https://superbot.gg/developers#errors-not_found) | No such resource on this account. |
| 410 | `job_lost_in_restart` | Superbot restarted after the job was queued and its outcome was not kept (`job_lost_in_restart`, `retryable: true`, `kind`). Send the job again once a repeat is safe. |

## Examples

```sh
curl -sS -X GET "https://superbot.gg/v1/devices/$DEVICE_ID/jobs/$JOB_ID" \
  -H "Authorization: Bearer $SUPERBOT_API_KEY"
```

```js
const deviceId = 'DEVICE_ID';
const jobId = 'JOB_ID';
const res = await fetch(`https://superbot.gg/v1/devices/${deviceId}/jobs/${jobId}`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.SUPERBOT_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

```python
import os
import requests

device_id = "DEVICE_ID"
job_id = "JOB_ID"
res = requests.request(
    "GET",
    f"https://superbot.gg/v1/devices/{device_id}/jobs/{job_id}",
    headers={
        "Authorization": f"Bearer {os.environ['SUPERBOT_API_KEY']}",
    },
)
print(res.status_code, res.json())
```
