API Reference
The public API reference now includes a site-rendered Work Run correction OpenAPI slice.
Correction OpenAPI evidence exists in owner repos:
retvest-contracts owns the shared
openapi/openapi.json snapshot at version 4.1.0 plus the Work Run correction
fixture and consumer pin, retvest-platform owns the runtime route/schema
implementation, and retvest-sdk owns SDK and CLI distribution claims. Hosted
API docs, package-registry release evidence, and customer automation proof
remain pending.
The committed correction slice is a pinned source-publication snapshot; it is
not proof that a newly bumped shared contract has been propagated to every
consumer.
Current Workflow
- Track publication notes in
docs-api/README.md; it stays paired with this customer-facing API reference. - Review the rendered publication boundary in API publication status.
- Inspect the committed correction-slice artifacts: OpenAPI JSON and OpenAPI HTML. This is not a full hosted API-doc availability claim.
- Keep the source-publication correction fixture visible:
docs-api/work-run-correction-openapi-sdk-fixtures.json. - Validate the correction publication artifacts and wording:
make api-publication-artifacts
- Build the Docusaurus source:
make docs-build
Auth Model
Retvest API docs should describe the auth model only at the publication level until the generated schema is committed. Exact routes, operation IDs, scopes, request bodies, response bodies, and error envelopes must come from the platform-owned OpenAPI artifact.
Expected security families:
- Session cookies for interactive browser flows.
- Refresh cookies for token rotation.
- Bearer API keys for scoped automation.
- Metrics bearer token for Prometheus scrape access.
- SCIM bearer token for provisioning endpoints.
API-key-enabled operations should advertise their required scope in OpenAPI metadata. Session-only routes should stay session-only when browser context or CSRF protection is required.
Endpoint Families
- Auth, MFA, sessions, SSO, SCIM, and API keys.
- Collections, documents, document versions, ACLs, connectors, and reindexing.
- RAG query, streaming query, conversation threads, and admin analytics.
- Compliance bundle, audit chain, model registry, license status, and LLM admin.
- Health, readiness, metrics, and operator diagnostics.
RAG Streaming Publication Boundary
The source-only RAG streaming SSE protocol fixes the
site-side success media type for POST /rag/query/stream as
text/event-stream and documents the ordered citation, token, error,
and done event vocabulary. It is not a generated OpenAPI snapshot, a live
stream capture, SDK distribution proof, or proof that platform, SDK, and app
consumer pins have synchronized.
Correction API Publication Map
Work Run correction source docs are split by operator action so public examples
can stay precise without treating hosted API docs, package-registry artifacts,
or customer automation as launch-ready. Treat the paths below as
source-publication anchors backed by the owner-repo correction evidence named in
docs-api/work-run-correction-openapi-sdk-fixtures.json.
| Action | Source docs | Publication boundary |
|---|---|---|
| Understand the correction lifecycle | Correction lifecycle for draft, pending review, applied, rejected, superseded, stale-version refresh, and retry-after wait states | Operator state guidance only; not hosted API docs proof or final UI browser evidence. |
| Follow the operator runbook | Recording corrections for correction create, history read, audit read, and Problem handling | Operational guidance only; exact decision endpoints, scopes, and schemas remain contract/platform-owned. |
| Create a pending correction | Create corrections for POST /admin/work-runs/{work_run_id}/corrections |
Contract evidence exists; examples must keep idempotency metadata bounded and metadata-only even with the committed source-only site-rendered API docs slice. |
| List correction history | List corrections for GET /admin/work-runs/{work_run_id}/corrections |
Cursor pagination shape and response members are pinned by owner artifacts but still source-publication examples here. |
| Read correction audit metadata | Audit visibility for GET /admin/work-runs/{work_run_id}/corrections/audit |
Audit examples may show bounded sequence, status, request id, receipt, visibility scope, and hash metadata only. |
| Apply a correction | Apply corrections for POST /admin/work-runs/{work_run_id}/corrections/{correction_id}/apply |
Expected-version, request-id propagation, retry handling, and typed Problem members remain source-publication examples tied to checked contract evidence. |
| Reject a correction | Reject corrections for POST /admin/work-runs/{work_run_id}/corrections/{correction_id}/reject |
Rejection examples must stay metadata-only and must not publish raw rejected correction text. |
| Request retry | Request retry for POST /admin/work-runs/{work_run_id}/corrections/{correction_id}/retry |
expected_work_run_version, retry-created pending rows, already-finalized Problems, invalid-transition Problems, and approval/export gate examples remain source-publication examples backed by checked fixtures. |
| Handle correction API errors | Correction API errors for fixture-aligned success and Problem examples | Request IDs, Retry-After, idempotency, expected-version conflicts, cursor pagination, and unsafe retry boundaries remain source-publication examples backed by checked contract fixtures. |
| Use SDK source-package helpers | Correction SDK examples for TypeScript and Python helper names, typed Problems, retry policy, and shipped limits | Source packages expose helpers; this does not claim package registry distribution, hosted API docs, or customer automation proof. |
Do not generate customer automation from these source docs or the
correction-slice rendering alone. The rendered JSON/HTML proves only the
committed correction OpenAPI slice, not a full hosted API-doc availability
claim. Source-package correction helper docs may describe
the shipped append-only semantics, typed Problem handling, request ID propagation,
Retry-After behavior, idempotency semantics, shipped limits, and expected-version and expected_work_run_version member names
verified in the owner repos.
Publication Caveat
Do not generate customer automation or full hosted API pages from an unreviewed runtime schema. Public API publication remains bounded to the committed correction slice until production docs hosting, indexing, and SDK/package evidence are verified. A moved shared contract still requires owner-repo consumer sync before public copy treats it as current.