Get Background Command Status
GET
/v1/sandbox/{sandbox_id}/command/status/{cmd_id}GET
/v1/sandbox/{'{sandbox_id}'}/command/status/{'{cmd_id}'}Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Description
Retrieves the current status of a background command that was launched with background: true. Use this endpoint to poll for completion and obtain the exit code once the command finishes.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sandbox_id | string | Yes | Sandbox ID or name |
cmd_id | string | Yes | ID of the background command to query |
Responses
200 Success
| Property | Type | Description |
|---|---|---|
id | string | Unique ID of the background command |
sandbox_id | string | ID of the sandbox the command is running in |
command | string | The shell command that was executed |
cwd | string | Working directory the command was run from |
running | boolean | Whether the command is currently running |
exit_code | integer | null | Exit code of the command. null while still running |
started_at | string | ISO 8601 timestamp when the command started |
finished_at | string | null | ISO 8601 timestamp when the command finished. null while still running |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
Request
curl -X GET "https://{instance}.{region}.everstack.ai/v1/sandbox/{sandbox_id}/command/status/{cmd_id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"const sandboxId = "your-sandbox-id";
const cmdId = "cmd_abc123";
const response = await fetch(
`https://{instance}.{region}.everstack.ai/v1/sandbox/${sandboxId}/command/status/${cmdId}`,
{
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
}
);
const data = await response.json();import requests
sandbox_id = "your-sandbox-id"
cmd_id = "cmd_abc123"
response = requests.get(
f"https://{instance}.{region}.everstack.ai/v1/sandbox/{sandbox_id}/command/status/{cmd_id}",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
)
data = response.json()Response
{
"id": "string",
"sandbox_id": "string",
"command": "string",
"cwd": "string",
"running": true,
"exit_code": null,
"started_at": "string",
"finished_at": null
}{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
