Execute Command

circle-info

POST /v1/sandboxes/{id}/execute

Try it

Response example (200)
{
  "id": "exec_m1n2o3p4q5r6s7t8",
  "status": "completed",
  "exit_code": 0,
  "stdout": "Hello, World!\n",
  "stderr": "",
  "execution_time_ms": 142,
  "created_at": "2024-01-15T12:30:00Z",
  "completed_at": "2024-01-15T12:30:00.142Z"
}

Authorizations

  • Name: x-api-key

    • Type: string (header)

    • Required: yes

    • Description: API key provided in the x-api-key header. Required.


Path Parameters

  • id (string) — required Sandbox ID


Body (application/json)

  • command (string) — required Command to execute (full CLI command, supports shell features like redirection, pipes, etc.)

  • env (object) — optional Environment variables

    • Child attributes: env.{key} (string)

  • timeout (integer) — optional

    • Default: 30

    • Execution timeout in seconds

    • Required range: 1 < x < 300

  • working_dir (string) — optional Working directory for execution


Response (200 - application/json)

  • id (string) — required Execution ID

  • status (enum) — required Execution status. Available options: running, completed, timeout, error

  • exit_code (integer) — required Exit code

  • stdout (string) — required Standard output

  • stderr (string) — required Standard error output

  • execution_time_ms (integer) — required Execution time in milliseconds

  • created_at (string) — required Execution start timestamp

  • completed_at (string) — required Execution completion timestamp

Last updated