Leap0

Restore a snapshot

Create a new sandbox from a previously saved snapshot. The restored sandbox reuses the snapshot's template, CPU, memory, and disk settings. `timeout` auto-pause behavior and network policy can be overridden at restore time.

POST
/v1/snapshot/restore

Create a new sandbox from a previously saved snapshot. The restored sandbox reuses the snapshot's template, CPU, memory, and disk settings. timeout auto-pause behavior and network policy can be overridden at restore time.

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.

snapshot_name*string

Name of the snapshot to restore.

timeout?integer

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

Formatint64
Range1 <= value <= 28800
auto_pause?boolean

Enable auto-pause for the restored sandbox.

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

application/json

application/json

curl -X POST "https://api.leap0.dev/v1/snapshot/restore" \  -H "Content-Type: application/json" \  -d '{    "snapshot_name": "workspace-warm"  }'
{  "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"}
{  "message": "string"}
{  "message": "string"}