Get Command Logs
GET
/v1/sandbox/{sandbox_id}/command/{cmd_id}/logsGET
/v1/sandbox/{'{sandbox_id}'}/command/{'{cmd_id}'}/logsYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Description
Returns the buffered output logs for a background command. Logs include all combined stdout and stderr lines captured during execution. This endpoint can be called while the command is still running or after it has completed.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sandbox_id | string | Yes | Sandbox ID or name |
cmd_id | string | Yes | ID of the background command whose logs to retrieve |
Responses
200 Success
| Property | Type | Description |
|---|---|---|
logs | string[] | Array of log lines captured from the command's output |
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/{cmd_id}/logs" \
-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/${cmdId}/logs`,
{
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/{cmd_id}/logs",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
)
data = response.json()Response
{
"logs": [
"line1",
"line2"
]
}{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
