Solver-DAG operations and theorem authoring, proof browser and artifact graph, kernel-run logs, submission pipeline, and webhook delivery audit for Backbuild Prove.
GET /prove/connect
Open a Prove session WebSocket
Upgrades the connection to a WebSocket for a Backbuild Prove kernel session. The request must carry an `Upgrade: websocket` header. Authentication is handled inside the ProveControllerDO after the upgrade. Browser clients must supply a valid `Origin` header matching the platform's allowed origin list; CLI clients without an `Origin` header are accepted. Each call mints a fresh server-generated session identifier — clients never supply their own. The negotiated sub-protocol is `prove-v1`.
Public Public: no authentication
Parameters
| Name | In | Type | Required | Description |
Upgrade | header | string (enum) | yes | Must be `websocket`. Any other value returns `426 Upgrade Required`. |
Responses
| Status | Description |
101 | WebSocket upgrade successful. The connection is handed off to the ProveControllerDO for the kernel session. |
403 | Origin not allowed — the request came from a browser with an `Origin` header that is not on the platform's allowed origin list. |
426 | Upgrade Required — the `Upgrade: websocket` header was absent or did not equal `websocket`. |
500 | An unexpected error occurred while establishing the WebSocket connection. |
503 | The Prove controller service is not configured for this environment. |
GET /prove/health
Prove service health check
Returns a simple liveness response for the Backbuild Prove service. Not authenticated; always returns `200` with `status: healthy` when the Worker is up.
Public Public: no authentication
Responses
| Status | Description |
200 | Service is healthy. |
GET /prove/info
Prove service capability information
Returns static metadata about the Backbuild Prove service: version, supported languages, protocol details, primitive rule count, and connection limits. Not authenticated; the response is static and does not reveal per-tenant state.
Public Public: no authentication
Responses
| Status | Description |
200 | Service capability information. |
GET /v1/bbprove/dag/operations
List solver-DAG operations for a scope
Returns all active (and optionally superseded) solver-DAG operations visible at `scope`. The SP applies the project → tenant → global scope walk so that project-scoped operations inherit tenant and global operations. `project_scope_id` is required when `scope=project`. Requires `bbprove.read` permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
scope | query | string (enum) | yes | Visibility scope: `global` (platform-wide), `tenant` (organization-wide), or `project` (project-scoped). |
project_scope_id | query | string<uuid> | no | Required when `scope=project`. The project whose scoped operations are returned (UUIDv7). |
strategy_kind | query | string (enum) | no | Filter to operations of a specific strategy kind. |
include_rules | query | string (enum) | no | When `false`, the per-operation rule list is omitted from the response to reduce payload size. Defaults to `true`. |
include_superseded | query | string (enum) | no | When `true`, superseded (soft-retracted) operations are included alongside active ones. Defaults to `false`. |
limit | query | integer | no | Maximum number of operations to return (default and ceiling are server-determined). |
offset | query | integer | no | Number of operations to skip for offset pagination. |
Responses
| Status | Description |
200 | List of operations matching the scope filter. |
400 | `VALIDATION_ERROR` — `scope` is missing or invalid; `project_scope_id` is not a valid UUID. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `bbprove.read` permission. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/dag/operations
Register a DAG solver operation
Registers a new solver-DAG operation (a named rewrite strategy) at `global`, `tenant`, or `project` scope. The scope walk and permission checks are enforced by the stored procedure: `tenant.write` or `global.write` permission is required. `global` scope writes additionally require platform-staff-level permission (`bbprove.global.write`) which is not held by ordinary organization owners — the SP returns `403 FORBIDDEN` for such attempts. `project_scope_id` is required when `scope` is `project`.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
scope | string (enum) globaltenantproject | yes | Visibility scope for the operation. |
name | string | yes | Unique operation name within its scope. |
strategy_kind | string (enum) normalize_to_fixpointpattern_isolatedecision_proceduresymbolic_rewritecomputecustom | yes | The rewrite strategy this operation implements. |
project_scope_id | string<uuid> | no | Required when `scope=project`. Project identifier (UUIDv7). |
description | string | no | Optional prose description. |
strategy_config | object | no | Optional strategy-specific configuration parameters. |
parent_op_id | string<uuid> | no | Optional parent operation this one specializes (UUIDv7). |
rule_filter | object | no | Optional filter expression applied during rule matching. |
pinned_content_hashes | array of object | no | Optional set of pinned content hashes (up to 1000). |
audit_notes | string | no | Optional audit notes. |
Responses
| Status | Description |
201 | Operation registered. The new operation record is returned under `data`. |
400 | `VALIDATION_ERROR` — body failed schema validation (missing required field, enum out of range, string too long, etc.) or `INVALID_ID_FORMAT` for a malformed UUID. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `bbprove.tenant.write` (or `bbprove.global.write` for `scope=global`) permission. |
409 | `CONFLICT` — an operation with the same `(scope, name)` already exists. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
201 response body: data fields
| Field | Type | Description |
id | string<uuid> | Operation identifier (UUIDv7). |
org_id | string | null | Owning organization (null for global-scope operations). |
scope | string (enum) globaltenantproject | Visibility scope. |
name | string | Operation name (unique within scope). |
strategy_kind | string (enum) normalize_to_fixpointpattern_isolatedecision_proceduresymbolic_rewritecomputecustom | Strategy kind. |
project_scope_id | string | null | Project scope id when `scope=project`. |
description | string | null | Prose description. |
strategy_config | object | null | Strategy-specific configuration. |
parent_op_id | string | null | Parent operation id. |
rule_filter | object | null | Rule filter expression. |
pinned_content_hashes | array | null | Pinned content hashes. |
is_superseded | boolean | Whether this operation has been superseded. |
superseded_by_id | string | null | Id of the superseding operation (if superseded). |
rules | array | null | Associated theorem rules (present only when `include_rules=true`). |
created_at | string<date-time> | Registration timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
POST /v1/bbprove/dag/operations/{operationId}/rules
Tag a theorem as a rewrite rule for an operation
Associates a theorem (by `theorem_id`) as a rewrite rule on the given solver-DAG operation. The optional `rule_order` determines priority (lower = higher priority); `direction` constrains the rule's application direction. Requires `bbprove.tenant.write` (or `bbprove.global.write` for global-scope operations) permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
operationId | path | string<uuid> | yes | Solver-DAG operation identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
theorem_id | string<uuid> | yes | Theorem to associate as a rewrite rule (UUIDv7). |
rule_order | integer | no | Optional priority order; lower values are applied first. |
direction | string (enum) forwardbackwardboth | no | Constrains the rule's application direction. |
audit_notes | string | no | Optional audit notes. |
Responses
| Status | Description |
201 | Rule association created. |
400 | `INVALID_ID_FORMAT` — malformed `operationId`. `VALIDATION_ERROR` — body failed schema validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks write permission for the operation's scope. |
404 | `NOT_FOUND` — `operationId` or `theorem_id` not found. |
409 | `CONFLICT` — the theorem is already a rule on this operation. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
201 response body: data fields
| Field | Type | Description |
operation_id | string<uuid> | Owning operation identifier. |
theorem_id | string<uuid> | Associated theorem identifier. |
rule_order | integer | Application priority (lower = higher priority). |
direction | string (enum) forwardbackwardboth | Allowed application direction. |
created_at | string<date-time> | When the rule was added. |
DELETE /v1/bbprove/dag/operations/{operationId}/rules/{theoremId}
Remove a theorem rule from an operation
Removes the association between the given theorem and solver-DAG operation. Requires `bbprove.tenant.write` (or `bbprove.global.write`) permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
operationId | path | string<uuid> | yes | Solver-DAG operation identifier (UUIDv7). |
theoremId | path | string<uuid> | yes | Theorem identifier to disassociate (UUIDv7). |
Responses
| Status | Description |
200 | Rule removed. The updated operation record is returned under `data`. |
400 | `INVALID_ID_FORMAT` — malformed `operationId` or `theoremId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks write permission. |
404 | `NOT_FOUND` — operation or rule association not found. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Operation identifier (UUIDv7). |
org_id | string | null | Owning organization (null for global-scope operations). |
scope | string (enum) globaltenantproject | Visibility scope. |
name | string | Operation name (unique within scope). |
strategy_kind | string (enum) normalize_to_fixpointpattern_isolatedecision_proceduresymbolic_rewritecomputecustom | Strategy kind. |
project_scope_id | string | null | Project scope id when `scope=project`. |
description | string | null | Prose description. |
strategy_config | object | null | Strategy-specific configuration. |
parent_op_id | string | null | Parent operation id. |
rule_filter | object | null | Rule filter expression. |
pinned_content_hashes | array | null | Pinned content hashes. |
is_superseded | boolean | Whether this operation has been superseded. |
superseded_by_id | string | null | Id of the superseding operation (if superseded). |
rules | array | null | Associated theorem rules (present only when `include_rules=true`). |
created_at | string<date-time> | Registration timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
POST /v1/bbprove/dag/operations/{operationId}/supersede
Supersede (soft-retract) a solver-DAG operation
Marks the given operation as superseded by `new_operation_id`. Superseded operations are excluded from the default listing (`include_superseded=false`) but remain queryable for audit purposes. Requires `bbprove.tenant.admin` (or `bbprove.global.admin`) permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
operationId | path | string<uuid> | yes | Solver-DAG operation to supersede (UUIDv7). |
Request Body
| Field | Type | Required | Description |
new_operation_id | string<uuid> | yes | The replacement operation (UUIDv7). |
audit_notes | string | no | Optional audit notes. |
Responses
| Status | Description |
200 | Operation superseded. |
400 | `INVALID_ID_FORMAT` or `VALIDATION_ERROR`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks admin permission for the operation's scope. |
404 | `NOT_FOUND` — `operationId` or `new_operation_id` not found. |
409 | `CONFLICT` — the operation is already superseded. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Operation identifier (UUIDv7). |
org_id | string | null | Owning organization (null for global-scope operations). |
scope | string (enum) globaltenantproject | Visibility scope. |
name | string | Operation name (unique within scope). |
strategy_kind | string (enum) normalize_to_fixpointpattern_isolatedecision_proceduresymbolic_rewritecomputecustom | Strategy kind. |
project_scope_id | string | null | Project scope id when `scope=project`. |
description | string | null | Prose description. |
strategy_config | object | null | Strategy-specific configuration. |
parent_op_id | string | null | Parent operation id. |
rule_filter | object | null | Rule filter expression. |
pinned_content_hashes | array | null | Pinned content hashes. |
is_superseded | boolean | Whether this operation has been superseded. |
superseded_by_id | string | null | Id of the superseding operation (if superseded). |
rules | array | null | Associated theorem rules (present only when `include_rules=true`). |
created_at | string<date-time> | Registration timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
GET /v1/bbprove/dag/operations/{operationId}/test-cases
List test cases for an operation
Returns the static test cases attached to the given solver-DAG operation. Inactive (soft-deleted) test cases are excluded by default; pass `include_inactive=true` to include them. Requires `bbprove.read` permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
operationId | path | string<uuid> | yes | Solver-DAG operation identifier (UUIDv7). |
include_inactive | query | string (enum) | no | When `true`, soft-deleted test cases are included. Defaults to `false`. |
limit | query | integer | no | Maximum test cases to return. |
offset | query | integer | no | Number of test cases to skip for pagination. |
Responses
| Status | Description |
200 | List of test cases. |
400 | `INVALID_ID_FORMAT` — malformed `operationId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `bbprove.read` permission. |
404 | `NOT_FOUND` — `operationId` not found. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/dag/operations/{operationId}/test-cases
Add a static test case to an operation
Attaches a static LaTeX test case to the given solver-DAG operation. An optional `expected_output` and `oracle_kind` control how the kernel verifier evaluates the test. Requires `bbprove.tenant.write` (or `bbprove.global.write`) permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
operationId | path | string<uuid> | yes | Solver-DAG operation identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
scope | string (enum) globaltenantproject | yes | Scope level for the test case. |
input_latex | string | yes | LaTeX source of the input expression (up to 10 MB). |
project_scope_id | string<uuid> | no | Required when `scope=project`. Project identifier (UUIDv7). |
expected_output | string | no | Optional expected output for oracle comparison (up to 10 MB). |
oracle_kind | string (enum) exactsympymanualnone | no | How the kernel evaluates the expected output against actual output. |
audit_notes | string | no | Optional audit notes. |
Responses
| Status | Description |
201 | Test case added. |
400 | `INVALID_ID_FORMAT` or `VALIDATION_ERROR`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks write permission for the operation's scope. |
404 | `NOT_FOUND` — `operationId` not found. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
201 response body: data fields
| Field | Type | Description |
id | string<uuid> | Test case identifier (UUIDv7). |
operation_id | string<uuid> | Owning operation identifier. |
scope | string (enum) globaltenantproject | Scope of the test case. |
input_latex | string | LaTeX input expression. |
expected_output | string | null | Expected output for oracle comparison. |
oracle_kind | string (enum) exactsympymanualnonenull | Oracle evaluation kind. |
is_active | boolean | `false` when the test case has been soft-deleted. |
created_at | string<date-time> | Creation timestamp. |
GET /v1/bbprove/dag/operations/lookup
Look up a solver-DAG operation by name
Fetches a single solver-DAG operation by its `(scope, name)` key. The SP applies the scope walk for `project` scope (project → tenant → global). `project_scope_id` is required when `scope=project`. Requires `bbprove.read` permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
scope | query | string (enum) | yes | Scope level: `global`, `tenant`, or `project`. |
name | query | string | yes | Operation name to look up (1–1000 characters). |
project_scope_id | query | string<uuid> | no | Required when `scope=project`. Project identifier (UUIDv7). |
include_rules | query | string (enum) | no | When `true`, the operation's associated theorem rules are included. Defaults to `false`. |
include_superseded | query | string (enum) | no | When `true`, a superseded operation at this name can still be returned. |
Responses
| Status | Description |
200 | The operation record. |
400 | `VALIDATION_ERROR` — `scope` or `name` is missing or invalid. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `bbprove.read` permission. |
404 | `NOT_FOUND` — no operation exists at `(scope, name)` visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Operation identifier (UUIDv7). |
org_id | string | null | Owning organization (null for global-scope operations). |
scope | string (enum) globaltenantproject | Visibility scope. |
name | string | Operation name (unique within scope). |
strategy_kind | string (enum) normalize_to_fixpointpattern_isolatedecision_proceduresymbolic_rewritecomputecustom | Strategy kind. |
project_scope_id | string | null | Project scope id when `scope=project`. |
description | string | null | Prose description. |
strategy_config | object | null | Strategy-specific configuration. |
parent_op_id | string | null | Parent operation id. |
rule_filter | object | null | Rule filter expression. |
pinned_content_hashes | array | null | Pinned content hashes. |
is_superseded | boolean | Whether this operation has been superseded. |
superseded_by_id | string | null | Id of the superseding operation (if superseded). |
rules | array | null | Associated theorem rules (present only when `include_rules=true`). |
created_at | string<date-time> | Registration timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
POST /v1/bbprove/dag/tenant-blocks
Block a content hash at tenant scope
Suppresses a global DAG content hash at the organization (tenant) level, preventing it from being applied within the org even when it is present in a global operation. `blocked_content_hash` must be a 64-character lowercase hex SHA-256 digest. Requires `bbprove.tenant.admin` permission.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
blocked_content_hash | string | yes | SHA-256 content hash to block — 64 lowercase hex characters. |
project_scope_id | string<uuid> | no | Optional project scope restriction for the block (UUIDv7). |
block_reason | string | no | Optional reason for blocking this content hash. |
Responses
| Status | Description |
201 | Content hash blocked. |
400 | `VALIDATION_ERROR` — `blocked_content_hash` is not a 64-character lowercase hex digest, or the body is otherwise invalid. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `bbprove.tenant.admin` permission. |
409 | `CONFLICT` — the content hash is already blocked at this scope. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
201 response body: data fields
| Field | Type | Description |
id | string<uuid> | Block identifier (UUIDv7). |
org_id | string<uuid> | Organization that owns this block. |
blocked_content_hash | string | Blocked SHA-256 content hash. |
project_scope_id | string | null | Optional project scope restriction. |
block_reason | string | null | Reason for the block. |
created_by | string | null | User who created the block. |
created_at | string<date-time> | When the block was created. |
DELETE /v1/bbprove/dag/tenant-blocks/{blockId}
Revoke a tenant-scope content hash block
Removes a previously added tenant-level DAG content hash block, restoring access to the global hash. Requires `bbprove.tenant.admin` permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
blockId | path | string<uuid> | yes | Tenant block identifier (UUIDv7). |
Responses
| Status | Description |
200 | Block revoked. |
400 | `INVALID_ID_FORMAT` — malformed `blockId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `bbprove.tenant.admin` permission. |
404 | `NOT_FOUND` — block not found or does not belong to the caller's organization. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
DELETE /v1/bbprove/dag/test-cases/{testCaseId}
Deactivate (soft-delete) a test case
Soft-deletes a DAG operation test case by setting `is_active=false`. The test case remains in the audit trail and can be retrieved with `include_inactive=true`. Requires `bbprove.tenant.write` (or `bbprove.global.write`) permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
testCaseId | path | string<uuid> | yes | Test case identifier (UUIDv7). |
Responses
| Status | Description |
200 | Test case deactivated. |
400 | `INVALID_ID_FORMAT` — malformed `testCaseId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks write permission. |
404 | `NOT_FOUND` — test case not found or not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Test case identifier (UUIDv7). |
operation_id | string<uuid> | Owning operation identifier. |
scope | string (enum) globaltenantproject | Scope of the test case. |
input_latex | string | LaTeX input expression. |
expected_output | string | null | Expected output for oracle comparison. |
oracle_kind | string (enum) exactsympymanualnonenull | Oracle evaluation kind. |
is_active | boolean | `false` when the test case has been soft-deleted. |
created_at | string<date-time> | Creation timestamp. |
GET /v1/bbprove/dag/theorems
List DAG theorems for a scope
Returns solver-DAG theorems visible at `scope`. The SP walks the scope hierarchy (project → tenant → global). Optional `name_prefix` prefix-matches on theorem names. Requires `bbprove.read` permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
scope | query | string (enum) | yes | Visibility scope: `global`, `tenant`, or `project`. |
project_scope_id | query | string<uuid> | no | Required when `scope=project`. Project identifier (UUIDv7). |
name_prefix | query | string | no | Optional name prefix filter (up to 1000 characters). |
include_superseded | query | string (enum) | no | When `true`, superseded theorems are included. Defaults to `false`. |
limit | query | integer | no | Maximum number of theorems to return. |
offset | query | integer | no | Number of theorems to skip for pagination. |
Responses
| Status | Description |
200 | List of theorems. |
400 | `VALIDATION_ERROR` — `scope` is missing or invalid. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `bbprove.read` permission. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/dag/theorems
Register a DAG theorem
Registers a new theorem in the solver-DAG knowledge base at `global`, `tenant`, or `project` scope. `proof_latex` and `conclusion` carry the formal content; `proof_class` classifies the audit status. Setting `kernel_verified=true` requires platform-staff-level permission (`bbprove.global.write`) — the SP returns `403 FORBIDDEN` for ordinary callers. `project_scope_id` is required when `scope=project`.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
scope | string (enum) globaltenantproject | yes | Visibility scope for the theorem. |
name | string | yes | Unique theorem name within its scope. |
proof_latex | string | yes | Full LaTeX proof source (up to 10 MB). |
conclusion | string | yes | Formal statement of the theorem's conclusion (up to 1 MB). |
project_scope_id | string<uuid> | no | Required when `scope=project`. Project identifier (UUIDv7). |
dep_theorem_ids | array of string | no | Optional dependency theorem ids (up to 1000). |
pinned_content_hashes | array of object | no | Optional content-hash pins (up to 1000). |
proof_class | string (enum) equational_unconditionalequational_unscopedimplicationalpropositionalunaudited | no | Classification of the proof's audit status. |
kernel_verified | boolean | no | When `true`, marks this theorem as kernel-verified. Requires platform-staff permission (`bbprove.global.write`). |
audit_notes | string | no | Optional audit notes. |
Responses
| Status | Description |
201 | Theorem registered. |
400 | `VALIDATION_ERROR` — body failed schema validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks write permission for the requested scope (or `bbprove.global.write` for `kernel_verified=true`). |
409 | `CONFLICT` — a theorem with the same `(scope, name)` already exists. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
201 response body: data fields
| Field | Type | Description |
id | string<uuid> | Theorem identifier (UUIDv7). |
org_id | string | null | Owning organization (null for global-scope theorems). |
scope | string (enum) globaltenantproject | Visibility scope. |
name | string | Theorem name (unique within scope). |
conclusion | string | Formal conclusion statement. |
proof_class | string (enum) equational_unconditionalequational_unscopedimplicationalpropositionalunauditednull | Proof audit classification. |
kernel_verified | boolean | Whether the theorem is kernel-verified. |
project_scope_id | string | null | Project scope id when `scope=project`. |
dep_theorem_ids | array | null | Dependency theorem ids. |
pinned_content_hashes | array | null | Pinned content hashes. |
is_superseded | boolean | Whether this theorem has been superseded. |
superseded_by_id | string | null | Id of the superseding theorem (if superseded). |
created_at | string<date-time> | Registration timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
POST /v1/bbprove/dag/theorems/{theoremId}/supersede
Supersede (soft-retract) a DAG theorem
Marks the given theorem as superseded by `new_theorem_id`. Superseded theorems are excluded from default listings but remain queryable for audit and rule-resolution purposes. Requires `bbprove.tenant.admin` (or `bbprove.global.admin`) permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
theoremId | path | string<uuid> | yes | Theorem to supersede (UUIDv7). |
Request Body
| Field | Type | Required | Description |
new_theorem_id | string<uuid> | yes | The replacement theorem (UUIDv7). |
audit_notes | string | no | Optional audit notes. |
Responses
| Status | Description |
200 | Theorem superseded. |
400 | `INVALID_ID_FORMAT` or `VALIDATION_ERROR`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks admin permission for the theorem's scope. |
404 | `NOT_FOUND` — `theoremId` or `new_theorem_id` not found. |
409 | `CONFLICT` — the theorem is already superseded. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Theorem identifier (UUIDv7). |
org_id | string | null | Owning organization (null for global-scope theorems). |
scope | string (enum) globaltenantproject | Visibility scope. |
name | string | Theorem name (unique within scope). |
conclusion | string | Formal conclusion statement. |
proof_class | string (enum) equational_unconditionalequational_unscopedimplicationalpropositionalunauditednull | Proof audit classification. |
kernel_verified | boolean | Whether the theorem is kernel-verified. |
project_scope_id | string | null | Project scope id when `scope=project`. |
dep_theorem_ids | array | null | Dependency theorem ids. |
pinned_content_hashes | array | null | Pinned content hashes. |
is_superseded | boolean | Whether this theorem has been superseded. |
superseded_by_id | string | null | Id of the superseding theorem (if superseded). |
created_at | string<date-time> | Registration timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
GET /v1/bbprove/dag/theorems/lookup
Look up a DAG theorem by name
Fetches a single solver-DAG theorem by its `(scope, name)` key. The SP applies the scope walk for `project` scope. Requires `bbprove.read` permission.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
scope | query | string (enum) | yes | Scope level: `global`, `tenant`, or `project`. |
name | query | string | yes | Theorem name (1–1000 characters). |
project_scope_id | query | string<uuid> | no | Required when `scope=project`. Project identifier (UUIDv7). |
include_superseded | query | string (enum) | no | When `true`, a superseded theorem at this name can still be returned. |
Responses
| Status | Description |
200 | The theorem record. |
400 | `VALIDATION_ERROR` — `scope` or `name` is missing or invalid. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `bbprove.read` permission. |
404 | `NOT_FOUND` — no theorem exists at `(scope, name)` visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Theorem identifier (UUIDv7). |
org_id | string | null | Owning organization (null for global-scope theorems). |
scope | string (enum) globaltenantproject | Visibility scope. |
name | string | Theorem name (unique within scope). |
conclusion | string | Formal conclusion statement. |
proof_class | string (enum) equational_unconditionalequational_unscopedimplicationalpropositionalunauditednull | Proof audit classification. |
kernel_verified | boolean | Whether the theorem is kernel-verified. |
project_scope_id | string | null | Project scope id when `scope=project`. |
dep_theorem_ids | array | null | Dependency theorem ids. |
pinned_content_hashes | array | null | Pinned content hashes. |
is_superseded | boolean | Whether this theorem has been superseded. |
superseded_by_id | string | null | Id of the superseding theorem (if superseded). |
created_at | string<date-time> | Registration timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
GET /v1/bbprove/documents/{documentId}
Get a document version
Fetches a single document version by its id. The caller must be a member of the owning project. A document the caller cannot see is indistinguishable from a non-existent one (404).
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
documentId | path | string<uuid> | yes | Document version identifier (UUIDv7). |
Responses
| Status | Description |
200 | The document version record. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Version-row identifier (UUIDv7). |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Owning project. |
path | string | Project-relative canonical file path (e.g. `ch01/main.pf2`). |
version | integer | Monotonically increasing version number within the (project, path) chain. |
format | string (enum) pf2amsthm | Document source format. |
content | string | null | Full source content. May be omitted in list responses. |
content_hash | string | null | SHA-256 hex digest of the stored content. |
parent_version_id | string | null | Id of the preceding version in the chain; null for the first version. |
created_by | string | null | User who created this version. |
created_at | string<date-time> | Timestamp when this version was created. |
GET /v1/bbprove/documents/{documentId}/ai-pref
Get per-document AI-check preference
Returns the calling user's AI-check preference override for the given document. `enable_ai_check` is `null` when no per-document override row exists (the effective setting falls back to the per-project default). Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
documentId | path | string<uuid> | yes | Document identifier (UUIDv7). |
Responses
| Status | Description |
200 | The user's AI-check preference for this document. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
enable_ai_check | boolean | null | Whether AI checking is enabled for this document for the calling user. `null` means no per-document override is set; the effective value is determined by the per-user-per-project preference then the project default. |
updated_at | string | null | When the preference was last updated. `null` when no override exists. |
PUT /v1/bbprove/documents/{documentId}/ai-pref
Set per-document AI-check preference
Upserts the calling user's AI-check preference override for the given document. The SP is idempotent — setting the same value twice is a no-op. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
documentId | path | string<uuid> | yes | Document identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
enable_ai_check | boolean | yes | Whether AI checking should be enabled for this document for the calling user. |
Responses
| Status | Description |
200 | The updated AI-check preference record. |
400 | `VALIDATION_ERROR` — `enable_ai_check` (boolean) is required. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
enable_ai_check | boolean | null | Whether AI checking is enabled for this document for the calling user. `null` means no per-document override is set; the effective value is determined by the per-user-per-project preference then the project default. |
updated_at | string | null | When the preference was last updated. `null` when no override exists. |
DELETE /v1/bbprove/documents/{documentId}/ai-pref
Clear per-document AI-check preference
Removes the calling user's per-document AI-check override row so the effective setting reverts to the per-user-per-project preference, then the project default. Idempotent — deleting a non-existent row returns `{ was_present: false }`. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
documentId | path | string<uuid> | yes | Document identifier (UUIDv7). |
Responses
| Status | Description |
200 | Preference cleared (or was not present). `was_present` indicates whether an override existed before this call. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
was_present | boolean | True if an override row existed and was deleted. |
GET /v1/bbprove/documents/{documentId}/history
Get document version history
Returns the full version chain for the document identified by `documentId`. The caller must supply `project_id` and `path` query parameters; these allow the server to locate the chain efficiently and verify that `documentId` belongs to it. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
documentId | path | string<uuid> | yes | Document version identifier (UUIDv7). |
project_id | query | string<uuid> | yes | Project identifier (UUIDv7) that owns the document chain. |
path | query | string | yes | Project-relative canonical file path (URL-encoded). Must match the canonicalization rules: no leading slash, no `.` or `..` segments, no null bytes, no backslashes, not double-encoded. |
Responses
| Status | Description |
200 | Ordered list of document versions in the chain (oldest first). |
400 | `VALIDATION_ERROR` — `project_id` or `path` missing/invalid, or `path` fails canonicalization. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/entitlement
Get Backbuild Prove entitlement
Returns the organization's current Backbuild Prove subscription state (enabled, tier, status, included languages, add-ons). Any authenticated org member may call this endpoint without needing an active subscription — it is used by the UI to gate feature rendering. Returns a disabled stub when no subscription exists; returns `503` when the database is transiently unavailable.
Auth Session JWT (Bearer)
Responses
| Status | Description |
200 | Entitlement record. `enabled: false` with `status: 'none'` when no active subscription exists. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — the database is transiently unavailable. Retry shortly. |
200 response body: data fields
| Field | Type | Description |
enabled | boolean | Whether the organization has an active Backbuild Prove subscription. |
tier | string (enum) proteambusinessenterprisenull | Subscription tier, or `null` if not subscribed. |
status | string (enum) activetrialingpast_duecancellednone | Subscription lifecycle status. |
subscription_id | string | Billing subscription identifier (present when subscribed). |
pricing_plan_id | string<uuid> | Pricing plan identifier. |
plan_slug | string | URL slug of the active plan. |
plan_name | string | Human-readable plan name. |
quantity | integer | Seat count for per-seat plans. |
is_per_seat | boolean | Whether the plan charges per seat. |
max_seats | integer | Maximum seats allowed, or `null` for unlimited. |
trial_end | string<date-time> | ISO 8601 trial end date, or `null` when not in trial. |
current_period_end | string<date-time> | ISO 8601 end of the current billing period. |
included_languages | any | Number of proof languages included in the plan. |
sql_addon | boolean | Whether the SQL Verification add-on is active. |
support_eligible | boolean | Whether the subscription includes priority support. |
extra_language_addon_eligible | boolean | Whether the organization can purchase additional language add-ons. |
GET /v1/bbprove/governance/library
List governance theorem catalog
Returns the platform-wide governance theorem catalog, optionally filtered by `category`, `language`, or `compliance_framework`. Gated by the `governance` feature flag within the Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
category | query | string | no | Filter by theorem category (e.g. `security`, `invariant`, `audit`). |
language | query | string | no | Filter by proof language (e.g. `lean4`, `coq`, `isabelle`). |
compliance_framework | query | string | no | Filter by compliance framework (e.g. `pci_dss`, `iso27001`, `soc2`, `hipaa`). |
Responses
| Status | Description |
200 | List of governance theorem catalog entries. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED` — active Prove subscription with the `governance` feature flag required. |
403 | `FEATURE_DISABLED` — the `governance` feature is not enabled on the organization's plan. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/governance/library/{id}
Get a governance theorem
Returns a single governance theorem from the platform catalog, including its full formal specification, compliance mappings, and associated proof artifacts. Gated by the `governance` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
id | path | string<uuid> | yes | Governance theorem catalog identifier (UUIDv7). |
Responses
| Status | Description |
200 | Governance theorem detail. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `governance` feature is not enabled. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
name | string | |
description | string | |
category | string | |
language | string | |
compliance_frameworks | array of string | Compliance frameworks this theorem maps to (e.g. `pci_dss`, `soc2`). |
formal_statement | string | |
severity | string (enum) warningerror | |
created_at | string<date-time> | |
GET /v1/bbprove/languages
List activated proof languages
Returns the set of proof languages activated for the caller's organization. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Responses
| Status | Description |
200 | List of language records for the organization. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` — no active Backbuild Prove subscription. `BILLING_SUBSCRIPTION_PAST_DUE` — subscription is past due. `BILLING_SUBSCRIPTION_CANCELLED` — subscription has been cancelled. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — the database is transiently unavailable. |
POST /v1/bbprove/languages
Activate or deactivate a proof language
Activates or deactivates a proof language for the caller's organization. `mode` defaults to `activate` when omitted. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
language | string | yes | Proof language identifier. |
mode | string (enum) activatedeactivate | no | Whether to activate or deactivate the language. Defaults to `activate`. |
Responses
| Status | Description |
200 | Language record after the activation/deactivation. |
400 | `VALIDATION_ERROR` — `language` is missing or exceeds 64 characters; `mode` is not `activate` or `deactivate`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED` — active subscription required. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Language record identifier. |
language | string | Proof language identifier (e.g. `lean4`, `coq`, `isabelle`, `agda`). |
activated | boolean | Whether the language is currently active. |
created_at | string<date-time> | ISO 8601 activation timestamp. |
GET /v1/bbprove/lean4/health
Probe Lean 4 verification service health
Checks whether the platform's Lean 4 cross-validation service is reachable and responsive. Any authenticated org member may call this without an active subscription. The response is always `200` — the `status` field (`ok` or `error`) inside `data` conveys liveness; an `error` value means the service is unreachable or not configured. The `configured` flag distinguishes "not provisioned" from "provisioned but unhealthy".
Auth Session JWT (Bearer)
Responses
| Status | Description |
200 | Health probe result. `status: 'error'` does NOT cause a non-2xx HTTP status — the outer envelope is always `success: true`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
status | string (enum) okerror | `ok` if the Lean 4 service is reachable and healthy; `error` otherwise. |
leanVersion | string | Lean 4 version string reported by the service (present when `status` is `ok`). |
error | string | Human-readable error description (present when `status` is `error`). |
configured | boolean | Whether the Lean 4 verification service is configured in the platform. `false` means the service is not provisioned. |
GET /v1/bbprove/pdf-builds/{buildId}
Get PDF build status
Returns the current status of a PDF build. JWT + project-membership required; no Prove entitlement gate (viewers must be able to poll regardless of subscription state).
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
buildId | path | string<uuid> | yes | PDF build identifier (UUIDv7). |
Responses
| Status | Description |
200 | PDF build record. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
build_id | string<uuid> | Build identifier. |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Owning project. |
document_id | string<uuid> | Document identifier. |
document_version | integer | Document version that was submitted. |
document_path | string | Document file path. |
status | string (enum) queuedrunningdonefailed | Build status. |
r2_key | string | null | Storage key for the rendered PDF. |
byte_size | integer | null | PDF byte size. |
page_count | integer | null | Number of pages. |
content_hash | string | null | SHA-256 digest of the rendered PDF. |
theme | string | null | Theme. |
primary_language | string | null | Language tag. |
compress | boolean | Whether compression was applied. |
error_message | string | null | Error message when `status` is `failed`. |
error_log_r2_key | string | null | Storage key for the captured builder log, present on failed builds that captured output. |
triggered_by | string | How the build was triggered. |
created_by | string<uuid> | User who triggered the build. |
queued_at | string<date-time> | When queued. |
started_at | string | null | When processing began. |
finished_at | string | null | When processing finished. |
duration_ms | integer | null | Total processing time in milliseconds. |
updated_at | string<date-time> | Last status update timestamp. |
GET /v1/bbprove/pdf-builds/{buildId}/download
Download a rendered PDF
Streams the rendered PDF for a `done` build. Returns `409 CONFLICT` when the build is in any state other than `done` (e.g. `queued`, `running`, `failed`). JWT + project-membership required; no Prove entitlement gate.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
buildId | path | string<uuid> | yes | PDF build identifier (UUIDv7). |
Responses
| Status | Description |
200 | PDF file bytes. `Content-Type: application/pdf`; `Content-Disposition: attachment`; `Cache-Control: private, max-age=0, must-revalidate`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | `NOT_FOUND` — build not found or PDF object missing from storage. |
409 | `CONFLICT` — the build is not yet in `done` state (still `queued`/`running`) or has `failed`. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/pdf-builds/{buildId}/error-log
Get PDF build error log
Streams the captured builder log for a failed PDF build. Returns `404 NOT_FOUND` if no error log was captured (e.g. build never ran or the log was not retained). JWT + project-membership required; no Prove entitlement gate.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
buildId | path | string<uuid> | yes | PDF build identifier (UUIDv7). |
Responses
| Status | Description |
200 | Builder log text. `Content-Type: text/plain; charset=utf-8`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | `NOT_FOUND` — no error log captured for this build. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/projects/{projectId}/certifications
List project certifications
Returns the certification bundles published to the project, ordered most recent first. A certification records a cryptographically signed snapshot of the project's proof state at a point in time. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | List of certification records. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/projects/{projectId}/certifications
Create (publish) a certification
Publishes a new certification for the project by recording the signed bundle metadata. The bundle bytes must already be in storage (uploaded via the `upload-relay` endpoint). The request body carries the Ed25519 public key, signature, storage key, SHA-256 digest, file hashes, and theorem counts. A `bundle_published` notification is emitted to all Prove notification subscribers for the project. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
name | string | yes | Bundle name. |
version | string | yes | Bundle version string. |
ed25519_pubkey_hex | string | yes | Ed25519 public key hex (64 lowercase hex chars). |
signature_hex | string | yes | Ed25519 signature hex. |
r2_key | string | yes | Storage key for the uploaded bundle. |
r2_bucket | string | no | Storage bucket name (optional; defaults to the configured Prove bundles bucket). |
bundle_size_bytes | integer | yes | Bundle size in bytes. |
bundle_sha256_hex | string | yes | SHA-256 hex digest of the bundle. |
file_hashes | object | no | Per-file SHA-256 hashes keyed by relative path. |
binary_hashes | object | no | Per-binary SHA-256 hashes keyed by name. |
theorem_count | integer | yes | Number of theorems in this bundle. |
lean4_verified | boolean | no | Whether Lean 4 verification was performed. |
Responses
| Status | Description |
200 | Created certification record identifier. |
400 | `VALIDATION_ERROR` — invalid `projectId` or body validation failure (e.g. `ed25519_pubkey_hex` not 64 hex chars, missing required fields). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
409 | `CONFLICT` — a certification with this bundle SHA already exists for the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Identifier of the newly created certification. |
DELETE /v1/bbprove/projects/{projectId}/certifications/{certificationId}
Revoke a certification
Revokes a published certification. A revocation reason is REQUIRED and must describe the specific grounds. Revoked certifications are flagged on the public verification page. A `bundle_revoked` notification is emitted to all project notification subscribers. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
certificationId | path | string<uuid> | yes | Certification identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
revocation_reason | string | yes | Human-readable reason for revoking this certification. |
Responses
| Status | Description |
200 | Certification revoked. |
400 | `VALIDATION_ERROR` — invalid `certificationId` or `projectId`, or `revocation_reason` is missing. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project or lacks revoke permission. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
PUT /v1/bbprove/projects/{projectId}/certifications/upload-relay/{sha}
Upload a certification bundle via relay
Receives a `.tar.gz` certification bundle and writes it to storage after running these server-side checks in order: (1) SHA-256 digest verification against the URL `sha` parameter, (2) gzip magic-byte presence (first two bytes must be `0x1f 0x8b`), (3) PDF active-content marker scan on the first 5 MiB, (4) decompression-bomb guard (absolute expansion cap and 100:1 ratio cap), (5) suppression-list check. Payloads that fail any check are rejected with an appropriate `4xx` code. Bundles exceeding 50 MiB are rejected with `413`. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
sha | path | string | yes | Expected SHA-256 hex digest of the bundle (64 lowercase hex chars). The server rejects the upload if the received bytes do not match. |
Responses
| Status | Description |
200 | Bundle written to storage. |
400 | `VALIDATION_ERROR` — invalid `projectId` or `sha`, empty body, SHA-256 mismatch, gzip magic absent, malformed gzip stream, or PDF active-content marker detected (`PDF_CONTAINS_JS_ACTION`). `UPLOAD_SUPPRESSED` — bundle hash matches the operator deny-list. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
413 | `PAYLOAD_TOO_LARGE` — the bundle exceeds 50 MiB, or the gzip expands beyond the absolute cap, or the expansion ratio exceeds 100:1 (decompression-bomb guard). |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — the bundle storage binding is not configured or is temporarily inaccessible, or the suppression-list service is unavailable. |
200 response body: data fields
| Field | Type | Description |
r2_key | string | Storage key where the bundle was written. |
size_bytes | integer | Exact size of the accepted bundle in bytes. |
POST /v1/bbprove/projects/{projectId}/certifications/upload-url
Get a bundle upload URL
Issues a pre-authenticated upload URL for a certification bundle. The caller provides the SHA-256 hex digest of the bundle; the server returns the relay upload URL and the storage key to use in the subsequent `certificationCreate` call. The upload must be completed via the corresponding `PUT` relay endpoint within the returned `expires_in` window (3600 seconds). Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
bundle_sha256_hex | string | yes | SHA-256 hex digest (64 lowercase hex chars) of the bundle to be uploaded. |
Responses
| Status | Description |
200 | Upload slot issued. |
400 | `VALIDATION_ERROR` — `bundle_sha256_hex` missing or not a 64-character hex digest. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — the bundle storage binding is not configured or is temporarily inaccessible. |
200 response body: data fields
| Field | Type | Description |
r2_key | string | Storage key to supply in the subsequent `certificationCreate` call. |
upload_url | string<uri> | Relay upload URL. PUT the bundle bytes to this URL within the `expires_in` window. |
expires_in | integer | Seconds until the upload slot expires (3600). |
GET /v1/bbprove/projects/{projectId}/compliance
Get compliance dashboard
Returns the project's compliance posture across all attached governance frameworks: overall score, per-framework control status, and top violations. Gated by the `compliance` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Compliance dashboard data. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `compliance` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
overall_score | number | Overall compliance score (0–100). |
frameworks | array of object | |
top_violations | array of object | |
GET /v1/bbprove/projects/{projectId}/contracts
List proof contracts for a project
Returns the formal contracts (pre/post-conditions, invariants) associated with source files in the project, optionally filtered by `file_path`. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
file_path | query | string | no | Filter to contracts defined in a specific source file. |
Responses
| Status | Description |
200 | List of proof contracts. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/projects/{projectId}/dashboard
Get project Prove dashboard
Returns aggregated proof coverage metrics for the project dashboard: total theorems, proven/failing/partial counts, coverage percentage, recent run history, and top-level domain breakdown. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Dashboard metrics for the project. |
400 | `VALIDATION_ERROR` — invalid `projectId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
total_theorems | integer | |
proven_count | integer | |
failing_count | integer | |
partial_count | integer | |
coverage_pct | number | Proof coverage percentage (0–100). |
last_run_at | string<date-time> | |
last_run_status | string (enum) passedfailedpartialrunning | |
GET /v1/bbprove/projects/{projectId}/dependency-tree
Get project proof dependency tree
Returns the directed dependency graph of theorems, lemmas, and axioms for the project. Nodes are the individual proof artifacts; edges represent `requires` / `imports` relationships. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Proof dependency tree (nodes + edges). |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
nodes | array of object | Proof artifact nodes. |
edges | array of object | Dependency edges between nodes. |
GET /v1/bbprove/projects/{projectId}/discoveries
List project discoveries
Returns the project-scoped feed of 5σ discoveries (kernel artifacts where `is_discovery` is true), enriched with first-discovery timestamp and parent hypothesis. Paginated and filtered by a lookback window. JWT-authenticated; no Prove entitlement gate (any project member may view discoveries).
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
sinceDays | query | integer | no | Look-back window in days (1–3650, default 30). |
page | query | integer | no | 1-based page number (1–100000, default 1). |
pageSize | query | integer | no | Records per page (1–100, default 20). |
Responses
| Status | Description |
200 | Paginated discoveries feed. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
discoveries | array of object | |
pagination | object | Pagination metadata. Endpoints use either page/pageSize or limit/offset style; fields present depend on the endpoint. |
since_days | integer | The lookback window used for this response. |
GET /v1/bbprove/projects/{projectId}/documents
List project documents
Returns documents in the project. By default only the HEAD (latest) version of each document is returned. Pass `head_only=false` to include all historical versions. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
head_only | query | string (enum) | no | When `false`, all historical versions are returned instead of only the HEAD. Defaults to `true`. |
Responses
| Status | Description |
200 | List of document versions. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — the caller's organization does not have an active Backbuild Prove entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/projects/{projectId}/documents
Save (or no-op) a document version
Persists a new version of a document in the given project. The body carries the full source content; if the content is byte-for-byte identical to the current HEAD the server may return the existing version (no-op). `format` defaults to `pf2` when omitted. Supplying an existing `document_id` anchors the version onto that document chain; omit it to let the server create a new chain.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
path | string | yes | Project-relative file path. Must be canonical: no leading slash, no `.` or `..` segments, no null bytes, no backslashes, not double-encoded, not an absolute Windows path, not starting with `//`. |
content | string | yes | Full document source content (≤ 10 MB). |
format | string (enum) pf2amsthm | no | Source format. Defaults to `pf2` when omitted. |
document_id | string<uuid> | no | Optional. When supplied, anchors the new version onto the existing document chain with this id. Omit to start a new chain. |
Responses
| Status | Description |
200 | Document version saved (or no-op'd). The persisted document version record is returned under `data`. |
400 | `VALIDATION_ERROR` — invalid `project_id`, malformed body, or a path that fails canonicalization (e.g. path traversal, double-encoded, null bytes, absolute path). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — the caller's organization does not have an active Backbuild Prove entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Version-row identifier (UUIDv7). |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Owning project. |
path | string | Project-relative canonical file path (e.g. `ch01/main.pf2`). |
version | integer | Monotonically increasing version number within the (project, path) chain. |
format | string (enum) pf2amsthm | Document source format. |
content | string | null | Full source content. May be omitted in list responses. |
content_hash | string | null | SHA-256 hex digest of the stored content. |
parent_version_id | string | null | Id of the preceding version in the chain; null for the first version. |
created_by | string | null | User who created this version. |
created_at | string<date-time> | Timestamp when this version was created. |
POST /v1/bbprove/projects/{projectId}/documents/{documentId}/assets
Upload a document asset (image)
Stream-uploads an image asset into the given document's asset store. The upload pipeline validates in this order: UUID params → document effective-access write-gate → R2 binding check → body size cap → magic-byte image type sniff + dimension/frame/ratio caps + SVG sanitization → content-addressed R2 PUT. Access is gated by project membership and write-grant, not a Prove subscription, so all document authors (regardless of subscription state) can upload images. Knowing the resulting content-addressed `sha256` does not grant read access — delivery requires a re-checked read on the owning document per request.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
documentId | path | string<uuid> | yes | Owning document identifier (UUIDv7). |
ext | query | string (enum) | no | Declared image file extension (`png`, `jpg`, `gif`, `webp`, `svg`). Used as a cross-check only — the server sniffs the actual type from the bytes and the sniff is authoritative. |
Responses
| Status | Description |
201 | Asset uploaded successfully. All metadata values are decoder-measured (never client-asserted). |
400 | `VALIDATION_ERROR` — invalid UUID params or path canonicalization failure. `UNSUPPORTED_FILE_TYPE` — the image type is not allowed or an SVG contains unsafe content. `UPLOAD_SUPPRESSED` — the content matches the operator deny-list. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — the caller has read-only access to the document and cannot upload assets into it. |
404 | `NOT_FOUND` — the document does not exist, is not a Backbuild Prove document, does not belong to the named project, or the caller cannot see it (uniform 404, no existence oracle). |
413 | `PAYLOAD_TOO_LARGE` — the uploaded image exceeds the maximum allowed size. `FILE_SIZE_LIMIT_EXCEEDED` is also emitted at 413 when the image cap is breached post-sniff. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — the asset storage binding is not configured or is temporarily unavailable. |
201 response body: data fields
| Field | Type | Description |
relPath | string | Project-relative path the editor writes into `\includegraphics{...}` (e.g. `.bbassets/<documentId>/<sha256>.<ext>`). |
sha256 | string | SHA-256 hex digest of the stored (sanitized) bytes. Also the content-address used to retrieve the asset. |
asset_sha | string | Alias for `sha256` (both fields are present for client compatibility). |
ext | string (enum) pngjpggifwebpsvg | File extension derived from the sniffed MIME type. |
width | integer | Image width in pixels (decoder-measured). |
height | integer | Image height in pixels (decoder-measured). |
width_px | integer | Alias for `width`. |
height_px | integer | Alias for `height`. |
byte_size | integer | Stored byte size of the (sanitized) image. |
frame_count | integer | Number of animation frames (1 for static images). |
GET /v1/bbprove/projects/{projectId}/documents/{documentId}/assets/{assetSha}
Deliver a document asset (image)
Streams the immutable image asset identified by its content-addressed `assetSha` (64-character lowercase hex SHA-256). Read access on the owning document is re-checked on every request — a revoked membership cannot use a cached URL to keep accessing assets. Supports `If-None-Match` for conditional GET (304). The `ext` query parameter is required to reconstruct the storage key.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
documentId | path | string<uuid> | yes | Owning document identifier (UUIDv7). |
assetSha | path | string | yes | Content-addressed SHA-256 identifier — 64 lowercase hex characters. |
ext | query | string (enum) | yes | Image file extension used to reconstruct the storage key. Must be one of the allowed types. |
Responses
| Status | Description |
200 | Image bytes. `Content-Type` reflects the stored MIME type; `ETag` equals `"<sha256>"`; `Cache-Control: private, max-age=3600`. |
304 | Not Modified — the `If-None-Match` value matched the `ETag`. |
400 | `VALIDATION_ERROR` — invalid UUID params, `assetSha` is not a 64-character hex digest, or `ext` is missing/invalid. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — the asset's storage key belongs to a different organization than the session. |
404 | `NOT_FOUND` — the document is not visible to the caller or the asset object is missing from storage. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — the asset storage binding is not configured or is temporarily unavailable. |
POST /v1/bbprove/projects/{projectId}/documents/{documentId}/build-pdf
Submit a document for PDF rendering
Submits the HEAD version of the given document for asynchronous PDF rendering. A new `bbprove_pdf_builds` row is created with status `queued` and a build job is enqueued. If `idempotent` is true (default) and a `done` build for the same input already exists, that build is returned immediately with `reused: true`. `queue_warning` in the response is non-null when the internal build queue was unavailable — the row is still created and can be replayed. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
documentId | path | string<uuid> | yes | Document identifier (UUIDv7). The HEAD version of this document is built. |
Request Body
| Field | Type | Required | Description |
theme | string | no | PDF theme identifier (e.g. `default`, `book`, `bw`). Falls back to project default when omitted. |
primaryLanguage | string | no | BCP-47 language tag for the primary document language (e.g. `en`, `fr`, `zh-Hans`). Falls back to project default when omitted. |
compress | boolean | no | Whether to compress the output PDF. Defaults to `true`. |
idempotent | boolean | no | When `true` (default), an existing `done` build for the same inputs is returned without creating a new one. |
Responses
| Status | Description |
200 | Build queued (or reused). `reused: true` when an existing `done` build was returned unchanged. |
400 | `VALIDATION_ERROR` — invalid UUID params or invalid request body. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. `FORBIDDEN` — project membership required. |
404 | `NOT_FOUND` — document not found or does not belong to this project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
build_id | string<uuid> | Build identifier. |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Owning project. |
document_id | string<uuid> | Document identifier. |
document_version | integer | Document version that was submitted. |
document_path | string | Document file path. |
status | string (enum) queuedrunningdonefailed | Current build status. |
r2_key | string | null | Storage key for the rendered PDF (present when `status` is `done`). |
byte_size | integer | null | PDF byte size (present when `status` is `done`). |
page_count | integer | null | Number of pages (present when `status` is `done`). |
theme | string | null | Theme used for this build. |
primary_language | string | null | Language tag used for this build. |
compress | boolean | Whether compression was applied. |
triggered_by | string | How the build was triggered (e.g. `user`). |
queued_at | string<date-time> | When the build was enqueued. |
reused | boolean | True when an existing `done` build was returned unchanged. |
queue_warning | string | null | Non-null when the internal build queue was unavailable. The build row was still created. |
PUT /v1/bbprove/projects/{projectId}/documents/drafts
Upsert a document draft
Creates or replaces the in-progress draft for the given `(project, path)` tuple. There is at most one draft per `(org, project, path)`; every PUT overwrites the previous draft body. Returns persisted metadata only — content is not echoed to minimize auto-save response size. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
path | string | yes | Project-relative canonical file path. Subject to the same canonicalization rules as the document save endpoint. |
content | string | yes | Full draft content (≤ 10 MB). |
format | string (enum) pf2amsthm | no | Source format. Defaults to `pf2` when omitted. |
baseVersionId | string<uuid> | no | Optional. The document version id the draft was based on (for 3-way merge conflict detection at publish time). |
baseVersion | integer | no | Optional. The version number the draft was based on. |
Responses
| Status | Description |
200 | Draft saved. Returns the persisted draft metadata (content not echoed). |
400 | `VALIDATION_ERROR` — invalid body, invalid `path` (canonicalization failure), or `project_id` is not a valid UUID. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Owning project. |
path | string | Canonical file path. |
base_version_id | string | null | The document version the draft was based on, if supplied. |
base_version | integer | null | The version number the draft was based on, if supplied. |
content_hash | string | SHA-256 hex digest of the stored draft content. |
format | string (enum) pf2amsthm | Source format. |
created_at | string<date-time> | When the draft was first created. |
created_by | string<uuid> | User who created the draft. |
updated_at | string<date-time> | When the draft was last saved. |
updated_by | string<uuid> | User who last saved the draft. |
GET /v1/bbprove/projects/{projectId}/documents/drafts/{path}
Get a document draft
Fetches the in-progress draft for `(project, path)`. Always returns a stable envelope: `{ exists: false }` when no draft is present; `{ exists: true, draft: { ... } }` otherwise. The `:path` segment must be URL-encoded by the caller. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
path | path | string | yes | URL-encoded project-relative file path (e.g. `ch01%2Fmain.pf2`). The server decodes and canonicalizes this before looking up the draft. |
Responses
| Status | Description |
200 | Draft lookup result. `exists` is always present; `draft` is present only when `exists` is `true`. |
400 | `VALIDATION_ERROR` — invalid `project_id` UUID or path canonicalization failure. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
exists | boolean | Whether a draft exists for `(project, path)`. |
draft | any | Full draft record including content, returned by the GET endpoint. |
DELETE /v1/bbprove/projects/{projectId}/documents/drafts/{path}
Discard a document draft
Discards the in-progress draft for `(project, path)`. Idempotent — `{ discarded: false }` is returned when no draft existed. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
path | path | string | yes | URL-encoded project-relative file path. |
Responses
| Status | Description |
200 | Draft discarded (or was not present). `discarded` is `true` if a draft existed and was deleted. |
400 | `VALIDATION_ERROR` — invalid `project_id` UUID or path canonicalization failure. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
discarded | boolean | True if a draft existed and was deleted. |
POST /v1/bbprove/projects/{projectId}/documents/drafts/{path}/publish
Publish a document draft
Atomically materializes the in-progress draft into a new document version and clears the draft. If no draft exists for the given `(project, path)`, returns `404 NOT_FOUND` with `error.sub_code = 'PUBLISH_NO_DRAFT'`. If the draft's base version is stale (another commit landed since the draft was saved), returns `409 CONFLICT` with `error.sub_code = 'PUBLISH_CONFLICT'` and `error.details` carrying `{ current_head_version_id, current_head_version, draft_base_version_id, draft_base_version }` to enable a 3-way merge in the editor. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
path | path | string | yes | URL-encoded project-relative file path. |
Responses
| Status | Description |
200 | Draft published successfully. Returns the new document version record. |
400 | `VALIDATION_ERROR` — invalid `project_id` UUID or path canonicalization failure. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
404 | `NOT_FOUND` — no draft exists for `(project, path)`. The error envelope includes `error.sub_code = 'PUBLISH_NO_DRAFT'` to distinguish this from a generic not-found. |
409 | `CONFLICT` — the draft's base version is stale. `error.sub_code = 'PUBLISH_CONFLICT'`; `error.details` contains `current_head_version_id`, `current_head_version`, `draft_base_version_id`, and `draft_base_version` for 3-way merge. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
documentId | string<uuid> | The new document version id. |
version | integer | The newly created version number. |
parentVersionId | string | null | The version id this build was based on. |
contentHash | string | SHA-256 hex digest of the committed content. |
format | string (enum) pf2amsthm | Source format. |
createdAt | string<date-time> | Timestamp of the new version. |
createdBy | string<uuid> | User who published. |
POST /v1/bbprove/projects/{projectId}/enable
Enable Backbuild Prove for a project
Initializes Backbuild Prove on an existing project, creating the necessary database rows and default settings. Idempotent — calling it on an already-enabled project is a no-op. Requires an active Backbuild Prove subscription and membership in the project.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Project Prove enablement record. |
400 | `VALIDATION_ERROR` — `projectId` is not a valid UUID. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | Project identifier. |
enabled | boolean | Whether Prove is now enabled for the project. |
created_at | string<date-time> | ISO 8601 timestamp when Prove was first enabled. |
GET /v1/bbprove/projects/{projectId}/governance
List governance theorems attached to a project
Returns the governance theorem attachments for the project, including the severity override and current compliance status. Gated by the `governance` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | List of governance theorem attachments. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `governance` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/projects/{projectId}/governance
Attach a governance theorem to a project
Attaches a governance theorem from the platform catalog to the project. An optional `severity_override` controls whether violations are reported as `warning`, `error`, or `ignored`; the catalog default is used when omitted. Gated by the `governance` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
governance_theorem_id | string<uuid> | yes | Governance theorem catalog identifier. |
severity_override | string (enum) warningerrorignored | no | Override the default severity for violations from this theorem. Omit to use the catalog default. |
Responses
| Status | Description |
200 | Created governance attachment record. |
400 | `VALIDATION_ERROR` — invalid `projectId`, missing `governance_theorem_id`, or `severity_override` not one of `warning`, `error`, `ignored`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `governance` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
404 | `NOT_FOUND` — project or governance theorem not found. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Attachment identifier. |
project_id | string<uuid> | |
governance_theorem_id | string<uuid> | |
severity_override | string (enum) warningerrorignorednull | Per-attachment severity override; `null` means the catalog default applies. |
theorem | object | A governance theorem from the platform catalog. |
created_at | string<date-time> | |
DELETE /v1/bbprove/projects/{projectId}/governance/{attachmentId}
Detach a governance theorem from a project
Removes a governance theorem attachment from the project. Gated by the `governance` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
attachmentId | path | string<uuid> | yes | Governance attachment identifier (UUIDv7). |
Responses
| Status | Description |
200 | Governance theorem detached. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `governance` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/projects/{projectId}/governance/violations
List governance violations for a project
Returns paginated governance violations — instances where the project's proof state does not satisfy an attached governance theorem. Optionally filtered by `attachment_id` and whether to include resolved violations. Gated by the `violations` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
page | query | integer | no | 1-based page number (default 1). |
page_size | query | integer | no | Records per page (default 50, max 200). |
attachment_id | query | string<uuid> | no | Filter to violations for a specific governance attachment (UUIDv7). |
include_resolved | query | string (enum) | no | When `true`, includes violations that have already been resolved or suppressed. Defaults to `false`. |
Responses
| Status | Description |
200 | Paginated list of governance violations. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `violations` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
violations | array of object | |
pagination | object | Pagination metadata. Endpoints use either page/pageSize or limit/offset style; fields present depend on the endpoint. |
POST /v1/bbprove/projects/{projectId}/governance/violations/{id}/suppress
Suppress (accept exception for) a governance violation
Marks a governance violation as suppressed (accepted exception), recording the justification reason. Suppressed violations are excluded from default violation counts but remain in the audit trail. A `reason` of 1–2000 characters is required. Gated by the `violations` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
id | path | string<uuid> | yes | Governance violation identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
reason | string | yes | Justification for accepting this governance exception. |
Responses
| Status | Description |
200 | Violation suppressed. |
400 | `VALIDATION_ERROR` — invalid violation `id` or `reason` missing/empty. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `violations` feature is not enabled. `FORBIDDEN` — caller lacks permission. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/projects/{projectId}/graph/layout
Get the user's persisted graph layout
Returns the calling user's persisted node positions and viewport for the project's proof artifact graph. Layouts are keyed per `(organization, project, user)` — each collaborator has independent node positions. Returns `null` under `data` when no layout has been saved yet (the client falls back to an automatic Verlet-physics layout). JWT-authenticated; project membership required.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Persisted layout, or `null` when no layout has been saved. |
400 | `VALIDATION_ERROR` — malformed `projectId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
PUT /v1/bbprove/projects/{projectId}/graph/layout
Save the user's graph layout
Upserts the calling user's node positions and viewport for the project's proof artifact graph. Sending an empty `nodes` array with no `viewport` fields deletes the stored layout (reset to automatic Verlet-physics). JWT-authenticated; project membership required.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
nodes | array of object | yes | Node positions to persist (up to 5000). An empty array with no `viewport` clears the layout. |
viewport | object | no | Persisted viewport state for the graph layout. |
Responses
| Status | Description |
200 | Layout saved (or cleared). `saved=true` when positions were written; `cleared=true` when the layout was deleted. |
400 | `VALIDATION_ERROR` — malformed `projectId`, `nodes` exceeds 5000 entries, non-finite coordinates, or `viewport.zoom` out of the 0.05–20 range. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
saved | boolean | `true` when node positions were written. |
cleared | boolean | `true` when the layout was deleted (reset to automatic). |
updated_at | string<date-time> | Timestamp of the upsert. |
GET /v1/bbprove/projects/{projectId}/handoff-contracts
Get handoff contract report
Generates a handoff contract report for the project: a structured, machine-readable summary of all proven contracts suitable for passing to an external system, audit, or release gate. Pass `include_unaudited=false` to exclude contracts that have not completed the audit workflow (defaults to including them). Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
include_unaudited | query | string (enum) | no | Whether to include contracts in the `unaudited` proof class. Defaults to `true`. |
Responses
| Status | Description |
200 | Handoff contract report. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
generated_at | string<date-time> | |
include_unaudited | boolean | |
contracts | array of object | |
total_proven | integer | |
total_audited | integer | |
POST /v1/bbprove/projects/{projectId}/hypotheses
Register a hypothesis
Registers a named hypothesis with its discharge obligations, `\impliedfrom` links, and `\dischargedby` declarations. `source_file_path` is canonicalized server-side for path confinement. `obligations` carries the structured formal conditions that must be discharged for the hypothesis to be promoted to a theorem. `implied_from` lists hypothesis labels that imply this one. `dischargedby` can reference existing labels or forward references (by kind + name). Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
label | string | yes | Unique label for this hypothesis within the project. |
name | string | yes | Human-readable name. |
constant_name | string | yes | Formal constant name in the proof language. |
formal_term | string | yes | Formal logical term being hypothesized. |
prose | string | no | Human-readable description of the hypothesis. |
source_file_path | string | yes | Source file path (canonicalized server-side; traversal sequences are rejected). |
obligations | array of object | no | |
implied_from | array of string | no | Labels of other hypotheses that imply this one. |
dischargedby | array of object | no | `\dischargedby` declarations. |
Responses
| Status | Description |
200 | Hypothesis registered with counts of inserted obligations and links. |
400 | `VALIDATION_ERROR` — invalid `projectId`, missing required fields, `source_file_path` failed canonicalization (path traversal, null bytes, absolute path), or arrays exceed their limits. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
hypothesis_id | string<uuid> | |
obligations_inserted | integer | |
implied_from_inserted | integer | |
dischargedby_inserted | integer | |
GET /v1/bbprove/projects/{projectId}/hypothesis-status
Get hypothesis discharge status graph
Returns the full hypothesis/obligation/implication/promotion graph for the project: each hypothesis with its discharge obligations, current promotion state, and `\impliedfrom`/`\dischargedby` edges. Used by the dashboard to render the hypothesis discharge state. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Hypothesis status graph. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
hypotheses | array of object | |
GET /v1/bbprove/projects/{projectId}/issues
List proof issues for a project
Returns paginated proof issues (type errors, failing theorems, lint warnings) for the project, with optional filters by file path, language, and domain. Page/page_size pagination (default page 1, page_size 50). Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
page | query | integer | no | 1-based page number (default 1). |
page_size | query | integer | no | Records per page (default 50, max 200). |
file_path | query | string | no | Filter to issues in a specific source file path. |
language | query | string | no | Filter to issues for a specific proof language. |
domain | query | string | no | Filter to issues in a specific proof domain. |
Responses
| Status | Description |
200 | Paginated list of proof issues. |
400 | `VALIDATION_ERROR` — invalid `projectId` or query parameters. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
issues | array of object | |
pagination | object | Pagination metadata. Endpoints use either page/pageSize or limit/offset style; fields present depend on the endpoint. |
GET /v1/bbprove/projects/{projectId}/lean4-reports
List Lean 4 verification reports
Returns Lean 4 verifier reports for the project, with optional filtering by `filter` (e.g. `errors`, `warnings`, `all`) and `file_path`. Gated by the `lean4` feature flag within the Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
filter | query | string | no | Narrow the report set (e.g. `errors`, `warnings`, `all`). Defaults to `all`. |
file_path | query | string | no | Restrict to reports for a specific source file. |
Responses
| Status | Description |
200 | List of Lean 4 verifier reports. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `lean4` feature is not enabled on the subscription. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/projects/{projectId}/notification-settings
Get project notification settings
Returns the notification channel configuration and event filters for the project. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Notification settings. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
channels | object | |
event_filters | object | Per-event-type enable/disable flags. |
recipient_user_ids | array of string | |
min_severity | string (enum) infowarningerror | |
cooldown_minutes | integer | |
updated_at | string<date-time> | |
PUT /v1/bbprove/projects/{projectId}/notification-settings
Update project notification settings
Updates the notification channel configuration and event filters for the project. All fields are optional — only provided fields are updated. `cooldown_minutes` controls the minimum gap between repeated notifications for the same event type (0–1440). Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
channels | object | no | |
event_filters | object | no | Per-event-type overrides. |
recipient_user_ids | array of string | no | |
min_severity | string (enum) infowarningerror | no | |
cooldown_minutes | integer | no | Minimum gap in minutes between repeated notifications for the same event type. |
Responses
| Status | Description |
200 | Updated notification settings. |
400 | `VALIDATION_ERROR` — `cooldown_minutes` out of range [0, 1440] or `min_severity` invalid. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project or lacks settings-write permission. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
channels | object | |
event_filters | object | Per-event-type enable/disable flags. |
recipient_user_ids | array of string | |
min_severity | string (enum) infowarningerror | |
cooldown_minutes | integer | |
updated_at | string<date-time> | |
POST /v1/bbprove/projects/{projectId}/paired-documents/sync
Sync a paired-repository document manifest
Bulk-syncs the document manifest from a paired external repository into the platform's document catalog. The `org_id` is always derived from the authenticated session — the body must not include it. A manifest may contain up to 5 000 file entries. Each entry's `rel_path` is re-canonicalized server-side for path confinement. Pass `prune: true` to remove catalog entries for files absent from the manifest. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
pairing_id | string<uuid> | yes | Identifier of the repository pairing configuration. |
prune | boolean | no | When `true`, removes catalog entries for files absent from the manifest. |
files | array of object | yes | Document manifest entries. Maximum 5 000 items. |
Responses
| Status | Description |
200 | Sync result with counts of inserted, updated, and optionally pruned entries. |
400 | `VALIDATION_ERROR` — invalid `projectId`, malformed body, `pairing_id` not a UUID, `files` array exceeds 5 000 entries, or a `rel_path` fails canonicalization. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
inserted | integer | Number of new document entries added to the catalog. |
updated | integer | Number of existing document entries updated. |
pruned | integer | Number of entries removed (present when `prune: true` was requested). |
GET /v1/bbprove/projects/{projectId}/pdf-builds
List PDF builds for a project
Returns PDF build records for the project, most recent first. Optionally filter by `document_id` or `status`. JWT + project-membership required; no Prove entitlement gate.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
document_id | query | string<uuid> | no | Filter to builds for a specific document (UUIDv7). |
status | query | string (enum) | no | Filter by build status. |
limit | query | integer | no | Maximum number of records to return. Default and ceiling are endpoint-specific (commonly default 25–50, max 100). |
offset | query | integer | no | Number of records to skip for offset pagination. |
Responses
| Status | Description |
200 | List of PDF build records. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/projects/{projectId}/pdf-settings
Get project PDF build defaults
Returns the per-project default PDF build settings (theme, primary language). JWT + project-membership (viewer level) required; no Prove entitlement gate so viewers always have access to display the Build PDF UX defaults.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Project PDF settings. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Owning project. |
theme | string (enum) defaultbookbw | Default PDF theme. |
primary_language | string | Default BCP-47 language tag. |
is_default | boolean | True when these are the platform defaults (no custom row saved yet). |
created_at | string | null | When the settings row was created. |
updated_at | string | null | When the settings row was last updated. |
updated_by | string | null | User who last updated the settings. |
PUT /v1/bbprove/projects/{projectId}/pdf-settings
Upsert project PDF build defaults
Persists per-project PDF build defaults (theme, primary language). Requires JWT + Backbuild Prove entitlement. Editor-level membership is enforced inside the stored procedure. At least one field must be present; unknown fields are rejected (`additionalProperties: false`).
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
theme | string (enum) defaultbookbw | no | New default PDF theme. |
primaryLanguage | string | no | New default BCP-47 language tag (e.g. `en`, `fr`, `zh-Hans`). Must match the pattern: 2–3 letter base language optionally followed by hyphen-separated subtags. |
Responses
| Status | Description |
200 | Updated project PDF settings. |
400 | `VALIDATION_ERROR` — invalid `theme`, invalid `primaryLanguage` (must satisfy BCP-47 syntax: 2-3 letter language code optionally followed by hyphen-separated subtags, max 35 chars). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. `FORBIDDEN` — caller lacks editor-level project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Owning project. |
theme | string (enum) defaultbookbw | Default PDF theme. |
primary_language | string | Default BCP-47 language tag. |
is_default | boolean | True when these are the platform defaults (no custom row saved yet). |
created_at | string | null | When the settings row was created. |
updated_at | string | null | When the settings row was last updated. |
updated_by | string | null | User who last updated the settings. |
GET /v1/bbprove/projects/{projectId}/predictions
List project predictions
Returns the predictions for the given project, optionally filtered by parent hypothesis. Predictions are created by the kernel from `\prediction{...}` macros in the document source — they are not directly mutable via this API. JWT-authenticated; project-membership enforced inside the stored procedure.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
parent_hypothesis_id | query | string<uuid> | no | Filter to predictions that belong to a specific hypothesis (UUIDv7). |
limit | query | integer | no | Maximum number of predictions to return (1–1000, default 100). |
offset | query | integer | no | Number of predictions to skip for pagination. |
Responses
| Status | Description |
200 | Paginated list of predictions with total count. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
predictions | array of object | |
total | integer | Total matching predictions. |
limit | integer | |
offset | integer | |
GET /v1/bbprove/projects/{projectId}/predictions/{predictionId}
Get a prediction
Returns a single prediction with its structured observables and computational evidence. JWT-authenticated; project-membership enforced inside the stored procedure. If the returned prediction does not belong to the URL `projectId`, `404 NOT_FOUND` is returned.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
predictionId | path | string<uuid> | yes | Prediction identifier (UUIDv7). |
Responses
| Status | Description |
200 | The prediction record with observables and evidence. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | `NOT_FOUND` — prediction not found or does not belong to the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Prediction identifier. |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Owning project. |
label | string | Short machine-readable label from the `\prediction` macro. |
name | string | Human-readable prediction name. |
parent_hypothesis_id | string<uuid> | Parent hypothesis identifier. |
source_file_path | string | null | Source document path where the macro was defined. |
source_line_start | integer | null | Starting source line. |
source_line_end | integer | null | Ending source line. |
prose | string | Full prose statement of the prediction. |
derivation_latex | string | LaTeX derivation block. |
observables | array of object | Structured observable definitions linked to this prediction. |
evidence | array of object | Computational evidence records attached to this prediction. |
POST /v1/bbprove/projects/{projectId}/proof-class
Set proof class for theorems
Bulk-updates the proof class of theorems to `unaudited`, `audited`, or `public_api`. Exactly one of `theorem_ids` (array of UUIDv7s) or `theorem_names` (array of strings) must be supplied. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
proof_class | string (enum) unauditedauditedpublic_api | yes | New proof class to assign. |
theorem_ids | array of string | no | UUIDs of theorems to update. Exactly one of `theorem_ids` or `theorem_names` must be supplied. |
theorem_names | array of string | no | Names of theorems to update. Exactly one of `theorem_ids` or `theorem_names` must be supplied. |
Responses
| Status | Description |
200 | Proof class update result. |
400 | `VALIDATION_ERROR` — invalid `projectId`, neither `theorem_ids` nor `theorem_names` supplied, or `proof_class` is not one of the allowed values. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project or lacks write permission. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
updated_count | integer | Number of theorems updated. |
GET /v1/bbprove/projects/{projectId}/proof-printout
Get proof printout
Returns the structured proof printout for the project: a canonical, signed-ready listing of theorems filtered by proof class (`all`, `verified`, `audited`) and optionally a specific `file_path`. The printout is used as the attestation payload for signing. Gated by the `proof-printout` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
filter | query | string (enum) | no | Proof class filter: `all` (default), `verified`, or `audited`. |
file_path | query | string | no | Restrict to theorems in a specific source file. |
Responses
| Status | Description |
200 | Proof printout data. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `proof-printout` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
filter | string (enum) allverifiedaudited | |
generated_at | string<date-time> | |
theorems | array of object | Theorems in the printout. |
content_sha256_hex | string | SHA-256 hex digest of the canonical printout payload, used as the input to attestation signing. |
GET /v1/bbprove/projects/{projectId}/proof-printout/signature
Get proof printout attestation signature
Returns the latest stored Ed25519 attestation signature for the project's proof printout, optionally filtered by `content_sha256_hex` to retrieve the signature for a specific printout snapshot. Gated by the `proof-printout` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
content_sha256_hex | query | string | no | Retrieve the signature for a specific printout content hash (64 lowercase hex chars). |
Responses
| Status | Description |
200 | Attestation signature record, or null if none exists for the requested snapshot. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `proof-printout` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
project_id | string<uuid> | |
content_sha256_hex | string | |
ed25519_pubkey_hex | string | |
signature_hex | string | |
filter | string (enum) allverifiedaudited | |
label | string | |
created_at | string<date-time> | |
POST /v1/bbprove/projects/{projectId}/proof-printout/signature
Store a proof printout attestation signature
Stores an Ed25519 attestation signature computed by the CLI over a canonical proof printout payload. Requires an active org signing key (`prove.publish` permission enforced inside the stored procedure). The public key referenced must match the organization's registered active key. Gated by the `proof-printout` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
content_sha256_hex | string | yes | SHA-256 hex digest of the printout payload that was signed. |
ed25519_pubkey_hex | string | yes | Ed25519 public key (64 lowercase hex chars). Must match the organization's registered active signing key. |
signature_hex | string | yes | Ed25519 signature over the printout payload (128 lowercase hex chars = 64 bytes). |
filter | string (enum) allverifiedaudited | no | Proof class filter used when generating the printout. |
label | string | no | Optional human-readable label for this signature. |
Responses
| Status | Description |
200 | Attestation signature stored. |
400 | `VALIDATION_ERROR` — invalid UUID, `content_sha256_hex` not 64 hex chars, `signature_hex` not 128 hex chars, or `filter` not one of `all`, `verified`, `audited`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `proof-printout` feature is not enabled. `FORBIDDEN` — caller lacks `prove.publish` permission or the referenced public key does not match the active signing key. |
409 | `CONFLICT` — no active signing key is registered for the organization. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
project_id | string<uuid> | |
content_sha256_hex | string | |
ed25519_pubkey_hex | string | |
signature_hex | string | |
filter | string (enum) allverifiedaudited | |
label | string | |
created_at | string<date-time> | |
GET /v1/bbprove/projects/{projectId}/proofs/{artifactId}
Get a proof artifact
Returns a single kernel artifact with its associated kernel-run record and source document metadata. JWT-authenticated; project membership required. A non-existent or inaccessible artifact is indistinguishable from a missing one (uniform 404).
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
artifactId | path | string<uuid> | yes | Artifact identifier (UUIDv7). |
Responses
| Status | Description |
200 | Artifact record with associated run and document. |
400 | `VALIDATION_ERROR` — malformed `projectId` or `artifactId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
artifact | object | Summary view of a kernel artifact, used in graph nodes and table rows. |
kernel_run | any | The kernel run that produced this artifact, if available. |
document | any | Source document metadata, if available. |
GET /v1/bbprove/projects/{projectId}/proofs/{artifactId}/history
Get a proof artifact's transition history
Returns the state-transition history for a kernel artifact (e.g. `draft` → `submitted` → `promoted`). JWT-authenticated; project membership required.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
artifactId | path | string<uuid> | yes | Artifact identifier (UUIDv7). |
limit | query | integer | no | Maximum history entries to return (1–500, default 50). |
Responses
| Status | Description |
200 | Ordered list of artifact state transitions. |
400 | `VALIDATION_ERROR` — malformed path param or invalid `limit`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
history | array of object | |
GET /v1/bbprove/projects/{projectId}/proofs/graph
Get the proof artifact dependency graph
Returns the directed acyclic graph of kernel artifacts (nodes) and their dependency edges for the given project. Nodes and edges can be filtered by `kind` and/or `state` (comma-separated multi-value). JWT-authenticated; project membership and `prove.read` permission are enforced by the stored procedure. No Prove subscription entitlement gate — any project member may browse the graph.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
kind | query | string | no | Comma-separated artifact kind filter. Allowed values: `hypothesis`, `prediction`, `observation`, `definition`, `obligation`, `discharge`, `theorem`, `lemma`, `corollary`, `proposition`. |
state | query | string | no | Comma-separated artifact state filter. Allowed values: `draft`, `submitted`, `pending`, `suggestive`, `corroborated`, `discharged`, `accepted_unverified`, `accepted_pending_promotion`, `provisional`, `promoted`, `rejected`, `refuted`, `stale`, `superseded`. |
Responses
| Status | Description |
200 | Artifact graph with nodes and edges. |
400 | `VALIDATION_ERROR` — invalid UUID `projectId` or an unrecognized value in the `kind`/`state` filter. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
nodes | array of object | Artifact nodes. |
edges | array of object | Dependency edges. |
POST /v1/bbprove/projects/{projectId}/proofs/search
Semantic search over proof source documents
Runs a hybrid dense + ColBERT semantic search over the project's proof source documents. The query is embedded by the platform's embedding service; results are ranked by cosine similarity against a `threshold` floor. JWT-authenticated; project membership required. No Prove subscription gate.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
q | string | yes | Natural-language search query. Control characters (except `\n`/`\t`) are rejected. |
limit | integer | no | Maximum results to return (default 10). |
threshold | number | no | Minimum similarity score floor (default 0.3). |
Responses
| Status | Description |
200 | Ranked list of matching proof source documents. |
400 | `VALIDATION_ERROR` — invalid `projectId`, missing/too-long query, or control characters in the query string. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | `INTERNAL_ERROR` — an unexpected server error, including a failure to contact the embedding service. |
502 | `INTERNAL_ERROR` — the embedding service returned an error or was unreachable. |
200 response body: data fields
| Field | Type | Description |
documents | array of object | |
GET /v1/bbprove/projects/{projectId}/proofs/table
Get a paginated proof artifact table
Returns a paginated, optionally text-searched list of kernel artifacts for the given project. Text search (`q`) is a full-text keyword search over artifact names and source. Results are ordered by relevance when `q` is supplied, by recency otherwise. JWT-authenticated; no Prove subscription gate.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
q | query | string | no | Full-text search query (1–500 characters). Control characters (except `\n`/`\t`) are rejected. |
page | query | integer | no | 1-based page number (1–100000, default 1). |
pageSize | query | integer | no | Records per page (1–200, default 50). |
kind | query | string | no | Comma-separated artifact kind filter (same allowed values as the graph endpoint). |
state | query | string | no | Comma-separated artifact state filter (same allowed values as the graph endpoint). |
Responses
| Status | Description |
200 | Paginated artifact table. |
400 | `VALIDATION_ERROR` — invalid `projectId`, out-of-range pagination params, unrecognized filter value, or control characters in `q`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
artifacts | array of object | |
pagination | object | |
POST /v1/bbprove/projects/{projectId}/realtime/ticket
Mint a realtime subscription ticket
Validates the caller's project access, then mints a single-use 60-second ticket for the project's realtime event room. After receiving the ticket, open a WebSocket connection to `GET /v1/collaboration/ws?token={ticket}` and send `{ type: 'join_room', roomId: room }` using the `room` value from the response. The ticket is deleted on first use and expires after 60 seconds; any error during the access check fails closed with `403 FORBIDDEN`.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Single-use realtime ticket minted. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller does not have read access to this project, or the access check failed (fail-closed). |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
ticket | string | Opaque single-use ticket string. Pass as `?token=<ticket>` on the WebSocket upgrade to `GET /v1/collaboration/ws`. |
expiresInSeconds | integer | Seconds until the ticket expires (currently 60). |
room | string | Room name to join after the WebSocket connects. Send `{ type: 'join_room', roomId: room }` over the WebSocket. |
GET /v1/bbprove/projects/{projectId}/reports/coverage-over-time
Proof coverage over time report
Returns a time-series of proof coverage metrics (proven, failing, total theorems) over the specified lookback window (`days`, default 30). Gated by the `reports` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
days | query | integer | no | Lookback window in days (default 30). |
Responses
| Status | Description |
200 | Coverage time-series data points. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `reports` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
days | integer | Lookback window used. |
data_points | array of object | |
GET /v1/bbprove/projects/{projectId}/reports/domain-breakdown
Proof domain breakdown report
Returns a breakdown of theorem coverage grouped by proof domain (e.g. `security`, `concurrency`, `memory_safety`). Gated by the `reports` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Domain breakdown data. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `reports` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/projects/{projectId}/reports/language-breakdown
Proof language breakdown report
Returns a breakdown of theorem coverage grouped by proof language. Gated by the `reports` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Language breakdown data. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `reports` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/projects/{projectId}/reports/verification-runs
Verification runs time-series report
Returns a daily time-series of verification run counts and average duration over the specified lookback window. Gated by the `reports` feature flag.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
days | query | integer | no | Lookback window in days (default 30). |
Responses
| Status | Description |
200 | Verification runs time-series. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FEATURE_DISABLED` — the `reports` feature is not enabled. `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
days | integer | Lookback window used. |
data_points | array of object | |
GET /v1/bbprove/projects/{projectId}/runs
List verification runs for a project
Returns paginated verification run records for the project, most recent first. Each run captures the kernel's execution: theorems checked, time taken, outcome, and per-file coverage snapshot. Page/page_size pagination. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
page | query | integer | no | 1-based page number (default 1). |
page_size | query | integer | no | Records per page (default 50). |
Responses
| Status | Description |
200 | Paginated list of verification run records. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
runs | array of object | |
pagination | object | Pagination metadata. Endpoints use either page/pageSize or limit/offset style; fields present depend on the endpoint. |
GET /v1/bbprove/projects/{projectId}/settings
Get project Prove settings
Returns the Prove-specific settings stored for the project (e.g. default proof language, auto-run policy, notification thresholds). Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Project Prove settings. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
settings | object | Arbitrary key-value settings for the project's Prove configuration. |
updated_at | string<date-time> | |
PUT /v1/bbprove/projects/{projectId}/settings
Update project Prove settings
Updates the Prove-specific settings for the project. The `settings` object is merged with the existing settings. Requires an active Backbuild Prove subscription and project admin access.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
settings | object | yes | Partial settings object to merge into the project's Prove settings. |
Responses
| Status | Description |
200 | Updated project Prove settings. |
400 | `VALIDATION_ERROR` — `settings` object is missing or not an object. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a project admin. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
settings | object | Arbitrary key-value settings for the project's Prove configuration. |
updated_at | string<date-time> | |
GET /v1/bbprove/projects/{projectId}/settings/user
Get user Prove preferences for a project
Returns the calling user's per-project Prove preferences, including the effective AI-check value after applying override → project-default fallback. JWT-authenticated; project-membership required.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | User preference record with effective values. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
default_ai_check_user_override | boolean | null | User's AI-check override for this project. `null` means no override is set. |
project_default_ai_check | boolean | The project-level default AI-check value. |
effective_ai_check | boolean | The resolved AI-check value after applying override → project default fallback. |
updated_at | string | null | When the user preference was last updated. |
PUT /v1/bbprove/projects/{projectId}/settings/user
Set user Prove preferences for a project
Updates the calling user's per-project Prove preferences. `default_ai_check_user_override` accepts `true`, `false`, or `null` — passing `null` clears the override so the project-level default applies. JWT-authenticated; project-membership required.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
default_ai_check_user_override | boolean | null | yes | AI-check override for this project. `true`/`false` sets the override; `null` clears it so the project default applies. The key must be present (omitting it is rejected). |
Responses
| Status | Description |
200 | Updated user preference record. |
400 | `VALIDATION_ERROR` — `default_ai_check_user_override` must be `true`, `false`, or `null`; the key must be present. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
default_ai_check_user_override | boolean | null | User's AI-check override for this project. `null` means no override is set. |
project_default_ai_check | boolean | The project-level default AI-check value. |
effective_ai_check | boolean | The resolved AI-check value after applying override → project default fallback. |
updated_at | string | null | When the user preference was last updated. |
POST /v1/bbprove/projects/{projectId}/source
Register a source file
Registers (or updates) a source file in the project's Prove catalog after the file has been uploaded to storage. The caller provides the storage key, SHA-256 digest, and optional symbol-level metadata derived from the language parser. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
file_path | string | yes | Relative path within the project. |
sha256_hex | string | yes | SHA-256 hex digest (64 lowercase hex chars). |
size_bytes | integer | yes | File size in bytes. |
language | string | no | Proof language (e.g. `lean4`, `coq`). |
r2_key | string | yes | Storage key for the file in the Prove source bucket. |
theorem_count | integer | no | |
proven_count | integer | no | |
failing_count | integer | no | |
partial_count | integer | no | |
symbols_function | integer | no | |
symbols_class | integer | no | |
symbols_struct | integer | no | |
symbols_enum | integer | no | |
symbols_type | integer | no | |
symbols_trait | integer | no | |
symbols_interface | integer | no | |
symbols_module | integer | no | |
symbols_annotated | integer | no | |
symbols_total | integer | no | |
warnings_count | integer | no | |
errors_count | integer | no | |
is_source | boolean | no | |
Responses
| Status | Description |
200 | Source file registration record. |
400 | `VALIDATION_ERROR` — invalid `projectId`, or the request body failed validation (e.g. `sha256_hex` not a 64-char hex digest, `r2_key` missing). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Source file record identifier. |
project_id | string<uuid> | |
file_path | string | Relative path within the project. |
sha256_hex | string | SHA-256 hex digest of the file at registration time. |
size_bytes | integer | File size in bytes. |
language | string | Proof language (e.g. `lean4`, `coq`). |
r2_key | string | Storage key for retrieving the file content. |
theorem_count | integer | |
proven_count | integer | |
failing_count | integer | |
partial_count | integer | |
symbols_function | integer | |
symbols_class | integer | |
symbols_struct | integer | |
symbols_enum | integer | |
symbols_type | integer | |
symbols_trait | integer | |
symbols_interface | integer | |
symbols_module | integer | |
symbols_annotated | integer | |
symbols_total | integer | |
warnings_count | integer | |
errors_count | integer | |
is_source | boolean | |
content | string | File content text (only present when `include_content=true` was requested). |
created_at | string<date-time> | |
updated_at | string<date-time> | |
GET /v1/bbprove/projects/{projectId}/source-tree
Get project source file tree
Returns the hierarchical tree of registered source files for the project, including per-file metadata (language, theorem counts, coverage). Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Source file tree for the project. |
400 | `VALIDATION_ERROR` — invalid `projectId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | |
files | array of object | Flat list of registered source files. |
total_files | integer | Total number of registered source files. |
total_theorems | integer | Sum of theorem counts across all files. |
GET /v1/bbprove/projects/{projectId}/source/{filePath}
Get a registered source file
Returns metadata for a registered source file, identified by its path within the project. Pass `include_content=true` to also stream the file's bytes from storage; the content is base64-encoded in the response. The file path is canonicalized server-side — path traversal sequences (e.g. `../`, null bytes, absolute paths) are rejected with `400 VALIDATION_ERROR`. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
filePath | path | string | yes | Relative path of the source file within the project (e.g. `src/Foo.lean`). The path is canonicalized server-side; traversal sequences are rejected. |
include_content | query | string (enum) | no | When `true`, streams the source file bytes from storage and includes them in the response. Defaults to `false`. |
Responses
| Status | Description |
200 | Source file metadata, optionally with content. |
400 | `VALIDATION_ERROR` — invalid `projectId` or `filePath` failed canonicalization (path traversal, null bytes, absolute path, etc.). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | `NOT_FOUND` — file not registered, or file registered but the underlying storage object is absent. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — the source-file storage binding is not configured or is temporarily inaccessible. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Source file record identifier. |
project_id | string<uuid> | |
file_path | string | Relative path within the project. |
sha256_hex | string | SHA-256 hex digest of the file at registration time. |
size_bytes | integer | File size in bytes. |
language | string | Proof language (e.g. `lean4`, `coq`). |
r2_key | string | Storage key for retrieving the file content. |
theorem_count | integer | |
proven_count | integer | |
failing_count | integer | |
partial_count | integer | |
symbols_function | integer | |
symbols_class | integer | |
symbols_struct | integer | |
symbols_enum | integer | |
symbols_type | integer | |
symbols_trait | integer | |
symbols_interface | integer | |
symbols_module | integer | |
symbols_annotated | integer | |
symbols_total | integer | |
warnings_count | integer | |
errors_count | integer | |
is_source | boolean | |
content | string | File content text (only present when `include_content=true` was requested). |
created_at | string<date-time> | |
updated_at | string<date-time> | |
POST /v1/bbprove/projects/{projectId}/theorems/{artifactId}/export
Create a theorem export
Initiates an export of a theorem artifact. `tex` and `json` formats complete synchronously (content returned inline in the response). `pdf` is async — a build job is enqueued and the caller must poll `poll_url` (the `/v1/bbprove/theorem-exports/{exportId}` endpoint). Requires `prove.read` permission on the project (enforced inside the stored procedure). Export creation is audit-logged.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
artifactId | path | string<uuid> | yes | Theorem artifact identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
format | string (enum) pdfjsontex | yes | Export format. `tex` and `json` complete synchronously with inline content. `pdf` is asynchronous — poll the `poll_url` for completion. |
Responses
| Status | Description |
200 | Export created. For `tex`/`json` formats, `content` contains the result inline. For `pdf`, `status` is `queued`; poll `poll_url` for completion. |
400 | `VALIDATION_ERROR` — invalid UUID params or unsupported `format`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `prove.read` permission on the project. |
404 | `NOT_FOUND` — artifact or project not found. |
409 | `CONFLICT` — no signing key is registered for this organization or the artifact is in an invalid state for export. A `CONFLICT` with a `no signing key` context means the caller must register a signing key before exporting. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
export_id | string<uuid> | Export identifier. |
status | string (enum) queuedrunningdonefailed | Export status. `tex`/`json` are immediately `done`. |
format | string (enum) pdfjsontex | Export format. |
signing_key_id | string | null | Signing key used, if any. |
signing_key_fingerprint_hex | string | null | Hex fingerprint of the signing key. |
signed_at | string | null | Timestamp when signed. |
pdf_build_id | string | null | Underlying PDF build id for `pdf` format exports. |
content | string | null | Inline content for synchronous `tex`/`json` exports. |
content_url | string | null | Download URL when content is available. |
poll_url | string | URL to poll for status on async exports (points to `/v1/bbprove/theorem-exports/{exportId}`). |
queue_warning | string | null | Non-null if the PDF build queue was unavailable at submission time. |
POST /v1/bbprove/projects/{projectId}/theorems/with-dischargedby
Record \dischargedby declarations on a theorem
Records explicit `\dischargedby` declarations on a freshly registered theorem and triggers auto-discharge of any hypothesis obligation whose forward reference (kind + name) now resolves to this theorem. Returns the counts of auto-discharged and explicitly-discharged obligations. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
theorem_id | string<uuid> | yes | Identifier of the theorem being registered. |
conclusion_term | string | yes | The theorem's conclusion formal term. |
dischargedby | array of object | yes | `\dischargedby` declarations for this theorem. |
Responses
| Status | Description |
200 | Discharge records stored. |
400 | `VALIDATION_ERROR` — invalid `projectId`, `theorem_id` not a UUID, missing `conclusion_term`, or `dischargedby` array exceeds 1024 entries. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
obligations_auto_discharged | array of string | Obligation labels that were automatically discharged by this theorem. |
obligations_explicit_discharged | array of string | Obligation labels that were explicitly discharged via the `dischargedby` declarations. |
GET /v1/bbprove/projects/{projectId}/third-party
List third-party contracts for a project
Returns third-party (external dependency) contracts registered for the project — formal specifications imported from upstream libraries or packages. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | List of third-party contract records. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
403 | `FORBIDDEN` — caller is not a member of the project. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/runs/{runId}/log
Get a kernel-run log
Returns metadata and AI-verdict (if any) for a single kernel verification run, including state, exit code, document reference, timing, and AI-check result. Consumed by the artifact history panel run-log overlay. JWT-authenticated; access is scoped to the caller's organization by Row-Level Security — cross-organization lookups return `404 NOT_FOUND`. No Prove subscription gate.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
runId | path | string<uuid> | yes | Kernel run identifier (UUIDv7). |
Responses
| Status | Description |
200 | Kernel run log record. |
400 | `VALIDATION_ERROR` — malformed `runId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller's organization does not match the run's organization (returned as `NOT_FOUND` by the SP for anti-enumeration). |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
run_id | string<uuid> | Kernel run identifier (UUIDv7). |
state | string | Current run state (e.g. `queued`, `running`, `done`, `failed`). |
verdict_summary | string | null | Human-readable verdict from the kernel or AI grader. |
log_uri | string | null | URI to the full kernel log output. |
exit_code | integer | null | Exit code of the kernel process (`0` = success). |
triggered_by | string | Who or what initiated the run. |
queued_at | string<date-time> | When the run was queued. |
started_at | string | null | When the kernel process started. |
finished_at | string | null | When the kernel process completed. |
duration_ms | integer | null | Wall-clock duration in milliseconds. |
document_id | string<uuid> | Source document version identifier (UUIDv7). |
document_version | integer | Document version number submitted. |
document_path | string | Document path within the project. |
ai_check_result | object | null | AI grader result object when `enable_ai_check=true`. Shape is model-defined. |
POST /v1/bbprove/search
Search theorems
Full-text and semantic search over theorems. `query` must be 2–500 characters. `scope` limits the search to `all` (default), `project` (requires `project_id`), `system` (platform-provided theorems), or `governance` catalog. Results are returned with limit/offset pagination (default limit 50, max 200). Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
query | string | yes | Search query (2–500 chars). |
scope | string (enum) allprojectsystemgovernance | no | `all` searches across all accessible theorems. `project` requires `project_id`. `system` searches platform-provided theorems. `governance` searches the governance catalog. |
project_id | string<uuid> | no | Required when `scope` is `project`. |
limit | integer | no | Maximum results to return. |
offset | integer | no | Results to skip for pagination. |
Responses
| Status | Description |
200 | Search results with pagination. |
400 | `VALIDATION_ERROR` — `query` is missing or less than 2 characters; `scope` is invalid; `project` scope requires `project_id`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
results | array of object | |
pagination | object | |
truncated | boolean | Whether the result set was truncated to the requested limit. |
GET /v1/bbprove/shares
List shares
Returns active shares filtered by `scope`. `scope=owned` returns shares this organization has granted; `scope=received` returns shares other organizations have granted to this organization. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
scope | query | string (enum) | yes | Whether to return shares this org has granted (`owned`) or received (`received`). |
Responses
| Status | Description |
200 | List of shares. |
400 | `VALIDATION_ERROR` — `scope` is missing or is not `owned` or `received`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/shares
Grant a cross-org share
Grants (or upserts) a cross-organization share of a document or artifact to a recipient organization. When `can_edit` is `true`, `granted_by_policy_id` is required — the API validates this before the stored procedure and returns `400 INVALID_POLICY` immediately. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
target_kind | string (enum) documentartifact | yes | The kind of resource being shared. |
target_id | string<uuid> | yes | The resource identifier to share (UUIDv7). |
recipient_org_id | string<uuid> | yes | The organization to share with (UUIDv7). |
can_edit | boolean | yes | Whether the recipient can edit the shared resource. When `true`, `granted_by_policy_id` is required. |
granted_by_policy_id | string<uuid> | no | Required when `can_edit=true`. The policy that authorizes write-sharing. |
Responses
| Status | Description |
200 | Share created or upserted. |
400 | `VALIDATION_ERROR` — invalid payload. `INVALID_POLICY` — `can_edit=true` but `granted_by_policy_id` is absent, or the referenced policy failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. `FORBIDDEN` — caller lacks share-grant permission. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
share_id | string<uuid> | Share identifier. |
owner_org_id | string<uuid> | The organization that granted the share. |
recipient_org_id | string<uuid> | The organization receiving the share. |
target_kind | string (enum) documentartifact | The kind of shared resource. |
target_id | string<uuid> | The shared resource identifier. |
can_edit | boolean | Whether the recipient has edit rights. |
granted_by_policy_id | string | null | Policy that authorized write-sharing, if applicable. |
granted_by | string | null | User who granted the share. |
created_at | string | null | When the share was created. |
revoked_at | string | null | When the share was revoked, if applicable. |
GET /v1/bbprove/shares/{shareId}
Get a share
Returns a single share record with target metadata. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
shareId | path | string<uuid> | yes | Share identifier (UUIDv7). |
Responses
| Status | Description |
200 | The share record. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. `FORBIDDEN` — caller is neither the owner nor the recipient. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
share_id | string<uuid> | Share identifier. |
owner_org_id | string<uuid> | The organization that granted the share. |
recipient_org_id | string<uuid> | The organization receiving the share. |
target_kind | string (enum) documentartifact | The kind of shared resource. |
target_id | string<uuid> | The shared resource identifier. |
can_edit | boolean | Whether the recipient has edit rights. |
granted_by_policy_id | string | null | Policy that authorized write-sharing, if applicable. |
granted_by | string | null | User who granted the share. |
created_at | string | null | When the share was created. |
revoked_at | string | null | When the share was revoked, if applicable. |
DELETE /v1/bbprove/shares/{shareId}
Revoke a cross-org share
Revokes a cross-organization share. Idempotent — revoking a non-existent or already-revoked share returns success. Only the owning organization can revoke. Requires an active Backbuild Prove entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
shareId | path | string<uuid> | yes | Share identifier (UUIDv7). |
Responses
| Status | Description |
200 | Share revoked. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FEATURE_DISABLED` — active Backbuild Prove entitlement required. `FORBIDDEN` — caller is not the share owner. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/signing-key
Get the active signing key
Returns the organization's currently active Ed25519 signing key (public key hex and metadata). Private key material is never stored on the platform — only the public key is returned. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Responses
| Status | Description |
200 | Active signing key record. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
404 | `NOT_FOUND` — no active signing key is registered for the organization. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
org_id | string<uuid> | |
public_key_hex | string | Ed25519 public key (64 lowercase hex chars). |
label | string | Optional human-readable label. |
status | string (enum) activeretiredrevoked | Key lifecycle status. |
revocation_reason | string | |
created_at | string<date-time> | |
retired_at | string<date-time> | |
revoked_at | string<date-time> | |
POST /v1/bbprove/signing-key
Register a new signing key
Registers a new active Ed25519 signing key for the organization. Only one active key is permitted at a time — if an active key already exists the call returns an error. Retire or revoke the existing key first. Private key material is never accepted or stored. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
public_key_hex | string | yes | Ed25519 public key (64 lowercase hex chars). The corresponding private key is never transmitted to or stored by the platform. |
label | string | no | Optional human-readable label for the key. |
Responses
| Status | Description |
200 | Registered signing key record. |
400 | `VALIDATION_ERROR` — `public_key_hex` is missing or not a 64-character hex digest. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
409 | `CONFLICT` — an active signing key already exists for this organization. Retire or revoke the current key before registering a new one. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
org_id | string<uuid> | |
public_key_hex | string | Ed25519 public key (64 lowercase hex chars). |
label | string | Optional human-readable label. |
status | string (enum) activeretiredrevoked | Key lifecycle status. |
revocation_reason | string | |
created_at | string<date-time> | |
retired_at | string<date-time> | |
revoked_at | string<date-time> | |
POST /v1/bbprove/signing-key/{id}/retire
Retire a signing key (normal rotation)
Retires a signing key as part of normal rotation. Retired keys' past signatures remain valid — downstream verifiers see them as signed by a retired (not compromised) key. No reason is required because retirement is informational. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
id | path | string<uuid> | yes | Signing key identifier (UUIDv7). |
Responses
| Status | Description |
200 | Signing key retired. |
400 | `VALIDATION_ERROR` — invalid signing key `id`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
409 | `CONFLICT` — the key is already retired or revoked. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
org_id | string<uuid> | |
public_key_hex | string | Ed25519 public key (64 lowercase hex chars). |
label | string | Optional human-readable label. |
status | string (enum) activeretiredrevoked | Key lifecycle status. |
revocation_reason | string | |
created_at | string<date-time> | |
retired_at | string<date-time> | |
revoked_at | string<date-time> | |
POST /v1/bbprove/signing-key/{id}/revoke
Revoke a signing key (compromise response)
Revokes a signing key in response to a suspected compromise. A `revocation_reason` of 10–2000 characters is REQUIRED and must describe the actual compromise event. Revoking a key flags all certifications previously signed by that key as `SIGNING KEY COMPROMISED` on their public verification pages. A `signing_key_revoked` notification is emitted to all Prove subscribers in the organization. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
id | path | string<uuid> | yes | Signing key identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
revocation_reason | string | yes | Description of the actual compromise event. Must be at least 10 characters. |
Responses
| Status | Description |
200 | Signing key revoked. `bundles_affected` is the count of certifications now flagged as compromised. |
400 | `VALIDATION_ERROR` — invalid `id` or `revocation_reason` does not meet the 10-character minimum. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
409 | `CONFLICT` — the key is already revoked. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
bundles_affected | integer | Number of certifications that were signed by this key and are now flagged as compromised. |
GET /v1/bbprove/signing-keys
List all signing keys
Returns the full key history for the organization: active, retired, and revoked signing keys. Useful for audit trails and verifying which key signed a specific certification. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Responses
| Status | Description |
200 | List of all signing key records. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/submissions
Submit a document for kernel evaluation
Submits the HEAD version of the given document for asynchronous Lean 4 kernel evaluation. The server resolves the current HEAD for the `documentId` chain, inserts a `queued` kernel run row, and best-effort enqueues the job. If the queue binding is unavailable, the run row is still created and can be replayed; `queue_warning` in the response will be non-null in that case. The `enableAiCheck` flag opts the run into an optional AI grader stage; when omitted, the server resolves the effective value from the per-document → per-user-per-project → per-project preference chain. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
documentId | string<uuid> | yes | Document version identifier (UUIDv7). The server resolves the current HEAD for the document chain. |
enableAiCheck | boolean | no | Optional override for the AI grader stage. When omitted, the server resolves through the per-document → per-user-per-project → per-project → platform-default fallback chain. |
Responses
| Status | Description |
200 | Submission queued. `queue_warning` is non-null if the background job queue was unavailable — the run row exists regardless and will be processed once the queue is restored. |
400 | `VALIDATION_ERROR` — `documentId` is missing or not a valid UUID. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` — no active Backbuild Prove subscription. `BILLING_SUBSCRIPTION_PAST_DUE` or `BILLING_SUBSCRIPTION_CANCELLED` for lapsed subscriptions. |
403 | `FORBIDDEN` — caller lacks project membership or `prove.submit` permission. |
404 | `NOT_FOUND` — `documentId` not found or the HEAD version of the document chain is missing. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
run_id | string<uuid> | Kernel run identifier (UUIDv7). |
queued_at | string<date-time> | When the run was queued. |
state | string | Initial run state (`queued`). |
document_id | string<uuid> | HEAD document version submitted. |
document_version | integer | HEAD document version number. |
document_path | string | Document path. |
triggered_by | string | Trigger source (`submission`). |
root_run_id | string | null | Root run identifier if part of a multi-run chain. |
queue_warning | string | null | Non-null if the background job queue was unavailable. The run row exists regardless. |
GET /v1/bbprove/theorem-exports/{exportId}
Get theorem export status
Returns the current status of a theorem export. For PDF exports, the row is auto-promoted to `done` or `failed` when the underlying PDF build completes. JWT-authenticated; project-membership enforced inside the stored procedure.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
exportId | path | string<uuid> | yes | Theorem export identifier (UUIDv7). |
Responses
| Status | Description |
200 | Theorem export status record. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
export_id | string<uuid> | Export identifier. |
project_id | string<uuid> | Owning project. |
artifact_id | string<uuid> | Source theorem artifact. |
format | string (enum) pdfjsontex | Export format. |
status | string (enum) queuedrunningdonefailed | Export status. |
signing_key_id | string | null | Signing key used. |
signed_at | string | null | When signed. |
content | string | null | Inline content for `tex`/`json` formats. |
content_url | string | null | Download URL. |
r2_key | string | null | Storage key for PDF exports. |
byte_size | integer | null | Content byte size. |
pdf_build_id | string | null | Underlying PDF build id. |
error_message | string | null | Error message for failed exports. |
created_at | string<date-time> | Creation timestamp. |
finished_at | string | null | Completion timestamp. |
GET /v1/bbprove/theorem-exports/{exportId}/content
Download theorem export content
Downloads the content of a completed theorem export. Returns `409 CONFLICT` when the export is not yet in `done` state. `tex` and `json` are served inline; `pdf` is streamed from storage. JWT-authenticated; project-membership enforced inside the stored procedure.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
exportId | path | string<uuid> | yes | Theorem export identifier (UUIDv7). |
Responses
| Status | Description |
200 | Export content. `Content-Disposition: attachment`. Content-Type varies by format: `application/json` for `json`, `application/x-tex` for `tex`, `application/pdf` for `pdf`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks project membership. |
404 | `NOT_FOUND` — export not found or content unavailable from storage. |
409 | `CONFLICT` — the export is not yet in `done` state or has `failed`. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/bbprove/webhooks
List Prove webhooks
Returns the Prove outbound webhook registrations for the organization, optionally filtered by `project_id`. Webhook secrets are never returned — only metadata is exposed. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
project_id | query | string<uuid> | no | Filter to webhooks scoped to a specific project (UUIDv7). Omit for all organization-level webhooks. |
Responses
| Status | Description |
200 | List of webhook registrations. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/webhooks
Register a Prove webhook
Registers a new outbound webhook for Prove events. The `url` must be HTTPS. The `secret` (16–256 chars) is stored encrypted and used to sign outgoing deliveries — it is never returned after registration. `event_types` controls which Prove event types trigger delivery; omit to receive all events. `project_id` scopes the webhook to a single project; omit for org-level delivery. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
url | string<uri> | yes | HTTPS delivery endpoint URL. Must start with `https://`. |
secret | string | yes | Signing secret used to compute the delivery HMAC signature. Store this immediately — it is not returned after creation. |
event_types | array of string | no | Event types to subscribe to. Omit to receive all Prove events. |
project_id | string<uuid> | no | Scope to a specific project. Omit for org-level delivery. |
Responses
| Status | Description |
200 | Webhook registration record. The plaintext secret is not returned — store it before calling this endpoint. |
400 | `VALIDATION_ERROR` — `url` is not HTTPS, `secret` is fewer than 16 characters or more than 256 characters, or `project_id` is not a valid UUID. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — webhook secrets cannot be encrypted due to a server-side configuration issue. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
org_id | string<uuid> | |
project_id | string<uuid> | Project scope (null = org-level). |
url | string<uri> | HTTPS delivery URL. |
event_types | array of string | Subscribed event types, or null for all events. |
created_at | string<date-time> | |
DELETE /v1/bbprove/webhooks/{id}
Delete a Prove webhook
Permanently deletes a Prove webhook registration. Deliveries in flight at the time of deletion may still be attempted once. Requires an active Backbuild Prove subscription.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
id | path | string<uuid> | yes | Webhook identifier (UUIDv7). |
Responses
| Status | Description |
200 | Webhook deleted. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/bbprove/webhooks/{id}/rotate-secret
Rotate a webhook secret
Rotates the signing secret for a Prove webhook with a grace-overlap window. The new secret replaces the current one; the current secret is kept as a secondary for `grace_days` (1–30, default 7) so in-flight deliveries and receivers being rolled forward can still verify against either secret. If `secret` is omitted, the server generates a fresh 64-character base64url secret. The plaintext new secret is returned exactly once in the response — it cannot be recovered afterward.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
id | path | string<uuid> | yes | Webhook identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
secret | string | no | New secret. When omitted, the server generates a fresh 64-character base64url secret. |
grace_days | integer | no | Grace overlap window in days during which the old secret continues to verify deliveries (default 7). |
Responses
| Status | Description |
200 | Secret rotated. The plaintext `secret` is returned exactly once. |
400 | `VALIDATION_ERROR` — invalid webhook `id`, `secret` less than 16 or more than 256 characters, or `grace_days` out of range [1, 30]. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
402 | `BILLING_SUBSCRIPTION_REQUIRED` / `BILLING_SUBSCRIPTION_PAST_DUE` / `BILLING_SUBSCRIPTION_CANCELLED`. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — webhook secrets cannot be encrypted due to a server-side configuration issue. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
org_id | string<uuid> | |
project_id | string<uuid> | Project scope (null = org-level). |
url | string<uri> | HTTPS delivery URL. |
event_types | array of string | Subscribed event types, or null for all events. |
created_at | string<date-time> | |
secret | string | The new plaintext webhook signing secret. Present exactly once in this response; store it immediately. |
GET /v1/bbprove/webhooks/{webhookId}/deliveries
List webhook delivery audit records
Returns the per-attempt delivery audit log for a Backbuild Prove webhook. Allows operators to review delivery status, response codes, and retry history. `only_failed=true` filters to failed attempts only. Requires `prove.read` permission (JWT-authenticated; no entitlement gate).
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
webhookId | path | string<uuid> | yes | Webhook identifier (UUIDv7). |
limit | query | integer | no | Maximum number of delivery records to return. |
offset | query | integer | no | Number of delivery records to skip for pagination. |
only_failed | query | string (enum) | no | When `true`, only failed delivery attempts are returned. Defaults to `false`. |
Responses
| Status | Description |
200 | Paginated list of delivery audit records. |
400 | `INVALID_ID_FORMAT` — malformed `webhookId`. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — caller lacks `prove.read` permission or the webhook does not belong to the caller's organization. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/projects/{projectId}/studio/jobs/{jobId}
Get the status of a render job
Returns the current status and progress information for a Studio render job. Poll this endpoint after calling `generate` until the job reaches a terminal state (`completed` or `failed`). The SP resolves the project and production from the job_id and enforces project-membership authorization. Internal token and pinned-secret state are omitted from the response.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
jobId | path | string<uuid> | yes | Render job identifier (UUIDv7) as returned by the generate endpoint. |
Responses
| Status | Description |
200 | Current job status. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
job_id | string<uuid> | Render job identifier. |
production_id | string<uuid> | Production this job belongs to. |
status | string (enum) queuedgenerating_audiogenerating_videocompositingcompletedfailed | Current lifecycle status of the render job. |
progress_pct | integer | null | Percentage completion (0–100), or `null` while the job is queued. |
error_message | string | null | Human-readable error description when `status` is `failed`. |
created_at | string<date-time> | When the job was created. |
updated_at | string<date-time> | When the job was last updated. |
completed_at | string | null | When the job completed (or `null` if still in progress). |
GET /v1/projects/{projectId}/studio/productions
List productions in a project
Returns all active Scripted Media Studio productions belonging to the specified project. The organization and RLS scope are derived from the caller's access token; the project must be accessible to the caller. Productions are ordered by creation time, newest first.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | List of productions for the project. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/projects/{projectId}/studio/productions
Create a production
Creates a new Scripted Media Studio production within the specified project. A production is the top-level container for a scripted video/audio piece — it holds the script, scenes, voice assignments, music/SFX placements, and render metadata. Both `title` and `slug` are required at creation; additional content sections are populated via the dedicated content-setter endpoints.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
title | string | yes | Display title of the production. |
slug | string | yes | URL-safe slug (unique within the project). |
{
"title": "Introduction to Backbuild AI",
"slug": "intro-backbuild-ai"
}
Responses
| Status | Description |
200 | Production created. The created production record is returned under `data`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Platform-assigned production identifier (UUIDv7). |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Project that contains this production. |
title | string | Display title of the production. |
slug | string | URL-safe slug for the production (unique within the project). |
status | string | Lifecycle status (e.g. `draft`, `generating`, `published`, `failed`). |
created_by_user_id | string | null | User who created the production. |
created_at | string<date-time> | Creation timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
GET /v1/projects/{projectId}/studio/productions/{productionId}
Get a production
Returns a single Scripted Media Studio production by id. A production the caller cannot see (wrong org, no project membership, or non-existent) is returned as `404 NOT_FOUND`.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Responses
| Status | Description |
200 | The production record. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Platform-assigned production identifier (UUIDv7). |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Project that contains this production. |
title | string | Display title of the production. |
slug | string | URL-safe slug for the production (unique within the project). |
status | string | Lifecycle status (e.g. `draft`, `generating`, `published`, `failed`). |
created_by_user_id | string | null | User who created the production. |
created_at | string<date-time> | Creation timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
PATCH /v1/projects/{projectId}/studio/productions/{productionId}
Update a production's metadata
Partially updates a production's top-level metadata (title, slug, description, status, voice assignments, etc.). The body is a free-form JSON object validated and applied by the stored procedure — the SP is the authority for which fields are mutable and enforces project-membership authorization. At least one field must be supplied.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
title | string | no | New production title. |
slug | string | no | New URL-safe slug (unique within the project). |
status | string | no | New lifecycle status. |
Responses
| Status | Description |
200 | Production updated. The updated production record is returned under `data`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Platform-assigned production identifier (UUIDv7). |
org_id | string<uuid> | Owning organization. |
project_id | string<uuid> | Project that contains this production. |
title | string | Display title of the production. |
slug | string | URL-safe slug for the production (unique within the project). |
status | string | Lifecycle status (e.g. `draft`, `generating`, `published`, `failed`). |
created_by_user_id | string | null | User who created the production. |
created_at | string<date-time> | Creation timestamp. |
updated_at | string<date-time> | Last-update timestamp. |
DELETE /v1/projects/{projectId}/studio/productions/{productionId}
Soft-delete a production
Marks a production as deleted (soft-delete). The underlying data is preserved for the audit trail; the production is hidden from listings. The stored procedure enforces project-membership and role authorization.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
Optional body — ignored by the SP; may be omitted entirely.
Responses
| Status | Description |
200 | Production soft-deleted. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/projects/{projectId}/studio/productions/{productionId}/actions
Get the actions list for a production
Returns the current on-screen actions (cursor moves, click highlights, app-drive events, camera transitions) attached to the production. Actions are keyed by timeline position and used by the video renderer.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Responses
| Status | Description |
200 | The actions array for the production. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
PUT /v1/projects/{projectId}/studio/productions/{productionId}/actions
Replace the actions list for a production
Replaces the entire ordered actions list for the production (replace-the-set semantics). The stored procedure strictly validates the nested array structure. Used by the Studio editor when the user reorders, adds, or removes on-screen actions in the timeline.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
Generic replace-the-set content body. The SP is the authority for structure validation; the route passes the full body through. This schema accepts any well-formed JSON object.
Responses
| Status | Description |
200 | Actions replaced. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
PUT /v1/projects/{projectId}/studio/productions/{productionId}/contributors
Replace the contributor credits for a production
Replaces the contributor credits list for the production (replace-the-set semantics). Contributors are credited in the output metadata and optional end-card; the SP validates structure.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
Generic replace-the-set content body. The SP is the authority for structure validation; the route passes the full body through. This schema accepts any well-formed JSON object.
Responses
| Status | Description |
200 | Contributors replaced. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/projects/{projectId}/studio/productions/{productionId}/estimate
Get a credit-cost estimate for generating a production
Returns the predicted render credit cost and change-gate analysis for the production in its current state. This is a read-only preflight — it has no side effects, does not reserve credits, and does not enqueue a render job. Use it to show the user the precise cost before they commit to calling the generate endpoint. The estimate mirrors the gate math used by `generate` so the number shown in the editor confirmation dialog exactly matches what will be charged.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Responses
| Status | Description |
200 | Render estimate and predicted change-gate analysis. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
estimated_credits | number | Predicted render credit cost if generate were called now with the same mode. |
mode | string (enum) audiovideofull | Render mode the estimate applies to. |
cache_hit | boolean | Whether the estimate predicts a full cache hit (no credits would be spent). |
gates | object | Predicted state of the three render change-gates (script→TTS, audio→STT, visuals→render). Present but structure is SP-determined. |
POST /v1/projects/{projectId}/studio/productions/{productionId}/generate
Generate (render) a production
Enqueues or directly triggers a render job for the production. Credits are spent on a cache miss (scripts/scenes that have changed since the last render). Returns the job_id, the final credit estimate, and the predicted change-gate results. Poll `GET /v1/projects/{projectId}/studio/jobs/{jobId}` for status. The optional `mode` parameter scopes the render: `audio` re-synthesizes narration only; `video` renders video against existing audio; `full` (default) synthesizes audio first if changed, then renders video.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
safety_factor | number | no | Optional safety multiplier for credit cost estimation. Must be positive. |
estimate | boolean | no | When `true`, returns only the credit estimate without enqueuing a render job (dry-run mode). |
mode | string (enum) audiovideofull | no | Render scope: `audio` re-synthesizes narration only; `video` renders video against existing audio; `full` (default) synthesizes audio first if changed, then renders video. |
{
"mode": "full"
}
Responses
| Status | Description |
200 | Render job enqueued. The job id and credit estimate are returned under `data`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
409 | `INSUFFICIENT_CREDITS` — the organization has insufficient render credits to complete the job; `QUOTA_EXCEEDED` — the organization has reached its render quota. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
job_id | string<uuid> | Platform-assigned render job identifier (UUIDv7). Poll `GET /v1/projects/{projectId}/studio/jobs/{jobId}` for status. |
estimated_credits | number | Predicted credit cost for this render job. |
mode | string (enum) audiovideofull | Render mode that was applied. |
gates | object | Predicted state of the three render change-gates. |
PUT /v1/projects/{projectId}/studio/productions/{productionId}/music
Replace the music placements for a production
Replaces the entire list of background music placements for the production (replace-the-set semantics). Each placement references an asset_id from the org media library, with a start offset and volume envelope. The SP validates structure and asset existence.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
Generic replace-the-set content body. The SP is the authority for structure validation; the route passes the full body through. This schema accepts any well-formed JSON object.
Responses
| Status | Description |
200 | Music placements replaced. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/projects/{projectId}/studio/productions/{productionId}/outputs
List composed render outputs for a production
Returns the composed output metadata for the production's published baseline render, or for a specific render when `render_id` is supplied. Only composed outputs are returned — raw pipeline captures are never exposed. Each output record includes the storage key and associated metadata; a future update will presign the key into a short-lived single-object URL via the R2 binding.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
render_id | query | string<uuid> | no | Render identifier (UUIDv7). When omitted, returns the published baseline render outputs. |
Responses
| Status | Description |
200 | Composed render output records. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
PUT /v1/projects/{projectId}/studio/productions/{productionId}/overlays
Replace the visual overlays for a production
Replaces the entire list of visual overlays for the production (replace-the-set semantics). Overlays include SVG graphics, lower-thirds, callout boxes, and other composited visual elements with timeline positions. The SP validates structure and asset references.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
Generic replace-the-set content body. The SP is the authority for structure validation; the route passes the full body through. This schema accepts any well-formed JSON object.
Responses
| Status | Description |
200 | Overlays replaced. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
PUT /v1/projects/{projectId}/studio/productions/{productionId}/scenes
Replace the scenes list for a production
Replaces the entire scenes list for the production (replace-the-set semantics). Scenes define the visual segments of the video — background, screen-demo captures, b-roll imagery, and SVG overlays. The SP strictly validates the nested structure.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
Generic replace-the-set content body. The SP is the authority for structure validation; the route passes the full body through. This schema accepts any well-formed JSON object.
Responses
| Status | Description |
200 | Scenes replaced. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/projects/{projectId}/studio/productions/{productionId}/script
Get the script for a production
Returns the current (or a specific versioned) script body for the given production. The script is the primary narration-text content used to drive the TTS synthesis and word-timeline. Pass `?version=<n>` to retrieve a specific version; omit for the latest.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
version | query | string | no | Specific script version number to retrieve. Omit to get the latest version. |
Responses
| Status | Description |
200 | The script content for the requested version. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
production_id | string<uuid> | Production this script version belongs to. |
version | integer | Script version number (monotonically increasing). |
sections | array of object | Ordered list of script sections (e.g. intro, body, outro). Each section contains one or more segments with speaker and text assignments. |
created_at | string<date-time> | When this version was saved. |
PUT /v1/projects/{projectId}/studio/productions/{productionId}/script
Replace the script for a production
Replaces the entire script body for the production with the supplied content. The stored procedure performs strict validation of the script structure (sections, segments, speaker assignments) and creates a new version; the previous version is retained in the version history. Calling this resets the TTS synthesis state — a re-generate will re-synthesize narration from scratch.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
Request body for replacing the production script. The SP performs strict validation of the nested sections/segments/speaker structure.
Responses
| Status | Description |
200 | Script updated. The new script record is returned under `data`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
production_id | string<uuid> | Production this script version belongs to. |
version | integer | Script version number (monotonically increasing). |
sections | array of object | Ordered list of script sections (e.g. intro, body, outro). Each section contains one or more segments with speaker and text assignments. |
created_at | string<date-time> | When this version was saved. |
POST /v1/projects/{projectId}/studio/productions/{productionId}/secrets
Link a vault secret to a production
Registers a secret link that allows the renderer to inject a vault-stored credential (e.g. API key, URL token) into the production at render time. The secret value is never transmitted through this endpoint — only the vault reference (vault_id, item_key) and injection metadata are stored. The `escrow_verified` attestation required by the renderer is established server-side by the platform's credential-escrow control plane; clients cannot supply it. Until that server-side attestation step is completed the stored procedure fails closed and secret-linked renders are blocked.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
vault_id | string<uuid> | yes | UUIDv7 of the vault containing the secret. |
item_key | string | yes | Key of the secret item within the vault. |
purpose | string | yes | Human-readable description of the link's purpose (e.g. `'TTS synthesis'`). |
allowed_origin | string | no | Optional origin constraint restricting where the renderer may present this credential (e.g. `'https://api.elevenlabs.io'`). |
injection_field | string | no | Optional target field or header name the renderer should inject the credential value into (e.g. `'x-api-key'`). |
{
"vault_id": "019d0000-0000-7000-8000-000000000001",
"item_key": "elevenlabs-api-key",
"purpose": "TTS synthesis",
"allowed_origin": "https://api.elevenlabs.io",
"injection_field": "x-api-key"
}
Responses
| Status | Description |
200 | Secret link registered. The link record is returned under `data`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
link_id | string<uuid> | Platform-assigned link identifier (UUIDv7). |
production_id | string<uuid> | Production this link belongs to. |
vault_id | string<uuid> | Vault containing the linked secret. |
item_key | string | Key of the secret item within the vault. |
purpose | string | Declared purpose of the link. |
allowed_origin | string | null | Optional origin constraint for the credential. |
injection_field | string | null | Optional target field for injection. |
created_at | string<date-time> | When the link was created. |
DELETE /v1/projects/{projectId}/studio/productions/{productionId}/secrets/{linkId}
Remove a vault secret link from a production
Removes a previously registered vault secret link from the production. The underlying vault item is not modified; only the link record is deleted. Future renders will no longer have access to the referenced credential via this link.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
linkId | path | string<uuid> | yes | Secret link identifier (UUIDv7) as returned by the link-secret endpoint. |
Request Body
Optional body — ignored by the SP; may be omitted entirely.
Responses
| Status | Description |
200 | Secret link removed. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
PUT /v1/projects/{projectId}/studio/productions/{productionId}/sfx
Replace the sound-effect placements for a production
Replaces the entire list of sound-effect placements for the production (replace-the-set semantics). Each placement references an asset_id from the org media library with a timeline position and volume. The SP validates structure and asset existence.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
productionId | path | string<uuid> | yes | Production identifier (UUIDv7). |
Request Body
Generic replace-the-set content body. The SP is the authority for structure validation; the route passes the full body through. This schema accepts any well-formed JSON object.
Responses
| Status | Description |
200 | SFX placements replaced. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/prove/projects/{projectId}/dag/deverify-all
Bulk-reset all project theorems to provisional
Bulk-flips every theorem in the project DAG back to provisional status and enqueues a fresh kernel replay pass. The optional `reason` field is appended to the audit row. Project-admin (or org-admin/owner) only — the `isAdmin` flag derived from the JWT is forwarded to the DO for enforcement. A non-admin member will receive `403`. The request body is optional; an absent `Content-Type` or empty body is treated as `{}`. A non-object body (e.g. an array or scalar) is rejected with `INVALID_JSON`. Requires an active Backbuild Prove `dag-project` entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
reason | string | no | Optional free-text reason for the deverification. Appended to the audit row in the stored procedure (≤ 2 000 characters). |
Responses
| Status | Description |
200 | Deverification completed. `affected` is the number of nodes reset to provisional. |
400 | `INVALID_JSON` — the request body is not a JSON object (e.g. it is an array or scalar). `VALIDATION_ERROR` — `reason` exceeds 2000 characters or an unknown key is present. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — the caller is not a project-admin, org-admin, or org-owner. Entitlement errors: `BILLING_SUBSCRIPTION_REQUIRED`, `BILLING_TIER_UPGRADE_REQUIRED`, `BILLING_ADDON_REQUIRED`. |
404 | `NOT_FOUND` — the project does not exist, is inactive, or is not accessible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
501 | `NOT_IMPLEMENTED` — the project-serializer Durable Object is not yet wired (Phase-3 scaffolding). |
503 | `SERVICE_UNAVAILABLE` — the project-serializer Durable Object binding is not configured or is unreachable. |
200 response body: data fields
| Field | Type | Description |
affected | integer | Number of theorem nodes reset to provisional status. |
reason | string | null | The `reason` value that was recorded in the audit row; `null` when no reason was supplied. |
GET /v1/prove/projects/{projectId}/dag/manifest
Get the project DAG manifest
Returns the current project DAG manifest (`headHash`, `nodeCount`, `lastFlushAt`, and optionally the node list). When the `since` query parameter is supplied the response includes only nodes admitted after that head hash (incremental sync). Project members with `prove.read` permission can call this endpoint. Requires an active Backbuild Prove `dag-project` entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
since | query | string | no | Optional DAG head hash. When supplied, only nodes admitted after this hash are returned (incremental sync). Omit to receive the full manifest. |
Responses
| Status | Description |
200 | Current project DAG manifest. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — the caller does not have `prove.read` permission on this project. `BILLING_SUBSCRIPTION_REQUIRED`, `BILLING_TIER_UPGRADE_REQUIRED`, or `BILLING_ADDON_REQUIRED` — entitlement check failed. |
404 | `NOT_FOUND` — the project does not exist, is inactive, or is not accessible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
501 | `NOT_IMPLEMENTED` — the project-serializer Durable Object is not yet wired (Phase-3 scaffolding). |
503 | `SERVICE_UNAVAILABLE` — the project-serializer Durable Object binding is not configured or is unreachable. |
200 response body: data fields
| Field | Type | Description |
headHash | string | null | Current DAG head hash. `null` when the DAG is empty (no nodes admitted yet). |
nodeCount | integer | Total number of nodes admitted to the project DAG. |
lastFlushAt | string | null | Timestamp of the most recent durable-storage flush. `null` if no flush has occurred yet. |
nodes | array of object | When `since` is omitted the full node list is returned; when `since` is supplied only nodes admitted after that head hash are included. |
GET /v1/prove/projects/{projectId}/dag/node/{name}
Get a single DAG node by name
Returns a single DAG node by its theorem name. The `name` path segment is captured greedily so multi-segment names containing `/` (e.g. `algebra/group/group_assoc`) round-trip correctly. The name must match the §3.1 byte set (`a-zA-Z0-9/_:.-`), be at most 256 UTF-8 bytes, and may not contain `.` or `..` path segments. Project members with `prove.read` permission can call this endpoint. Requires an active Backbuild Prove `dag-project` entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
name | path | string | yes | Theorem name. Must match the §3.1 byte set (`a-zA-Z0-9/_:.-`), be at most 256 UTF-8 bytes, and must not contain `.` or `..` path segments. Multi-segment names separated by `/` are captured as a single parameter. |
Responses
| Status | Description |
200 | The DAG node record. |
400 | `VALIDATION_ERROR` — the `name` path parameter does not match the §3.1 byte set, exceeds 256 UTF-8 bytes, or contains a `.` or `..` segment. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — the caller does not have `prove.read` permission on this project. Entitlement errors: `BILLING_SUBSCRIPTION_REQUIRED`, `BILLING_TIER_UPGRADE_REQUIRED`, `BILLING_ADDON_REQUIRED`. |
404 | `NOT_FOUND` — the project or the named node does not exist, or is not accessible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
501 | `NOT_IMPLEMENTED` — the project-serializer Durable Object is not yet wired (Phase-3 scaffolding). |
503 | `SERVICE_UNAVAILABLE` — the project-serializer Durable Object binding is not configured or is unreachable. |
200 response body: data fields
| Field | Type | Description |
name | string | Theorem name (§3.1 byte set). |
domain | string | Domain identifier. |
category | string | null | Category label; null when not set. |
statement | string | null | Plain-text theorem statement; null when not set. |
orgId | string<uuid> | Owning organization identifier (UUIDv7), injected by the DO. |
projectId | string<uuid> | Owning project identifier (UUIDv7), injected by the DO. |
nodeHash | string | BLAKE3-derived node hash (hex), produced by the DO per §3.4. |
bodyHash | string | BLAKE3-derived body hash (hex), produced by the DO per §3.4. |
admittedAt | string<date-time> | Timestamp at which the DO admitted this node. |
admittedBy | string<uuid> | User ID of the caller who admitted the node (from the JWT, injected by the DO). |
admittedOrgId | string<uuid> | Organization of the admitting user (from the JWT, injected by the DO). |
depOrder | integer | null | Dependency-order hint; null when not supplied. |
upstream | array of object | Upstream dependency references (canonical order per §3.4 sort criterion). |
lean4Equiv | string | null | Lean 4 equivalence reference; null when not set. |
notes | string | null | Free-form notes; null when not set. |
proofClass | string (enum) unauditedpendinggenuinecross_validatedinvalidunprovenpromoted | Canonical proof-class label. The allowed set is unified across the API schema, the `api.prove_project_theorem_upsert` stored-procedure allowlist, and the `chk_prove_project_theorems_proof_class` database CHECK constraint. |
POST /v1/prove/projects/{projectId}/dag/register
Register a theorem into the project DAG
Registers a theorem node into the caller's project DAG. The body mirrors the `bbprove-serializer::NodeRequest` wire format (§3.1 of the DAG state-cache spec). `orgId` and `projectId` are derived from the JWT claim and the URL path; they are never accepted in the request body (`.strict()` rejects unknown top-level keys with `VALIDATION_ERROR`). The project is pre-flight validated before dispatching to the project-serializer Durable Object — an unknown or inactive project, or a project the caller cannot access, is reported as `403`/`404`. Requires an active Backbuild Prove subscription and the `dag-project` feature entitlement. `prove.write` permission on the project is enforced inside the DO-backed stored procedure.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
name | string | yes | Theorem name. Must match the §3.1 byte set (`a-zA-Z0-9/_:.-`), be at most 256 UTF-8 bytes, and must not contain `.` or `..` path segments. |
latex | string | yes | LaTeX source for the theorem (1 byte – 10 MiB). |
domain | string | yes | Domain identifier (1–100 characters). |
category | string | no | Optional category label (≤ 100 characters). |
statement | string | no | Optional plain-text statement of the theorem (≤ 100 000 characters). |
depOrder | integer | no | Optional dependency-order hint (0–100 000). Used by the kernel for topological ordering. |
upstream | array of object | no | Upstream dependency references (≤ 10 000 items). The DO canonicalises ordering before §3.4 BLAKE3 hashing; clients may submit in any order. |
lean4Equiv | string | no | Optional Lean 4 equivalence reference identifier (≤ 500 characters). |
notes | string | no | Optional free-form notes (≤ 10 000 characters). |
proofClass | string (enum) unauditedpendinggenuinecross_validatedinvalidunprovenpromoted | no | Canonical proof-class label. The allowed set is unified across the API schema, the `api.prove_project_theorem_upsert` stored-procedure allowlist, and the `chk_prove_project_theorems_proof_class` database CHECK constraint. |
conclusionTerm | string | no | Optional Rust-aligned hash-input field for the conclusion term (≤ 1 MiB). Used by `lib.rs` for `body_hash` computation. Required once the bbprove CLI is updated to forward it. |
ledgerSteps | integer | no | Optional proof ledger step count (0–2³²−1). |
rulesUsed | array of string | no | Optional list of rule identifiers used in the proof (≤ 8 192 entries, each ≤ 256 characters). |
lean4Typechecks | boolean | no | Whether the Lean 4 equivalence (`lean4Equiv`) successfully typechecks. |
Responses
| Status | Description |
200 | Theorem admitted. The admitted DAG node is returned under `data.node`. |
400 | `INVALID_JSON` — the request body is not parseable JSON or is not a JSON object. `VALIDATION_ERROR` — a required field is missing, a field fails its type/bounds/enum constraint, or an unknown top-level key is present (strict schema). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — the caller does not have `prove.write` permission on this project, or the project pre-flight access check denied access. `BILLING_SUBSCRIPTION_REQUIRED` — the organization has no active Backbuild Prove subscription. `BILLING_TIER_UPGRADE_REQUIRED` — the `dag-project` feature requires a higher plan tier. `BILLING_ADDON_REQUIRED` — the SQL Verification add-on is required. |
404 | `NOT_FOUND` — the project does not exist, is inactive, or is not accessible to the caller (uniform 404; no existence oracle). |
409 | `CONFLICT` — a node with the same name already exists in the project DAG. `CONCURRENT_MODIFICATION` — a concurrent write to the same DAG cell created a contention conflict; the caller should re-fetch and retry. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
501 | `NOT_IMPLEMENTED` — the project-serializer Durable Object is not yet wired for this environment (Phase-3 scaffolding). The validation and authorization envelope is exercised; only the final DO dispatch is pending. |
503 | `SERVICE_UNAVAILABLE` — the project-serializer Durable Object binding is not configured for this environment, or the DO is unreachable. |
200 response body: data fields
| Field | Type | Description |
node | object | A single admitted DAG node as returned by the project-serializer Durable Object. All hash and audit fields are DO-injected and immutable post-admission. |
POST /v1/prove/projects/{projectId}/dag/sync
Force an immediate DAG state flush
Triggers an operator-initiated immediate flush of the project serializer's dirty in-memory state to durable storage. Project-admin (or org-admin/owner) only — enforced by the `prove.write` permission check and an org-admin role check inside the stored procedure. A non-admin member with `prove.read` will receive `403`. Requires an active Backbuild Prove `dag-project` entitlement.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
projectId | path | string<uuid> | yes | Project identifier (UUIDv7). |
Responses
| Status | Description |
200 | Sync completed (or state was already clean — `flushed: false`). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — the caller lacks project-admin (or org-admin/owner) access. Entitlement errors: `BILLING_SUBSCRIPTION_REQUIRED`, `BILLING_TIER_UPGRADE_REQUIRED`, `BILLING_ADDON_REQUIRED`. |
404 | `NOT_FOUND` — the project does not exist, is inactive, or is not accessible to the caller. |
409 | `CONFLICT` — a concurrent flush is already in progress; retry after the current flush completes. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
501 | `NOT_IMPLEMENTED` — the project-serializer Durable Object is not yet wired (Phase-3 scaffolding). |
503 | `SERVICE_UNAVAILABLE` — the project-serializer Durable Object binding is not configured or is unreachable. |
200 response body: data fields
| Field | Type | Description |
flushed | boolean | `true` when a flush was performed; `false` when the state was already clean and no flush was needed. |
headHash | string | null | DAG head hash after the flush. `null` when the DAG is empty. |
flushedAt | string | null | Timestamp of the flush. `null` when `flushed` is `false`. |
POST /v1/science/academic/subscriptions
Create an academic subscription
Activates the academic subscription by consuming a completed verification. The plan is pinned from the verification row (not the body).
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
verification_id | string<uuid> | yes | A completed verification to consume. |
Responses
| Status | Description |
200 | The activated subscription (or an existing one reused). |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | `NOT_FOUND` — the referenced verification does not exist. |
409 | `CONFLICT` — an active subscription already exists. |
422 | `VALIDATION_ERROR` — the verification is not in a consumable state. |
500 | `DATABASE_ERROR`. |
200 response body: data fields
| Field | Type | Description |
subscription_id | string<uuid> | |
plan_key | string | The academic plan key. |
status | string | Subscription status. |
cancel_at | string | null | |
metadata | object | |
reused | boolean | True when an existing subscription was returned. |
POST /v1/science/academic/subscriptions/{subscription_id}/renew
Renew an academic subscription
Renews an academic subscription by consuming a fresh completed verification (academic status must be re-confirmed each term).
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
subscription_id | path | string<uuid> | yes | Subscription identifier (UUIDv7). |
Request Body
| Field | Type | Required | Description |
verification_id | string<uuid> | yes | A fresh completed verification to consume for the renewal. |
Responses
| Status | Description |
200 | The renewed subscription. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
409 | 409 Conflict — the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate). |
422 | `VALIDATION_ERROR` — the verification is not consumable or the subscription cannot be renewed in its current state. |
500 | `DATABASE_ERROR`. |
200 response body: data fields
| Field | Type | Description |
subscription_id | string<uuid> | |
plan_key | string | The academic plan key. |
status | string | Subscription status. |
cancel_at | string | null | |
metadata | object | |
reused | boolean | True when an existing subscription was returned. |
GET /v1/science/academic/subscriptions/current
Get the current academic subscription
Returns the caller's current academic subscription for the Backbuild Science package, if any.
Auth Session JWT (Bearer)
Responses
| Status | Description |
200 | The current subscription (or null when none). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
subscription_id | string<uuid> | |
plan_key | string | The academic plan key. |
status | string | Subscription status. |
cancel_at | string | null | |
metadata | object | |
reused | boolean | True when an existing subscription was returned. |
POST /v1/science/academic/verifications
Initiate academic verification
Starts an academic identity/affiliation verification for the authenticated user and creates the external KYC handoff session. The organization and user are pinned from the session (never accepted in the body). An existing in-flight verification may be reused (`reused: true`).
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
requested_plan_slug | string (enum) academic_free | yes | The verification-gated plan being requested. |
return_url | string<uri> | no | HTTPS URL the verified user is redirected back to after the KYC handoff. Must be https (a javascript: or other scheme is rejected). |
Responses
| Status | Description |
200 | Verification initiated (or an existing one reused). |
400 | `INVALID_JSON` (unparseable body) or `VALIDATION_ERROR` (bad `requested_plan_slug`, non-https `return_url`, or unknown field). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
409 | `CONFLICT` — a conflicting verification or subscription state. |
422 | `VALIDATION_ERROR` — the requested plan is not verification-eligible or the state transition is invalid. |
500 | `DATABASE_ERROR` / `INTERNAL_ERROR`. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | Verification id. |
org_id | string<uuid> | |
user_id | string<uuid> | |
status | string | Verification status. |
requested_plan_slug | string | The requested plan. |
created_at | string<date-time> | |
reused | boolean | True when an existing in-flight verification was returned. |
GET /v1/science/academic/verifications/{id}
Get a verification
Returns the status and details of an academic verification the caller owns (or may review).
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
id | path | string<uuid> | yes | Verification identifier (UUIDv7). |
Responses
| Status | Description |
200 | The verification record. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
id | string<uuid> | |
org_id | string<uuid> | |
user_id | string<uuid> | |
requested_plan_slug | string | |
didit_session_id | string | null | External KYC session reference. |
status | string | e.g. pending, completed, declined, expired. |
document_type | string | null | |
document_country | string | null | |
expires_at | string | null | |
declined_reason | string | null | |
consumed_subscription_id | string | null | |
consumed_at | string | null | |
created_at | string<date-time> | |
updated_at | string<date-time> | |
POST /v1/science/academic/verifications/bulk-import
Bulk-import academic verifications
Reviewer endpoint to create verification rows on behalf of subject users (1–500 per call), e.g. from an institution roster. Requires the academic-review capability. Also reachable at `/v1/science/verifications/bulk-import`.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
rows | array of object | yes | Verification rows to create. |
provider | string | no | Source provider/label for the import batch. |
Responses
| Status | Description |
200 | Import summary (created / skipped counts). |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — the caller lacks the academic-review capability. |
422 | `VALIDATION_ERROR` — a row failed validation. |
500 | `DATABASE_ERROR`. |
POST /v1/science/academic/verifications/erase
Erase academic verification data (GDPR)
GDPR Article 17 erasure of a subject's academic verification data. The subject erases their own data when `user_id` is omitted; a super-admin or academic-review holder may target another subject. Also reachable at `/v1/science/verifications/erase`.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
user_id | string<uuid> | no | Subject to erase (defaults to the caller). |
Responses
| Status | Description |
200 | Erasure completed. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | `FORBIDDEN` — not permitted to erase another subject's data. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | `DATABASE_ERROR`. |
POST /v1/science/substrate/clone
Clone the Substrate Framework into the caller's organization
Copies the canonical read-only Substrate Framework project (all documents and structure) into the authenticated user's organization as a new project. Requires an active Backbuild Science subscription for the organization; organization admin or owner role is required. Subsequent edits to the cloned project are blocked until the clone is forked via `POST /v1/science/substrate/fork`. If an identical clone already exists the operation is idempotent: `already_existed` is `true` and `backfilled` reflects whether any missing documents were re-added.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
name | string | no | Display name for the cloned project. Defaults to `'Substrate Framework'` when omitted. |
slug | string | no | URL-safe slug for the cloned project (1–100 chars; must start with alphanumeric; allowed characters: `a-z A-Z 0-9 space _ -`). Defaults to `'substrate-framework'` when omitted. |
{
"name": "Substrate Framework",
"slug": "substrate-framework"
}
Responses
| Status | Description |
201 | Clone created (or already existed). The project record stub is returned under `data`. |
400 | `INVALID_JSON` (unparseable body), `VALIDATION_ERROR` (a field failed schema validation — e.g. slug contains illegal characters or exceeds 100 chars). |
401 | `AUTH_REQUIRED` — no valid session token presented. |
403 | `FORBIDDEN` — caller lacks the required admin or owner role within the organization. |
409 | `CONFLICT` — a project with the supplied slug already exists in the organization, a duplicate clone conflict occurred, or the organization does not have an active Backbuild Science subscription (paywall precondition not met). |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
201 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | Platform-assigned identifier (UUIDv7) of the newly created or existing clone project. |
cloned_from | string<uuid> | Identifier of the canonical Substrate source project that was cloned. |
org_id | string<uuid> | Organization that received the clone. |
documents_cloned | integer | Number of documents copied into the clone project. |
already_existed | boolean | `true` when a clone already existed for this organization and was not re-created. |
backfilled | boolean | `true` when the existing clone was missing some documents and they were backfilled from the canonical source. |
POST /v1/science/substrate/fork
Fork a read-only Substrate clone into an editable copy
Creates a fully editable fork of an existing read-only Substrate Framework clone. This is the standard resolution of a `FORK_REQUIRED` error returned when a caller attempts to edit a readonly clone via `api.document_update` or `api.project_update`. The fork inherits all documents from the source clone; subsequent writes target the fork. Requires organization admin, owner, or developer role.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
source_project_id | string<uuid> | yes | UUIDv7 of the existing read-only Substrate clone to fork. Must belong to the caller's organization. |
name | string | no | Display name for the forked project. Defaults to a platform-generated name when omitted. |
slug | string | no | URL-safe slug for the forked project (1–100 chars; must start with alphanumeric; allowed characters: `a-z A-Z 0-9 space _ -`). Auto-generated from the name when omitted. |
{
"source_project_id": "019d0000-0000-7000-8000-000000000000",
"name": "My Substrate Fork",
"slug": "my-substrate-fork"
}
Responses
| Status | Description |
201 | Fork created. The new editable project record is returned under `data`. |
400 | `INVALID_JSON` (unparseable body), `VALIDATION_ERROR` (a field failed schema validation — e.g. `source_project_id` is not a valid UUID). |
401 | `AUTH_REQUIRED` — no valid session token presented. |
403 | `FORBIDDEN` — caller lacks admin, owner, or developer role, or does not own the source clone. |
404 | `NOT_FOUND` — `source_project_id` does not exist or is not visible to the caller's organization. |
409 | `CONFLICT` — a project with the supplied slug already exists in the organization. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
201 response body: data fields
| Field | Type | Description |
project_id | string<uuid> | Platform-assigned identifier (UUIDv7) of the newly created editable fork project. |
forked_from | string<uuid> | Identifier of the source read-only clone that was forked. |
org_id | string<uuid> | Organization that owns the fork. |
documents_forked | integer | Number of documents copied into the fork project. |
POST /v1/studio/media/upload
Upload an audio file to the org media library
Validates, registers, and stores an audio file (music or SFX) in the organization's media library in a single call. The audio bytes are supplied as a base64-encoded string. The endpoint performs: MIME allow-list check, byte-level magic-byte content sniff, 25 MB size enforcement, and a deny-list hash check. On success the asset row is created with a server-derived R2 storage key and the bytes are written to R2. Returns the `MediaAsset` record including `asset_id` for use in music/SFX production placements.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
kind | string (enum) musicsfx | yes | Asset category: `music` for background tracks, `sfx` for sound effects. |
mime | string | yes | MIME type of the audio file (e.g. `audio/mpeg`, `audio/wav`, `audio/ogg`, `audio/flac`). Must be in the platform audio allow-list. |
filename | string | no | Optional original filename for display purposes. |
data_base64 | string | yes | Base64-encoded audio file bytes. Maximum decoded size is 25 MB. |
duration_ms | integer | no | Optional audio duration in milliseconds (0–86 400 000). When omitted the renderer measures it during the first render pass. |
{
"kind": "music",
"mime": "audio/mpeg",
"filename": "background-loop.mp3",
"data_base64": "<base64-encoded audio bytes>",
"duration_ms": 120000
}
Responses
| Status | Description |
200 | Audio uploaded and registered. The `MediaAsset` record including `asset_id` is returned under `data`. |
400 | `VALIDATION_ERROR` (missing/invalid fields, invalid base64, empty file, file exceeds 25 MB), `UNSUPPORTED_FILE_TYPE` (MIME type not in the audio allow-list, or magic-byte sniff failed), `UPLOAD_SUPPRESSED` (content matches the platform deny list). |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `SERVICE_UNAVAILABLE` — the upload suppression check service or R2 storage binding was unavailable. |
200 response body: data fields
| Field | Type | Description |
asset_id | string<uuid> | Platform-assigned asset identifier (UUIDv7). |
org_id | string<uuid> | Owning organization. |
kind | string (enum) musicsfx | Asset category. |
mime | string | MIME type of the asset. |
duration_ms | integer | null | Duration of the audio asset in milliseconds. |
r2_key | string | null | Storage key for the asset bytes in R2 (server-assigned). |
checksum_sha256 | string | null | SHA-256 hex digest of the asset bytes. |
created_at | string<date-time> | When the asset was registered. |
GET /v1/studio/shapes
List available shapes in the org shape library
Returns the organization's available shapes — SVG-based graphic primitives and imported shape assets that can be placed as overlays in productions.
Auth Session JWT (Bearer)
Responses
| Status | Description |
200 | List of available shape records. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/studio/shapes/import
Import a shape into the org shape library
Imports an SVG shape asset into the organization's shape library. The imported shape is immediately available for use as an overlay in productions. The SP validates the SVG structure and assigns a platform `shape_id`.
Auth Session JWT (Bearer)
Request Body
Generic replace-the-set content body. The SP is the authority for structure validation; the route passes the full body through. This schema accepts any well-formed JSON object.
Responses
| Status | Description |
200 | Shape imported. The shape record including `shape_id` is returned under `data`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
shape_id | string<uuid> | Platform-assigned shape identifier (UUIDv7). |
org_id | string<uuid> | Owning organization. |
display_name | string | null | Human-readable display name for the shape. |
created_at | string<date-time> | When the shape was imported. |
GET /v1/studio/voices
List available voices
Returns the organization's available TTS voices, including both the platform's built-in voice catalog and any custom voices the organization has added. Voices are referenced by `voice_id` in production script speaker assignments.
Auth Session JWT (Bearer)
Responses
| Status | Description |
200 | List of available voices. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
POST /v1/studio/voices
Add a custom voice to the organization library
Registers a custom TTS provider voice in the organization's voice library by its external provider identifier. The `provider_voice_id` is the identifier assigned by the TTS provider (e.g. ElevenLabs voice id). The voice is available immediately for use in production speaker assignments.
Auth Session JWT (Bearer)
Request Body
| Field | Type | Required | Description |
provider_voice_id | string | yes | External provider identifier for the voice (e.g. ElevenLabs voice id). |
display_name | string | yes | Human-readable display name for the voice in the Studio editor. |
{
"provider_voice_id": "Vek2E11z0mkT8fYiTyI0",
"display_name": "Primary Narrator"
}
Responses
| Status | Description |
200 | Voice registered. The new voice record is returned under `data`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
409 | 409 Conflict — the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate). |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
voice_id | string<uuid> | Platform-assigned voice identifier (UUIDv7). |
provider_voice_id | string | null | External provider identifier for custom voices (e.g. ElevenLabs voice id). |
display_name | string | Human-readable voice name for display in the Studio editor. |
is_custom | boolean | `true` for organization-added custom voices; `false` for platform built-in voices. |
created_at | string<date-time> | When the voice was added. |
PATCH /v1/studio/voices/{voiceId}
Update a custom voice in the organization library
Partially updates a custom voice record (e.g. display_name, settings). The SP is the authority for which fields are mutable; only custom (non-platform) voices owned by the organization may be updated.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
voiceId | path | string<uuid> | yes | Voice identifier (UUIDv7). |
Request Body
Generic replace-the-set content body. The SP is the authority for structure validation; the route passes the full body through. This schema accepts any well-formed JSON object.
Responses
| Status | Description |
200 | Voice updated. The updated voice record is returned under `data`. |
400 | 400 Bad Request — a request parameter, body field, or the JSON body itself failed validation. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
200 response body: data fields
| Field | Type | Description |
voice_id | string<uuid> | Platform-assigned voice identifier (UUIDv7). |
provider_voice_id | string | null | External provider identifier for custom voices (e.g. ElevenLabs voice id). |
display_name | string | Human-readable voice name for display in the Studio editor. |
is_custom | boolean | `true` for organization-added custom voices; `false` for platform built-in voices. |
created_at | string<date-time> | When the voice was added. |
DELETE /v1/studio/voices/{voiceId}
Remove a custom voice from the organization library
Removes a custom voice from the organization's voice library. Only custom (non-platform) voices owned by the organization may be deleted. Voices referenced in existing production scripts are not automatically removed from those scripts.
Auth Session JWT (Bearer)
Parameters
| Name | In | Type | Required | Description |
voiceId | path | string<uuid> | yes | Voice identifier (UUIDv7). |
Request Body
Optional body — ignored by the SP; may be omitted entirely.
Responses
| Status | Description |
200 | Voice removed. |
401 | 401 Unauthorized — missing, expired, malformed, or revoked credentials. |
403 | 403 Forbidden — authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement. |
404 | 404 Not Found — the requested resource does not exist or is not visible to the caller. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
GET /v1/verify/{id}
Verify a proof certificate bundle
Public, unauthenticated endpoint for verifying a Backbuild Prove proof-certificate bundle by its identifier. Returns a cryptographic verification verdict: the bundle's Ed25519 signature is replayed against the canonical manifest bytes and the signing key is checked against the operator-managed trusted-issuer registry before `verified: true` is reported. A revoked bundle is always `verified: false` regardless of signature validity. When the verifier has not been enabled by the operator, every request returns `503 VERIFICATION_OFFLINE` — the service never advertises a verdict it has not computed. Rate-limited to 60 requests per minute per IP (IPv6 addresses are bucketed to /64). Requires no authentication (`security: []`).
Public Public: no authentication
Parameters
| Name | In | Type | Required | Description |
id | path | string<uuid> | yes | Proof certificate bundle identifier (UUID). |
Responses
| Status | Description |
200 | Verification result. `verification.verified` is `true` only when the signature is valid AND the signing key is in the trusted-issuer registry AND the bundle has not been revoked. Check `verification.reason` for the specific outcome. |
400 | `INVALID_ID_FORMAT` — `id` is not a valid UUID. |
404 | `NOT_FOUND` — no bundle with this identifier. |
429 | `RATE_LIMIT_EXCEEDED` — the IP has exceeded 60 requests per minute. |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `VERIFICATION_OFFLINE` — the proof verifier is not currently enabled. This is NOT a transient error — the operator has not yet provisioned the trusted-issuer key registry. Retry only after the operator has enabled the verifier. Also returned when the rate-limiter service is unavailable (fail-closed) or the request arrived without a Cloudflare-provided IP header. |
200 response body: data fields
| Field | Type | Description |
bundle | object | Public-facing proof certificate bundle record. |
verification | object | Cryptographic verification verdict for a proof certificate bundle. |
POST /v1/verify/binary
Match a binary against the proof certificate catalog
Public, unauthenticated endpoint. Accepts either a JSON body with a pre-computed `sha256_hex` or a raw binary upload (`application/octet-stream`, max 50 MB). Returns all proof certificate bundles whose `bundle_sha256_hex` matches the supplied digest. An empty `matches` array means no published bundle records this binary's hash — it does not indicate the binary is untrustworthy. Subject to the same operator-enable gate and IP rate-limit as `GET /v1/verify/{id}`. Requires no authentication (`security: []`).
Public Public: no authentication
Request Body
| Field | Type | Required | Description |
sha256_hex | string | yes | Lowercase SHA-256 hex digest of the binary to match (64 hex characters). |
Responses
| Status | Description |
200 | Lookup complete. `matched` is `true` when at least one bundle record contains this binary's hash. |
400 | `VALIDATION_ERROR` — neither a valid `sha256_hex` (64-character hex) nor an octet-stream body was supplied. Also returned for an empty octet-stream body. |
413 | `PAYLOAD_TOO_LARGE` — the uploaded binary exceeds 50 MB. |
429 | `RATE_LIMIT_EXCEEDED` — IP rate limit exceeded (60 req/min). |
500 | 500 Internal Server Error — an unexpected server-side error. The message is sanitized; the correlation id is logged server-side. |
503 | `VERIFICATION_OFFLINE` — the proof verifier is not currently enabled. Also returned when the rate-limiter service is unavailable (fail-closed). |
200 response body: data fields
| Field | Type | Description |
binary_sha256_hex | string | The SHA-256 digest that was looked up (either supplied or computed from the uploaded binary). |
matches | array of object | Bundle records whose `bundle_sha256_hex` equals the supplied digest. An empty array means no published bundle records this binary. |
matched | boolean | `true` when at least one bundle record contains this binary's hash. |
verified_at | string<date-time> | ISO 8601 timestamp when the lookup was performed. |