# Get detached command status and logs

`GET https://sandboxer.com/api/v1/sandboxes/{sandboxId}/commands/{processId}`

Without offsets, the answer holds the end of each log. With `stdoutOffset` or `stderrOffset`, it holds only the output written since those byte offsets, so each poll returns only new output. A sandbox agent too old for offsets answers 409 `agent_outdated`.

## Parameters

| Name | In | Required | Description |
| - | - | - | - |
| `sandboxId` | path | yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `processId` | path | yes | Process id returned by a detached command start. |
| `tailBytes` | query | no | Cap each returned log to its last N bytes. Defaults to 8388608 (8 MiB). Ignored with offsets. |
| `stdoutOffset` | query | no | Return only stdout written from this byte offset. Use `stdoutNextOffset` of the previous answer. |
| `stderrOffset` | query | no | Return only stderr written from this byte offset. Use `stderrNextOffset` of the previous answer. |

## Responses

- `200` Process status and log tails, or the output since the offsets. (`CommandStatusResponse`)
- `400` Invalid request body or parameters. (`ErrorEnvelope`)
- `401` Missing or invalid bearer token. (`ErrorEnvelope`)
- `404` Resource not found. (`ErrorEnvelope`)
- `409` Request conflicts with current account or sandbox state. (`ErrorEnvelope`)
