curl --request GET \
--url https://api.blaxel.ai/v0/snapshots/{snapshotName} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blaxel.ai/v0/snapshots/{snapshotName}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blaxel.ai/v0/snapshots/{snapshotName}', 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.blaxel.ai/v0/snapshots/{snapshotName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.blaxel.ai/v0/snapshots/{snapshotName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.blaxel.ai/v0/snapshots/{snapshotName}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/snapshots/{snapshotName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"createdAt": "<string>",
"id": "snap_abc123",
"name": "my-snapshot",
"status": "ready",
"workspace": "<string>",
"createdBy": "<string>",
"sandboxName": "<string>",
"source": {
"name": "<string>",
"deleted": true,
"kind": "sandbox"
},
"spec": {
"generation": "mk2",
"image": "<string>",
"memory": 123,
"ports": [
{
"target": 8080,
"name": "http",
"protocol": "HTTP"
}
],
"region": "<string>",
"volumes": [
{
"mountPath": "/mnt/data",
"name": "my-volume",
"readOnly": false,
"sizeMb": 102400,
"type": "persistent"
}
]
}
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}Get snapshot
Returns a snapshot of the workspace by ID.
curl --request GET \
--url https://api.blaxel.ai/v0/snapshots/{snapshotName} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blaxel.ai/v0/snapshots/{snapshotName}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blaxel.ai/v0/snapshots/{snapshotName}', 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.blaxel.ai/v0/snapshots/{snapshotName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.blaxel.ai/v0/snapshots/{snapshotName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.blaxel.ai/v0/snapshots/{snapshotName}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/snapshots/{snapshotName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"createdAt": "<string>",
"id": "snap_abc123",
"name": "my-snapshot",
"status": "ready",
"workspace": "<string>",
"createdBy": "<string>",
"sandboxName": "<string>",
"source": {
"name": "<string>",
"deleted": true,
"kind": "sandbox"
},
"spec": {
"generation": "mk2",
"image": "<string>",
"memory": 123,
"ports": [
{
"target": 8080,
"name": "http",
"protocol": "HTTP"
}
],
"region": "<string>",
"volumes": [
{
"mountPath": "/mnt/data",
"name": "my-volume",
"readOnly": false,
"sizeMb": 102400,
"type": "persistent"
}
]
}
}{
"error": "Resource already exists",
"code": 409,
"message": "Invalid request body"
}Authorizations
OAuth2 authentication with JWT tokens
Path Parameters
ID of the snapshot
Response
successful operation
A point-in-time snapshot of a sandbox. It is a workspace-level object: it outlives the sandbox it was captured from, and can be restored onto a sandbox or forked into a new sandbox or application on its own.
When the snapshot was created
Identifier of the snapshot, unique in the workspace. Workspace-level routes address the snapshot by it.
"snap_abc123"
Display name of the snapshot, unique among the snapshots of the sandbox it was captured from. Defaults to the identifier.
"my-snapshot"
Status of the snapshot (pending, ready, failed)
"ready"
Workspace owning the snapshot
Who created the snapshot
Name of the source sandbox. Kept for compatibility, read source.name instead.
The object a snapshot was captured from.
Show child attributes
Show child attributes
The configuration a snapshot carries, so a sandbox or an application can be created from it once its source object is gone.
Show child attributes
Show child attributes
Was this page helpful?