Run Command

  • POST
  • /workspaces
  • /:workspace
  • /sandboxes
  • /:sandbox_id
  • /commands

Execute a command in a sandbox

Request

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

Example: "my-company"

sandbox_idrequiredstring
The ID of the sandbox

Example: "sb-1234567890abcdef"

POST 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
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
idstring
The ID of the command
commandstring
Command to execute in the sandbox
runtimestring enum
Runtime environment for command execution (default: BASH)
Allowed enum:
BASH,
JAVASCRIPT,
TYPESCRIPT,
PYTHON
statusstring enum
Command execution status
Allowed enum:
INPROGRESS,
SUCCESSFUL,
FAILED
exit_codeinteger
Command exit code
start_datestring
Command execution start date
finish_datestring
Command execution finish date
logs_urlstring
API endpoint URL to retrieve logs for this command

Last modified on Jan 26, 2026

Request example

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