Skip to content
Dashboard

Execute command (synchronous)

POST/computers/{id}/exec/sync

Execute a shell command and wait for completion, returning buffered stdout/stderr.

Path ParametersExpand Collapse
id: string
Body ParametersJSONExpand Collapse
command: optional string
cwd: optional string
env: optional map[string]
timeout_seconds: optional number
ReturnsExpand Collapse
exit_code: optional number
stderr: optional string
stdout: optional string

Execute command (synchronous)

curl https://api.tzafon.ai/computers/$ID/exec/sync \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TZAFON_API_KEY" \
    -d '{}'
{
  "exit_code": 0,
  "stderr": "stderr",
  "stdout": "stdout"
}
Returns Examples
{
  "exit_code": 0,
  "stderr": "stderr",
  "stdout": "stdout"
}