Export a signed compliance-evidence bundle
const url = 'https://example.com/v1/compliance/evidence/export';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"signingKeyId":"example","filter":{"runId":"example","agentId":"example","flowId":"example","kind":"access-event","from":"2026-04-15T12:00:00Z","to":"2026-04-15T12:00:00Z"}}'};
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/compliance/evidence/export \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "signingKeyId": "example", "filter": { "runId": "example", "agentId": "example", "flowId": "example", "kind": "access-event", "from": "2026-04-15T12:00:00Z", "to": "2026-04-15T12:00:00Z" } }'Canonicalizes the filtered records 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). Envelope shape matches ExportProvenanceResult + audit-bundle — verifiers reuse one wrapper across all three surfaces. Deployments without a signingKey binding mounted return 404 signing-not-configured.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”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 signing-key-not-found if unknown.
Optional filter narrowing the export set. Composition is AND — every populated field must match. Absent / empty filter exports every record for the tenant.
object
Compliance-relevant event class. Open set: evidence is a classifier lens over the audit stream, and a deployment can mark any audit-event kind exportable. examples lists the built-in kinds; clients must tolerate kinds they do not know.
Responses
Section titled “Responses”Signed evidence 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. Bundle body: { bundleSchemaVersion, tenantId, filter, records, recordCount, exportedAt }. Envelope shape identical to ExportProvenanceResult + audit-bundle — verifiers reuse one verifyEd25519 wrapper across all three surfaces.
object
Base64-encoded canonical JSON of the bundle body.
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
{ "bundleSchemaVersion": "1.0.0", "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" }}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" }}