SDK reference · Node SDK

prov.attest.captureSessions.appendChunk

prov.attest.captureSessions.appendChunk in Node SDK.

Signature

prov.attest.captureSessions.appendChunk(sessionId: string, params: AppendChunkParams): Promise<ChunkAck>

Parameters

sessionIdstringRequired
paramsAppendChunkParamsRequired

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
idstringpathRequired
The session's ID.
indexintegerRequired
The position, from 0.
chunk_hashstringRequired
The chunk's chained hash.
captured_atstringRequired
When the device captured the chunk.

Returns

Promise<ChunkAck> The session with the chunk added.

HTTP operation

POST /v1/attest/capture_sessions/{id}/chunks: Add a chunk hash

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/capture_sessions`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "claim_id": "CLM-DOCS-VIDEO",
    "chunk_duration_ms": 2000
  }),
})).json();
const sessionId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/capture_sessions/${sessionId}/chunks`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "index": 0,
    "chunk_hash": "2110a233677a28c9cd6d66ac954ce831e70587e1940cf53e1a66f36683efad68",
    "captured_at": "2026-10-24T13:30:00.000Z"
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.