Docs
Snapshots and forks ›

Create snapshot

POST/v1/sandboxes/{id}/snapshots

Take a snapshot.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. const snapshot = await sandbox.snapshot("before-upgrade");
Answer201 Created · Snapshot
  1. {
  2. "id": string,
  3. "sandboxId": string,
  4. "name": string,
  5. "createdAt": string,
  6. "browsable": boolean,
  7. "size": string | null,
  8. "sandboxDeleted": boolean,
  9. }

Snapshot taken: the sandbox as it is now, kept to roll back to.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Body

namerequired
string

Returns

201 Snapshot taken: the sandbox as it is now, kept to roll back to. The sandbox may be running or stopped, and is left as it was.

Snapshot7 fields
id
string
sandboxId
string
name
string
createdAt
string
browsable
boolean
Whether the files in it can be listed and downloaded.
More False for a snapshot of the whole machine: roll back to it to reach them.
size
stringnull
The size of the sandbox it was taken of.
More A sandbox made from it gets this size unless another, with no less disk, is asked for.
sandboxDeleted
boolean
Whether the sandbox it was taken of has been deleted.
More The snapshot is kept either way, and a new sandbox can still be made from it.

Errors and other answers

404 Not found.
409 snapshot_limit_reached, or capacity_exceeded when there is no disk free to keep another.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.