Everstack
API ReferenceSandboxGet Command Logs

Get Command Logs

GET/v1/sandbox/{sandbox_id}/command/{cmd_id}/logs
GET/v1/sandbox/{'{sandbox_id}'}/command/{'{cmd_id}'}/logs

Your 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

ParameterTypeRequiredDescription
sandbox_idstringYesSandbox ID or name
cmd_idstringYesID of the background command whose logs to retrieve

Responses

200 Success

PropertyTypeDescription
logsstring[]Array of log lines captured from the command's output

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

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"
    }
  ]
}