canopy-medicaid API Reference

Overview

Cross-link: canopy-medicaid Data Model (#419)

Medicaid + CHIP program service. Evaluates all 38 PAMMS-defined Categories of Assistance via the CMD (Categories of Medicaid Determination) cascade + EE15 38-COA priority hierarchy. Tracks Transitional Medicaid (TMA) cross-program coverage from canopy-tanf case closures, Express Lane Eligibility evaluations from SNAP/TANF approvals, and an IRC §6103(l)(21)-scoped FTI audit log (ADR-004 + ADR-014). HIPAA-scoped data; FDSH integration in scope.

All eligibility logic runs through the rules engine (ADR-003): the four eligibility rulesets (medicaid-magi, medicaid-non-magi, chip-eligibility, medicaid-eligibility-hierarchy) plus the medicaid-cmd-cascade-priority, medicaid-denial-reasons and medicaid-tma-phase tables (the pack’s), and the federal medicaid-residency and medicaid-cooperation gates (the federal layer’s). PAMMS citations are traced by cargo xtask policy audit.

Base URL

container port 8015 (host: CANOPY_PORT_CANOPY_MEDICAID_8015 in .ports.env); every route below is mounted under /v1

Authentication

Bearer token: a canopy-identity token for this receiver (its aud is urn:canopy:service:canopy-medicaid), authenticated by the service’s identity receiver (ADR-049 Amendment 14): no bearer is 401 token_missing, a token it refuses 401 token_rejected, an X-Canopy-Actor header 400 actor_header_retired, and no trustworthy key set in time 503 keys_unavailable.

Access

canopy-eligibility and canopy-reporting hold system edges to canopy-medicaid (both also delegate onward); canopy-web and canopy-cli reach it by delegation. The writes admit a system caller or the writer bar (the cooperation-finding create the writer bar alone, Cooperation findings (#3189)), the reads a system caller or caseworker+ (canopy-web’s case readers on the listed reads, canopy-reporting’s on the overpayment list), the federal month scope system callers alone; the ELE revoke and renewal run admit admin or quality_control alone, the redaction data_steward, the FTI audit reads fti_auditor, the admin replay admin, and the held-determination list a determination operator’s delegation through canopy-eligibility alone (GET /v1/held-determinations). A refusal is 403 with its ReceiverDenial code (ADR-049 Amendment 14); each route’s constant is in the authorization inventory.

Swagger UI

/swagger-ui on the same host port

Database

canopy_medicaid (isolated per ADR-001; FTI scope under IRC §6103(l)(21), FDSH per CMS guidance, HIPAA-scoped per ADR-004)

Admission specifics

Access legend: system = any system caller but the portal; writer = a user’s delegation holding a CASEWORKER_WRITER_ROLES role; caseworker+ = CASEWORKER_OR_ABOVE_ROLES; case reader = CASE_READER_ROLES (all crates/canopy-auth/src/roles.rs); via canopy-web / via canopy-reporting = only a delegation that client presents; with no client named, the bar admits a delegation through any client.

  • The admissions are READER, WRITER, SYSTEM and ELE_OPERATOR (src/api/mod.rs), FTI_AUDITOR (src/api/fti_audit_handlers.rs), the overpayment crate’s own READER / WRITER (crates/canopy-overpayments/src/api.rs), inline Admission::user_roles(&["data_steward"]), canopy-api’s ADMIN_HUMAN, and the ten delegated::MEDICAID_* rows.

  • GET /v1/determinations admits conditionally: with month, SYSTEM; without, delegated::MEDICAID_GET_DETERMINATIONS.

  • POST /v1/determine adds a provenance gate (enforce_provenance_gates, src/api/handlers/determine.rs): an as_of other than the service’s legal day, a trigger, a previous_determination_id, served_program: chip (#2319) or an operation_id (#2673) from any client but canopy-eligibility (principal.client(): its system token, or a delegation it presents onward) is 403 before any evaluation or write. This 403 carries no ReceiverDenial code.

  • The cooperation-finding and demonstration-activity-report creates add recorder_subject (src/api/worker_record.rs), which refuses the system caller WRITER admits with 403 service_class_on_user_only (#3189, #3203).

  • ELE_OPERATOR names quality_control beside admin, so the ELE revoke and the renewal run are writes QC may make: an explicit policy choice, the carve-out crates/canopy-test-lib/tests/qc_write_gate_sweep_test.rs records.

  • Attribution: the determine’s FTI chain accessed_by, the CMD ingest’s submitted_by and the redaction event’s actor sub are principal.attribution_sub() (the user’s canopy subject, or a system caller’s client id; the redaction admits users alone). The ELE revoke’s actor and the overpayment claim’s discovered_by are principal.actor(): a user as Human (the canopy subject), a system caller as Service named by its client id; the revoke admits users alone, so its actor is always Human. A cooperation finding and a demonstration activity report each record the delegation’s OIDC subject as recorded_by (recorder_subject); neither body names one.

  • Outbound calls: the determine’s canopy-rules calls ride the request’s outbound (RequestOutbound), which on canopy-medicaid’s system-only edge to canopy-rules is its own system token whoever the caller. The subscribers, the ELE renewal scheduler (the manual POST /v1/ele/renewals/run included) and the boot signing-key registration send through canopy-medicaid’s IdentitySender (system origin) to canopy-persons, canopy-rules and canopy-security.

Determination

POST /v1/determine

Run a Medicaid/CHIP eligibility determination. Called by canopy-eligibility orchestrator.

Access

system; writer (WRITER, src/api/mod.rs) — quality_control is 403 required_role_missing; the provenance gate (Admission specifics) holds as_of, trigger, previous_determination_id, served_program: chip and operation_id to canopy-eligibility. The FTI chain’s accessed_by is the caller’s attribution_sub().

Request: ApplicationContext carrying a members[] list. Medicaid is multi-subject (ADR-035): the handler runs the cascade per member, scoring each on that member’s own age + disability; an empty members[] runs a single determination for applicant_person_id (required — a subject-less request is refused 422, #1931). Income stays household-level (per-member budget-group composition is deferred to #864). served_program (medicaid | chip, #2319) names the program the run serves and is required — a body naming none is refused 422; canopy-eligibility’s mapper stamps it on the Medicaid and CHIP bodies, and a direct caller may name medicaid only. operation_id (#2673) is the determination operation canopy-eligibility claimed for the dispatch, orchestrator-only like trigger: every subject’s envelope signs it and its row stores it with signed_payload, the exact bytes the signature covers. A dispatch whose operation already has a subject’s determination is 409 operation_already_determined and writes nothing; canopy-eligibility reads the first execution’s envelopes back (GET /v1/determination-operations/{operation_id}/envelopes).

Residency first (#3095): before the steps below, the handler tests each member’s state residency (42 CFR 435.403(a), 457.320(a)(1)): the federal medicaid-residency ruleset compares the member’s state_of_residence with the jurisdiction’s own ([jurisdiction].fips_state_code). A non-resident is denied not_a_state_resident under both served programs, with the basis Not a resident of <state> (42 CFR 435.403; 42 CFR 457.320(a)(1)), and steps 1–6 never run for them: no coverage group is evaluated, no coa_evaluations row is written, and denial_reasons_by_coa is empty. The denial then takes steps 7–9 like any other, the ruleset’s firing in the member’s derivation graph. With no pairs to route, medicaid.determined carries the whole-person denial_reason_codes instead (["not_a_state_resident"]), and canopy-notices states that code’s label on the notice of action (42 CFR 431.210(b)); a denial with pairs routes the pairs alone.

Cooperation (#3190): 42 CFR 435.610(a)(2)-(3) and 433.148(a) penalize an adult who refuses, without good cause, to cooperate in obtaining medical support or in pursuing liable third parties.

  • The refusals. Before any member is evaluated, the handler reads every member’s refusals once, on the run’s legal day, from the worker-recorded findings (refusals_on, Cooperation findings (#3189)).

  • The MAGI household size. magi_size is the household size less the members who refuse either kind and are aged [medicaid.cooperation].adult_age or over, never below 1 (PAMMS 2657 Step 4). It counts the refusal, not the gate’s outcome.

    • The MAGI groups' limits, CHIP’s limits, TMA’s limit and the 5% FPL disregard are scaled from the FPL for magi_size (magi_fpl_100).

    • The QMB, SLMB, QI-1 and QDWI limits keep the FPL for the household size, and the MNIL and the resource limits are unchanged.

    • Every member’s income still counts, a penalized parent’s included (PAMMS 2657).

  • The gate. Between steps 4 and 5, the federal medicaid-cooperation ruleset takes the member’s refusals, age and the groups the cascade found eligible, with the pack’s [medicaid.cooperation] thresholds (rulesets.adoc#medicaid-cooperation).

    • A member under adult_age is never penalized.

    • A penalized adult keeps only the groups exempt from every kind they refuse. Each removed group’s evaluation turns ineligible under the code of the refusal that removed it: medical_support_non_cooperation or third_party_liability_non_cooperation. The removed groups reach coa_evaluations, cmd_cascade_log and denial_reasons_by_coa with that code, and the hierarchy picks among the retained groups.

    • A penalized adult left with no group, when the cascade found one, is denied. denial_reason is the medical-support code when present, else the TPL code, and denial_reason_codes leads with every penalty code. The basis reads Did not cooperate in obtaining medical support without good cause (42 CFR 435.610(a)(2); 433.148(a)), or its third-party form citing 435.610(a)(3).

    • A member the cascade found ineligible everywhere keeps the cascade’s own reasons.

    • A non-resident is denied for residency before the gate runs.

  • The record. The ruleset’s firing joins the member’s derivation graph. The snapshot’s policy_params and program_input record magi_size and magi_fpl_100_monthly beside household_size and fpl_100_monthly.

Section 1115 adult demonstration hours (#3204): the jurisdiction’s adult demonstration (42 USC 1315; Georgia Pathways, PAMMS 2195 and 2256) admits an adult only when they report enough hours of qualifying activity at application.

  • The reports. Before any member is evaluated, the handler reads every member’s reports once (Demonstration activity reports (#3203)). It reads those whose period overlaps the counted window and which are effective by its last day (reports_in_window). The window is the pack’s [medicaid.adult_demonstration].window_weeks × 7 days ending on the run’s legal day, both bounds inclusive (rulesets.adoc#medicaid-adult-demonstration).

  • The count. demonstration_activity::activity_met counts each member’s hours:

    • An hours activity counts by the days of its period inside the window, hours × overlap_days / period_days. The reports sum, truncated to hundredths, and are compared with hours_per_month with no scaling to a calendar month.

    • A threshold activity overlapping the window meets the condition whatever its hours.

    • A code the pack no longer lists counts nothing, and a disabled section is never met.

    • No report is not met: the gate fails closed. A self-attested report counts as a verified one.

  • The rule. medicaid-magi takes the result as input.demonstration_activity_met, and ex-pathways requires it beside the age and income tests (ADR-003). medicaid-denial-reasons tells an adult in the age band who does not meet it demonstration_activity_not_met, before the income reason. Every other group is untouched, so a parent short of the hours falls to Parent/Caretaker when its own tests hold.

  • The record. The snapshot’s sealed program_input records the member’s count (demonstration_activity: met, counted_hours). Its policy_params record the window (demonstration_activity_window) and the threshold (demonstration_hours_per_month).

The handler, per member:

  1. Builds the MAGI household per 42 CFR 435.603 OR non-MAGI household per state plan

  2. Runs MAGI / non-MAGI / CHIP rulesets in parallel via tokio::try_join!

  3. Evaluates Q-Track (QMB / SLMB / QI-1) with resource tests

  4. Applies MN spenddown for FM-MN / Pregnant-MN / AMN paths

  5. Decides the served program’s slot (#2319, src/determine/slot.rs). The EE15 hierarchy picks among the eligible Medicaid-track groups (every track but chip).

    • A Medicaid run assigns that pick, or denies no_eligible_coa. It never assigns a CHIP-track class.

    • A CHIP run is denied medicaid_eligible whenever there is a Medicaid pick (42 USC 1397jj(b)(1)©; 42 CFR 457.310(b)(2)). Otherwise it assigns the hierarchy’s pick among the CHIP-track groups, or denies no_eligible_coa.

    • A denial’s denial_reasons_by_coa names only its own program’s groups. For a screened-out CHIP run, each CHIP-track group’s reason comes from a second medicaid-denial-reasons pass with medicaid_eligible: true. That pass covers a group that met its own criteria, and it leaves the cascade’s per-COA reasons unchanged.

  6. Records every COA evaluated (eligible or not) in coa_evaluations for audit The admission gate (ADR-052). When the jurisdiction's configuration ships an extension module for medicaid (extensions/<name>/, point admission), canopy-medicaid installs and compiles it at boot and refuses to start if it cannot. A determination then evaluates every member over the rules engine as before, and signs inside the transaction that records it:

    • for each member the rules approved, in person-id order, the module's admit is called. withhold makes the member's status withheld: the class they are eligible for stays, with no benefit type and no coverage date, and the module's label and reason are signed into the envelope's extension member and carried on medicaid.determined as outcome_label and outcome_reason;

    • the module's outcome is then called for every member with the final status, so it can release a place;

    • a member whose most recent determination under the served program is approved, in whichever household it was made, is passed as currently-approved.

Decision interception (ADR-052, unsupported). The same manifest row may list decisions: names from the determination's decisions (medicaid-residency, medicaid-cooperation, medicaid-eligibility-hierarchy, medicaid-tma-phase, medicaid-denial-reasons, medicaid-magi, medicaid-non-magi, chip-eligibility). For each, the module's decide is given the body canopy-rules would have been sent and its answer is read as the engine's would be; canopy-rules is not called. Any other name, medicaid-cmd-cascade-priority included, refuses the boot. Each subject's signed extension.decisions names the decisions answered for that subject, and their derivation graph carries no firings for them. An answer missing an output the service reads fails the determination. canopy may rename or reshape a decision in any release: a rename refuses the boot, a reshape does not.

The module's writes, the signatures and the rows commit or roll back together. A module failure fails the whole household's determination with a 500, and nothing is written. Without a module nothing changes.

  1. Assembles the determination input snapshot (ADR-028, #685), per member: the CMD cascade priority order + per-COA magi/non-MAGI/CHIP/TMA results + per-COA denial-reason evals + the EE15 hierarchy result + assigned_coa + countable_resources + member SOLQ flags + the served program (program_input.served_program, #2319), the income/expense facts + whole-household composition, the resolved policy params, and the ruleset corpus-hash. When SOLQ was supplied it also freezes a typed cross_program_inputs.solq by-value projection of the raw SolqRecord(s) — the cross-program source behind the derived ABD flags (#684) — and marks the snapshot schema_version: 2. Its SHA-256 (RFC 8785 canonical) becomes the snapshot_hash

  2. Signs the determination with ECDSA P-256, person_id set before signing — the signature now covers snapshot_hash (ADR-002 / ADR-035 / ADR-028). The envelope claims the served program, program: chip on a CHIP run, signed with the service’s one medicaid key, and the dispatch’s operation_id (ADR-002 Amendment 6).

  3. Persists each member’s snapshot immutably in determination_snapshots. canopy-medicaid treats each snapshot as FTI-bearing (its purpose codes cite IRC §6103(l)(21)), so each snapshot’s creation additionally joins the ADR-014 fti_audit_log hash chain (resource_type='determination_snapshot', one entry per member determination, purpose MEDICAID_ELIG or, on a CHIP run, CHIP_ELIG, #2942), and the snapshot inherits the Pub 1075 §4 tamper-evidence + §9 breach pathway. As built, no snapshot input is FTI-derived: neither canopy-medicaid nor canopy-tanf reads fti_tax_data (ADR-004 Amendment 9; #785 adds the Medicaid reader). The deleted readers' audited element lists are recorded in Amendment 9 and on #2238.

All N per-member determinations + their COA-evaluation rows + their input snapshots + their snapshot DEKs (redaction_keys rows, generated without a write) + the per-member FTI chain entries persist in one transaction (all-or-nothing), so a request that does not commit leaves no key (#2382). An invalid or duplicate member person_id returns 422. A missing applicant_person_id is 422 as well. Every row records the run’s served program (medicaid_determinations.program, #2942): a person’s Medicaid and CHIP determinations are separate supersession chains, so each subject’s signed previous_determination_id is its latest determination under the run’s own program, and a previous_determination_id pin naming the other program’s determination is 422 cross_program_previous_determination.

The canopy-rules calls carry canopy-medicaid’s own system token (Admission specifics). canopy-eligibility dispatches a chip request here as well, with the canopy-medicaid bearer a medicaid one carries (ProgramServiceRegistry::service, services/canopy-eligibility/src/registry.rs), naming served_program: chip.

State of residence (#3094): each members[] entry carries state_of_residence, the USPS code of the member’s residential address on the determination date, or the applicant’s when the member has none, which canopy-eligibility reads from canopy-persons; a direct caller with an empty members[] may send the applicant’s as the top-level state_of_residence. Both are optional and default to absent. Each member’s own state is tested on the members path, the top-level one only on the empty-members[] path, and the top-level state never stands in for a member’s. A subject whose state is absent or not a USPS code is refused 422 state_of_residence_missing, naming the subject’s person id, before any rules call; nothing is written (#3095). canopy-eligibility never dispatches a Medicaid or CHIP body in which a member’s state is absent or names no state: it pends the program input_unsatisfiable instead (canopy-eligibility).

SSA SOLQ input (#384): the orchestrator may populate ApplicationContext.ssa_solq: Option<HashMap<Uuid, SolqRecord>> pre-dispatch for elderly / disabled applicants. When present, derive_abd_flags_from_solq(map, applicant_id) projects the SSA record onto the five Phase D booleans (lost_ssi_due_to_cola, is_disabled_adult_child, is_disabled_widow, is_widow_60_64, lost_ssi_as_disabled_child) consumed by the medicaid-non-magi ruleset. The pre-existing Option<bool> ApplicationContext fields stay as an override channel (test fixtures, manual worker overrides) and win when present; SOLQ derivation is the implicit default. When SOLQ is unconfigured or returns no record, all five flags fall back to false — exact match for the pre-#384 behaviour. Per ADR-004, raw SOLQ records are stored only in this service’s database and are never re-emitted to the orchestrator. As of #684 the raw record is additionally frozen by value into the determination snapshot’s cross_program_inputs.solq (still DB-local, never on the wire), so the verdict reproduces even if the SOLQ→flag derivation later changes.

Response (200): DeterminationList — one signed SignableDetermination envelope per member (ADR-035), each carrying its person_id; per ADR-002 (selected COA in program_extension, status, basis, benefit fields, JWS signature, and the snapshot_hash binding that member’s input snapshot per ADR-028). The orchestrator verifies each signature against this same shape and receives only outcome + hash, never the snapshot cleartext (which stays inside canopy-medicaid’s Pub 1075 boundary); the per-program MedicaidDeterminationRead rows are what the read endpoints below return.

Response (503; the chain-v2 FTI append arm is withdrawn, ADR-041, and #1304 retires it): when that arm is enabled (CANOPY_MEDICAID__CHAIN_V2_APPEND_ENABLED, #1207 / ADR-014 Amendment 7) and the append hits an Environment-class refusal — topology missing, epoch not active/current, routing-version skew, or a malformed source registry — the whole multi-member determination aborts fail-closed (no Pub 1075 snapshot can persist without its chain row) with the fixed detail audit chain unavailable; the environment specifics go to logs only. With the flag off (the default), this arm is unreachable.

GET /v1/determinations

List determinations newest-first, keyset-paginated (#1195).

Access

conditional — system with month (SYSTEM, #1249); otherwise system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_DETERMINATIONS). A user asking for month is 403 system_caller_required and uses the unscoped list.

Query parameters: limit (default 50, max 200), after_determined_at + after_id (keyset cursor — pass the previous page’s next_cursor fields together; omit both for the first page), month (optional, any day in the month).

The list is ordered (determined_at DESC, id DESC) — newest first, with the UUID-v7 id as a stable tiebreak — and keyset-paginated over that compound cursor (there is no offset; the old hard LIMIT 200 cap that silently truncated the T-MSIS federal universe is gone). household_id (optional, #1244) scopes the page to one household’s FULL history — every run, re-determination and change report is a row per subject — so a roster that wants each member’s current decision reads GET /v1/households/{household_id}/determinations/newest below instead of paging this list (#1967). The default page rides idx_medicaid_determinations_determined_at_id, an index scan with no top-N sort. month scopes the universe to determinations whose coverage window [effective_date, expiration_date] overlaps that calendar month (the T-MSIS monthly-eligibility universe); when set, the first page carries total_in_scope (the authoritative scoped COUNT(*)) so a page-looping extractor can assert completeness. The month scope is system-caller-only (#1249, ADR-001 Amendment 1 least privilege): the completeness universe belongs to the reporting extractor — a user gets 403 and uses the unscoped list.

Response (200): MedicaidDeterminationPage — items (array of MedicaidDeterminationRead, each the MedicaidDetermination fields flattened including the required snapshot_hash) + next_cursor ({after_determined_at, after_id} while a full page may have more; null at the end) + total_in_scope (first page of a month-scoped query only; null otherwise).

GET /v1/determinations/{id}

Fetch a determination by ID.

Access

system; caseworker+ (READER)

Response (200): MedicaidDeterminationRead — the MedicaidDetermination fields flattened, including the required snapshot_hash (#911: legacy pre-snapshot rows were deleted and the ADR-028 §58 snapshot_status marker retired). Returns 404 if no determination exists for the supplied ID.

GET /v1/determination-operations/{operation_id}/envelopes

Every subject’s signed envelope of the determinations a claimed operation produced (#2673), ordered by subject: the exact bytes each determination’s signature covers (signed_payload, base64, standard alphabet, padded) and that signature, served verbatim from the rows, never re-serialized. canopy-eligibility adopts a replayed operation’s determinations through it after POST /v1/determine answered 409 operation_already_determined, and resolves an order’s idempotency_body_mismatch the same way, as it does canopy-snap’s single envelope (#2439, #2676).

Access

system: canopy-eligibility alone (OPERATION_MINTER, src/api/operation_envelopes.rs), the one service that mints determination operations

Response (200): array of DeterminationEnvelope (canopy_contracts_eligibility::envelope). (404): coded operation_not_determined — the operation has no determination.

GET /v1/households/{household_id}/determinations/newest

Each subject’s NEWEST determination per served program in the household, newest-first (#1967, #2942) — the worker portal’s roster read (and the household rollup behind the Medicaid/CHIP identity chip, tile and cross-program matrix row). A subject served under both Medicaid and CHIP has a row for each; every row carries its program. DISTINCT ON (person_id, program) over the household’s rows ordered (person_id, program, determined_at DESC, id DESC), re-ordered (determined_at DESC, id DESC); bounded by the household’s distinct (subject, program) pairs, so there is no page envelope and no cursor — a member whose newest row sits beyond a page of the household’s full history is never lost.

Access

system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_HOUSEHOLDS_HOUSEHOLD_ID_DETERMINATIONS_NEWEST)

Response (200): array of MedicaidDeterminationRead (as the list’s items); an empty array for a household with no determinations.

GET /v1/applications/{id}/categories

List every COA evaluated for the Medicaid application — both eligible and ineligible. Each row includes the rule-trace pointer used (which ruleset, which version) so caseworkers can answer "why this COA, why not that one." Source-of-truth for hearings. The {id} is the medicaid_application_id (#1011 moved this from /determinations/{id}/categories, where the URL implied a determination id but the handler keyed on the application id — a natural-reading caller silently got an empty list).

Access

system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_APPLICATIONS_ID_CATEGORIES)

GET /v1/determinations/{id}/explanation

Human-readable explanation of the determination — selected COA, basis, thresholds compared. Useful for case notes and notice generation.

Access

system; caseworker+ (READER)

GET /v1/held-determinations

The determinations whose completion events canopy-medicaid still holds past its held-row warning age, oldest first (#3065): the read an operator lists before adopting or dropping one through canopy-eligibility. A determination’s events stay held until canopy-eligibility records or disowns it (ADR-002 Amendment 7), so a listed determination is one the held-row watch warns about. The read releases and drops nothing.

Access

a determination operator through canopy-eligibility alone (delegated::MEDICAID_GET_HELD_DETERMINATIONS, src/api/held.rs; determination operator = DETERMINATION_OPERATOR_ROLES): a system caller is 403 service_class_on_user_only, a user’s direct delegation 403 actor_not_allowed, and a delegation without the roles 403 required_role_missing.

Query (HeldDeterminationsQuery): after, the previous page’s next; limit, 1 to 200, default 50; determination_id, to look up one determination.

Response (200): HeldDeterminationPage (crates/canopy-contracts-eligibility/src/held.rs): items, in (held_since, determination_id) order, and next, an opaque cursor absent on the last page. Each item is { determination_id, program, operation_id, held_since, held_rows }:

  • held_since is when the oldest still-held event was staged, and held_rows how many are held. A determination is listed once its held_since is older than the decision clock’s instant less CANOPY_MQ_HELD_AGE_WARN_SECS (MqTuning::held_age_warn; Configuration Reference).

  • program is the row’s served program, medicaid or chip (medicaid_determinations.program).

  • operation_id is the canopy-eligibility operation the row was determined under (medicaid_determinations.operation_id), absent for a direct caller’s determination.

  • A hold whose determination row is missing is still listed, with no operation, and logged at WARN.

Returns 422 invalid_limit for a limit outside 1 to 200 and invalid_cursor for an after no page issued.

POST /v1/determinations/{id}/redact

Crypto-shred a determination’s frozen input snapshot (#687, ADR-036). The per-determination DEK in redaction_keys is tombstoned (its wrapped_dek overwritten with a zero sentinel + shredded_at stamped), so every sealed leaf becomes permanently unrecoverable, while the snapshot ciphertext and the signed snapshot_hash are left untouched — the snapshot still re-hashes to the signed value and the determination’s JWS stays verifiable (hash-over-ciphertext, ADR-036 Decision B). Only the plaintext PII is destroyed. Medicaid is FTI-bearing, so the determination.redacted event is plaintext-free (IDs + actor + reason only, ADR-004).

Access

data_steward (inline Admission::user_roles(&["data_steward"])); a system caller is 403 service_class_on_user_only. A dedicated, privileged, irreversible role for redaction/expungement: admins do NOT hold it by default (separation of duties, mirroring fti_auditor). canopy-identity grants it from the upstream’s groups through its projection (ROLE_VOCABULARY, crates/canopy-auth/src/roles.rs); on the devstack the Kanidm cast (devstack/kanidm/migrations/00-canopy.hjson) grants it to data.steward alone.

Request:

{
  "reason": "..."
}

reason is mandatory; a blank reason is rejected with HTTP 400.

The shred and a plaintext-free determination.redacted audit event (carrying the steward’s sub + the reason) commit in one transaction (ADR-018); canopy-security audits it via the existing wildcard subscriber.

Response (200): { "determination_id": "…​", "redacted_at": "…​" }; redacted_at is also the tombstoned DEK’s shredded_at, and the DEK’s created_at is the determination’s decision instant (#2475). Both instants come from the service’s injected decision clock (#2581, ADR-033 §5): a determination reads it once and stamps its envelope, its rows and its snapshot at that instant, and a redaction reads it once for redacted_at. Returns 400 on a blank reason, 403 if the caller lacks the data_steward role, and 404 for an unknown determination. Idempotent: re-redacting an already-shredded determination tombstones 0 rows and still returns 200.

The path uses the sub-resource form …/{id}/redact (mirroring snap’s reference impl), not the AIP-136 custom-method …/{id}:redact — axum/matchit 0.8 allows only one parameter per path segment.

Cooperation findings (#3189)

canopy-medicaid records a worker’s finding that a person does or does not cooperate in obtaining medical support (42 CFR 435.610(a)(2); PAMMS 2250) or in pursuing liable third parties (435.610(a)(3); PAMMS 2230). The record is append-only: a change is a new row with a later effective_date. A person refuses a kind on a date when that kind’s newest row effective by the date is non_cooperating, a later created_at first on the same day (refusals_on, src/store/cooperation.rs). Every other status, and no row at all, is no refusal. The determination reads every member’s refusals on its legal day ([cooperation-gate], #3190). Handlers: src/api/cooperation.rs. Shapes: crates/canopy-contracts-medicaid/src/cooperation.rs.

POST /v1/cooperation-findings

Record a person’s cooperation finding of one kind from a date.

Access

writer (WRITER); a system caller is 403 service_class_on_user_only

  • WRITER admits the writer bar, so quality_control is 403 required_role_missing.

  • recorder_subject refuses the system caller WRITER also admits, with 403 service_class_on_user_only.

  • recorded_by is the delegation’s OIDC subject, never a body field; created_at is the request’s decision instant (the injected DecisionClock).

Request: CreateCooperationFinding (deny_unknown_fields):

{
  "person_id": "0196eb5b-1f60-7e3f-9000-9a0bf1cfc9e7",
  "kind": "medical_support",
  "status": "non_cooperating",
  "effective_date": "2027-04-01"
}
  • kind (CooperationKind) is medical_support or third_party_liability.

  • status (CooperationStatus) is non_cooperating, good_cause_claimed, good_cause_established, hearing_requested or cooperating. Only non_cooperating is a refusal: a claimed good cause, an established one and a requested hearing each hold the penalty off, and cooperating ends it (PAMMS 2250).

  • effective_date is judged in this order. Outside the years 1900-9999 it is 422 medicaid_date_out_of_range, so a date PostgreSQL cannot store is refused rather than failing the insert. After the service’s legal today it is 422 medicaid_effective_date_in_future; the legal today is the request’s decision instant read on the pack’s [jurisdiction].timezone calendar (MedicaidParameterTable::legal_timezone), never the UTC day. Either refusal writes nothing and names the field, never the date sent.

  • A body naming id, created_at or recorded_by, or a token outside a vocabulary, is 422.

Response (201): the stored MedicaidCooperationFinding: the body’s fields, id, recorded_by and created_at.

GET /v1/cooperation-findings?person_id={uuid}

List a person’s recorded findings of both kinds.

Access

system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_COOPERATION_FINDINGS)

Response (200): array of MedicaidCooperationFinding, newest effective_date first, then the later created_at, then the higher id, at most 100; an empty array when none is recorded. person_id is required; a missing or malformed one is 400.

Demonstration activity reports (#3203)

canopy-medicaid records a worker’s report of one person’s hours of one qualifying activity over one period: the input to the section 1115 adult demonstration’s qualifying-activity condition at application (42 USC 1315; Georgia PAMMS 2195 and 2256, Chart 2256.2). The pack’s [medicaid.adult_demonstration] section (Rulesets) names the activities a report may carry, how each counts and its label, the threshold and the window. The record is a ledger: one row is one activity over one period (two jobs in a month are two rows), and a later report for an overlapping period does not supersede an earlier one. Handlers: src/api/demonstration_activity.rs. Shapes: crates/canopy-contracts-medicaid/src/demonstration_activity.rs. The determination reads them into the demonstration group’s hours gate ([demonstration-hours-gate], #3204).

POST /v1/demonstration-activity-reports

Record a person’s hours of one qualifying activity over a period.

Access

writer (WRITER); a system caller is 403 service_class_on_user_only

  • WRITER admits the writer bar, so quality_control is 403 required_role_missing.

  • recorder_subject refuses the system caller WRITER also admits, with 403 service_class_on_user_only.

  • recorded_by is the delegation’s OIDC subject, never a body field; created_at is the request’s decision instant (the injected DecisionClock).

Request: CreateDemonstrationActivityReport (deny_unknown_fields):

{
  "person_id": "0196eb5b-1f60-7e3f-9000-9a0bf1cfc9e7",
  "activity": "community_service",
  "hours": "80.5",
  "period_start": "2027-03-01",
  "period_end": "2027-03-28",
  "verification": "verified",
  "effective_date": "2027-03-29"
}
  • activity is a code from the pack’s [medicaid.adult_demonstration].activities; no Rust enum lists them.

  • hours is a decimal string, at most one decimal place (the column is NUMERIC(6,1)).

  • verification (ActivityVerification) is self_attested or verified; both count, and the distinction keeps an unverified entry visible.

  • The body is judged in this order, each refusal a 422 that writes nothing and names the field, never the value sent:

    • effective_date, then period_start, then period_end: outside the years 1900-9999, medicaid_date_out_of_range; after the service’s legal today, medicaid_effective_date_in_future for the effective date and medicaid_period_in_future for either end of the period. The legal today is the request’s decision instant on the pack’s [jurisdiction].timezone calendar, never the UTC day.

    • period_end before period_start: medicaid_period_end_before_start.

    • An activity the pack does not list: medicaid_unknown_activity (exact bytes; no case folding).

    • hours negative, over the pack’s max_hours_per_report, or finer than one decimal place: medicaid_hours_out_of_range.

  • A body naming id, created_at or recorded_by, missing a field, or with a verification token outside the two values, is 422.

Response (201): the stored MedicaidDemonstrationActivityReport: the body’s fields, id, recorded_by and created_at.

GET /v1/demonstration-activity-reports?person_id={uuid}

List a person’s recorded reports of every activity.

Access

system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_DEMONSTRATION_ACTIVITY_REPORTS)

Response (200): array of MedicaidDemonstrationActivityReport, newest effective_date first, then the later created_at, then the higher id, at most 100; an empty array when none is recorded. person_id is required; a missing or malformed one is 400.

GET /v1/demonstration-activity-counts?person_id={uuid}

A person’s count over the window ending on the service’s legal today (#3205): the window and count the hours gate reads ([demonstration-hours-gate]), so canopy-web’s Medicaid tab shows a worker what a determination run today would see, without counting a second way.

Access

system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_DEMONSTRATION_ACTIVITY_COUNTS)

Response (200): DemonstrationActivityCount:

{
  "person_id": "0196eb5b-1f60-7e3f-9000-9a0bf1cfc9e7",
  "enabled": true,
  "window_start": "2027-03-02",
  "window_end": "2027-03-29",
  "hours_per_month": "80",
  "counted_hours": "80.5",
  "met": true
}
  • window_start and window_end bound the pack’s window_weeks × 7 days ending on the legal today (the request’s decision instant on the pack’s [jurisdiction].timezone calendar), both inclusive.

  • counted_hours and met are demonstration_activity::activity_met over the reports reports_in_window reads, as in the gate. enabled is the pack’s switch; a disabled section is never met.

  • person_id is required; a missing or malformed one is 400. A person with no report answers zero hours, not met.

Cross-Program Coverage

GET /v1/tma

List Transitional Medicaid (TMA) coverage records. Created by the tanf.case_closed subscriber per 42 USC 1396r-6 / PAMMS 2166. Phase 1 (no income test) / Phase 2 (205% FPL with quarterly reporting).

Access

system; caseworker+ (READER)

Query parameters: household_id (required; TmaQueryParams).

Response (200): array of TmaCoverage rows. prior_coverage_end_date is the day the coverage before the transitional period ended: the TANF closure, for a row this subscriber opens (#3447).

Express Lane Eligibility (42 USC 1396a(e)(13))

The durable one-year Express Lane flag a child earns from a SNAP or TANF approval. Grants are written by the canopy-medicaid.express-lane subscriber (below), gated on the consent the canopy-medicaid.ele-consent subscriber persisted; every transition is a hash-chained ele_grant_events row. Wire DTOs: canopy_contracts_medicaid::ele (EleStatus, EleHouseholdSummary / EleChildBrief, EleChainStatus); paths: crates/canopy-contracts-medicaid/src/paths.rs. The literal chain-status segment registers before the {person_id} route (axum matchit precedence).

The two income thresholds that sort a child into the medicaid or the chip tier are the pack's, [medicaid.express_lane] (Rulesets › Medicaid Express Lane); the age ceiling and the grant length are the federal layer's. A pack that publishes no [medicaid.express_lane] runs no Express Lane (#3423): an approval grants no flag and writes no ele_grant_events row (consents and deferred approvals are still recorded, and a deferred approval drains without a grant), and a sweep pass renews nothing (its age-out still runs). canopy-medicaid refuses to start under such a pack while an active flag exists, because that flag could never be renewed or lapse at its expiry: restore the table or revoke the flags first. The reads below therefore answer no active flag.

GET /v1/ele/{person_id}

The child’s current durable ELE status.

Access

system; caseworker+ (READER)

Response (200): EleStatus — every field is always present (none is nullable): id (this ele_status row, UUID v7), child_person_id, household_id, child_date_of_birth (ISO date), eligibility_tier (medicaid / chip: the federal program the flag grants, never a State's name for it, #3423), granted_at and expires_at (RFC 3339 instants; the current grant window), granting_program_history (array of program slugs, e.g. ["snap", "tanf"] — may be empty for an active flag whose last source program closed), current_status (active / lapsed / revoked / pending_redetermination), last_event_id and last_event_hash (the chain tip of the child’s ele_grant_events), created_at and updated_at (audit instants). child_date_of_birth is PII: the child’s date of birth rides this response body (the row denormalises it from canopy-persons for the local age-out query, ADR-001), so every caseworker+ caller receives a DOB here — the ELE outbox events below carry none (the ADR-014 allowlist excludes DOB). 404 when the child has no active flag.

GET /v1/ele/household/{household_id}

The household’s aggregate ELE view — the worker portal’s household chip.

Access

system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_ELE_HOUSEHOLD_HOUSEHOLD_ID)

Response (200): EleHouseholdSummary — household_id, active_count (children with an active flag), soonest_expires_at (ISO date — the earliest expires_at across them, as a date in the pack’s [jurisdiction].timezone, never its UTC date, #2526; null when active_count is 0), children[] (one EleChildBrief per active flag: child_person_id, eligibility_tier, expires_at). PII-light by design: IDs, tier and expiry only — no DOB.

GET /v1/ele/chain-status

Verifies the ele_grant_events hash chain (store::ele::verify_ele_chain).

Access

system; caseworker+ (READER)

Response (200 intact / 503 break): EleChainStatus — valid, events_verified (rows verified before the verdict), broken_at and message (the first broken row’s id and the reason; both null on an intact chain) — the SAME body on both codes, so a status-code-only consumer fails closed.

POST /v1/ele/{person_id}/revoke

Revoke the child’s active flag; the revoke is one more chained ele_grant_events row and stages medicaid.ele.revoked. The actor is principal.actor() — on this user-only route always a Human canopy subject — stored in the row’s actor column and carried as EleRevokedEvent.actor, an Actor object ({"actor_type": "human", "subject": "…"}; #1008).

Access

admin or quality_control (ELE_OPERATOR, src/api/mod.rs); a system caller is 403 service_class_on_user_only

Request: EleRevokeRequest — { "reason": "…​" }; a blank reason is 400.

Response (200): the revoked EleStatus (the full shape above, child_date_of_birth included). 404 when the child has no active flag.

POST /v1/ele/renewals/run

Manual trigger of the ELE renewal sweep the scheduler otherwise runs. A literal route in services/canopy-medicaid/src/api/mod.rs (the contracts crate does not lift it).

Access

admin or quality_control (ELE_OPERATOR); a system caller is 403 service_class_on_user_only

Query parameters: within_days (optional; the renewal-due window, default 30, clamped to 1..=3650; RenewalRunParams).

A pass reads the service’s injected decision clock once (#2241, ADR-033 §5): the renewal-due cohort is the flags expiring within within_days of that instant, the age-out cohort the children whose max-age birthday is on or before its legal day (the instant as a date in the pack’s [jurisdiction].timezone), and a renewal’s fresh window and the child’s age come from the same instant and day. The sweep’s leases and retry gates stay on the database clock. The Express Lane grant subscribers do the same per delivery: a fresh grant’s window starts at the delivery’s instant (an extend keeps its prior window), and the child’s age is taken on its legal day.

Response (200): EleSchedulerCheckResult — the pass’s counters: processed (flags re-evaluated successfully — renewed / lapsed / pending), errors (re-evaluations that failed; logged, not fatal to the pass) and unchanged (evaluated but deliberately left as-is: unknown decision, non-coverage tier, or an age-out verdict that kept the flag, #1271). Concurrent passes share the due cohort through SKIP-LOCKED lease claims, so rows another pass claimed are simply absent from these counters.

FTI Audit Log (IRC §6103(l)(21) / Pub 1075)

Each entry’s purpose_code maps to the authority for the access (FtiPurposeCode::irc_section(), ADR-004 Amendment 8). MEDICAID_ELIG, MEDICAID_MAGI and CHIP_ELIG all cite 26 USC 6103(l)(21), the §6103 paragraph that names titles XIX and XXI:

  • (l)(21)(A) discloses return information from the IRS to HHS.

  • (l)(21)(B) lets HHS give a State agency any inconsistency between the agency’s information and the IRS information.

  • (l)(21)©(ii) limits a State agency’s use of information disclosed under (A) or (B) to determining eligibility.

  • No statute or regulation delivers the return-information values themselves (AGI, filing status, …) to a State agency. The agency receives them from HHS through the CMS Data Services Hub under the CMS–IRS computer matching agreement, as IRS Publication 1075 §2.C.11.6 describes (ADR-004 Amendment 12, #2936).

One thing logs under these codes today: the determination-snapshot chain entry, under MEDICAID_ELIG. It reads no fti_tax_data, and the service treats its snapshot as FTI-bearing. No reader of fti_tax_data (IRS return information) exists until #785 adds one (ADR-004 Amendment 9).

Medicaid’s 26 USC 6103(l)(7) route is IEVS data: SSA-held earnings and IRS unearned income, with Medicaid listed at (l)(7)(D)(ii). canopy-medicaid holds none of that data, and no purpose code cites (l)(7) for Medicaid. A feed of that kind would add its own purpose code.

The log stores the code, never the citation. The 2026-09-23 correction from IRC 6103(l)(12)(A) therefore changed no stored row. (l)(12) is Medicare-beneficiary employment-status verification.

ADR-014 hash-chain integrity applies — same pg_advisory_xact_lock(2) + canonical-timestamp pattern as canopy-tanf. Chain breaks emit fti.audit_chain.breach_detected and force 503 from GET /v1/security/chain/status?family=fti&service=canopy-medicaid on canopy-security (#1206; a latched legacy v1 breach surfaces there as breached / legacy_breach_latched).

GET /v1/fti-audit-log

List FTI audit entries. IRS auditor access only.

Access

fti_auditor (FTI_AUDITOR, src/api/fti_audit_handlers.rs; a dedicated role admins do NOT hold by default); a system caller is 403 service_class_on_user_only

Query parameters: from, to, accessed_by, purpose_code, action, resource_type, page, page_size (AuditListQuery in fti_audit_handlers.rs).

Paging: page is zero-based and defaults to 0; page_size defaults to 50 and a larger size than 200 reads as 200. Entries come newest first, and entries of one access time by id, highest first, so a walk through the pages meets each entry once. A negative page or page_size, or a page whose first row is past what an offset can express, is 400 invalid_page (FtiAuditPaging in canopy-db). total and the page are read in one snapshot of the log, so an entry written while the list is read is in neither (query_log in canopy-db).

GET /v1/fti-audit-log/{id}

Fetch a single entry (full event payload).

Access

fti_auditor (FTI_AUDITOR), as the list route

GET /v1/fti-audit-log/summary

Aggregated counts by event type + actor over a date range. Used by Pub 1075 §9 quarterly review.

Access

fti_auditor (FTI_AUDITOR), as the list route

Query parameters: from, to (both required; SummaryQuery).

Overpayment Recovery (42 CFR 433.300)

Cross-program shape — the same paths on canopy-snap (/v1/overpayments, whose create screens the claim against SNAP’s claim floors, #2242) and canopy-tanf (/v1/overpayments), with per-service data isolation per ADR-001. The types, the store and the handlers come from the shared crates/canopy-overpayments crate: services/canopy-medicaid/src/api/mod.rs merges canopy_overpayments::api::routes() (six operations on five paths) into its routes(), the list admitting by delegated::MEDICAID_GET_OVERPAYMENTS, and the handlers run over canopy-medicaid’s own database. Ledger is the system of record; outstanding balance is derived (not stored). Claims auto-open from appeal.overpayment_assessed events (see canopy-appeals).

POST /v1/overpayments

File an overpayment claim. A claim already recorded for the same assessment or source event is the coded 409 unique_violation (#2250).

Access

system; writer (the overpayment crate’s WRITER) — quality_control is read-only and gets 403 required_role_missing

Request:

{
  "person_id": "uuid",
  "household_id": "uuid",
  "determination_id": "uuid",
  "claim_amount_cents": 50000,
  "claim_basis": "agency_error",
  "error_type": "coa-misclassification",
  "discovered_at": "2026-05-01"
}

claim_basis ∈ agency_error / inadvertent_household_error / ipv. claim_amount_cents > 0. The body carries no actor: the claim’s discovered_by is principal.actor() — the worker’s canopy subject, or a system caller’s client id — and an unknown field, such as a stale discovered_by, is refused with 422 (#1008).

Response 201: the persisted OverpaymentClaim row; its discovered_by is an Actor object ({"actor_type": "human", "subject": "…"} or {"actor_type": "service", "service": "…"}).

GET /v1/overpayments[?status=…​&limit=…​&after_created_at=…​&after_id=…​]

One keyset page of claims WITH server-side ledger totals (#1222) — same envelope and semantics as the canopy-snap page (see the SNAP API page); the three services serve the one shared handler.

status ∈ open / in_repayment / closed / written_off.

Access

system; caseworker+; case reader via canopy-reporting (delegated::MEDICAID_GET_OVERPAYMENTS, layered as the crate’s ListAdmission) — canopy-reporting’s onward delegation for its overpayment summary and export

GET /v1/overpayments/{id}

Read a single claim.

Access

system; caseworker+ (the overpayment crate’s READER)

POST /v1/overpayments/{id}/repayment-plans

Attach a repayment plan. HTTP 409 if claim is closed or written_off.

Access

system; writer (WRITER) — quality_control is read-only and gets 403 required_role_missing

POST /v1/overpayments/{id}/recoupments

Append a recoupment ledger entry. Same TX semantics and refusals as canopy-snap and canopy-tanf: an unknown claim is a 404, and a repayment_plan_id that names no plan of this claim the coded 422 repayment_plan_unknown (#2250).

Access

system; writer (WRITER) — quality_control is read-only and gets 403 required_role_missing

GET /v1/overpayments/{id}/ledger

Full ledger view + derived total_recouped_cents + outstanding_cents.

Access

system; caseworker+ (READER)

CMD change-report pipeline (#575)

The CMD ingest is the head of the change-report pipeline (#1506): one transaction commits the lifecycle row (state requested, the PAMMS 2750 10-day deadline_at) together with a determination.requested::Order (origin ("medicaid-cmd", cmd_event_id), as_of = the change’s effective date, the signed change-report trigger). canopy-eligibility’s durable order substrate executes the signed re-determination; the canopy-medicaid.cmd-settle consumer completes the row off the origin-echoing determination.completed. Backs the #1507 two-step BFF action (actions_medicaid::ingest_cmd_update_medicaid — the disability fact writes through canopy-persons first).

POST /v1/cmd/ingest

Access

system; writer (WRITER, src/api/mod.rs); submitted_by is the caller’s attribution_sub() (the worker’s canopy subject, or a system caller’s client id), never a request field

Request:

{
  "person_id": "uuid",
  "household_id": "uuid",
  "application_id": "uuid",
  "cmd_event_type": "ssi_terminated",
  "effective_date": "2026-08-01",
  "notes": "DCH SSI-termination feed"
}

cmd_event_type is the closed canopy_reference::CmdEventType vocabulary.

The order names every program the application determined (#2319): each program any of its determinations served, Medicaid first (store::programs_served). A Medicaid/CHIP application therefore re-determines both programs, and each supersedes its own chain. An application with no determination is refused 422 cmd_application_undetermined before anything is written.

The order is staged for the body’s household_id, so the application must belong to that household (#2545). After the undetermined refusal, so that an undetermined application reveals no owner, the handler reads every household the application’s medicaid_applications rows name (store::application_households). Any household other than the body’s is refused 409 cmd_application_household_mismatch before anything is written: no CMD row and no determination.requested order. The detail names the request’s ids, never the stored household. The check ties the application to the household the request names; it is not an authorization of that household. canopy-medicaid cannot know which household a worker acts in, so a caller that names the application’s true household passes. canopy-web binds the application to the worker’s household before it sends the report (canopy-web).

Response (202): the lifecycle handle (state, deadline_at, processed_at = null until settled). The response is a handle, not an outcome — poll GET /v1/cmd/events.

GET /v1/cmd/events?household_id=

The household’s CMD lifecycle rows, newest first (bounded at the 100 most recent). Backs the worker portal’s determination-tab status table.

Access

system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_CMD_EVENTS)

Query parameters: household_id (required; CmdEventsQuery).

GET /v1/cmd/escalations

The cross-household escalation feed (#1511): unresolved rows whose PAMMS 2750 deadline is inside the [medicaid].cmd_escalation_warning_days window (overdue included) plus state='failed' rows, most-urgent deadline first, bounded at 50. Backs the worker-dashboard CMD-escalations panel — the worker-visible arm of the 10-day clock. Both clock values are jurisdiction data: [medicaid].cmd_clock_days stamps deadline_at at ingest and cmd_escalation_warning_days bounds this feed (the [appeals] clock-pair precedent, ADR-003). Both are measured from the service’s injected decision clock (#2581, ADR-033 §5): ingest stamps ingested_at and starts the deadline at the request’s instant, and this feed judges the window at its own request’s instant. The pair is optional together (#3441): a pack with neither key states no decision deadline, so ingest stamps deadline_at null, no report joins this feed on a deadline (a failed one still does), and the worker screens print "no deadline". One key without the other refuses boot.

Access

system; caseworker+; case reader via canopy-web (delegated::MEDICAID_GET_CMD_ESCALATIONS)

The pipeline’s queues and deployment ordering are the operator’s concern: the CMD change-report rollout runbook; the depth and age gauges are services/canopy-medicaid/src/cmd_metrics.rs. The events it publishes and consumes are listed below.

NOTE
The determination requeue (POST /v1/determinations/{id}/requeue, #448) is deleted (#2061): it rewrote a signed status. canopy-eligibility quarantines an envelope that does not verify or bind, and a determination operator reverifies or dismisses it there — canopy-eligibility › Quarantined envelopes.

Admin replay

The shared canopy-api operator route (crates/canopy-api/src/admin.rs): main.rs merges it from canopy_api::AdminRoutes beside the API routes, behind the same identity receiver, and the handler admits by ADMIN_HUMAN. Replay is per service (ADR-001) — there is no cross-service replay endpoint.

POST /v1/admin/events/replay

Re-offer one or more of this service’s unprocessed event_inbox rows to its own handlers, in process (nothing is published); every requested id is classified in the response.

Access

admin (canopy-api’s ADMIN_HUMAN, crates/canopy-api/src/admin.rs), a delegation through any client; a system caller is 403 service_class_on_user_only

Request: ReplayRequest — { "event_ids": ["uuid", …] }, the envelope ids to look up in this service’s event_inbox.

Response (200): ReplayReport — each requested id in exactly one of replayed, already_processed, missing, failed, unparked (a parked outbox row reset for the drainer), outbox_pending.

Response (403): service_class_on_user_only (a system caller) or required_role_missing (a user without admin).

Error Codes

Code Meaning

201

Resource created (overpayment claim / repayment plan / recoupment ledger entry / cooperation finding / demonstration activity report)

400

Invalid input; an X-Canopy-Actor header (actor_header_retired)

401

No bearer (token_missing) or a token the receiver refuses (token_rejected)

403

The route’s admission refuses the caller: service_class_on_user_only (a system caller on the redaction, the ELE revoke or renewal run, the FTI audit reads, the admin replay, the cooperation-finding create or the demonstration-activity-report create), system_caller_required (a user asking GET /v1/determinations for month), required_role_missing (a user without the route’s roles). Uncoded: the determine’s provenance gate (Admission specifics)

404

Determination, COA evaluation, TMA record, or overpayment not found; an operation with no determination (operation_not_determined)

409

Status transition not allowed; operation_already_determined (a determined operation’s repeat, #2673) and supersession_conflict on POST /v1/determine; cmd_application_household_mismatch on POST /v1/cmd/ingest (the application’s Medicaid record names a household other than the body’s, #2545)

422

Semantically-invalid input (invalid enum value, etc.); cross_program_previous_determination and state_of_residence_missing (#3095), foster_care_state_at_18_invalid (not a USPS State code) and foster_care_state_at_18_contradicted (a State stated while was_in_foster_care_at_18 is false, #3472) on POST /v1/determine; cmd_application_undetermined on POST /v1/cmd/ingest (an application with no determination to re-determine, #2319); medicaid_date_out_of_range and medicaid_effective_date_in_future on POST /v1/cooperation-findings (an effective_date outside 1900-9999, or after the legal today, #3189); those two, medicaid_period_in_future, medicaid_period_end_before_start, medicaid_unknown_activity and medicaid_hours_out_of_range on POST /v1/demonstration-activity-reports (Demonstration activity reports (#3203), #3203)

503

FTI hash-chain breach detected; GET /v1/ele/chain-status on an ELE chain break (typed body); no trustworthy key set in time (keys_unavailable)

Events Published

Each medicaid.determined is held until its determination is recorded (#2322). api/determination_events.rs stages the run’s events after its determinations commit, in a transaction of their own, each under its own canopy_mq::hold_for(determination_id); the verdict consumer under Subscribed Events releases it on determination.recorded.medicaid or .chip and drops it on the matching determination.disowned key (ADR-002 Amendment 7). A verdict can arrive before that transaction commits, so the staging and the consumer serialize on an advisory lock keyed on the determination, and the staging releases or drops its own rows by a verdict already stored in determination_verdicts. A determination canopy-eligibility never records, a direct caller’s included, publishes nothing.

  • medicaid.determined — one event per subject (IDs and status only — no PII, FTI, or HIPAA data per ADR-004): application_id is this service’s per-run medicaid_applications row, upstream_application_id is the canopy-applications record the determination was run for (#1940; canopy-notices stores the latter as the notice’s application id), plus household_id, person_id, program (medicaid | chip, the served program, #2942 — also the envelope’s programs assertion, which canopy-security scopes the audit row by), status, assigned_coa, assigned_coa_track, benefit_type, trigger, determined_at, and — on an approval only — effective_date, the coverage start as an ISO legal day (medicaid_determinations.effective_date; an approval without one is refused at the producer, a denial carries no such key; #1995). Since #3422 the event carries the words a letter prints, as the pack stated them when the determination was made: an approval carries assigned_coa_label, the assigned class's label from its [[medicaid.classes]] row (absent on a denial); each entry of a denial's denial_reasons_by_coa is exactly { coa_code, coa_label, reason_code, reason_text }, the reason's text from its [[medicaid.denial_reasons]] row; and a denial that refused the whole person before any class was evaluated carries denial_reason_texts beside denial_reason_codes, one sentence for each code the pack words, in order. A reason code the pack gives no text for refuses the determination with 502 before anything is signed, and canopy-medicaid refuses to start on a pack that gives no text for a code it can put on a denial itself (medicaid_eligible, not_a_state_resident, medical_support_non_cooperation, third_party_liability_non_cooperation)

  • determination.redacted (#687) — a data steward crypto-shredded a determination’s snapshot; carries the actor sub + reason, no plaintext, and the determination’s served program (payload program and envelope programs, #2942)

  • fti.audit_chain.breach_detected (Pub 1075 §9 reportable)

  • medicaid.overpayment_claimed (#1035) — staged in the same tx as an appeal-opened overpayment claim; routes to the 42 CFR 433.300 demand notice in canopy-notices AND acknowledges the assessment back to canopy-appeals (#1105)

  • medicaid.ele.granted / medicaid.ele.extended / medicaid.ele.renewed / medicaid.ele.lapsed / medicaid.ele.revoked — the Express Lane grant-event family, one per ele_grant_events transition (routing keys canopy_contracts_medicaid::ele::routing_keys::ELE_GRANTED and siblings; IDs, tier, dates and actor only)

  • medicaid.cmd_settled / medicaid.cmd_failed — the CMD lifecycle row’s terminal flips, staged in the settling transaction by the cmd-settle / cmd-fail subscribers (main.rs)

  • determination.requested — the signed re-determination Order POST /v1/cmd/ingest stages for canopy-eligibility

Subscribed Events

Queues and bindings from services/canopy-medicaid/src/main.rs:

  • canopy-medicaid.tma ← tanf.case_closed — creates TMA coverage rows (Phase 1) for AU members (logs-and-skips when person_ids is empty) and runs the ELE source-closure lapse

  • canopy-medicaid.ele-case-closed-snap ← snap.case_closed — the SNAP-closure ELE lapse: under the federal ele-lapse-2026 ruleset the durable flag stays active and only granting_program_history drops snap (handle_ele_case_closed)

  • canopy-medicaid.ele-income-changed ← persons.income_changed — ELE income-change re-evaluation (handle_ele_income_changed; no source program closes, so history is preserved)

  • canopy-medicaid.express-lane ← snap.application_approved, tanf.application_approved — the Express Lane grant path

  • canopy-medicaid.ele-consent ← application.ele_consent_recorded — persists the durable consent the grant path is gated on, with its consent_recorded_by actor (#1008). The subscriber parses only the actor_type-tagged Actor object: an old-shape (bare string) or malformed actor returns Err, so the delivery is nack-requeued to max_attempts and dead-lettered, never acked and dropped

  • canopy-medicaid.cmd-settle ← determination.completed — completes the CMD lifecycle row off the origin-echoing completion

  • canopy-medicaid.cmd-fail ← determination.order_failed — marks the CMD row state='failed' + failure_code, surfacing it on the escalation feed

  • canopy-medicaid.overpayments ← appeal.overpayment_assessed (filters program == "medicaid"; auto-opens an OverpaymentClaim row) and appeal.overpayment_assessment_voided (#1105; voids the claim stamped with the event’s assessment_id — idempotent, no-claim is a no-op)

  • canopy-medicaid.determination-verdicts ← determination.recorded.medicaid, determination.disowned.medicaid, determination.recorded.chip, determination.disowned.chip (src/verdict_subscriber.rs, #2322) — canopy-eligibility’s verdict on a determination this service signed (ADR-002 Amendment 7; payloads in canopy-eligibility’s verdicts). In the inbox transaction, recorded releases the outbox rows held under canopy_mq::hold_for(determination_id) and disowned deletes them; the verdict is recorded in determination_verdicts, where a recorded verdict is final. A key that is no verdict parks; a malformed payload, or one naming a program this service does not determine, dead-letters. A replay releases or drops nothing.

Edit this page · default