Export a signed provenance bundle for a run
const url = 'https://example.com/v1/provenance/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/export';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"signingKeyId":"example","includeMessages":false}'};
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/v1/provenance/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/export \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "signingKeyId": "example", "includeMessages": false }'Canonicalizes the record + optional messages as sorted-key JSON and signs with the deployment’s Ed25519 key looked up by signingKeyId. Verification is a pure client-side operation: verifyEd25519(publicKey, bundleBytes, signature). Deployments without a signingKey binding mounted return 404 signing-not-configured.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”RunId — opaque branded string (a UUID).
Header Parameters
Section titled “Header Parameters”Caller-supplied idempotency key. Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1).
Request Bodyrequired
Section titled “Request Bodyrequired”object
The SigningKeyId the deployment plugs into its signingKey binding. Server looks up the private key via signingKey.getPrivateKey(signingKeyId) — 404 if unknown.
When true, hydrates conversation messages tied to the run (agent turns pin runId === conversationId). Non-agent runs return an empty messages: [] — the field is still present on the bundle for shape stability.
Responses
Section titled “Responses”Signed bundle.
Signed exportable bundle. bundle is base64 of the exact bytes that were signed (sorted-key canonical JSON, no whitespace); verifiers can pass those bytes directly to verifyEd25519. The bundle body itself includes bundleSchemaVersion, runId, tenantId, dag: { nodes, edges }, messages? (if requested), etc. See canonicalization for the deterministic serialization algorithm.
object
Base64-encoded canonical JSON of the bundle body.
Semver for the shape of the bundle body. Currently 1.0.0.
Base64-encoded Ed25519 signature bytes over bundle (after base64-decode).
PEM-encoded Ed25519 public key (DER SPKI envelope). Callers can pass this straight into parsePublicKeyPem for verification.
Canonicalization algorithm — sorted-key JSON, no whitespace. Same algorithm as canonicalize.
Example
{ "algorithm": "ed25519", "canonicalization": "sorted-key-json"}Malformed request body.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Provenance not found, signing key id unknown, or signing not configured on this deployment.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Server error (unmapped domain code or framework crash).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}