Snapshots
Library versioning through point-in-time snapshots with restore capability.
GET /api/libraries/{id}/snapshots
List all snapshots for a library.
Authentication: Required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
Response:
[
{
"id": "snapshot-uuid-123",
"trigger": "manual",
"createdAt": "2024-02-09T10:00:00Z",
"fileCount": 127
},
{
"id": "snapshot-uuid-456",
"trigger": "scheduled",
"createdAt": "2024-02-08T10:00:00Z",
"fileCount": 125
}
]
POST /api/libraries/{id}/snapshots
Create a new snapshot of the library.
Authentication: Required
Permissions: Requires library:write permission
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
Request Body:
| Field | Type | Default | Description |
|---|---|---|---|
limit | integer | 10 | Maximum number of snapshots to keep (1-100) |
trigger | string | "manual" | Trigger type: manual, refresh, scheduled |
Example:
{
"limit": 10,
"trigger": "manual"
}
Response:
201 Created
{
"id": "snapshot-uuid-789",
"fileCount": 127,
"trigger": "manual",
"createdAt": "2024-02-09T12:00:00Z"
}
If the snapshot count exceeds limit, the oldest snapshots are automatically deleted to maintain the limit.
POST /api/libraries/{id}/snapshots/{snapshotId}/_restore
Restore the library to a previous snapshot state.
Authentication: Required
Permissions: Requires library:write permission
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
snapshotId | string (UUID) | Snapshot ID |
Response:
200 OK
{
"restored": true,
"fileCount": 127
}
Restoring a snapshot deletes all current files in the library and replaces them with the snapshot's files. This cannot be undone unless you create a snapshot beforehand.
DELETE /api/libraries/{id}/snapshots/{snapshotId}
Delete a specific snapshot.
Authentication: Required
Permissions: Requires library:write permission
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
snapshotId | string (UUID) | Snapshot ID |
Response:
204 No Content