List Snapshots
curl --request GET \
--url https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"snapshots": [
{}
],
"snapshot_id": "<string>",
"sandbox_id": "<string>",
"source": "<string>",
"mem_blob_key": "<string>",
"vmstate_blob_key": "<string>",
"mem_size_bytes": {},
"mem_stored_bytes": {},
"vmstate_stored_bytes": {},
"overlay_stored_bytes": {},
"created_at": "<string>"
}Sandbox API
List Snapshots
List all snapshots (periodic, pause, and manual) for a sandbox, newest first.
GET
/
sandboxes
/
{sandbox_id}
/
snapshots
List Snapshots
curl --request GET \
--url https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.declaw.ai/sandboxes/{sandbox_id}/snapshots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"snapshots": [
{}
],
"snapshot_id": "<string>",
"sandbox_id": "<string>",
"source": "<string>",
"mem_blob_key": "<string>",
"vmstate_blob_key": "<string>",
"mem_size_bytes": {},
"mem_stored_bytes": {},
"vmstate_stored_bytes": {},
"overlay_stored_bytes": {},
"created_at": "<string>"
}Returns every snapshot recorded for this sandbox — periodic, pause-induced, and
manual — ordered by
created_at descending.
Ownership is enforced: the caller must be the owner of the sandbox for any
snapshot metadata to be returned.
Path Parameters
string
required
The sandbox identifier. Format:
sbx-<8 chars>.Response
Snapshot[]
Array of snapshot objects, newest first.
Snapshot object
string
Unique snapshot identifier.
string
The sandbox this snapshot belongs to.
string
How this snapshot was created:
"periodic", "pause", or "manual".string
Blob store key for the memory image.
string
Blob store key for the sandbox VM state.
integer | null
Logical size of the guest’s memory image in bytes, when recorded. This is the
VM’s RAM size, not the storage it occupies — snapshots are compressed before
they are stored, typically by 10–80x. Use the
*_stored_bytes fields below
for actual storage footprint.integer | null
Bytes actually stored for the memory image, after compression.
null for
snapshots taken before stored-byte accounting existed.integer | null
Bytes actually stored for the VM state, after compression.
integer | null
Bytes actually stored for the disk overlay, after compression. The overlay is
copy-on-write, so this reflects only what the sandbox wrote — not its
provisioned disk size.
string
UTC timestamp when the snapshot was created.
Example
curl "https://api.declaw.ai/sandboxes/sbx-a1b2c3d4/snapshots" \
-H "X-API-Key: YOUR_API_KEY"
from declaw import Sandbox
sbx = Sandbox.connect("sbx-a1b2c3d4", api_key="YOUR_API_KEY", domain="api.declaw.ai")
for snap in sbx.list_snapshots():
print(snap.snapshot_id, snap.source, snap.created_at)
import { Sandbox } from "@declaw/sdk";
const sbx = await Sandbox.connect("sbx-a1b2c3d4", {
apiKey: "YOUR_API_KEY",
domain: "api.declaw.ai",
});
for (const snap of await sbx.listSnapshots()) {
console.log(snap.snapshotId, snap.source, snap.createdAt);
}
Response
{
"snapshots": [
{
"snapshot_id": "snap-a1b2c3d4",
"sandbox_id": "sbx-a1b2c3d4",
"source": "manual",
"mem_blob_key": "snapshots/.../mem",
"vmstate_blob_key": "snapshots/.../state",
"mem_size_bytes": 268435456,
"mem_stored_bytes": 20722117,
"vmstate_stored_bytes": 2167,
"overlay_stored_bytes": 5239084,
"created_at": "2026-04-14T10:30:00Z"
}
]
}
Error Responses
| Status | Cause |
|---|---|
401 | Missing or invalid API key |
404 | Sandbox not found |
500 | Internal error listing snapshots |