Canopy API Reference

For an integrator consuming a canopy REST surface: this page is the entry point. Each JSON API service exposes a utoipa-generated OpenAPI 3.1 document that cargo xtask api-docs snapshots into docs/modules/ROOT/openapi/<service>.json (committed, so it ships with every Antora build). The per-service pages below state what the snapshot cannot: the guard behind each route, the coded refusals, the events published and consumed. The bearer shapes and guard families those guards compose are stated once, in Security › The identity receiver and admissions; each page carries only its own route specifics. What a service is lives in the Service Catalog; this table carries only what is specific to its snapshot.

Specifications

To consume a spec interactively, paste the JSON into Swagger Editor (https://editor.swagger.io/) or load the file in Postman / Insomnia. The service list is SERVICES in xtask/src/cmd/api_docs.rs.

Service Spec Service-level reference Snapshot notes

canopy-rules

rules.json

canopy-rules

Service-to-service only; every program service is a caller.

canopy-persons

persons.json

canopy-persons

The ADR-038 X-Canopy-Finalize-* header tag is deliberately absent from the snapshot (an applications-only contract, documented on the page).

canopy-applications

applications.json

canopy-applications

The largest surface (56 paths); the page indexes the RFC 9457 code vocabulary the snapshot’s descriptions only mention.

canopy-eligibility

eligibility.json

canopy-eligibility

Three read routes are registered as literals with no paths.rs constant; when bulk_runs_enabled is off the bulk-run reads and the pause and cancel controls stay live, while create, enact, resume and retry-failures answer 503.

canopy-verification

verification.json

canopy-verification

The worker/portal /v1/verifications surface (9 paths); the /internal/v1 IEVS / SAVE / SSA-SOLQ adapter routes, which admit only their named callers' tokens behind the service’s canopy-identity receiver (#2648), are not in the snapshot.

canopy-enrollment

enrollment.json

canopy-enrollment

POST /v1/enrollments/{id}/terminate stays registered and answers 410.

canopy-renewals

renewals.json

canopy-renewals

Program-parameterized routes (/v1/renewals/{program}/…) sit beside the literal SNAP routes; the literal match wins.

canopy-notices

notices.json

canopy-notices

Eight paths; the event-routing catalogue that drives most letters is ruleset data, not API, and is tabulated on the page.

canopy-appeals

appeals.json

canopy-appeals

The IPV router is merged into the appeals router; both are in one snapshot.

canopy-reporting

reporting.json

canopy-reporting

Composition surface over the program services (ADR-001); no program data of its own.

canopy-security

security.json

canopy-security

The audit subscriber’s write path is the event bus, not HTTP; the snapshot is the read / export / chain surface.

canopy-snap

snap.json

canopy-snap

Mounts its own floor-screened POST /v1/overpayments beside the shared list handler and canopy_overpayments::api::claim_routes(…) (below; #2242).

canopy-tanf

tanf.json

canopy-tanf

Mounts the shared overpayment routes, canopy_overpayments::api::routes(…) (below), over its own database.

canopy-medicaid

medicaid.json

canopy-medicaid

Mounts the same shared overpayment routes, over its own database; CHIP is served by this service.

canopy-caps

caps.json

canopy-caps

—

canopy-wic

wic.json

canopy-wic

—

canopy-web

web.json

canopy-web

The composition API (/v1/composition/*) only. Not in SERVICES: checked by its unit test and cargo xtask api-docs --offline, not fetched from the devstack.

Of the two browser BFFs, canopy-web's pages have no OpenAPI document, only its composition API above, which it serves at /api-doc/openapi.json (canopy-web); canopy-portal has no OpenAPI document. canopy-exchange registers no routes (ADR-034).

Cross-program surfaces

Some types and endpoint shapes appear in several program services rather than in one cross-program service. Per ADR-001 the data stays in each program’s database; the types and wire shape are shared through a workspace crate.

  • Overpayment recovery — crates/canopy-overpayments carries the typed OverpaymentClaim / RepaymentPlan / RecoupmentLedgerEntry shapes, the canonical migration SQL, the store (canopy_overpayments::store) and the HTTP handlers and routes (canopy_overpayments::api). canopy-snap, canopy-tanf and canopy-medicaid each run an identical copy of the tables in their own database and serve the same /v1/overpayments[/…​] paths over it: canopy-tanf and canopy-medicaid mount canopy_overpayments::api::routes(); canopy-snap mounts its own POST /v1/overpayments, which screens a claim against the pack’s pre-establishment claim floors before filing it (#2242), beside the shared list handler and canopy_overpayments::api::claim_routes(…). canopy-reporting composes the cross-program roll-up over HTTP (no cross-program DB access). Lifecycle and rationale: the archived plan.

Pattern precedent: canopy-signing (types shared, signing keys per service) and canopy-policy (types + tooling shared, jurisdiction.toml lives in the pack).

Refresh workflow

Snapshots are refreshed when a contract change is accepted:

cargo xtask dev start              # bring up the devstack
cargo xtask api-docs               # diff the live specs against the snapshots
cargo xtask api-docs --update      # accept the diff (after review)

The unflagged form is one of the cargo xtask validate gates (api-docs), so contract drift is a battery failure. The gate is intentional: pre-1.0 contracts can change, but every change is a deliberate snapshot bump in the same commit as the code.

Live Swagger UI

While the devstack is running, every JSON API service in the table above serves an interactive Swagger UI at /swagger-ui on its own host port (canopy_api::ApiServer). The browser BFFs do not: canopy-web’s strict CSP allows the JSON spec only, and canopy-portal serves none. Host ports are ephemeral — read them from cargo xtask dev status or .ports.env (CANOPY_PORT_<SERVICE>_<CONTAINER_PORT>), then open http://localhost:<port>/swagger-ui.

Edit this page · default