Skip to content

Export a signed provenance bundle for a run

POST
/v1/provenance/{runId}/export
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.

runId
required
string format: uuid

RunId — opaque branded string (a UUID).

Idempotency-Key
string
>= 1 characters

Caller-supplied idempotency key. Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1).

Media typeapplication/json
object
signingKeyId
required

The SigningKeyId the deployment plugs into its signingKey binding. Server looks up the private key via signingKey.getPrivateKey(signingKeyId) — 404 if unknown.

string
>= 1 characters
includeMessages

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.

boolean

Signed bundle.

Media typeapplication/json

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
runId
required
string format: uuid
bundle
required

Base64-encoded canonical JSON of the bundle body.

string
bundleSchemaVersion
required

Semver for the shape of the bundle body. Currently 1.0.0.

string
algorithm
required
string
Allowed value: ed25519
signingKeyId
required
string
signature
required

Base64-encoded Ed25519 signature bytes over bundle (after base64-decode).

string
publicKey
required

PEM-encoded Ed25519 public key (DER SPKI envelope). Callers can pass this straight into parsePublicKeyPem for verification.

string
canonicalization
required

Canonicalization algorithm — sorted-key JSON, no whitespace. Same algorithm as canonicalize.

string
Allowed value: sorted-key-json
exportedAt
required
string format: date-time
Example
{
"algorithm": "ed25519",
"canonicalization": "sorted-key-json"
}

Malformed request body.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Missing / malformed / expired / revoked bearer token.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Provenance not found, signing key id unknown, or signing not configured on this deployment.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Idempotency-Key was reused with a different body, or resource-state conflict.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Server error (unmapped domain code or framework crash).

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}