Skip to main content
Snapshots are point-in-time backups stored in repositories. Each snapshot contains files from a backup job and includes metadata like tags, duration, and retention categories.

List Snapshots

curl -X GET "http://localhost:4096/api/v1/repositories/{shortId}/snapshots?backupId=abc123" \
  -H "Cookie: zerobyte.session=..."
List all snapshots in a repository, optionally filtered by backup schedule. Parameters:
shortId
string
required
Repository short ID
backupId
string
Filter by backup schedule short ID
Response:
snapshots
array

Get Snapshot Details

curl -X GET http://localhost:4096/api/v1/repositories/{shortId}/snapshots/{snapshotId} \
  -H "Cookie: zerobyte.session=..."
Get detailed information about a specific snapshot. Parameters:
shortId
string
required
Repository short ID
snapshotId
string
required
Snapshot ID or short ID
Response: Returns a snapshot object (same structure as list response).

Refresh Snapshots

curl -X POST http://localhost:4096/api/v1/repositories/{shortId}/snapshots/refresh \
  -H "Cookie: zerobyte.session=..."
Clear snapshot cache and force refresh from repository. Parameters:
shortId
string
required
Repository short ID
Response:
message
string
Success message
count
number
Number of snapshots refreshed

List Snapshot Files

curl -X GET "http://localhost:4096/api/v1/repositories/{shortId}/snapshots/{snapshotId}/files?path=/data&offset=0&limit=500" \
  -H "Cookie: zerobyte.session=..."
List files and directories within a snapshot. Parameters:
shortId
string
required
Repository short ID
snapshotId
string
required
Snapshot ID
path
string
Directory path to list (URL-encoded)
offset
integer
default:"0"
Pagination offset
limit
integer
default:"500"
Items per page (max: 1000)
Response:
snapshot
object
Snapshot metadata
files
array
File and directory entries
offset
number
Current offset
limit
number
Current limit
total
number
Total number of entries
hasMore
boolean
Whether more entries are available

Download Snapshot Files

curl -X GET "http://localhost:4096/api/v1/repositories/{shortId}/snapshots/{snapshotId}/dump?path=/data/file.txt&kind=file" \
  -H "Cookie: zerobyte.session=..." \
  -o downloaded-file.txt
Download files or directories from a snapshot as a stream. Parameters:
shortId
string
required
Repository short ID
snapshotId
string
required
Snapshot ID
path
string
File or directory path to download
kind
string
Path type: “file” (raw stream) or “dir” (tar archive)
Response:
  • For files: Raw file stream with Content-Type: application/octet-stream
  • For directories: Tar archive with Content-Type: application/x-tar
The Content-Disposition header includes the appropriate filename.

Restore Snapshot

curl -X POST http://localhost:4096/api/v1/repositories/{shortId}/restore \
  -H "Cookie: zerobyte.session=..." \
  -H "Content-Type: application/json" \
  -d '{
    "snapshotId": "abc12345",
    "targetPath": "/mnt/restore",
    "include": ["/data/*"],
    "exclude": ["*.tmp"],
    "overwrite": "always"
  }'
Restore a snapshot to a target path on the filesystem. Parameters:
shortId
string
required
Repository short ID
Request Body:
snapshotId
string
required
Snapshot ID to restore
targetPath
string
Target filesystem path (defaults to original location)
include
string[]
Patterns to include (glob patterns)
exclude
string[]
Patterns to exclude (glob patterns)
excludeXattr
string[]
Extended attributes to exclude
delete
boolean
Delete extra files not in snapshot
overwrite
string
Overwrite mode: “always”, “never”, or “if-newer”
Response:
success
boolean
Whether restore succeeded
message
string
Result message
filesRestored
number
Number of files restored
filesSkipped
number
Number of files skipped

Delete Snapshot

curl -X DELETE http://localhost:4096/api/v1/repositories/{shortId}/snapshots/{snapshotId} \
  -H "Cookie: zerobyte.session=..."
Delete a specific snapshot. Parameters:
shortId
string
required
Repository short ID
snapshotId
string
required
Snapshot ID to delete
Response:
message
string
Success message

Delete Multiple Snapshots

curl -X DELETE http://localhost:4096/api/v1/repositories/{shortId}/snapshots \
  -H "Cookie: zerobyte.session=..." \
  -H "Content-Type: application/json" \
  -d '{
    "snapshotIds": ["abc123", "def456"]
  }'
Delete multiple snapshots in a single operation. Parameters:
shortId
string
required
Repository short ID
Request Body:
snapshotIds
string[]
required
Array of snapshot IDs to delete (minimum 1)
Response:
message
string
Success message

Tag Snapshots

curl -X POST http://localhost:4096/api/v1/repositories/{shortId}/snapshots/tag \
  -H "Cookie: zerobyte.session=..." \
  -H "Content-Type: application/json" \
  -d '{
    "snapshotIds": ["abc123", "def456"],
    "add": ["production", "important"],
    "remove": ["test"]
  }'
Add, remove, or set tags on multiple snapshots. Parameters:
shortId
string
required
Repository short ID
Request Body:
snapshotIds
string[]
required
Array of snapshot IDs (minimum 1)
add
string[]
Tags to add
remove
string[]
Tags to remove
set
string[]
Replace all tags with this list
Response:
message
string
Success message

Build docs developers (and LLMs) love