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
sessionIdstringRequiredparamsAppendChunkParamsRequired
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
- authentication_required
- chunk_index_conflict
- insufficient_scope
- invalid_json
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- resource_missing
- session_already_finalized
- session_expired
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();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/attest/capture_sessions", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
"device_id": "dev_00000000000000000000000000000001",
"claim_id": "CLM-DOCS-VIDEO",
"chunk_duration_ms": 2000
}).json()
session_id = step1["id"]
data = httpx.post(f"{api}/v1/attest/capture_sessions/{session_id}/chunks", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
"index": 0,
"chunk_hash": "2110a233677a28c9cd6d66ac954ce831e70587e1940cf53e1a66f36683efad68",
"captured_at": "2026-10-24T13:30:00.000Z"
}).json()