POST
/
process
Execute a command
curl --request POST \
  --url https://run.blaxel.ai/{workspace_id}/sandboxes/{sandbox_id}/process \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "command": "ls -la",
  "env": {
    "{\"PORT\"": " \"3000\"}"
  },
  "name": "my-process",
  "timeout": 30,
  "waitForCompletion": false,
  "waitForPorts": [
    3000,
    8080
  ],
  "workingDir": "/home/user"
}'
{
  "command": "ls -la",
  "completedAt": "Wed, 01 Jan 2023 12:01:00 GMT",
  "exitCode": 0,
  "logs": "logs output",
  "name": "my-process",
  "pid": "1234",
  "startedAt": "Wed, 01 Jan 2023 12:00:00 GMT",
  "status": "running",
  "workingDir": "/home/user"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Process execution request

command
string
required
Example:

"ls -la"

env
object
Example:
{ "{\"PORT\"": " \"3000\"}" }
name
string
Example:

"my-process"

timeout
integer
Example:

30

waitForCompletion
boolean
Example:

false

waitForPorts
integer[]
Example:
[3000, 8080]
workingDir
string
Example:

"/home/user"

Response

Process information

command
string
required
Example:

"ls -la"

completedAt
string
required
Example:

"Wed, 01 Jan 2023 12:01:00 GMT"

exitCode
integer
required
Example:

0

logs
string
required
Example:

"logs output"

name
string
required
Example:

"my-process"

pid
string
required
Example:

"1234"

startedAt
string
required
Example:

"Wed, 01 Jan 2023 12:00:00 GMT"

status
enum<string>
required
Available options:
failed,
killed,
stopped,
running,
completed
Example:

"running"

workingDir
string
required
Example:

"/home/user"