List database snapshots
List a database’s snapshots, newest first, with GET /v2/databases//snapshots: size, date, download URL and the IDs to restore each one.
GET
/
v2
/
databases
/
{database_id}
/
snapshots
List database snapshots
curl --request GET \
--url https://api.squarecloud.app/v2/databases/{database_id}/snapshots \
--header 'Authorization: <authorization>'import requests
url = "https://api.squarecloud.app/v2/databases/{database_id}/snapshots"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.squarecloud.app/v2/databases/{database_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.squarecloud.app/v2/databases/{database_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 => [
"Authorization: <authorization>"
],
]);
$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.squarecloud.app/v2/databases/{database_id}/snapshots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.squarecloud.app/v2/databases/{database_id}/snapshots")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.squarecloud.app/v2/databases/{database_id}/snapshots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status":"success",
"response":[
{
"name":"a14b8d5e1cb7405a851eb4c075506121_mongo_manual",
"size":10644463,
"modified":"2025-08-13T13:29:11.263Z",
"key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=VZ03MSxcNw3%2FtPezXv0IhTs0jq4%3D&versionId=45ec0b49-9af6-445e-a55c-abd7ec5278b2",
"version_id":"45ec0b49-9af6-445e-a55c-abd7ec5278b2",
"url":"https://snapshots.squarecloud.app/databases/<account_id>/<name>.zip?<signed-query-string>",
"runtime":"mongo",
"origin":"manual"
},
{
"name":"a14b8d5e1cb7405a851eb4c075506121_mongo_automatic",
"size":2742383,
"modified":"2025-08-13T00:01:47.010Z",
"key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=7zw5apjyaOd1xPZl3gRgp8Y4yEs%3D&versionId=f65e1378-8717-45c5-8aec-bb233eedb5ce",
"version_id":"f65e1378-8717-45c5-8aec-bb233eedb5ce",
"url":"https://snapshots.squarecloud.app/databases/<account_id>/<name>.zip?<signed-query-string>",
"runtime":"mongo",
"origin":"automatic"
}
]
}
string
required
The API key for your account. You can find this in your account settings.
snapshots:read scope.
Lists every snapshot stored for a database, most recent first, with size and last-modified date for each. Use it to build a restore picker in a dashboard, or to poll after a Create Snapshot call returned 202 SNAPSHOT_PROCESSING and confirm the file has landed.
Each item carries a signed download url, valid for 30 days, and a version_id to pass as versionId when restoring. Responses are cached for 30 minutes per user and database, so a snapshot that just finished generating may take a short while to show up here. To restore one of these snapshots, see Restore Snapshot.
Parameters
string
required
The ID of the database.
Response
string
Indicates whether the call was successful:
success if it was, error if not.array
The contents of the response.
Show Toggle object
Show Toggle object
string
The snapshot’s name: the database ID suffixed with
_<type> and, on newer snapshots, _<origin>. Pass it unchanged as snapshotId when restoring.number
Size of the backup in bytes.
string
Date of the last modification of the backup.
string
The signed query string of the download URL.
string
The snapshot’s version. Pass it as
versionId when restoring.string
A signed URL that downloads the snapshot, valid for 30 days.
string | null
Runtime the snapshot was taken from: the application’s language (
javascript, python, rust…) or the database engine (mongo, mysql, postgres, redis). null on snapshots taken before this field existed.string | null
How the snapshot was created:
manual (requested through the API, dashboard or CLI) or automatic (the daily scheduled snapshot). null on older snapshots.{
"status":"success",
"response":[
{
"name":"a14b8d5e1cb7405a851eb4c075506121_mongo_manual",
"size":10644463,
"modified":"2025-08-13T13:29:11.263Z",
"key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=VZ03MSxcNw3%2FtPezXv0IhTs0jq4%3D&versionId=45ec0b49-9af6-445e-a55c-abd7ec5278b2",
"version_id":"45ec0b49-9af6-445e-a55c-abd7ec5278b2",
"url":"https://snapshots.squarecloud.app/databases/<account_id>/<name>.zip?<signed-query-string>",
"runtime":"mongo",
"origin":"manual"
},
{
"name":"a14b8d5e1cb7405a851eb4c075506121_mongo_automatic",
"size":2742383,
"modified":"2025-08-13T00:01:47.010Z",
"key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=7zw5apjyaOd1xPZl3gRgp8Y4yEs%3D&versionId=f65e1378-8717-45c5-8aec-bb233eedb5ce",
"version_id":"f65e1378-8717-45c5-8aec-bb233eedb5ce",
"url":"https://snapshots.squarecloud.app/databases/<account_id>/<name>.zip?<signed-query-string>",
"runtime":"mongo",
"origin":"automatic"
}
]
}
Download a snapshot from its
url. The link stays valid for 30 days.Common errors
| Code | HTTP | Meaning |
|---|---|---|
DATABASE_NOT_FOUND | 404 | The database does not exist or is not owned by the caller. |
Related
- CLI:
squarecloud db snapshot list - SDKs:
api.databases.snapshots.list()(JavaScript),client.databases.snapshots.list()(Python),c.Databases.Snapshots.List()(Go)
⌘I
List database snapshots
curl --request GET \
--url https://api.squarecloud.app/v2/databases/{database_id}/snapshots \
--header 'Authorization: <authorization>'import requests
url = "https://api.squarecloud.app/v2/databases/{database_id}/snapshots"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.squarecloud.app/v2/databases/{database_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.squarecloud.app/v2/databases/{database_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 => [
"Authorization: <authorization>"
],
]);
$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.squarecloud.app/v2/databases/{database_id}/snapshots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.squarecloud.app/v2/databases/{database_id}/snapshots")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.squarecloud.app/v2/databases/{database_id}/snapshots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status":"success",
"response":[
{
"name":"a14b8d5e1cb7405a851eb4c075506121_mongo_manual",
"size":10644463,
"modified":"2025-08-13T13:29:11.263Z",
"key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=VZ03MSxcNw3%2FtPezXv0IhTs0jq4%3D&versionId=45ec0b49-9af6-445e-a55c-abd7ec5278b2",
"version_id":"45ec0b49-9af6-445e-a55c-abd7ec5278b2",
"url":"https://snapshots.squarecloud.app/databases/<account_id>/<name>.zip?<signed-query-string>",
"runtime":"mongo",
"origin":"manual"
},
{
"name":"a14b8d5e1cb7405a851eb4c075506121_mongo_automatic",
"size":2742383,
"modified":"2025-08-13T00:01:47.010Z",
"key":"AWSAccessKeyId=accesskey&Expires=1757683751&Signature=7zw5apjyaOd1xPZl3gRgp8Y4yEs%3D&versionId=f65e1378-8717-45c5-8aec-bb233eedb5ce",
"version_id":"f65e1378-8717-45c5-8aec-bb233eedb5ce",
"url":"https://snapshots.squarecloud.app/databases/<account_id>/<name>.zip?<signed-query-string>",
"runtime":"mongo",
"origin":"automatic"
}
]
}

