Skip to main content
GET
/
sandboxes
/
{sandbox_id}
/
commands
List Commands
curl --request GET \
  --url https://api.declaw.ai/sandboxes/{sandbox_id}/commands \
  --header 'X-API-Key: <api-key>'
{
  "[].pid": 123,
  "[].cmd": "<string>",
  "[].is_pty": true,
  "[].envs": {}
}
Returns an array of background processes that are currently tracked for the sandbox. Only commands started with background: true appear in this list. Processes are removed from the list when they complete via wait or are killed via kill.

Path Parameters

sandbox_id
string
required
The sandbox identifier. Format: sbx-<8 chars>.

Response

Returns an array of ProcessInfo objects. May be empty if no background processes are tracked.
[].pid
integer
Process ID.
[].cmd
string
The command string that was run.
[].is_pty
boolean
Whether the process was started with a pseudo-terminal.
[].envs
object
Environment variables the process was started with.

Example

curl https://api.declaw.ai/sandboxes/sbx-a1b2c3d4/commands \
  -H "X-API-Key: YOUR_API_KEY"
Response
[
  {
    "pid": 42,
    "cmd": "python3 worker.py",
    "is_pty": false
  },
  {
    "pid": 43,
    "cmd": "sleep 60",
    "is_pty": false
  }
]

Error Responses

StatusCause
401Missing or invalid API key