Skip to main content

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:

ParameterTypeDescription
idstringLibrary 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:

ParameterTypeDescription
idstringLibrary ID or natural ID

Request Body:

FieldTypeDefaultDescription
limitinteger10Maximum number of snapshots to keep (1-100)
triggerstring"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"
}
Automatic Cleanup

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:

ParameterTypeDescription
idstringLibrary ID or natural ID
snapshotIdstring (UUID)Snapshot ID

Response:

200 OK

{
"restored": true,
"fileCount": 127
}
Destructive Operation

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:

ParameterTypeDescription
idstringLibrary ID or natural ID
snapshotIdstring (UUID)Snapshot ID

Response:

204 No Content