Sandbox

Execute code

Run a script in a secure, isolated environment. Scripts can read from stdin and write to stdout or stderr. They can access input files, environment variables and command line arguments.

post/v1/execute

Request body

allow_http_hostsstring[]

List of allowed hosts for HTTP requests.

argsstring[]

List of command line arguments to pass to the script.

codestring required

The code to execute.

envobject

Set of key-value pairs to add to the script's execution environment.

language'PYTHON' | 'JAVASCRIPT' | 'TYPESCRIPT' | 'RUBY' | 'PHP'

The interpreter to use when executing code.

revisionstring
runtimestring

The runtime to use when executing code. Deprecated in favor of runtime_revision_id.

runtime_revision_idstring

The ID of the runtime revision to use when executing code.

stdinstring

Input made available to the script via 'stdin'.

Response

OK

exit_codeinteger

The exit code returned by the script. Will often be '0' on success and non-zero on failure.

stderrstring

The contents of 'stderr' after executing the script.

stdoutstring

The contents of 'stdout' after executing the script.

Changes