ContestDrop your site, win 2x $500 in credits.Drop your site, share it on X, win 2x $500 in credits.Enter nowEnter now

Execute Command

View as Markdown
  • POST
  • /workspaces
  • /:workspace
  • /sandboxes
  • /:sandbox_id
  • /exec

Run a command in a sandbox and return its result

Request

REQUIRED SCOPES
SANDBOX_WRITE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspace

Example: "my-company"

sandbox_idrequiredstring
The ID of the sandbox

Example: "sb-1234567890abcdef"

BODY PARAMETERS
commandrequiredstring
Command to execute in the sandbox
runtimestring enum
Runtime environment for command execution (default: BASH)
Allowed enum:
BASH,
JAVASCRIPT,
TYPESCRIPT,
PYTHON

Response

RESPONSE BODY
commandstring
Command to execute in the sandbox
runtimestring enum
Runtime environment for command execution (default: BASH)
Allowed enum:
BASH,
JAVASCRIPT,
TYPESCRIPT,
PYTHON
exit_codeinteger
Command exit code
stdoutstring
Everything the command wrote to standard output
stderrstring
Everything the command wrote to standard error

Last modified on Oct 7, 2026

Request example

curl -X POST "https://api.buddy.works/workspaces/:workspace/sandboxes/:sandbox_id/exec" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "command": "npm test", "runtime": "BASH" }'