Skip to main content
POST
Run a sandbox command

Authorizations

Authorization
string
header
required

Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.

Path Parameters

app_id
string
required

ID of the app whose sandbox to operate on.

Body

application/json
command
string
required

Shell command to execute via bash inside the sandbox.

Required string length: 1 - 100000
branch_id
string | null

Optional Base44 branch ID. Omit to operate on main.

cwd
string | null

Working dir relative to the app root. cd does not persist across calls — use this or chain commands.

timeout_ms
integer
default:120000

Timeout in milliseconds (default 120000, max 600000).

Required range: 1 <= x <= 600000

Response

The command ran. Read exit_code for its result.

What a command left behind.

stdout
string
required

Everything the command wrote to standard output.

Example:

"added 12 packages in 3s\n"

stderr
string
required

Everything the command wrote to standard error. Populated on success too, since many tools log there.

Example:

""

exit_code
integer
required

The command's exit status. 0 means success. A non-zero status is still a 200 from this endpoint: the command ran and failed, which is not a request error.

Example:

0

truncated
boolean
required

true when the output hit the 1 MB cap and was cut short. stdout and stderr are each capped, and either one hitting it sets this.

Example:

false

duration_ms
integer
required

How long the command took, in milliseconds.

Example:

3120

unsaved_large_files
UnsavedLargeFile · object[]
required

Files in the app over the 32 MiB per-file limit. They can't be saved to the app's code, so they stay in the sandbox only: the published app doesn't have them, and they're lost if the sandbox is rebuilt. Checked after commands that can change files; empty after read-only ones.

Example: