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:
Filter by backup schedule short ID
Response:
Snapshot creation timestamp (milliseconds)
Backup duration in seconds
Retention categories (e.g., “daily”, “weekly”)
Hostname where backup was created
Restic backup summary with detailed statistics
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:
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:
Response:
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:
Directory path to list (URL-encoded)
Items per page (max: 1000)
Response:
File and directory entries Entry type (“file”, “dir”, etc.)
Modification time (ISO 8601)
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:
File or directory path to download
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:
Request Body:
Target filesystem path (defaults to original location)
Patterns to include (glob patterns)
Patterns to exclude (glob patterns)
Extended attributes to exclude
Delete extra files not in snapshot
Overwrite mode: “always”, “never”, or “if-newer”
Response:
Whether restore succeeded
Delete Snapshot
curl -X DELETE http://localhost:4096/api/v1/repositories/{shortId}/snapshots/{snapshotId} \
-H "Cookie: zerobyte.session=..."
Delete a specific snapshot.
Parameters:
Response:
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:
Request Body:
Array of snapshot IDs to delete (minimum 1)
Response:
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:
Request Body:
Array of snapshot IDs (minimum 1)
Replace all tags with this list
Response: