Create a manual PCD snapshot
POST
/pcd/{databaseId}/snapshots
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”databaseId
required
integer
PCD database ID
Request Body
Section titled “Request Body”Media typeapplication/json
Request body for creating a manual snapshot. All fields are optional.
object
description
Optional description for the snapshot
string
Examplegenerated
{ "description": "example"}Responses
Section titled “Responses”Snapshot created
Media typeapplication/json
object
id
required
integer
databaseId
required
integer
type
required
Whether the snapshot was auto-created or user-initiated
string
trigger
required
What event triggered the snapshot creation.
- pull: before a PCD repository pull/refresh
- sync: before an Arr instance sync
- manual: user-initiated via API
string
description
required
string
opsSequenceMaxId
required
Maximum pcd_ops ID at snapshot time
integer
opsCountBase
required
Count of published base-origin ops
integer
opsCountUser
required
Count of published user-origin ops
integer
cacheStateHash
required
SHA-256 state fingerprint
string
targetInstanceIds
required
Arr instance IDs targeted by this operation
Array<integer>
createdAt
required
string format: date-time
Example
{ "type": "auto", "trigger": "pull"}Invalid databaseId
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}Database not found
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}Snapshot creation failed
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}