canopy-appeals API Reference
For an integrator (canopy-web and canopy-cli) and, secondarily, a hearing-officer reader: canopy-appeals manages fair hearing requests (7 CFR 273.15) and Intentional Program Violation cases (7 CFR 273.16). It enforces the filing window and the decision clock from the ruleset ([appeals] in the pack’s jurisdiction.toml: each program's own [appeals.program.<p>].filing_window_days, and decision_clock_days, 60 for SNAP per 7 CFR 273.15(c)(1), extendable by one recorded household postponement), the 30-day ADH notice, and the Chart B2 continued-benefits election with its stay discipline against canopy-enrollment. A hearing reads the contested determination’s FTI-safe projection in-boundary from the owning program service, never the sealed snapshot (ADR-028, ADR-004). Tables: the data-models page; design history: fair-hearings-appeals and adverse-action-pipeline; operations: the appeals-reconciliation runbook.
- Base URL
-
container port 8010 (host:
CANOPY_PORT_CANOPY_APPEALS_8010in.ports.env) - Authentication
-
Bearer token: a canopy-identity token for this receiver (its
audisurn:canopy:service:canopy-appeals), 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
-
No client holds a system edge to canopy-appeals, so every route admits only a user’s delegation (canopy-web and canopy-cli hold delegation edges): filing, the hearing decision and the IPV referral admit the writer bar through either client; the appeal list, queue, upcoming-hearings and single-appeal reads admit canopy-web’s workers at each row’s bar; every other route is a canopy-cli operator route — reads caseworker+, writes the writer bar, the two internal triggers
admin— reached bycanopy appealandcanopy ipv(canopy CLI Reference). A refusal is 403 with itsReceiverDenialcode (ADR-049 Amendment 14); each route’s constant is in the authorization inventory. - Database
-
canopy_appeals
Admission specifics
-
The admissions are
WORKER_WRITE,OPERATOR_READ,OPERATOR_WRITEandOPERATION(services/canopy-appeals/src/api/mod.rs, shared bysrc/ipv/api.rs) and the fourdelegated::APPEALS_*rows; no handler checks anything beyond its admission. -
Attribution (#1008): every appeal and IPV timeline row, and the IPV case’s
referred_by, records a typedActor—{"actor_type": "human", "subject": "<subject>"}or{"actor_type": "service", "service": "<client id>"}. A request-path writer recordsprincipal.actor(), always the user (Human, the canopy subject) since every route admits only users; this service’s own jobs (the stay retry, the assessment worker and its claim-ack handler, the rep-overturn retry) recordcanopy-appeals.hearing_officer_idis a referent: the officer’s subject, named by the schedule request, not the caller. -
Outbound calls: the canopy-applications reads and the rep-bar cancel a request makes, and the hearing view’s canopy-snap read, ride the request’s outbound (
RequestOutbound: the caller’s delegation onward, current actor canopy-appeals); the canopy-enrollment adverse-action lookup, stay, veto and release commands ride canopy-appeals' own sender (system origin,AdverseActionsClientinsrc/clients.rs), as do the background workers' calls.
Routes
Mounted by routes() in services/canopy-appeals/src/api/mod.rs, which merges crate::ipv::api::routes(); spelling from crates/canopy-contracts-appeals/src/paths.rs.
| Route | Access | Success | Refusals |
|---|---|---|---|
|
writer |
201 |
400 outside the program's filing window, naming the program, its days and its citation ( |
|
worker reader via canopy-web |
200 |
422 unknown |
|
worker reader via canopy-web |
200 |
422 unknown |
|
supervisor view via canopy-web |
200 |
422 unknown |
|
writer via canopy-web |
200 |
404 |
|
caseworker+ via canopy-cli |
200 |
404 no appeal / no snapshot (determination arm); 422 non-SNAP determination |
|
writer via canopy-cli |
200 |
404 |
|
writer |
200 |
400 chronology / dismissal fields; 404 unknown or not open; 409 |
|
writer via canopy-cli |
200 |
400 untimely / federal-policy bar / no CB to continue; 404; 409 already filed / not decided / action dead; 500 enrollment unavailable (nothing granted) |
|
writer via canopy-cli |
200 |
400 chronology; 404; 409 no filing / outcome recorded |
|
writer via canopy-cli |
200 |
404 not open |
|
writer via canopy-cli |
200 |
404; 409 not an oral pre-submission withdrawal |
|
writer via canopy-cli |
200 |
404; 409 nothing pending / window lapsed |
|
writer via canopy-cli |
200 |
404; 409 nothing pending / window open / confirmation unsent / concurrent transition |
|
writer via canopy-cli |
201 |
400 over |
|
|
200 counts |
— |
|
|
200 |
— |
|
writer |
201 |
400; 422 |
|
caseworker+ via canopy-cli |
200 |
— |
|
caseworker+ via canopy-cli |
200 |
404 |
|
writer via canopy-cli |
200 |
404 |
|
writer via canopy-cli |
200 |
400 hearing inside the 30-day notice; 404 |
|
writer via canopy-cli |
200 |
400 bad decision value; 404 |
|
writer via canopy-cli |
200 |
404 |
|
writer via canopy-cli |
200 |
404; 409 case not in a valid status |
|
writer via canopy-cli |
200 |
404 |
|
caseworker+ via canopy-cli |
200 |
— |
Access legend: writer = a user’s delegation holding a CASEWORKER_WRITER_ROLES role; caseworker+ = CASEWORKER_OR_ABOVE_ROLES; worker reader = WORKER_READER_ROLES; supervisor view = SUPERVISOR_VIEW_ROLES (all crates/canopy-auth/src/roles.rs); via canopy-web / via canopy-cli = only a delegation that client presents; with no client named, the bar admits a delegation through any client. The internal segment is a naming convention; both triggers mount under /v1 like every other route.
Fair hearings
Filing — POST /v1/appeals
Request FileAppealRequest (deny_unknown_fields; request_date is server-stamped from the gated clock):
{
"household_id": "uuid", "requestor_person_id": "uuid", "program": "snap",
"contested": { "kind": "determination", "determination_id": "uuid" },
"notice_id": "uuid", "adverse_action_id": "uuid", "request_method": "phone",
"continued_benefits_waived": false, "good_cause_claimed": false,
"repayment_obligation_disclosed": true
}
contested names exactly one record, a tagged union:
-
determination— a rules determination;application_idon the stored appeal staysnull. -
administrative_denial— resolved against canopy-applications at filing; must exist and belong to the filing household (a foreign or unknown id is the same 404), must matchprogram(422);application_idis server-populated from the record. Continued benefits never bind (anadverse_action_idbeside it is 422). -
rep_disqualification— resolved againstGET /v1/rep-disqualifications/{id}; the assistance unit holds the hearing right (the filing household must be one of the record’snoticed_household_ids, else the same 404); the barred representative may not appeal personally (422representative_may_not_appeal); no CB binding. -
wic_termination— a scheduled WIC mid-certification termination (#3387, 7 CFR 246.9), programwiconly (another program is 422), with noadverse_action_id(422: benefits continue through the hold below, not an enrollment stay). Resolved against canopy-wic'sGET /v1/terminations/{termination_id}; an unknown termination and another household's are the same 404.
The WIC hearing hold (services/canopy-appeals/src/wic_hold.rs). 246.9(g) continues benefits for a participant who appeals within the notice period. Before a wic_termination appeal commits, canopy-appeals sends canopy-wic hold for the appeal's own id (PUT /v1/terminations/{termination_id}/holds/{appeal_id}): a receipt commits the appeal with wic_hold_state = held and a wic_hold_placed timeline row. canopy-wic refusing because the termination date has come (hold_not_timely) or the termination is no longer scheduled (termination_not_scheduled) still files the appeal, with no hold and a wic_hold_not_placed row: the hearing is owed either way (246.9(e)). canopy-wic unreachable, or an instance with no service identity, is 503 with nothing written, so the worker sees the failure and retries while the notice period still runs. Every call to canopy-wic is sent as canopy-appeals's own system token: canopy-wic's hold routes admit no user.
adverse_action_id binds the filing to an enrollment adverse action (validated against enrollment: unknown, wrong household or program mismatch is 422). Without it the filing is a narrative grievance and continued benefits cannot flow. The election window runs [appeals].continued_benefits_election_days (14) from the action’s noticed_date; continuation is assumed unless waived. cb_election outcomes: granted_timely (a synchronous fenced stay is taken through canopy-enrollment’s PUT /v1/adverse-actions/{id}/stays/{appeal_id} and the grant commits only with the receipt), pending_stay (enrollment unreachable — the canopy-appeals.cb-stay-retry worker completes the grant when the stay lands; never granted without a receipt), granted_reinstate (the action already enacted; reinstate by cb_reinstate_by, cb_adequate_reinstate_workdays = 5 working days in Georgia; the timeline note names the pack’s count, #2212), pending_good_cause (past the window with good cause; OSAH approval), waived / not_electable / not_applicable. The response carries decision_due_date: the filing day plus the program's decision_clock_days, counted in calendar days, or in the pack's workdays when [appeals.decision_clock_unit] names business_days for the program (#3466).
Reads
GET /v1/appeals filters by household_id, limit, offset; the list, the queue and the upcoming-hearings feed all accept repeated programs= keys (snake_case slugs, empty = unscoped, unknown → 422) — the BFF passes the worker’s program scope. GET /v1/appeals/hearings/upcoming takes days (default 30, clamped 1..=365) and limit (default 50, clamped 1..=200); the window [today, today + days] opens on the jurisdiction’s legal day ([jurisdiction].timezone), never the database session’s UTC date (#2526). GET /v1/appeals/{id}/hearing-view proxies the contested record as the operator, on the request’s outbound (the operator’s delegation onward): the determination arm fetches canopy-snap’s /v1/determinations/{id}/hearing-view (CANOPY_APPEALSSNAP_URL; SNAP only), the two applications arms fetch their record from CANOPY_APPEALSAPPLICATIONS_URL. canopy-snap’s hearing-view admission lists canopy-appeals among its delegating clients, so the determination arm’s onward delegation is admitted for every role this route admits (canopy-snap API).
Decision — PUT /v1/appeals/{id}/decision
Request RecordDecisionRequest — household_id, decision ∈ upheld_agency | reversed_household | dismissed, decision_basis, decision_signed_date ≤ decision_received_date ≤ today with decision_received_date ≥ request_date, actor, dismissal_basis (required for dismissed: abandoned | federal_mass_change | untimely_request), dismissal_good_cause, federal_policy_issue (an agency-favorable decision on federal policy; a later final appeal never reinstates benefits when set). household_id is required (#3104, the #2545 pattern): axum’s Json extractor refuses a body without it with a 422 before admission. After the body checks, canopy-appeals reads the appeal’s appeal_requests.household_id (store::appeal_household); an unknown id is a 404, and an appeal of another household is refused with 409 appeal_household_mismatch before the status fence or any write, with the detail naming the path id and the requested household, never the stored owner. A caller that names the appeal’s own household still passes: canopy-appeals admits a delegation by role alone and cannot know which household a worker acts in, so the check holds the stored owner to the household canopy-web’s binding proved, not to the worker. Fenced one-shot: requires pending / scheduled, sets decided.
Effects in the same transaction: the timeline and decision events; for an agency-favorable outcome with granted CB, the cessation record dated the next issuance cycle after receipt: the first day of the cycle after the one the receipt falls in, by the pack's [snap.issuance].cycle_granularity (benefit_month is the only value; a missing or unknown one refuses boot). Where a jurisdiction staggers the day benefits post, that day falls inside the benefit month and does not move this date. Then the enrollment command: reversed_household vetoes the bound action; an agency-favorable decision releases this appeal’s stay (the action proceeds next cycle, never an immediate enact). Receipts persist to the timeline and cb_stay_link_status; both commands are idempotent replays on the enrollment side. On a rep_disqualification appeal a reversal also cancels the bar upstream (POST /v1/rep-disqualifications/{id}/cancel, reason = hearing_overturned, household_id the appeal’s, which canopy-applications holds to the record’s noticed set, #3106) post-commit; a failed overturn is retried by the canopy-appeals.rep-overturn-retry worker and reported by the reconciliation sweep as rep_overturn_unreceipted.
Final appeal and final decision
PUT …/final-appeal { filed_date, actor, continue_benefits } records a judicial appeal of the hearing decision; filed_date must fall within [appeals].final_appeal_window_days (30) of decision_received_date. With continue_benefits, the stay is re-granted synchronously through enrollment’s restay command before anything commits, the recorded cessation is superseded, and — if the action already enacted — cb_reinstate_by is set; refused when the decision carried federal_policy_issue or no benefits were continued pending the initial decision, and refused outright where the pack does not extend benefits through a final appeal ([appeals].final_appeal_continues_benefits = false, #3281). PUT …/final-decision { outcome: affirmed | reversed, received_date, actor }: affirmed records the final_decision cessation at the next issuance cycle, re-arms the CB assessment and releases the stay post-commit; reversed vetoes the action, records no cessation, voids any completed assessment, and overturns a rep bar as the initial decision does.
Withdrawal (P12) and postponement (P13)
PUT …/withdraw { method: written | oral, actor } opens the lifecycle (status = withdrawal_pending); an oral pre-submission withdrawal owes a written confirmation within withdrawal_confirmation_days (10). …/withdraw/confirm server-stamps that notice; …/withdraw/reinstate returns the appeal to its prior status while the withdrawal_reinstatement_days (10) window is open; …/withdraw/finalize is the only transition that releases the enrollment stay — the fenced finalization commits first, the release follows post-commit with its receipt persisted. A post-commit failure is never unwound: a release that fails is logged and timeline-noted and leaves a lingering stay, and a receipt that cannot be written is logged and still answers 200 with the committed, withdrawn appeal, leaving its stale stayed receipt to reconciliation (#2668; runbook). POST …/postponements { days, reason, actor } records the one household-requested postponement (7 CFR 273.15(c)(4)), days 1..=max_postponement_days (30), moving decision_due_date by that many calendar days, whatever unit the clock counts; a second is 409.
Ending a WIC hearing hold
When a wic_termination appeal is decided, finally decided or its withdrawal finalized, the command it then owes canopy-wic is written on the appeal row in that transaction (wic_hold_command, wic_hold_command_at) and sent after the commit. reversed_household, and a final decision reversed, owe cancel, whether or not the appeal held: canopy-wic cancels the termination (appeal_reversed). upheld_agency, dismissed, a final decision affirmed and a finalized withdrawal owe release, and only when the appeal holds; an appeal that never held owes nothing on those. canopy-wic's receipt clears the command, records the hold status it reports and writes a wic_hold_command_receipt timeline row. A command that does not land stays owed, with one wic_hold_command_unsent row; the hold stays standing, which only delays the termination.
The hold retry (canopy-appeals.wic-hold-retry, every 60 s under an advisory lock, 100 rows a pass) re-sends each owed command until its receipt, and pages canopy-wic's standing holds to release one whose appeal id names no appeal row here (a filing whose hold was taken and whose commit then failed), but only once the hold is more than an hour old, so a filing still in flight is never released.
Internal triggers
POST /v1/internal/appeals/clock-check runs the decision-deadline check (approaching at approaching_deadline_warning_days = 14, refused at boot outside 1..=366 like every [appeals] day and workday count, #2425; overdue past the clock) and returns the counts. POST /v1/internal/appeals/reconcile runs the canopy-appeals.reconciliation sweep on demand: stay receipts vs enrollment’s per-appeal links, CB elections parked in pending_stay past pending_stay_alert_hours (24), and unreceipted rep overturns confirmed against canopy-applications. Response ReconcileReport — receipts_checked, lingering_checked, findings[] (receipt_link_disagreement | link_missing | lingering_stay | pending_stay_past_sla | rep_overturn_unreceipted), skipped_unreachable. Report-only; remediation is the runbook’s.
IPV / ADH
-
POST /v1/ipv/cases—CreateIpvReferralRequest(household_id,person_id,program,allegation_type,allegation_description,evidence_summary,overissuance_amount,overissuance_period,discovered_in_qc_review;deny_unknown_fields). The body names no referrer (#1008):referred_byon the case andrecorded_byon itsreferredtimeline row are the caller’sActor(principal.actor()): the writer’s canopy subject. -
overissuance_period(#3566) is the benefit months the over-issuance covers,{first_month, last_month}, each the first day of its month and in order (canopy_types::month_period::MonthPeriod; anything else does not parse). It is required exactly whenoverissuance_amountis stated: an amount without it is 422overissuance_period_required, a period without an amount 422overissuance_period_without_amount, and neither writes a case. SNAP’s claim for the amount must state its period on the demand letter (7 CFR 273.18(e)(3)(iv)(D)), and the months cannot be derived from the amount later. The case answers it onIpvCase.overissuance_period. -
discovered_in_qc_review(#2444) is the referring worker’s attestation that a quality control review discovered the over-issuance. It is required, with no serde default: a body without it is 422. 7 CFR 273.18(e)(2)(i) and (ii) except an overpayment "discovered … in a quality control review" from the SNAP claim floors, which judge the claim an ADH that finds no IPV leaves (canopy-snap API). The case stores it and answers it onIpvCase.discovered_in_qc_review,nullfor a referral recorded before it was captured. -
PUT …/schedule-adh{ adh_date };PUT …/send-noticerecords the advance notice and refuses a hearing inside[appeals].adh_notice_advance_days(30; 7 CFR 273.16(e)(3)(i));PUT …/record-decision{ decision };PUT …/waiver{ waiver_signed_date };PUT …/withdraw. -
PUT …/impose-disqualificationderives the penalty window server-side from the person’s prior IPV count: the federalsnap-procedure.jsonipv.first_offense_months(12),second_offense_months(24), permanent on the third (ipv/penalties.rs); no body. -
GET /v1/ipv/disqualifications/active?person_id=→disqualified, end date, program, IPV case id.
Error codes
| Code | Meaning |
|---|---|
400 |
Invalid body; filing outside the program's |
401 |
No bearer ( |
403 |
|
404 |
Appeal or IPV case not found; the contested record unknown or owned by another household |
409 |
Lifecycle refusals — withdrawal, final-appeal and postponement transitions out of order; an IPV case not in a valid status; a decision naming a household the appeal does not belong to ( |
422 |
Unknown |
503 |
Enrollment / applications unavailable for a lookup the write depends on (nothing committed; retry); no trustworthy key set ( |
Events published
String set from crates/canopy-contracts-appeals/src/events.rs and services/canopy-appeals/src.
-
appeal.filed— routed by canopy-notices to the acknowledgment letter. -
appeal.continued_benefits_granted— routed to the continued-benefits letter. -
appeal.decision_recorded— one event for every outcome (typed decision, signed/received dates, the next-cycle cessation date when CB was granted); consumed by canopy-enrollment’s convergence consumer. -
appeal.withdrawal_finalized— consumed by canopy-enrollment (stay release + enact gate). -
appeal.decision_deadline_approaching,appeal.overdue— the clock-check’s supervisor signals. -
appeal.overpayment_assessed— the CB assessment worker’s claim request (full provenance:appeal_id/adverse_action_id/assessment_id, and since #2242 thedispositionthat made the household liable —upheld_agency,dismissedorwithdrawn,canopy_contracts_appeals::events::LiableDisposition), re-emitted by the acknowledgment scanner until acknowledged. Since #3566 it carriesperiod_first_monthandperiod_last_month: the month the assessment’s window starts in to the month its recorded cessation falls in, the whole-month window its lines were billed over. An assessment whose cessation precedes its window start has no such period, and its event is withheld. -
appeal.overpayment_assessment_voided— an assessment with a possible downstream claim was retired (veto, cancel, supersession). -
ipv.case_referred,ipv.adh_scheduled,ipv.disqualification_imposed(routed to the sanction letter; carriesoffense_number,permanent),ipv.overissuance_claim_created. -
ipv.not_established— staged with theclearedflip when an ADH finds no IPV on a case that carried a positive over-issuance (publish_ipv_not_establishedinsrc/ipv/events.rs):ipv_case_id,household_id,person_id, the lowercaseprogram,amount_cents, since #3566 the referral'speriod_first_monthandperiod_last_month, and since #2444 the referral'sdiscovered_in_qc_review—nullfor a referral recorded before the attestation, which canopy-snap reads as unrecorded. The field is additive within the envelope's schema version (event-delivery protocol).
Events consumed
-
snap.overpayment_claimed/tanf.overpayment_claimed/medicaid.overpayment_claimed(queuecanopy-appeals.claim-acks,main.rs) — the program service’s in-claim-transaction acknowledgment; flips the referenced assessmentcomputed → applied(idempotent) and timelines the claim id. -
snap.overpayment_declined(same queue, #2242) — canopy-snap declined the claim under its pre-establishment claim floors (a dismissed or withdrawn appeal); settles the assessment the same way (assessment_worker.rs (handle_claim_decline_ack), idempotent), so the scanner stops re-emitting it, and timelinesoverpayment_claim_declinedwith the recorded reason.
Configuration
Service tunables: CANOPY_APPEALSENROLLMENT_URL, CANOPY_APPEALSSNAP_URL, CANOPY_APPEALSAPPLICATIONS_URL, CANOPY_APPEALSWIC_URL (services/canopy-appeals/src/config.rs). Policy parameters are the [appeals] and [snap.ipv] blocks of the jurisdiction ruleset, loaded at boot (AppealsParams). The load refuses a pack whose filing window for an enabled program is outside its federal bound (hearing-request-windows.json: SNAP at least 90 days, WIC at least 60, Medicaid at most 90) or differs from the deadline that program's letters print (Rulesets › the federal bounds). Identity settings are the baseline IDENTITY_ISSUER / IDENTITY_INTERNAL_URL (configuration reference) and the client key CANOPY_APPEALS__IDENTITY_CLIENT_PRIVATE_KEY; canopy-appeals refuses to boot without its sender (main.rs), which the CB assessment worker needs.