Create a manual PCD snapshot
const url = 'https://example.com/api/v1/pcd/1/snapshots';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"description":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/pcd/1/snapshots \ --header 'Content-Type: application/json' \ --data '{ "description": "example" }'Creates a manual snapshot of the current PCD database state. The snapshot captures ops metadata and a state fingerprint for future restore operations.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”PCD database ID
Request Body
Section titled “Request Body”Request body for creating a manual snapshot. All fields are optional.
object
Optional description for the snapshot
Examplegenerated
{ "description": "example"}Responses
Section titled “Responses”Snapshot created
object
Whether the snapshot was auto-created or user-initiated
What event triggered the snapshot creation.
- pull: before a PCD repository pull/refresh
- sync: before an Arr instance sync
- manual: user-initiated via API
- rollback: system pre-rollback auto-capture taken before a restore rewinds the op log
Maximum pcd_ops ID at snapshot time
Count of published base-origin ops
Count of published user-origin ops
SHA-256 state fingerprint
Arr instance IDs targeted by this operation
Example
{ "type": "auto", "trigger": "pull"}Invalid databaseId
object
Optional machine-readable error code, for example sync_in_progress or preview_stale
Examplegenerated
{ "error": "example", "code": "example"}Database not found
object
Optional machine-readable error code, for example sync_in_progress or preview_stale
Examplegenerated
{ "error": "example", "code": "example"}Snapshot creation failed
object
Optional machine-readable error code, for example sync_in_progress or preview_stale
Examplegenerated
{ "error": "example", "code": "example"}