canopy-snap API Reference
Overview
Cross-link: canopy-snap Data Model (#419)
SNAP program service. Computes eligibility determinations (income tests, deductions, allotment), manages ABAWD work requirement tracking, categorical eligibility (BBCE), student status screening, IEVS verification results, and exposes jurisdiction parameters.
All eligibility logic runs through the rules engine (ADR-003) — no federal regulation values are hardcoded.
- Base URL
-
container port 8013 (host:
CANOPY_PORT_CANOPY_SNAP_8013in.ports.env); every route below is mounted under/v1 - Authentication
-
Bearer token: a canopy-identity token for this receiver (its
audisurn:canopy:service:canopy-snap), authenticated by the service’s identity receiver (ADR-049 Amendment 14): no bearer is 401token_missing, a token it refuses 401token_rejected, anX-Canopy-Actorheader 400actor_header_retired, and no trustworthy key set in time 503keys_unavailable. - Access
-
canopy-eligibility, canopy-reporting and the portal hold system edges to canopy-snap; canopy-web, canopy-cli, canopy-appeals, canopy-eligibility and canopy-reporting hold delegation edges. Writes admit a system caller or the writer bar and reads a system caller or caseworker+, plus canopy-web’s readers on the inventory’s delegated reads;
POST /v1/determinethen refuses every caller but canopy-eligibility, the dry run and the snapshot admit canopy-eligibility’s onward delegation, the operation envelope admits canopy-eligibility’s system token alone, the portal reaches onlyGET /v1/params, the held-determination list admits a determination operator’s delegation through canopy-eligibility alone (GET /v1/held-determinations), and the redaction, the export and the admin replay are user-only. A refusal is 403 with itsReceiverDenialcode (ADR-049 Amendment 14); each route’s constant is in the authorization inventory. - Swagger UI
-
/swagger-uion the same host port - Database
-
canopy_snap(isolated per ADR-001; contains IEVS data per ADR-004)
Admission specifics
Each route’s access line names its admission and constant: system is any system caller but the portal; writer is CASEWORKER_WRITER_ROLES, caseworker+ CASEWORKER_OR_ABOVE_ROLES, case reader CASE_READER_ROLES and worker reader WORKER_READER_ROLES (crates/canopy-auth/src/roles.rs); "via" lists the only clients a user’s delegation may come through. WRITER, READER and SYSTEM are src/api/mod.rs's.
-
The orchestrator pin.
POST /v1/determineadmitsWRITER, then its guard ladder (src/api/determine_policy.rs) admits canopy-eligibility alone byprincipal.client(): its system token, or its onward delegation, whose current actor is canopy-eligibility. Every other caller, a canopy-web worker’s delegation and canopy-reporting’s system token included, is an uncoded 403 before any evaluation or write. -
canopy-eligibility’s other arms. The dry run and the snapshot admit its onward delegation at caseworker+; a worker’s direct delegation is refused (the snapshot admits it only for
adminorquality_control); the operation envelope admits its system token alone (system_from), so another system caller is 403service_not_allowlistedand a usersystem_caller_required. -
The hearing view admits case readers through canopy-web, canopy-cli or canopy-appeals: canopy-appeals' hearing proxy (
GET /v1/appeals/{id}/hearing-view) calls it with the operator’s onward delegation. -
The portal reaches
GET /v1/paramsalone (scopeportal:snap-params:read); on any other route its token is 403portal_on_non_portal_route. -
Attribution. The recompute’s
requested_by(therequested_by/requested_by_servicepair, recorded again as the claim’sdiscovered_by), the IEVS resolve’sresolved_by(resolved_by/resolved_by_service) and the manual claim’sdiscovered_byareprincipal.actor(): a user asHumanwith the canopy subject, a system caller asServicenamed by its client id (e.g.canopy-eligibility). The redaction event’sactor_suband the export audit’sactorareprincipal.attribution_sub(), the caller’s canopy subject (both routes admit users alone). -
Onward calls. A request’s calls ride its outbound (
RequestOutbound). canopy-rules (the determination, the dry run, the recompute’s replay) always gets canopy-snap’s system token, its only edge to canopy-rules. The recompute’s canopy-persons read and canopy-enrollment reads, and the manual claim’s participation read, carry the worker’s onward delegation for a user and canopy-snap’s system token for a system caller. Background work sends through canopy-snap’sIdentitySender(system origin): the detached IEVS run (the canopy-persons roster, the canopy-verification match), the claim-screen pass’s canopy-enrollment participation reads, and the boot signing-key registration with canopy-security. Identity settings are the baselineIDENTITY_ISSUER/IDENTITY_INTERNAL_URL(configuration reference) and the client keyCANOPY_SNAP__IDENTITY_CLIENT_PRIVATE_KEY.
Determination
POST /v1/determine
Run a SNAP eligibility determination. Called by canopy-eligibility orchestrator.
- Access
-
system; writer (
WRITER), then canopy-eligibility alone: the guard ladder refuses every other caller 403 (Admission specifics)
Request: ApplicationContext (crates/canopy-contracts-snap/src/determine.rs; members[] are canopy_types::household::ApplicationMember). Income, assets and expenses are household-level arrays, not per member, and the contract carries no SSN — identity stays in canopy-persons (ADR-004). Amounts are decimal strings. A member’s optional pregnancy (MemberPregnancy: expected_delivery_date, fetus_count, family_size_increase_waived) and pregnancy_end_date are the orchestrator’s canopy-persons pregnancy facts as of the evaluation day (#3145); canopy-snap reads only whether pregnancy is present, for the ABAWD exception below.
{
"application_id": "uuid",
"household_id": "uuid",
"household_size": 3,
"jurisdiction": "georgia",
"members": [ { "person_id": "uuid", "relationship": "head", "age": 34 } ],
"income": [ { "income_type": "employment", "amount": "1500.00", "frequency": "monthly" } ],
"assets": [ { "asset_type": "bank_account", "value": "2000.00" } ],
"expenses": [ { "expense_type": "rent", "amount": "800.00", "frequency": "monthly" } ],
"has_elderly_disabled_member": false,
"is_categorically_eligible": false,
"liheap_received_last_12_months": false
}
Optional: categorical_eligibility_type (default none), utility_tier, as_of, trigger, expected_policy_target, previous_determination_id, effective_date_basis, postponement — the guards below say what each requires. The handler:
-
Evaluates gross income test (130% FPL via rules engine)
-
Computes deductions (standard, earned income, dependent care, medical, shelter/SUA). For self-employment income, pre-processes via the
snap-self-employment-deductionJDM ruleset (se_deduction::RULESET_NAME, #3135): net SE = gross SE − max(actual_business_expenses, gross_SE × 40%) (PAMMS 3425 / 7 CFR 273.11(a)(2)). Applicants with zero reported actual business expenses (common for service workers) get the 40% standard rather than being penalized. -
Evaluates the net income test (100% FPL via the rules engine) and calculates the allotment (max allotment − 30% net income)
-
On an eligible verdict, assigns the certification period through the
snap-certification-perioddecision (#1703; the subsection below) — the assigned months drive the signed period on every basis exceptexpedited_postponedand the period-carrying continuation kinds (interim_change,order_continuation,mass_change_cola— the carried live period is signed verbatim and the assignment is recorded, not applied; #806 U-C for the COLA), and the assignment ridesdetermination.completed.snapon every approval -
Assembles + persists the determination input snapshot (ADR-028,
schema_version12, the one versionverify_schema_versionaccepts:DeterminationSnapshot::SCHEMA_VERSION_MAXandSCHEMA_VERSION_MINare both 12, Amendment 8): the configuration stamp (config_stamp, the commit of each configuration layer the replica loaded, the same value the signed envelope carries), the proven facts with provenance + a correction-stable fact id (re-parsed from the orchestrator-forwarded persons facts), the household’s per-member ABAWD identification (facts.household.abawd_identification[], the frozen source of the decision’sabawd_status), the resolved policy params (theSnapPolicyBundle, whose eight certification keys — thecertification_monthsmap, the ceiling, the age cutoffs (the ABAWD dependent-child cutoff among them) and the filing day;esapoptional — are required at v10), the exact evaluated input, and the ruleset corpus-hash — joining the snap-local IEVS reconstruction for any IEVS-authored income fact. Its SHA-256 (RFC 8785 canonical) becomes thesnapshot_hashsigned into the determination; the snapshot is stored immutably indetermination_snapshotsin the same transaction. The snapshot’s DEK is generated and KEK-wrapped without a write (PgRedactionKeyStore::mint_unpersisted), and itsredaction_keysrow is inserted in that transaction (persist_determination_rows), so a determination that does not commit (a supersession race’s 409 included) leaves no key (#2382). -
Records supersession (ADR-028 §57): when the request carries
previous_determination_id(an optional context field — a recert/adjustment re-determination supplied by the caller), it is validated (the antecedent must exist, belong to the same household, and not already be superseded — else 422/409) and bound into the signed envelope before signing. Production callers do not set it yet (the recert→determine trigger is a follow-up); absent it, the determination supersedes nothing. -
Signs the determination with ECDSA P-256 (ADR-002) — the signature covers
snapshot_hash+previous_determination_id— and triggers IEVS verification asynchronously: per household member, one transaction writes the member’s current match row per source (the wage figure aggregates every wage record, and both its all-quarter average and its latest quarter are compared, the data modelievs_match_results, #2691; a re-run of the same application updates the rows in place) and its open discrepancies; a partial IEVS answer (a source query failed upstream) leaves the unanswered sources' stored results as they stood; a member whose IEVS query or store fails, or whose answer was partial, is named in the run’s WARN and every later member is still verified (#2665)
The certification-period decision
The length of an approved certification is jurisdiction policy, so it lives in JDM per pack (#1703): the georgia pack’s snap-certification-period.json and fixtures/config/{default,test-min,test-max}/snap-certification-period.json, embedded name snap-certification-period, one first-hit decision table whose rows are the pack’s declared categories (georgia: ABAWD → Senior SNAP → all-adults-elderly-or-disabled → unresolved ABAWD → all other, transcribing PAMMS MT-87 Chart 3105.1; test-max the same shape with its elderly_simplified row where georgia has Senior SNAP; test-min without a waived row; default the 7 CFR 273.10(f) floor — every-adult-elderly-or-disabled and all other). canopy-snap (services/canopy-snap/src/certification_period.rs) evaluates it on every eligible determination through evaluate_pinned_with_provenance under the determination-wide corpus pin, traced, and parses the output strictly.
Since #2209 the VOCABULARY is pack data too (ADR-003): each pack declares its categories as [[snap.certification.categories]] rows in jurisdiction.toml, its ceiling as [snap.certification].max_certification_months and the ESAP election as ONE optional [snap.certification.esap] table. services/canopy-snap/src/params.rs (CertificationKeys::load) refuses the pack at boot, naming the key, on any breach of the constraints below. The closed CertificationCategory enum is gone: canopy_contracts_snap::CertificationCategory is a shape-validated newtype (^[a-z][a-z0-9_]{0,63}$, never expedited, enforced on FromStr and on deserialization, so "", Senior and expedited are refused on the wire) and membership in a pack’s rows is every consumer’s check against ITS booted pack — canopy-snap at signing, canopy-renewals, canopy-enrollment and the worker portal at their writes.
| Pack key | Meaning |
|---|---|
|
One row per category the decision may assign and a worker may declare. Every field but
|
|
the longest |
|
the |
The georgia rows, as (label, months, waived, interim contact, declarable, convertible → target): standard (Standard, 6, no, yes, yes, no) · elderly_disabled (Elderly/disabled, no earned income, 12, no, no, yes, no) · senior (Senior SNAP, 36, yes, no, yes, yes → standard) · abawd (ABAWD, 4, no, no, yes, no). default: standard (6) and elderly_disabled (24), neither waived nor convertible. test-max names its waived, convertible row elderly_simplified (36 → standard) — the corpus’s proof that the vocabulary extends without code. The same row table is what canopy-renewals (the manual POST, the waiver, the interim contact, the conversion), canopy-enrollment (the continuation row) and the worker portal (the select) load from THEIR packs — see canopy-renewals and Rulesets.
| Axis | Content |
|---|---|
|
|
|
ONE map, |
outputs |
|
the |
a row longer than Standard fires only on facts it knows; an |
refusals |
the output is accepted only when a |
Policy bundle v11. The snapshot’s frozen SnapPolicyBundle (policy_params, crates/canopy-contracts-snap/src/determine.rs) carries exactly the certification policy the decision read: certification_months (the code → months map), max_certification_months, esap ({ senior_age_floor, fixed_income_types } — Some iff the pack elects it; None is the not-elected state, never an omission), abawd_age_min, abawd_age_max, abawd_dependent_child_age (v10, #2930), abawd_aged_age_min (v11, &94), elderly_age_threshold, age_of_majority and recert_timely_filing_day. SnapPolicyBundle::CERTIFICATION_KEYS names the nine keys REQUIRED from CERTIFICATION_KEYS_REQUIRED_FROM = 11 (esap is deliberately not one); verify_certification_keys_at refuses a v11 bundle missing any of them, one whose certification_months map is empty, or a Some ESAP with an empty fixed_income_types, and lets v5–v10 history replay unchecked (the four flat month keys and the senior floor of v8 are gone; the devstack reseed leaves no v8 or v9 history). The shared cap DeterminationSnapshot::SCHEMA_VERSION_MAX (crates/canopy-contracts-eligibility/src/snapshot.rs) is 12, the version canopy-snap writes; retrieval, the hearing views and recomputation all call its guard. From snapshot version 12 a stored bundle must also carry the five BBCE keys (bbce_gross_income_limit, bbce_asset_limit, bbce_elderly_disabled_gross_income_limit, bbce_net_income_test_waived, bbce_elderly_disabled_screen), each null when the pack elects no BBCE: the overpayment recompute and the orchestrator's baseline replay (a 422, manual review) refuse a bundle missing one, naming it, since an absent key would read as "not elected" (SnapPolicyBundle::verify_bbce_keys_at, #3311).
Evaluation date and the guards
The optional as_of context field is the evaluation date (#1467, ADR-028 Amendment 6): it selects the effective-dated parameter set in force (snap-{allotments,deductions,income-limits}-* grouped by _effective_date), anchors the benefit-period dates and the snapshot as_of, and dates a non-continuation denial’s snap.case_closed; absent, it is today as a legal date in the jurisdiction’s timezone, read from the service’s injected decision clock (#2591). Only determined_at stays wall-clock. The pre-evaluation guards run in this order, before any evaluation or write (services/canopy-snap/src/api/determine_policy.rs resolve_determine_policy):
| Condition | Status | Code |
|---|---|---|
|
422 |
— |
A bulk-marked context ( |
422 |
|
A caller other than canopy-eligibility ( |
403 |
— |
A dispatch missing any of |
422 |
|
An |
422 |
|
A |
422 |
|
An |
422 |
|
A |
422 |
|
No parameter set in force at the selection date — unless |
422 |
|
A claimed anchor owing more than 24 benefit months (a dispatch defect) |
422 |
|
|
409 |
|
Two further refusals are raised after the live verdict and before the input snapshot is built (determine.rs), so an ineligible household is denied whether or not the owed months are staged:
| Condition | Status | Code |
|---|---|---|
An owed benefit month with no parameter set in force — only once the verdict is eligible; the detail names the month |
422 |
|
An eligible benefit month the ruleset priced without a figure (a ruleset defect, never a guess) |
422 |
|
An eligible verdict whose benefit_amount a determination cannot store breaks canopy-rules' output contract: a number Decimal cannot hold (non-finite, or finite past about 7.9e28, #2257), or one whose magnitude, rounded to cents, reaches 100000000.00, past what snap_determinations.benefit_amount (NUMERIC(10,2)) holds (#2293). parse_verdict refuses it with an uncoded 502 that names the ruleset, before either refusal above and before the determination insert, and logs the same detail at error. The check follows the rounding, because PostgreSQL rounds before it checks. An in-range amount is converted exactly as before — Decimal::from_f64_retain, then rescale(2) — so the signed bytes do not change (#338).
The verdict itself is read strictly (#628): the ruleset output must carry eligible as a boolean and a status that is the verdict eligible implies — approved exactly when eligible, denied exactly when not. A missing or non-boolean eligible, a missing status, any other token (sanctioned included) or a contradicting pair is the same uncoded 502, raised before anything is signed or persisted. canopy-snap therefore signs only approved and denied.
Supersession is checked separately in determine.rs, not in the ladder above: a previous_determination_id (ADR-028 §57) that is missing or belongs to another household is an uncoded 422; an antecedent already superseded is 409 supersession_conflict. At the insert, the violated unique index decides (#2251): the supersession index (a concurrent supersede of the same antecedent) is 409 supersession_conflict; snap_determinations_operation_uq (the dispatch’s operation_id already has a determination) is 409 operation_already_determined; any other unique violation is a 500. Both details are fixed text. canopy-eligibility’s bulk arm adopts the baseline’s successor on either code; its orchestrator adopts the operation’s determination on operation_already_determined (through GET /v1/determination-operations/{operation_id}/envelope, #2439; order runs only — an interactive run’s operation is fresh) and keeps supersession_conflict a conflict.
Each coded 422 surfaces as the applications postponement saga’s error_code. trigger and expected_policy_target are bound into the signed envelope pre-sign; GET /v1/params/provenance reports attestation_enabled so the #1213 enact preflight fails closed against a replica that cannot attest.
Effective-date basis kinds
ApplicationContext.effective_date_basis (canopy_types::effective_date_basis::EffectiveDateBasis) selects how the period, the parameter selection and the closure behave. Regulatory bases: 7 CFR 273.9(a)/(d), 273.10(e)(4), 273.10(f), 273.12(e)(1), 273.2(i)(4)(iii); PAMMS 3110:140-143.
| Kind | Period | Parameter selection | Event mirrors and closure |
|---|---|---|---|
every other kind ( |
|
the live set at |
a denial stages |
|
|
the certified month from the set at |
|
|
|
at |
the expedited-only mirrors are ABSENT; a denial stages no |
|
|
at |
a denial carries no period and stages no |
|
the default arm from the anchor: |
the live set at |
a denial carries no period and stages no |
The live selection anchor — as_of, evaluated_as_of, the snapshot as_of, policy_target and benefit_amount — is the same under every kind; the schedule only ADDS back-dated months.
Response (200): SignableDetermination — the universal signed-determination envelope (ADR-002) with status, benefit amount, basis, JWS signature, a program-specific program_extension payload (since #1662 PERSISTED on snap_determinations and surfaced on the read model as the typed SnapProgramExtension; following_month is its first SNAP member), the snapshot_hash binding the input snapshot (ADR-028), and the optional previous_determination_id supersession link (ADR-028 §57). When emit_policy_attestation is enabled (devstack: on; production: after the fleet carries the tolerant envelope — see the scaling runbook), the envelope additionally binds policy_target (the composite policy identity) and evaluated_as_of (the exact evaluation date, present for denials too). The canonical bytes the signature covers (canonical_signing_payload(), computed once) are signed and persisted as snap_determinations.signed_payload in the determination’s transaction, and served verbatim by GET /v1/determinations/{id}/envelope (below; #1984). The orchestrator verifies the JWS over the canonical bytes of this same shape and receives only outcome + hash (never the snapshot cleartext).
POST /v1/determine/dry-run
Non-persisting dry-run (#680; ADR-027 §6) against exactly ONE policy source — the frozen bundle of a determination-of-record (the materiality replay) or, since #1472, a caller-named target policy (the COLA preview). Called by the canopy-eligibility orchestrator; not a worker-facing endpoint.
- Access
-
system; caseworker+ via canopy-eligibility (
delegated::SNAP_POST_DETERMINE_DRY_RUN) — no row is written, but the dry-run replays sealed-determination policy, so no direct worker is admitted
Request: DryRunDetermineRequest — context (the ApplicationContext shape above, with the current facts) plus EITHER the baseline pair policy_bundle (the SnapPolicyBundle read from the baseline determination’s snapshot.policy_params) + corpus_hash (its ruleset corpus version), OR target_policy { corpus_hash, params_digest } alone (#1472).
Any other combination (both sources, neither, or a bundle without its corpus pin) is a 400. Baseline replay runs the shared evaluate_verdict pipeline reading policy ONLY from the supplied policy_bundle, never the live parameter table. Target policy (#1472) resolves params_digest against the loaded parameter sets — content-addressed and date-blind, so a staged next-window COLA set is previewable before its window opens — and pins every rules call to target_policy.corpus_hash; it requires an explicit context.as_of (400 without one) and the configured jurisdiction (422 on mismatch), and a digest matching no loaded set is a fail-closed 422. Both arms are write-free end to end (no DEK, nothing sealed or signed, no rows, no events; the corpus pin + audit=false thread through every rules call, so canopy-rules writes no audit rows either).
Response (200): DryRunOutcome — { status, benefit_amount, benefit_unit, corpus_hash_used, resolved_target?, household_size, gross_monthly_income, gross_income_limit }. The last three (#1619) are the decision inputs the replay actually scored with — gross_income_limit is the limit THIS evaluation used under its frozen bundle, so a caller (canopy-renewals' change-report screen) can re-screen the verdict without re-deriving anything. Unsigned: a dry-run is not a determination of record. resolved_target (target mode only) carries the full PolicyTarget including the matched set’s intrinsic effective_period. Returns 400 on an invalid body (e.g. household_size = 0), 403 for a caller the admission refuses, and 422 when the pinned corpus is unknown to canopy-rules (CorpusUnavailable) or the target digest matches no loaded set — the caller degrades to manual review rather than failing. An eligible verdict whose benefit_amount a determination cannot store (outside the Decimal range, or 100000000.00 or more in magnitude once rounded to cents), or a verdict the strict read refuses (#628), is the same uncoded 502 as on POST /v1/determine (#2257, #2293).
GET /v1/determinations/{id}
Get a determination by ID.
- Access
-
system; caseworker+ (
READER)
Response (200): SnapDeterminationRead — the SnapDetermination fields (flattened, including snapshot_hash + the previous_determination_id it supersedes) including the required snapshot_hash (#911 retired the ADR-028 §58 snapshot_status marker) and the derived supersession edge (ADR-028 §57): superseded_by_id (the determination that supersedes this one, if any) + superseded_as_of (the world-date from which it stopped being operative — the superseder’s effective date, falling back to the superseder’s snapshot evaluation date for an adverse re-determination with no effective date). Both are absent when this is the operative (latest) determination in its chain. Returns 404 if no determination exists for the supplied ID.
GET /v1/determinations
List determinations newest-first, optionally scoped to one household (#1576; the scoped read rides a composite (household_id, created_at DESC, id DESC) index, and the id tiebreak makes equal-timestamp rows page deterministically).
- Access
-
system; caseworker+; case reader via canopy-web (
delegated::SNAP_GET_DETERMINATIONS)
Query parameters (SnapDeterminationListParams, crates/canopy-contracts-snap/src/models.rs): page (default 1), per_page (default 25), household_id (optional).
Response (200): array of SnapDeterminationRead (each with its derived supersession edge — resolved in the same read, so list rows are accurate, never a misleading absent value).
GET /v1/determinations/{id}/snapshot
Return a determination’s frozen ADR-028 §57 input snapshot — the cross-service read for materiality/overpayment/QC consumers.
- Access
-
system;
adminorquality_control; caseworker+ via canopy-eligibility (delegated::SNAP_GET_DETERMINATIONS_ID_SNAPSHOT). The full snapshot carries proven facts, provenance, income, household composition, and DOB/disability, so a direct worker needsadminorquality_control— NOT general caseworkers; the caseworker+ arm is canopy-eligibility’s onward delegation, for its dry run.
Response (200): the typed DeterminationSnapshot JSONB blob (proven facts with provenance, resolved policy params, exact evaluated input, ruleset corpus-hash). Returns 404 if no determination exists for the ID, or if it is a legacy determination with no input snapshot (a distinct "no input snapshot" message, ADR-028 §58). A determination whose signed snapshot_hash is present but whose stored snapshot blob is missing is 500 (data corruption, alerted) — never silently served. FTI programs' (tanf/medicaid) hearing-scoped in-boundary snapshot read is a separate follow-up; this endpoint is SNAP (non-FTI) only.
GET /v1/determinations/{id}/certified-members
Return who an approved determination certified (#2365): its snapshot's members less those it excluded for a work sanction, in snapshot order. canopy-eligibility reads it before a WIC determination, so that only those members are sent as holding the SNAP certification (7 CFR 246.7(d)(2)(vi)(A)(1)).
- Access
-
system: canopy-eligibility (
CERTIFICATION_READER,src/api/certified_members_handler.rs)
Response (200): CertifiedMembers — { "determination_id": "uuid", "person_ids": ["uuid", …] }. 404 for an unknown determination; 409 determination_not_approved for one that is not an approval; 410 snapshot_redacted when its snapshot's key was shredded, since the exclusions can no longer be read.
GET /v1/determinations/{id}/envelope
Return the exact bytes a determination’s signature covers, and that signature, verbatim from the row (#1984) — so a verifier checks the JWS against the signed bytes rather than an envelope rebuilt from columns. canopy-eligibility’s bulk arm reads it to adopt a superseding determination (ADR-002 Amendment 5).
- Access
-
system;
adminorquality_control(ENVELOPE_READER,src/api/envelope_handler.rs) — the snapshot read’s direct arms
Response (200): DeterminationEnvelope (crates/canopy-contracts-snap/src/envelope.rs) — { "signed_payload": "<base64>", "signature": "<detached JWS>" }. signed_payload is the RFC 8785 canonical JSON of the SignableDetermination with an empty signature, as computed once at signing, carried as standard padded base64 (RFC 4648 §4); decoding refuses any other flavour. Returns 404 for an unknown determination and 403 for any other caller.
GET /v1/determination-operations/{operation_id}/envelope
The same DeterminationEnvelope, for the determination a claimed operation produced (#2439): at most one per operation (snap_determinations_operation_uq). canopy-eligibility’s orchestrator reads it to adopt the determination an operation already has when POST /v1/determine answers that operation operation_already_determined (a re-execution of an order epoch’s dispatch whose first execution committed; an interactive run’s operation is fresh, so it never meets the code), then verifies the bytes and binds them, the operation included, before recording them; its bulk consumer reads it to learn whether a cohort case’s operation already has a determination before an enrollment-state refusal settles the case (#2655; only the coded 404 means "none").
- Access
-
system: canopy-eligibility (
OPERATION_MINTER,src/api/envelope_handler.rs) — it alone mints operations
Response (200): DeterminationEnvelope, as above. Returns 404 coded operation_not_determined (canopy_contracts_snap::envelope::OPERATION_NOT_DETERMINED, so a reader tells it from a bare 404) when the operation has no determination, and 403 for any other caller, whether or not it has one.
GET /v1/held-determinations
The determinations whose completion events canopy-snap 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::SNAP_GET_HELD_DETERMINATIONS,src/api/held.rs; determination operator =DETERMINATION_OPERATOR_ROLES): a system caller is 403service_class_on_user_only, a user’s direct delegation 403actor_not_allowed, and a delegation without the roles 403required_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_sinceis when the oldest still-held event was staged, andheld_rowshow many are held. A determination is listed once itsheld_sinceis older than the decision clock’s instant lessCANOPY_MQ_HELD_AGE_WARN_SECS(MqTuning::held_age_warn; Configuration Reference). -
programissnap. -
operation_idis the canopy-eligibility operation the row was determined under (snap_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.
- Access
-
data_steward(inlineAdmission::user_roles,src/api/determine_handler.rs); a system caller is 403service_class_on_user_only. A dedicated, privileged, irreversible role for redaction/expungement — admins do NOT auto-hold it (separation of duties; admins grant/revoke the role but do not wield redaction authority themselves, mirroringfti_auditor).
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 canopy subject as actor_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.
GET /v1/determinations/{id}/hearing-view
Return a determination’s hearing-scoped, FTI-safe projection (#681, ADR-028 §70) — the in-boundary read for displaying a frozen determination at a hearing, without ever pulling a sealed leaf or restricted value out of the owning program service.
- Access
-
system; case reader via canopy-web, canopy-cli or canopy-appeals (
delegated::SNAP_GET_DETERMINATIONS_ID_HEARING_VIEW; Admission specifics). Unlike/snapshot(which returns the sealed blob to system callers, admin and QC), this is a distinct, unsealed, non-restricted projection: canopy-snap unseals the snapshot service-locally (it owns the DEK) and projects to a DTO that carries only the verdict (status, benefit, dates), the pinnedcorpus_hash+policy_params_digest, the household size, and afacts_summaryof input-fact identities (kind/ optionalperson_id/ optionalfact_id/label) — never a fact value. FTI-safety is by construction of the projection, so an FTI program (tanf/medicaid) returns an FTI-redacted shape unchanged.
Response (200): HearingDeterminationView. Returns 404 for an unknown determination or a legacy determination with no input snapshot, 422 for a non-SNAP determination, 403 for a caller the admission refuses.
POST /v1/determinations/{id}/overpayment-recompute
Replay a determination’s frozen snapshot against the corrected household facts to size an overpayment, file the #382 claim, and emit snap.overpayment_claimed → OverpaymentNotice (#681, ADR-028 §70). Worker-actioned (a retroactive fact correction whose valid_from <= snapshot.as_of revealed the past determination was wrong); the recompute runs entirely in canopy-snap (which owns the snapshot + the per-determination DEK), so FTI never crosses to canopy-appeals/canopy-reporting (ADR-004).
- Access
-
system; writer (
WRITER);requested_byis the caller’sprincipal.actor()(#1008) — a user’s canopy subject, or a system caller’s client id — stored as therequested_by/requested_by_servicepair and recorded again as the claim’sdiscovered_by; never a body field
Per-month sizing (#1692): each month’s PAID figure is the money attributed to it through SnapBenefitIssuance::covered_months (a 7 CFR 274.2(c) combined row splits into its filing-month and month+1 parts; retained and non-issued rows excluded) and its CORRECT figure is the recomputed monthly — prorated by the paid initial row’s own day ratio, rounded down to the whole dollar (273.10(a)(1)(ii)), when the household was paid a prorated first month — so a lawful prorated or combined first issuance sizes to $0, never a spurious under/overpayment.
Request: OverpaymentRecomputeRequest — { correction_as_of, claim_basis, discovered_in_qc_review }, all three required. correction_as_of bounds the clawback window (it must be <= the determination’s evaluation date — a forward-effective change is a redetermination, not an overpayment, and is rejected 422); claim_basis ∈ {agency_error, inadvertent_household_error}; discovered_in_qc_review is the worker’s attestation that a quality control review found the overpayment (#936). It is a request field because canopy records no QC findings of its own (the review-findings surface is a catalogued gap in compliance/action-catalogue/snap.toml, and the quality_control role cannot call this route): a QC reviewer’s finding reaches the agency outside the system and a worker establishes the claim, through this recompute when the error is a determination error. The worker portal’s recompute form carries it as a checkbox (unticked = false).
Flow — plan with no lock and no transaction held, then apply under the household lock (#2245, the #1917 plan/apply shape): idempotency lookup (unique (determination, the claim window’s first month)) → baseline snapshot → provisional-derived and overlap guards (a pre-check) → unseal the frozen inputs in-boundary + re-fetch the corrected income/asset/expense leaves from canopy-persons as-of snapshot.as_of → replay via the write-free dry_run_determine → read canopy-enrollment: the paid issuances over the claim window, sized per month (Σ max(0, paid − correct)), and on a positive overpayment the pre-establishment claim floors (below) → only then the per-household pg_advisory_xact_lock and one transaction: re-check idempotency, re-run the guards, re-verify what the canopy-enrollment reads depended on — the claim window (capped by the baseline’s supersession date and the recompute’s legal day) — then create_claim + an overpayment_recomputes audit row + the outbox event; a declined overpayment writes the audit row alone. A slow canopy-enrollment holds no lock, transaction or pool connection, and a failed read is a coded 502 that records nothing: issuances_unavailable for the issuances read (#2441), participation_unavailable for the participation read (below). If the window moved since the reads, the apply refuses 409 coded recompute_plan_stale and writes nothing; the retry plans afresh. The recompute’s legal day — the window’s cap, the claim’s discovered_at and the floors' establishment date — is its one decision instant as a date in the jurisdiction’s timezone (#2241), the same for the plan and the apply, so it cannot move between them. The same code, with its own detail, answers a recompute whose guard tripped at plan time (so it skipped the replay and read nothing) but no longer trips under the lock: there is no replayed verdict to settle, and the retry replays. The guards re-run under the lock are the double-claim backstop: a claim filed over an overlapping window while the recompute read makes its apply an overlapping_claim row, never a second claim.
Idempotency and request terms (#2243): every audit row records the request’s terms — claim_basis and discovered_in_qc_review — whatever the outcome. The natural key is the determination and the claim window’s first month (first_of_month(max(correction_as_of, effective_date))): a correction date contributes nothing else to a recompute, since the replay reads facts as-of the snapshot’s own date, so every correction date in the same month is a repeat of the same recompute and another day cannot sidestep the key. A repeat, found on the fast path or re-checked under the household lock, replays the recorded row only when its terms equal the recorded ones. A repeat under different terms is refused 409 coded recompute_terms_conflict and writes nothing; the detail names the recorded terms beside the requested ones and states that no canopy endpoint corrects or voids a recorded recompute or the claim it filed — the recorded result stands, and a corrected basis or QC flag is never answered with the old result as though it had been applied.
Pre-establishment claim floors (#936, 7 CFR 273.18(e)(2)): The pack’s [snap.overpayment] table (the pack’s jurisdiction.toml, loaded into SnapParameterTable at boot; a pack missing any of its four keys refuses to start, naming the key) carries not_participating_floor_cents, participating_floor_cents, floor_claim_bases and quality_control_bypasses_floors. A positive overpayment is declined — outcome below_threshold, no claim, no event — when its basis is in floor_claim_bases, it was not found in a QC review (or the pack does not elect the QC bypass), and its total is AT OR BELOW (<=, "or less") the floor for the household’s participation on the establishment date — the establishing request’s (or claim-screen pass’s) decision instant as a legal date in the jurisdiction’s timezone (#2241), the floors read from the parameter set in force on it (none in force is the coded 422 params_unstaged, as for a determination). Only a positive overpayment consults the floors: a recompute that sizes none (no_overpayment, underpayment_found) settles without selecting a parameter set. Participation is canopy-enrollment’s GET /v1/enrollments/live?household_id=&as_of= (EnrollmentClient::live_enrollment): a live row — active, status pending_issuance / active / suspended, certification period covering the date — is participating; enrollment: null is not. The read runs only when a floor could decline (a covered overpayment at or below the higher floor, unless it was found in a QC review and the pack elects the bypass). It fails closed: a transport error, any non-2xx (a 404 included — the route answers "none" as a 200) or a malformed body refuses the recompute with 502 coded participation_unavailable; the read runs before the lock and the transaction (#2245), so no audit row, claim or outbox event is recorded and a retry reuses the idempotency key — a guessed participation would either silently decline a claim or establish one the policy declines. The floors apply only before establishment: an idempotent re-return and an established claim are never re-judged (the write-off of a small established claim, 273.18(e)(8)(ii)©, is out of scope). Values per pack — georgia 12500 / 10000 over agency_error + inadvertent_household_error (MAN 3450 4005.adoc:97/99, 4000.adoc:44/46); default and test-min 12500 / 0 over every claim type (the FNS threshold, 273.18(e)(2)(ii), which never skips a participating household); test-max 25000 / 20000 over every claim type (an approved-plan arm, (e)(2)(i)); the QC bypass is true everywhere.
The worker portal redirects a below_threshold recompute to the case with ?notice=overpayment-below-threshold (canopy-web recompute_landing), whose fixed banner says the overpayment was at or below the claim floor for the household’s participation and that no claim or notice follows; every other outcome lands without a banner.
The below_threshold audit row records the declined total in overpayment_cents, the window month by month in sized_months (benefit_month, paid_cents, correct_cents, overpayment_cents per month), the declined claim_basis, discovered_in_qc_review, and the reason in outcome_message — the amount, the floor it is at or below, and the participation with its date.
Response (200): OverpaymentRecomputeResult — a typed outcome (claim_created | no_overpayment | underpayment_found | below_threshold | provisional_excluded | overlapping_claim | no_baseline_snapshot | corpus_unavailable), overpayment_cents (the claimed amount for claim_created, the declined amount for below_threshold, 0 otherwise) + affected_months, the baseline/correct verdict refs, outcome_message (a manual-review detail, or the below_threshold reason), and claim_id when a claim was created. Degraded outcomes (no snapshot / unavailable corpus / shredded DEK) return 200 with an outcome_message (manual review), never a 500 or a wrong claim. Returns 404 for an unknown determination, 422 for a forward-effective correction_as_of or a positive overpayment with no parameter set in force today (params_unstaged), 502 (participation_unavailable) when the participation read fails, 502 (issuances_unavailable, #2441) when the issuances read fails, and an uncoded 502 when the replayed verdict’s benefit_amount is one a determination cannot store (outside the Decimal range, or 100000000.00 or more in magnitude once rounded to cents — #2257, #2293).
Replayed verdicts (#2325): the baseline and correct verdict refs are each a status and its monthly benefit_amount; correct is absent on provisional_excluded / overlapping_claim, which never replay. Every persisted outcome answers from its stored audit row, and the idempotent re-return replays that same row, so a repeat under the recorded terms states exactly what the recompute first answered — a denied or sanctioned verdict keeps its status; a repeat under different terms is the 409 above.
SNAP Export
GET /v1/export/determinations
Bulk export of SNAP determinations within a time window, rendered as CSV — one of the three cross-service FOIA / audit export surfaces described in the data-export runbook. Each call stages snap.export.requested (export.rs).
- Access
-
adminorquality_control(inlineAdmission::user_roles,src/api/export.rs); a system caller is 403service_class_on_user_only
Query parameters (ExportDeterminationsParams): from, to (RFC 3339 date-times, optional), format (optional), limit (optional).
Response (200): determinations within the requested window as text/csv. Returns 400 for an invalid window or limit, and 403 if the caller lacks the admin / quality_control role.
ABAWD Work Requirements
POST /v1/abawd/activity
Record monthly work activity for an ABAWD-tracked individual.
- Access
-
system; writer (
WRITER);quality_controlis read-only and gets 403required_role_missing
Request: { person_id, tracking_id, benefit_month ("YYYY-MM"), hours_worked, hours_job_search, hours_training, hours_community_service, hours_self_employment }. Each hours field must be a whole number from 0 to 744 (canopy_contracts_snap::abawd::MAX_MONTHLY_ACTIVITY_HOURS, the hours in the longest month — the bound the worker portal’s activity form applies too); any other value is 422 abawd_hours_out_of_range, naming the field, before anything is read or written (#2666). The tracking window is read before anything is recorded: an unknown tracking_id is 404, and one whose window tracks another person than person_id is 422 abawd_tracking_person_mismatch (#2543), so a posted tracking id cannot move another person’s clock. The activity row, the tracking window’s status and months used, and the warning / exhaustion event below commit in one transaction, so a failed request records nothing and its retry records all three (#2654). That transaction locks the tracking row first, so two activities for one window serialize and the later one counts the earlier one’s month. A month already recorded for the person with a DIFFERENT activity is 409 unique_violation (the abawd_activity_month unique, the shared database mapping); a request identical to the recorded one (same tracking window and hours, on a window that tracks the request’s person: the retry of a request that committed) is answered 200 with that activity’s activity_id and the window’s current time_status, and writes nothing.
Qualifying: total hours >= jurisdiction.toml [snap.abawd.qualifying_hours_per_month] (default: 80). The five categories are summed in a 32-bit integer, so no stored row’s hours (a row written before the 0–744 bound included) can wrap the total negative or overflow it (#2666). A countable month is a month with SNAP received, short of the qualifying hours and not discretionarily exempted (#3220). Each countable month stages abawd.warning_month_1 / _2 / _other; after 3 countable months in a 36-month window, abawd.time_limit_reached is published (events.rs). On a window with a regaining (below), the months before its period never count again: the second period begins at the first countable month after the period and runs the months the regaining allows consecutively, and the window reads regained until the period's last month is recorded, then exhausted (abawd::window_status; 7 CFR 273.24(e), PAMMS 3355 "The second three-month period is consecutive").
GET /v1/abawd/tracking
List ABAWD tracking records.
- Access
-
system; caseworker+; case reader via canopy-web (
delegated::SNAP_GET_ABAWD_TRACKING)
Query parameters: person_id
POST /v1/abawd/tracking:batchGet
Get the ABAWD flag for a set of households in one round-trip (#1203) — one
household_id = ANY($1) set query for the QC extract. Capped at 500 IDs
per request (422 on overflow); duplicates collapse to one entry; the
response follows first-occurrence request order.
- Access
-
system (
SYSTEM) — the §B4 bulk-read posture; a user is 403system_caller_required, even though the interactive per-household GET above admits workers
GET-OR-FALSE, exact-set: every requested UNIQUE id gets exactly one
entry; is_abawd_household is current_status ∈ {tracking, exhausted, regained}
OR-folded over the household’s tracking records (no active filter), and
false means honestly no qualifying tracking on file. The response is the
bool only, never the record vector. as_of rides the frozen wire shape but
scopes nothing today (reserved for the valid-time ABAWD corpus, #1331).
Request: BatchAbawdTrackingRequest — { "household_ids": ["uuid", …], "as_of": "2026-06-30" }. Response (200): Vec<HouseholdAbawdEntry> — [{ household_id, is_abawd_household }].
GET /v1/abawd/tracking/{id}/activities
List activity records for a tracking record.
- Access
-
system; caseworker+ (
READER)
POST /v1/abawd/tracking/{id}/regain
Record that an exhausted ABAWD regained eligibility (7 CFR 273.24(d)-(e); PAMMS 3355; #3220). Each regaining is one snap_abawd_regains row.
- Access
-
writer (
WRITER), user-only:recorded_byis the caller's own OIDC subject, and a service bearer gets 403service_class_on_user_only
Request: RegainEligibilityRequest — { period_start, period_end, hours }, the consecutive-day period in which the ABAWD met the work requirement and the hours completed in it. Unknown fields (months_allowed, recorded_by, person_id among them) are refused. Response: 201 AbawdRegain, the stored row. 404 for an unknown window.
Every refusal is a coded 422 and writes nothing. Judged before any read, against the booted [snap.abawd] terms: snap_date_out_of_range, snap_regain_period_in_future (either date after the legal today), abawd_hours_out_of_range (outside 0 to 744), snap_regain_period_reversed, snap_regain_period_too_long (more than regain_days days, both ends counted), snap_regain_hours_short (fewer than regain_hours). Then, against the window, locked as an activity write locks it: snap_abawd_not_exhausted (the window is not exhausted), snap_regain_before_exhaustion (the period begins before the end of the month that last counted: PAMMS 3355, "after accumulating the first three countable/non-compliance months").
What canopy-snap computes. months_allowed is the pack's second_period_months for the window's first regaining, and 0 once an earlier regaining granted the second period (273.24(e)). In the same transaction the window moves to regained with months_used 0. The second period begins at the first countable month after period_end and runs months_allowed consecutive months (see POST /v1/abawd/activity). A regaining that allows no months reads regained until the first countable month, which exhausts the window again. certification_period::identify reads a regained window as an ABAWD (reason current_tracking_window).
POST /v1/abawd/discretionary-exemptions
Exempt one benefit month of an ABAWD from the time limit, against the State's FNS allotment for the month's federal fiscal year (7 CFR 273.24(g)-(h); #3220). Each exemption is one snap_abawd_discretionary_exemptions row. PAMMS 3355 has the State office approve each request; the worker records the approved month.
- Access
-
writer (
WRITER), user-only
Request: CreateDiscretionaryExemption — { person_id, tracking_id, benefit_month }. Unknown fields (fiscal_year, recorded_by) are refused. Response: 201 DiscretionaryExemption, the stored row with its fiscal_year (October through September, named for the year it ends). 404 for an unknown window.
Every refusal is a coded 422 and writes nothing. Judged before any read: snap_date_out_of_range, snap_benefit_month_in_future (after the legal today's month), snap_benefit_month_not_first. Then, against the locked window: abawd_tracking_person_mismatch, snap_abawd_not_time_limited (the window is exempt), snap_month_outside_window. Then, under a transaction lock on the fiscal year: snap_exemption_month_covered (the person's month is already exempted), snap_exemption_allotment_unknown (the pack names no allotment for the year), snap_exemption_allotment_exhausted (the year's exemptions already number the allotment). The allotment is the pack's [snap.abawd.discretionary_exemptions_per_year] (the pack keys). In the same transaction the window's time status is recounted without the month, so an exhausted window can return to tracking.
Work Registration (#3218)
A worker records each member's work-registration standing and ABAWD screening (7 CFR 273.7(a)-(b), 273.24; PAMMS 3350, 3355) on one act. The record is append-only: a new standing is a new row with a later effective_date. The exemption and exception codes are the booted pack's [[snap.work_registration.exemptions]] and [[snap.abawd.exceptions]] (the pack tables).
POST /v1/work-registrations
Record one member's standing and screening.
- Access
-
writer (
WRITER), user-only:recorded_byis the caller's own OIDC subject, and a service bearer gets 403service_class_on_user_only
Request: CreateWorkRegistration — { person_id, household_id, standing, exemption, exemption_expires, abawd_screening, abawd_exception, et_referred_on, effective_date }; standing ∈ exempt | registrant | voluntary_registrant, abawd_screening ∈ not_abawd | abawd | aged_abawd. Unknown fields (recorded_by among them) are refused. Response: 201 WorkRegistration, the stored row.
Every refusal is a coded 422, judged before any write, in this order: snap_date_out_of_range (a date outside 1900-9999), snap_effective_date_in_future, snap_et_referral_in_future (after the legal today); snap_exemption_on_registrant, snap_exemption_missing (an exempt member or a voluntary registrant names none), snap_unknown_exemption; snap_abawd_not_registrant (an abawd or aged_abawd screening of a member who is not a registrant: an ABAWD is a registrant), snap_exception_needs_not_abawd (an exception is why a registrant is not an ABAWD), snap_unknown_exception, snap_expiry_without_exemption.
The screening's tracking row. In the same transaction, a screening of abawd sets the member's active abawd_tracking row counting (an exempt row returns to tracking, its exemption cleared), and aged_abawd or not_abawd with an exception sets the row's exemption_type (aged_abawd, or the exception code) and exemption_expires. With no active row, it opens one: the 36-month window from effective_date, months_used 0. An existing row keeps its window and its months. A failure of either write stores neither.
The determination. certification_period::identify reads each member's newest registration effective on the run's day first: an exempt member, a voluntary registrant, and a registrant screened not_abawd or aged_abawd are not ABAWDs (reason work_registration). A registrant screened abawd is read from the tracking row the screening opened; an unscreened member from the rows and facts, as before.
GET /v1/work-registrations
A person's registrations, newest effective_date first (a later created_at first on the same day), at most 100.
- Access
-
system; caseworker+ (
READER)
Query parameters: person_id (required)
GET /v1/households/{household_id}/work-registrations
Each member's newest registration effective on the service's legal today, one row per member with one; a member never registered has none. The SNAP case tab's read.
- Access
-
system; caseworker+; case reader via canopy-web (
delegated::SNAP_GET_HOUSEHOLDS_HOUSEHOLD_ID_WORK_REGISTRATIONS)
Work Sanction (#3219)
A worker records that a registrant did not comply with the work requirements, and lifts the sanction (7 CFR 273.7(f), 273.11(c)(1); PAMMS 3380). Each finding is one snap_work_sanctions row; the lift is that row's one later write.
POST /v1/work-sanctions
Record one finding.
- Access
-
writer (
WRITER), user-only:recorded_byis the caller's own OIDC subject, and a service bearer gets 403service_class_on_user_only
Request: CreateWorkSanction — { person_id, household_id, violation, good_cause, effective_date }; violation ∈ failure_to_comply | voluntary_quit | hours_reduction, good_cause ∈ not_established | established. Unknown fields (violation_number, minimum_months, begins_on, recorded_by among them) are refused. Response: 201 WorkSanction, the stored row.
Every refusal is a coded 422 and writes nothing. In order: snap_date_out_of_range, snap_effective_date_in_future; then, read from the member's newest registration effective on the legal today, snap_work_registration_missing (none), snap_sanction_household_mismatch (it is another household's), and snap_sanction_on_exempt_member (it is exempt or voluntary_registrant; PAMMS 3380:22, 3380:145).
What canopy-snap computes. The violation_number is 1 plus the member's earlier findings without good cause, counted under a per-member transaction lock. Without good cause, minimum_months is the pack's [snap.work_sanction] minimum_months entry for that number, the last entry repeating, and begins_on is the first of the month after the timely-notice period that starts on the request's legal day ([notices].advance_notice_days, the window canopy-enrollment's notice floor reads; PAMMS 3380:114). With good cause both are absent: the contact is recorded and nothing is imposed or published.
The order. In the same transaction, a finding without good cause stages determination.requested::Order (origin snap-work-sanction with the finding's id, programs = ["snap"], as_of = begins_on, trigger work-sanction, subject_person_id = the member) for the household's newest SNAP determination's application. canopy-eligibility signs a work_sanction re-price of the live allotment, and canopy-enrollment stages the person-level member_sanction with timely notice (canopy-enrollment API). A household canopy-snap never determined gets no order; its first determination applies the sanction.
POST /v1/work-sanctions/{id}/lift
Lift one sanction.
- Access
-
writer (
WRITER), user-only
Request: LiftWorkSanction — { lift_reason, lifted_on }; lift_reason ∈ complied | exempt | good_cause_found | hearing_reversed. Response: 200 WorkSanction. 404 for an unknown finding. Coded 422s, each writing nothing: snap_sanction_not_imposed (a good-cause finding), snap_sanction_already_lifted, snap_date_out_of_range, snap_lift_date_in_future, snap_lift_before_finding.
The restoration day (ends_on, exclusive). Compliance restores at the later of the compliance day and begins_on plus the minimum period (7 CFR 273.7(f)(2)). An exemption (PAMMS 3380:187), good cause found later and a hearing reversal (3380:141-148) restore on the lift day. A lift before begins_on restores on begins_on, so the sanction is never in force (3380:147). The lift stages the same order, origin snap-work-sanction-lift, as of the later of ends_on and the legal today: a restoration in a past month is restoration of lost benefits (7 CFR 273.17, #1113), not a re-price.
GET /v1/work-sanctions
A person's findings, newest first, at most 100.
- Access
-
system; caseworker+ (
READER)
Query parameters: person_id (required)
GET /v1/households/{household_id}/work-sanctions
Every finding recorded for the household's members, newest first, at most 200. The SNAP case tab's read.
- Access
-
system; caseworker+; case reader via canopy-web (
delegated::SNAP_GET_HOUSEHOLDS_HOUSEHOLD_ID_WORK_SANCTIONS)
The determination's exclusion
A sanction is in force on a day when begins_on is on or before it and ends_on is absent or after it. POST /v1/determine reads the sanctions in force on the run's benefit anchor (benefit_effective_date: the month the run prices) for the context's members, and lowers household_size by each sanctioned member before the policy resolves, so the rules and the size-resolved parameters (the standard deduction, the maximum allotment) count the smaller household. Every income record stays countable (7 CFR 273.11(c)(1); PAMMS 3380:138). The snapshot's program_input.work_sanction records { excluded: [{ person_id, violation_number, ends_on }], household_size, counted_household_size }, present only when a member is excluded. A household whose every member is sanctioned is denied before the main ruleset runs, with denial_reason_codes = ["work_sanction_in_force"] (PAMMS 3380:179). Under a work_sanction basis the event carries the finding's work_sanction terms (violation_number, minimum_months, minimum_period_ends_on), and a basis naming no imposed finding is 422 work_sanction_unknown.
Replays. POST /v1/determine/dry-run counts out the members in force on its anchor before its policy resolves, exactly as the live run does. An overpayment recompute replays the exclusion the snapshot recorded: its context takes program_input.work_sanction.counted_household_size (and an all-sanctioned record replays the denial), never today's sanctions.
The re-stage. canopy-snap consumes enrollment.adverse_action_cancelled (queue canopy-snap.work-sanction-restage). When a newer determination superseded a staged member_sanction before it took effect (reason superseded_by_newer_determination, the event naming the finding in sanction_ref), it re-stages the sanction's order in the delivery's transaction (work_sanction::handle_action_cancelled): origin snap-work-sanction-restage with the cancelled action's id, so redelivery stages one order on canopy-eligibility's dedup key, as_of the later of begins_on and the legal today. Nothing is re-staged for a sanction already over, or when the household's newest determination is anchored on or after begins_on (its in-force read already counted the member out). Every order carries the finding as subject_sanction_ref.
Transitional SNAP (TSNAP)
A certification's frozen_benefit_amount is the household's last approved allotment recalculated without its TANF income (7 CFR 273.27(a), #3379): canopy-snap re-scores that determination from its own input snapshot, under the policy and rules corpus it pinned, with the tanf income records removed. pre_closure_snap_allotment is the allotment before, and tanf_grant_removed the monthly income removed. A determination that counted no TANF income is frozen as it stands. One with no figure to freeze fails the tanf.case_closed delivery to the dead-letter queue, with an error naming the determination (tsnap_freeze::Unfreezable): an approval that stored no allotment (#3416), or one that cannot be re-scored (no snapshot, a redacted one, no complete policy bundle, no pinned corpus, or a re-score that does not approve with an amount). A snapshot of a version the binary cannot replay, and a failed read or rules call, fail the delivery the same way with their own errors. Nothing is frozen at $0 or at the unadjusted figure. A household with no approved determination at all gets a certification of $0.
Categorical Eligibility
Standard categorical eligibility in a determination (#3323)
A household is standard categorically eligible when every counted member receives TANF cash or SSI (7 CFR 273.2(j)(2)(i)(A), (E)).
The count. POST /v1/determine and the dry-run count the members the work-sanction exclusion leaves whose receives_tanf_cash or receives_ssi is true. The facts are canopy-eligibility's (canopy-eligibility), and an unknown fact (null) counts as no receipt. The count reaches the pack's snap-eligibility decision as input.members_receiving_pa_or_ssi.
The decision. When the count equals household_size (the counted size), the decision takes its standard-CE arm, before BBCE. The gross, net and resource tests are bypassed (bypassed_standard_categorical_eligibility), and the allotment is still computed from net income.
Replays. The snapshot's sealed program_input.member_facts freezes the counted members' facts ({ person_id, receives_tanf_cash, receives_ssi }, present only when one carries a fact). An overpayment recompute restores them onto the frozen members and recounts. A snapshot recorded before #3323 replays with a count of 0, as it was scored.
Facts unknown (#3324). A denied determination names the counted members whose standard-CE facts were unknown (neither fact true, at least one unknown) when the household would have been standard CE had every one of them been a recipient, against the household size the rules counted: the case where an unknown could have turned the verdict, and only that case (standard_ce::ce_facts_unknown). The signed envelope carries them as the advisory { "kind": "ce_facts_unknown", "person_ids": […] } (ADR-002 Amendment 9), the sealed program_input freezes their ids as ce_facts_unknown, and once the determination commits the counter snap_ce_facts_unknown_total counts each unknown fact under the label fact, tanf or ssi (metrics.rs). An approval, or a denial no unknown could have turned, names nobody, and its envelope and snapshot are as they were before #3324. The dry-run names nobody.
Carried facts (#3325). A context naming member_facts_from (a determination id) carries that determination's member facts. canopy-eligibility's bulk COLA arm and its dry-run name their baseline instead of reading the facts afresh, so a mass change or a what-if keeps the baseline's standard-CE facts. POST /v1/determine and the dry-run restore the facts frozen in the named determination's snapshot onto the context's members by person id, before anything reads them. A member the baseline did not freeze keeps no fact, and a redacted or pre-#3323 snapshot restores none. A determination with no snapshot is 422 member_facts_baseline_unknown, and one of another household is 422 member_facts_baseline_foreign: one household's facts never reach another's determination.
Not yet applied. The (j)(2)(vii) bars are not applied yet (#3309).
POST /v1/categorical-eligibility/participations
Record a household’s participation in a categorically eligible program (TANF, SSI).
- Access
-
system; writer (
WRITER);quality_controlis read-only and gets 403required_role_missing
Request: CreateParticipationRequest, { person_id, household_id, program, case_number?, effective_date }: the household member and household, the conferring program, its case or claim number when known, and the date the participation begins to confer categorical eligibility. A second active participation of the person in the same program is 409 unique_violation (the idx_unique_participation partial unique, the shared database mapping).
IEVS Verification
A discrepancy is raised when a member’s IEVS-verified monthly income and that member’s own self-reported income of the same kind differ by more than the pack’s [snap.verification].ievs_discrepancy_threshold_cents (#2212; Georgia 10000, $100, cited as canopy’s operating value: PAMMS 3035 states no match threshold). The verification keys beside it, wage_match_source and unemployment_match_source, name the state sources queried; the determination’s resolved policy carries all three to the verification task.
GET /v1/verification/discrepancies
List income discrepancies for an application or household.
- Access
-
system; caseworker+; case reader via canopy-web, canopy-cli (
delegated::SNAP_GET_VERIFICATION_DISCREPANCIES)
Query parameters: exactly one of application_id (the SHARED eligibility application id — the namespace IEVS rows key on, NOT the snap-local snap_applications.id) or household_id (#962, via the match-results join — what the worker income tab uses). Neither or both → 422.
GET /v1/verification/discrepancies/{id}
One income discrepancy by id (verification_handler::get_discrepancy, #2540): the row a resolving caller binds to, as an IevsDiscrepancyRead — the discrepancy’s fields plus household_id, the household its match result was run for (#2543). canopy-web’s IEVS accept and reject read it before any write, check that household_id is the worker’s household (canopy-snap’s own record, so it holds whatever has become of the application since), and author the accepted income fact onto its person_id. Unknown id → 404.
- Access
-
system; caseworker+ (
READER)
PUT /v1/verification/discrepancies/{id}/resolve
Resolve an income discrepancy.
- Access
-
system; writer (
WRITER,verification_handler::resolve_discrepancy, #874);quality_controlgets 403required_role_missing
Request: ResolveDiscrepancyRequest — { household_id, resolution_status, resolution_notes, resolved_fact_id? }. household_id is required (#3103, the #2545 pattern): axum’s Json extractor refuses a body without it with a 422 before admission. Resolution statuses: confirmed_additional_income, corrected_ievs_error,
resolved_household_explanation, aged_out, accepted_verified, rejected.
An accepted_verified names the persons fact its accept held as resolved_fact_id,
and no other status names one: either mismatch is a 422 (code
resolution_fact_mismatch, #2965) before any read, so no accept is recorded naming no
fact. An unknown status is a 400. After those checks, canopy-snap reads the household of the discrepancy’s match result (ievs_match_results.household_id); an unknown discrepancy id is a 404, and a discrepancy whose match result belongs to another household is refused with 409 discrepancy_household_mismatch before any transition check or write, with the detail naming the path id and the requested household, never the stored owner (#3103). A caller that names the discrepancy’s own household still passes: canopy-snap admits a delegation by role alone and cannot know which household a worker acts in.
The resolver of record is the caller’s principal.actor() (#874, #1008), never the
body: a user’s delegation records the worker’s canopy subject, a system caller its
client id. It is persisted as the resolved_by / resolved_by_service pair and echoed on the
discrepancy as resolved_by, an Actor object. The resolution and its attributed
ievs.discrepancy_resolved event commit atomically (ADR-018); the event carries the
same Actor as resolved_by ({actor_type: human, subject} or {actor_type: service,
service}), which canopy-security records as the audit row’s actor — IDs + status
actor only, never an income figure. The verified income is held in canopy-persons by
canopy-web’s or canopy-cli’s accept, and promoted to an accepted fact by canopy-persons
when it consumes this event (#2546), never by canopy-snap.
Transition guard (#2544): a discrepancy is resolved once. An open discrepancy
takes any listed status. A resolved one takes only its own resolution again — the
same resolution_status and the same resolved_fact_id (both absent for a reject) —
and that repeat is a 200 answering the row as stored: resolver, resolved_at and
notes are not rewritten, and no second ievs.discrepancy_resolved event is staged.
That keeps canopy-web’s persons-OK/snap-fail retry idempotent: the retry corrects the
fact the failed attempt authored and repeats the flip. Any
other status, or an accept with another fact, is a 409 (code
discrepancy_already_resolved) that changes nothing, so neither the resolution nor
the discrepancy↔fact link (#876) can be rewritten. The row is locked for the decision,
so two concurrent resolves cannot both pass. A discrepancy a verification re-run
withdrew (resolution_status withdrawn, #2665: the re-run no longer finds it) takes
no resolution at all: any request is a 409 (code discrepancy_withdrawn) that changes
nothing, never a 404 — the row stays, so a persons fact an accept already authored
(origin ievs:{id}) still names an existing discrepancy, and canopy-web answers the
worker through its snap-conflict path.
Parameters
GET /v1/params
Get SNAP parameters for a given household size (loaded from rules engine, not hardcoded).
- Access
-
system; portal (
portal:snap-params:read); caseworker+; worker reader via canopy-web (delegated::SNAP_GET_PARAMS) — the portal’s ONE snap surface (#1441)
Query parameters: household_size (required, ≥ 1), has_elderly_disabled (optional, default: false)
Response (200): SnapParamsResponse — { household_size, has_elderly_disabled, gross_income_limit, net_income_limit, asset_limit, standard_deduction_amount, max_allotment, minimum_benefit, minimum_benefit_max_hh_size, medical_expense_threshold, max_excess_shelter_cap, utility_allowance_amount }. For household_size=3 under the FY2026 set (_effective_date 2025-10-01: the federal layer’s snap-income-limits-2026.json, snap-allotments-2026.json, snap-deductions-2026.json) that is 2888 / 2221 / 785 / 209; the figures change every 1 October.
Values come from the federal layer’s effective-dated snap-*.json set in force today (legal date in the jurisdiction timezone, #1467, read from the service’s injected decision clock, #2937) — a request when NO set is in force (e.g. October 1 arrived before the new FY files were staged) answers 422 unless the CANOPY_SNAP__ALLOW_EXPIRED_PARAM_SET override is on.
GET /v1/params/provenance
The parameter-set identity in force at an as_of (#1467, ADR-028 Amendment 6): the content digest of the complete policy-parameter input set, its intrinsic validity window, and the jurisdiction table revision. A bulk dispatcher (#1213) composes this with canopy-rules GET /v1/corpus into the expected_policy_target pre-write pin. config_stamp is the configuration this replica loaded (ADR-051), the stamp a determination it makes now is signed with; the dispatcher freezes it on the run.
- Access
-
system (
SYSTEM); a user is 403system_caller_required
Query parameters: as_of (optional date; default = today as a legal date in the jurisdiction timezone, read from the service’s injected decision clock, #2937)
Response (200): ParamsProvenanceResponse (crates/canopy-contracts-snap/src/params.rs) — attestation_enabled mirrors emit_policy_attestation; absent ⇒ false, so the #1213 enact preflight fails closed against a pre-#1213 fleet.
{
"as_of": "2026-06-02",
"params_digest": "<hex sha-256>",
"effective_period": { "start": "2025-10-01", "end_exclusive": "2026-10-01" },
"policy_params_version": "1.0.0",
"attestation_enabled": true,
"config_stamp": [
{ "name": "federal", "sha": "<40 hex>" },
{ "name": "georgia", "sha": "<40 hex>" }
]
}
Response (422): no parameter set in force at as_of.
Overpayment Recovery (PAMMS 9000 / 7 CFR 273.18)
Cross-program shape — the same paths as canopy-tanf (/v1/overpayments) and canopy-medicaid (/v1/overpayments), with per-service data isolation per ADR-001; canopy-snap’s create alone screens the claim against the claim floors. The types, the store and the read/ledger handlers come from the shared crates/canopy-overpayments crate: services/canopy-snap/src/api/mod.rs registers /overpayments with canopy-snap’s own create handler (api/overpayments_handler.rs, which screens the claim against the claim floors, #2242) beside the shared list_claims, and merges canopy_overpayments::api::claim_routes() for the four per-claim paths — six operations on five paths, behind the service’s receiver with the other routes, over canopy-snap’s own database. Ledger is the system of record; outstanding balance is derived (not stored).
Where the claim floors apply (#2242)
The pre-establishment claim floors (7 CFR 273.18(e)(2), the pack’s [snap.overpayment]; the decision, the participation read and its fail-closed 502 are described under the recompute above) judge every path that establishes a SNAP claim, with one exemption:
-
The overpayment recompute (
POST /v1/determinations/{id}/overpayment-recompute): screened, QC origin from the worker’sdiscovered_in_qc_review; a declined overpayment is itsbelow_thresholdaudit row. -
A manual claim (
POST /v1/overpayments, below): screened, QC origin from the worker’s requireddiscovered_in_qc_review; the participation read runs before anything is written. A declined claim is not filed: it is recorded inoverpayment_claim_screens(sourcemanual) with the amount, the floor, the participation, the establishment date and the reason, and answered 200DeclinedClaim. -
The ADH not-established IHE claim (
ipv.not_established): screened, QC origin from the event’sdiscovered_in_qc_review, the referring worker’s attestation on the IPV referral (#2444; canopy-appeals API). Anullor absent field (a referral recorded before the attestation, or an event staged before the field) is unrecorded: since declining a QC-found overpayment is unlawful while establishing a small one never is ((e)(2) is permissive), an unrecorded origin is never declined by a floor the pack’s QC bypass would lift. Any other non-boolean value fails the delivery, which retries. Under a pack that elects the bypass, a claim attested QC-found, or of an unrecorded origin, therefore opens at once; otherwise, a claim a floor could decline (a covered amount at or below the higher floor) is stagedpendinginoverpayment_claim_screens(sourceipv_not_established) — the participation read must not run inside the subscriber’s inbox transaction — and the claim-screen pass (every 60 s,claim_screen.rs) decides it: the read with no transaction open, then, under the row’s lock, a re-check that the row is still pending (the establishment date is the pass’s legal day, fixed for the pass, #2241), then the claim +snap.overpayment_claimed(claim_created, naming the claim) or thebelow_thresholdverdict. A failed read decides nothing: the row stays pending,attempts/last_errorrecorded, and the next pass retries it. A claim above every floor, or on a basis the floors do not cover, opens at once. Since #3567 the event must nameperiod_first_monthandperiod_last_month, whole months in order: without them the delivery fails (retried, then dead-lettered) and no claim is opened or staged. -
The appeal-assessed continued-benefits claim (
appeal.overpayment_assessed,appeal_claim.rs) turns on the event’sdisposition. An appeal whose hearing upheld the agency (upheld_agency) is not screened: 7 CFR 273.15(k)(1) — "If the State agency action is upheld by the hearing decision, a claim against the household shall be established for all overissuances", its one exception an EBT adjustment ((s)(2) likewise) — makes that claim mandatory at any amount, so the permissive (e)(2) option does not reach it (APPEAL_CLAIM_FLOOR_EXEMPTION). A dismissed or withdrawn appeal’s continued benefits are an ordinary overissuance, so the floors judge its claim (QC origin: not QC-found): a claim a floor could decline is stagedpendinginoverpayment_claim_screens(sourceappeal_assessed, carrying the assessment provenance) and decided by the claim-screen pass; one above every floor opens at once. Every outcome acknowledges to canopy-appeals, whose #1105 scanner re-emits an assessment until it does: a filed claim withsnap.overpayment_claimed, a declined one withsnap.overpayment_declined. A re-emitted assessment re-acknowledges what its first delivery did (and waits while its screen is pending); a voided assessment retires its pending screen (voided). An event without a recogniseddispositionis skipped (the scanner offers it again). Since #3567 an event without a whole-monthperiod_first_month/period_last_monthis skipped the same way.
POST /v1/overpayments
File an overpayment claim. A claim already recorded for the same assessment or source event is the coded 409 unique_violation, not a 500 (#2250; the shared overpayment store’s claim insert).
- Access
-
system; writer (
WRITER,src/api/overpayments_handler.rs);quality_controlis read-only and gets 403required_role_missing
Request: SnapCreateClaimRequest — { person_id, household_id, determination_id, claim_amount_cents, claim_basis, error_type, discovered_at, provenance?, discovered_in_qc_review } — claim_basis ∈ agency_error / inadvertent_household_error / ipv; claim_amount_cents must be > 0 (rejected with HTTP 400 otherwise); discovered_in_qc_review is the worker’s required attestation that a quality control review found the overpayment (#2242, as on the recompute). The body carries no actor: discovered_by is the caller’s principal.actor() (#1008), and an unknown field — a stale discovered_by among them — or a missing discovered_in_qc_review is refused with 422. Since #3567 the body also requires period, {first_month, last_month}, the benefit months the overpayment covers, each the first day of its month and in order: a body without one, or with one that is not whole months in order, is 422 and nothing is read or written.
Floor screen (#2242): a positive claim is screened against the claim floors in force today before anything is written (see Where the claim floors apply above). No parameter set in force today is the coded 422 params_unstaged; a failed participation read is the coded 502 participation_unavailable, and nothing is recorded.
Response 201: the persisted OverpaymentClaim row (status begins at open); its discovered_by is an Actor object. The claim’s snap.overpayment_claimed is staged in the same transaction as the claim row, in the payload the other establishing paths stage, so the 7 CFR 273.18(e)(3) demand notice follows (#2442); a declined claim stages none.
Response 200: DeclinedClaim — the floors declined the claim, so nothing was filed: { screen_id, claim_amount_cents, claim_basis, floor_cents, participation, establishment_date, reason, discovered_in_qc_review }, the overpayment_claim_screens row that records it.
GET /v1/overpayments[?status=…&limit=…&after_created_at=…&after_id=…]
One keyset page of claims WITH server-side ledger totals (#1222, ADR-001 Amendment 1 §B2/§B3): { items: [{ claim, total_recouped_cents, outstanding_cents }], next_cursor, total_in_scope }, newest-first over (created_at, id) (served by overpayment_claims_keyset). limit defaults to 200 (cap 500); the cursor pair travels together (half-specified ⇒ 400); total_in_scope — the completeness tripwire for the PAMMS-9000 / 7 CFR 273.18 roll-up — rides the first page only. Used by canopy-reporting's roll-up CSV + supervisor summary, which loop to exhaustion and never make per-claim ledger calls; per ADR-001 reporting cannot read the DB directly.
status ∈ open / in_repayment / closed / written_off.
- Access
-
system; caseworker+; case reader via canopy-reporting (
delegated::SNAP_GET_OVERPAYMENTS, layered on the sharedlist_claimsas itsListAdmission) — the via arm is canopy-reporting’s roll-up and summary, carrying the worker’s onward delegation
GET /v1/overpayments/{id}
Read a single claim.
- Access
-
system; caseworker+ (the shared
READER,crates/canopy-overpayments/src/api.rs)
POST /v1/overpayments/{id}/repayment-plans
Attach a repayment plan. Rejected with HTTP 409 if the claim is closed or written_off.
- Access
-
system; writer (the shared
WRITER,crates/canopy-overpayments/src/api.rs);quality_controlis read-only and gets 403required_role_missing
Request: { monthly_amount_cents, starts_on }.
POST /v1/overpayments/{id}/recoupments
Append a recoupment ledger entry. Inside the same TX, if the new entry drives outstanding to ≤ 0 the claim status flips to closed + closed_at is stamped. The first non-zero recoupment on an open claim flips status to in_repayment (so dashboards can distinguish untouched claims from in-progress collections).
Rejected with HTTP 409 if the claim is already closed / written_off. Rejected with HTTP 400 if amount_cents == 0 (a corrective no-op should use manual_adjustment with a non-zero compensating amount). An unknown claim is a 404, and a repayment_plan_id that names no plan of this claim (unknown, or another claim’s) is the coded 422 repayment_plan_unknown, both before any write (#2250).
- Access
-
system; writer (the shared
WRITER,crates/canopy-overpayments/src/api.rs);quality_controlis read-only and gets 403required_role_missing
Request: { amount_cents, method, repayment_plan_id, notes } — method ∈ allotment_reduction / cash_payment / tax_offset / write_off / manual_adjustment; negative amount_cents is allowed (a compensating reversal of a previously-recorded recoupment).
GET /v1/overpayments/{id}/ledger
Full ledger view: the claim row + all ledger entries ordered by occurred_at + derived total_recouped_cents + outstanding_cents (may be negative if over-collection occurred — flagged by caseworker workflow, not enforced by the DB).
- Access
-
system; caseworker+ (the shared
READER,crates/canopy-overpayments/src/api.rs)
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 receiver, and its handler admits 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(ADMIN_HUMAN = Admission::user_roles(&["admin"])), through any client; a system caller is 403service_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): a system caller (service_class_on_user_only) or a user without admin (required_role_missing).
Error Codes
| Code | Meaning |
|---|---|
400 |
An |
401 |
No bearer ( |
403 |
The route’s admission refuses the caller: |
404 |
Determination, overpayment claim, TSNAP certification, or discrepancy not found |
409 |
Overpayment claim is in a terminal state ( |
422 |
|
502 |
An upstream dependency failed: canopy-rules returned an eligible verdict whose |
503 |
The receiver holds no trustworthy key set in time ( |
Events Published
Routing keys from services/canopy-snap/src/events.rs unless noted; every payload is IDs and status only — no PII or income data (ADR-004).
The three determine-path events, determination.completed.snap, snap.application_approved and snap.case_closed, are held until the determination is recorded (#2322). determine::determine stages them in the persist transaction under canopy_mq::hold_for(determination_id), and the verdict consumer under Events Consumed releases them on determination.recorded.snap or drops them on determination.disowned.snap (ADR-002 Amendment 7). A determination canopy-eligibility never records, a direct caller’s included, publishes none of them.
-
determination.completed.snap— one per determination. Beyond the base IDs / status / dates, these additive fields (the Present-when column gives each field’s presence rule):Field Present when Meaning / consumer effective_date_basis_kindevery event
the flat mirror of the signed
effective_date_basis.kind— the notices routing discriminatorupstream_application_idevery event
the canopy-applications id (
application_idstays snap’s LOCAL id for enrollment; canopy-renewals persists it)certification_months(1 | 2),postponed_itemsexpedited_postponedthe postponement letter’s inputs (ADR-004 tokens, ruleset order)
assigned_certification_monthsevery APPROVED determination (#1703; renamed from
standard_certification_months, which rode only the expedited basis)the length the
snap-certification-perioddecision assigned — always a[[snap.certification.categories]]row’smonthsof the signing pack (georgia 4 / 6 / 12 / 36; #2209); underexpedited_postponedthe letter’s "correct period once verification is provided" while the signed period stayscertification_monthscertification_categoryevery APPROVED determination (#1703)
which pack row assigned it — the
codeof a[[snap.certification.categories]]row of the signing pack (georgiastandard|elderly_disabled|senior|abawd), a shape-validated token on the wire (^[a-z][a-z0-9_]{0,63}$, neverexpedited; #2209); the in-cert conversion mints a certification of this type after canopy-renewals validates it against ITS booted packfollowing_month_allotmenttwo-month expedited certification
decimal string, REQUIRED by enrollment;
0.00= no benefit due for month+1benefit_effective_dateevery event (a required field since #1648, present on denials too)
the benefit date the signed envelope anchored; under
in_cert_conversionit is the conversion’s evaluation date — the anchor enrollment’s continuation arm keys money onbenefit_month_pricesevery APPROVED determination (#1704)
the signed per-benefit-month schedule
[{benefit_month, allotment, params_digest}], ascending; canopy-enrollment prices each issued month from itexpiration_dateevery APPROVED determination (#1999)
the certification end the approval NOA and enrollment carry; a denial carries no period
denial_reason_codesDENIED determinations (#1955; an empty array when the ruleset attributed the denial to no test)
canopy_reference::SnapDenialReasonCode, ruleset order (orimmigration_status_ineligibleon the 7 CFR 273.4 short-circuit); canopy-notices forwards it to the denial NOA (canopy-notices) -
snap.application_approved— staged with an approved determination (determine.rs); consumed by canopy-medicaid’s Express Lane grant path -
snap.case_closed— staged when a non-continuation determination landsdenied(SNAP has no separate close-case endpoint; #651); consumed by canopy-medicaid’s ELE source-closure lapse -
abawd.warning_month_1/abawd.warning_month_2/abawd.warning_month_other— a non-qualifying ABAWD month, keyed by months used; the payload carriesperson_id,household_id,months_used,programand the booted pack’s[snap.abawd]figures the warning letter states:abawd_qualifying_hours,abawd_age_min,abawd_age_max,abawd_dependent_child_age(#2437) -
abawd.time_limit_reached— the non-qualifying month that exhausts the limit in the 36-month window; the payload is the warnings', withmonths_usedand the pack's[snap.abawd]figures, so canopy-notices' limit-reached letter states the same rule (#3221).abawd.warning_month_otheris never staged under a 3-month limit (a tracking status carries 1 or 2) and has no route. -
ievs.discrepancy_resolved(#677) — a worker accepted/rejected an IEVS income discrepancy; carries the caller-derived resolver asresolved_by, anActor(humanwith the worker’s canopy subject for a user’s delegation,servicewith the client id for a system caller — #874, #1008; canopy-security records it as the actor) plus the discrepancy/application/person ids,resolution_statusandincome_type. Typed ascanopy_contracts_snap::events::IevsDiscrepancyResolvedV1(#2546), with the wire shape unchanged; canopy-persons consumes it to promote the held IEVS accept anaccepted_verifiedresolution’sresolved_fact_idnames (canopy-persons). A verification re-run that withdraws a discrepancy stages it too, in the same transaction:resolution_statuswithdrawn, noresolved_fact_id, and canopy-snap’s own service asresolved_by(#2966), so the withdrawn discrepancy’s held accepts are consumed. -
determination.redacted(#687) — a data steward crypto-shredded a determination’s snapshot; the steward’s canopy subject (actor_sub) + reason, no plaintext -
snap.overpayment_claimed(#681; #994) — staged in the SAME tx as the claim it announces (recompute, IPV-IHE, claim-screen, appeal and manualPOST /v1/overpaymentspaths, #2442); carriesappeal_id/assessment_id(#1105) so canopy-appeals' acknowledgment consumer can flip its assessmentcomputed → appliedSince #3567 every path builds the event from the stored claim row (events::claimed_event) and it also carriesperiod_first_month/period_last_month, the claim’s period, andmonths, the calculation rows{benefit_month, paid, correct, overpaid}of a recompute claim (amounts as$d.cc), empty for every other path; a re-acknowledged claim states the period its row stores. canopy-notices does not print them yet. -
snap.overpayment_declined(#2242) — staged in the SAME tx that records the decline, when the claim floors decline a dismissed or withdrawn appeal’s continued-benefits claim (and again when the assessment is re-emitted); carriesappeal_id/assessment_id, the screen id, the declined amount, floor, participation, establishment date and reason. canopy-appeals' acknowledgment consumer settles the assessment on it, as onsnap.overpayment_claimed; no demand notice follows -
snap.export.requested— one perGET /v1/export/determinationscall (api/export.rs); persisted by canopy-security’s wildcard subscriber as the export’s audit row
Events Consumed
Queues and bindings from services/canopy-snap/src/main.rs:
-
canopy-snap.overpayments←appeal.overpayment_assessed(filtersprogram == "snap"; opens theOverpaymentClaimwith the #1104 provenance quad, or — for a dismissed or withdrawn appeal a claim floor could decline — stages it for the claim-screen pass (#2242, Where the claim floors apply); an event whoseassessment_idalready has a claim RE-ACKNOWLEDGES withsnap.overpayment_claimed, one whose screen was declined withsnap.overpayment_declined, #1105) andappeal.overpayment_assessment_voided(retires the assessment’s pending screen, then voids the claim stamped with itsassessment_id; idempotent, nothing to retire is a no-op) -
canopy-snap.tsnap←tanf.case_closed— opens the transitional SNAP certification (7 CFR 273.26) read back byGET /v1/tsnap -
canopy-snap.ipv-not-established←ipv.not_established(7 CFR 273.18(b)(2), #981) — when an ADH finds no IPV, canopy-appeals publishes the household’s over-issuance and this reprocesses it as a non-fraud IHE claim + a 7 CFR 273.18 demand notice, screened against the claim floors — or staged for the claim-screen pass when a floor could decline it (#2242, Where the claim floors apply) -
canopy-snap.determination-verdicts←determination.recorded.snap,determination.disowned.snap(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,recordedreleases the outbox rows held undercanopy_mq::hold_for(determination_id)anddisowneddeletes them; the verdict is recorded indetermination_verdicts, where arecordedverdict 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.