Leap0

Create a sandbox

Create a new sandbox from a template. The sandbox will start booting immediately. A maximum of 3 sandboxes per organization is enforced.

POST
/v1/sandbox/

Create a new sandbox from a template. The sandbox will start booting immediately. A maximum of 3 sandboxes per organization is enforced.

Authorization

BearerAuth
AuthorizationBearer <token>

API key passed as a Bearer token in the Authorization header. Alternatively, use the leap0-authorization header.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

template_name*string

Name of the template to create the sandbox from.

env_vars?

Environment variables to set in the sandbox.

mounts?array<>

Read-only object storage mounts to attach before boot. They are exposed inside the sandbox through a lazy FUSE mount, while credentials stay on the runner and are not exposed inside the sandbox.

Itemsitems <= 8
vcpu?integer

Number of virtual CPUs. Defaults to 1 if not provided.

Default1
Range1 <= value <= 8
memory?integer

Memory in MiB. Must be an even number. Defaults to 1024 if not provided.

Default1024
Formatint64
Range512 <= value <= 8192
timeout?integer

Sandbox timeout in seconds. Defaults to 300 if not provided.

Formatint64
Range1 <= value <= 28800
auto_pause?boolean

Automatically pause the sandbox into a snapshot when it reaches its timeout.

Defaultfalse
network_policy?

Network egress policy for a sandbox. When omitted, defaults to allow-all.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.leap0.dev/v1/sandbox/" \  -H "Content-Type: application/json" \  -d '{    "template_name": "my-template"  }'
{  "id": "sbx-abc123",  "template_id": "string",  "mounts": [    {      "id": "mnt-abc123",      "type": "object-storage",      "bucket": "string",      "mount_path": "string",      "prefix": "string",      "read_only": true    }  ],  "vcpu": 1,  "memory": 1,  "disk": 1,  "timeout": 1,  "state": "starting",  "auto_pause": true,  "network_policy": {    "mode": "allow-all",    "allow_domains": [      "string"    ],    "allow_cidrs": [      "string"    ],    "transforms": [      {        "domain": "string",        "inject_headers": {          "property1": "string",          "property2": "string"        },        "strip_headers": [          "string"        ]      }    ]  },  "created_at": "2019-08-24T14:15:22Z"}
{  "message": "string",  "errors": [    {      "field": "string",      "error": "string"    }  ]}
{  "message": "string"}
{  "message": "string"}