Verified by the sovseal team

POST /snapshot

Upload a client-encrypted state snapshot checkpoint.

This endpoint accepts a base64-encoded encrypted snapshot envelope representing the entire state of an agent. It enforces monotonic sequence numbering, handles platform billing debits, uploads the ciphertext to storage, and returns a transaction receipt.

Request URL

POST /snapshot

Request Body Schema

The body must be a JSON object with the following fields:

FieldTypeRequiredDescription
agent_idstringYesSHA-256 hash (64 characters) identifying the agent, derived from project ID and encryption key.
sequence_numberintegerYesMonotonically increasing checkpoint index (starting at 0 for genesis).
parent_snapshotstring | nullYesThe arweave_tx_id (or path ID) of the parent snapshot. Must be null for sequence 0.
policy_hashstringYesSHA-256 hash of the security policy (defaults to 64 zeros 0000... until policy enforcement).
client_payload_hashstringYesSHA-256 hash of the canonicalized payload (used for Verified Semantic Recall verification).
ciphertext_b64stringYesBase64-encoded binary ciphertext (packed AES-256-GCM `IV
byte_sizeintegerYesByte length of the decoded ciphertext. Must be $> 0$ and $\le 10,485,760$ (10 MB).
timestampstringYesISO-8601 timestamp generated by the client.

Example Request Body

{
  "agent_id": "4e73b22cf900d744b827e8d7d3d1597f8c159048b65429384f9b4f3b7d1597f8",
  "sequence_number": 0,
  "parent_snapshot": null,
  "policy_hash": "0000000000000000000000000000000000000000000000000000000000000000",
  "client_payload_hash": "84c8a8d11d95e0cce8da70c1a96c14b7454f738f65429384f9b4f3b7d1597f8c",
  "ciphertext_b64": "YmFzZTY0X2NpcGhlcnRleHRfZXhhbXBsZV93aXRoX2l2X2FuZF9hdXRoX3RhZw==",
  "byte_size": 42,
  "timestamp": "2026-06-09T16:45:30.000Z"
}

Processing Flow

  1. JSON & Structural Validation: Verifies that the JSON shape is correct and that all required fields are present.
  2. Sequence Constraints:
    • Sequence 0 requires parent_snapshot to be null.
    • Sequence $> 0$ requires parent_snapshot to be non-null.
    • The sequence number must be exactly latest + 1 (preventing sequence gaps).
  3. Idempotent Retries: If the sequence number matches the latest sequence number in the database, and the client_payload_hash is identical, the endpoint returns the prior confirmed receipt immediately without debiting credits or re-uploading storage.
  4. Billing Debit: For paid API keys (sov_live_), the system calculates a debit cost based on byte_size and executes an atomic credit debit. If the balance is insufficient, a 402 insufficient_credits error is thrown.
  5. Storage Upload: Ciphertext is uploaded to the public sovseal-rom bucket at: {agent_id}/seq-{sequence_number}-{client_payload_hash.slice(0, 12)}.bin
  6. Confirmation & Response: Upon successful upload, the database record status changes to confirmed and a receipt is returned. If storage fails, the database row is updated to failed, the credit debit is refunded, and a 503 storage_unavailable error is returned.

Response Schema (200 OK)

A JSON receipt object confirming checkpoint registration:

{
  "snapshot_id": "a1b2c3d4-e5f6-7a8b-9c0d-e1f2a3b4c5d6",
  "agent_id": "4e73b22cf900d744b827e8d7d3d1597f8c159048b65429384f9b4f3b7d1597f8",
  "sequence_number": 0,
  "arweave_tx_id": "4e73b22cf900d744b827e8d7d3d1597f8c159048b65429384f9b4f3b7d1597f8/seq-0-84c8a8d11d95.bin",
  "byte_size": 42,
  "cost_milli": 0,
  "client_payload_hash": "84c8a8d11d95e0cce8da70c1a96c14b7454f738f65429384f9b4f3b7d1597f8c",
  "status": "confirmed",
  "confirmed_at": "2026-06-09T16:45:31.123Z"
}

On this page