Data Export API (FOIA, audit, portability)
For a policy analyst, auditor or data steward pulling a bulk export, and the
operator who runs it: three GET endpoints satisfy the data-disclosure
obligations. All three are user-only and admit the admin or
quality_control role — contract.require_user_only(&claims, &["admin",
"quality_control"]) in each handler — and a service-class bearer is 403
outright.
| Endpoint | Service | Purpose |
|---|---|---|
|
canopy-security ( |
The raw audit chain within the window — Pub 1075 §9 access-log review, CMS-aligned audit-trail requests, internal QC investigations. No redaction: the log is metadata about who accessed what. |
|
canopy-persons ( |
FOIA disclosure ( |
|
canopy-snap ( |
SNAP determinations finalized within the window — |
Person-record FOIA redaction
mode=foia (default) projects the Person record to a public-records-safe shape:
| Field | Released? | Rationale |
|---|---|---|
|
✓ |
Names appear in court orders / public records; not exempt under the Georgia Open Records Act personal-privacy carve-outs. |
|
✓ (year only) |
Full DOB is exempt under the personal-privacy carve-out; year-only is the standard de-identification for actuarial / demographic disclosure. |
|
✓ |
Not personally identifying. |
|
✓ |
Operational metadata, not PII. |
|
✗ |
Personal-privacy exemption (Georgia OCGA 50-18-72(a)(20) and
HIPAA-adjacent disability/race fields). The |
mode=portability&person_id=<uuid> returns the full record for the named data
subject — for an applicant exercising the right to their own data, never for a
public-records request.
Address join
Both modes return the person’s active addresses joined to the record:
| Field | FOIA released? | Rationale |
|---|---|---|
|
✓ |
City/state/zip survive at the FOIA level — these are part of the public address record (voter registration, court filings) and the county FIPS code is jurisdictional metadata, not personal. |
|
✗ |
Street address is exempt under the personal-privacy carve-out; an attacker combining street + birth_year + name would have material to re-identify. |
|
✗ |
Timing-sensitive metadata that fingerprints a record even after PII is removed (e.g. a unique move-in date). |
|
✗ (FOIA only) |
Implementation IDs / audit timestamps. Released in portability mode where the data subject is entitled to their full record. |
In portability mode every Address column is released — full street, unit
number, dates and the row’s identifier — so a caller can re-issue the export
and detect address changes by id. Multi-address shapes: JSON nests
addresses: […] on the person object (an empty array when none); CSV
flattens to one row per (person, address) pair with the person columns
repeating, and a person with zero addresses still emits one row with empty
trailing address columns — CSV consumers wanting one person row GROUP BY id
after import.
Request parameters
| Param | Endpoints | Meaning |
|---|---|---|
|
all |
Inclusive window start (RFC 3339 / ISO 8601). Defaults to 24 hours before |
|
all |
Exclusive window end. Defaults to now. |
|
all |
|
|
all |
Row cap, clamped into |
|
audit-events |
Repeated |
|
persons |
|
|
persons |
Required when |
Responses
-
200 OKin the requested format; CSV carriesContent-Disposition: attachment; filename="…"for browser-driven exports. -
400 Bad Request—from >= to, ormode=portabilitywithoutperson_id. -
403 Forbidden— a service-class bearer, or a user token without theadmin/quality_controlrole (the frozen contract, ADR-043, the frozen 401/403 contract). -
422 Unprocessable Entity— an unknownprogramsslug (audit-events).
Verify — the export’s own audit trail
Every export publishes one event — audit.export.requested (canopy-security),
persons.export.requested (canopy-persons; adds mode and, in portability
mode, person_id) or snap.export.requested (canopy-snap) — carrying actor,
from, to, format and row_count. The canopy-security wildcard subscriber
persists it into the audit chain, so querying that chain for export activity is
itself an export. A failure to publish is logged at WARN and does not fail the
request: the caller is already authenticated, the data is visible elsewhere and
the chain still holds the original events — degraded, not catastrophic.
References
-
services/canopy-security/src/api/export.rs,services/canopy-persons/src/api/export.rs,services/canopy-snap/src/api/export.rs -
canopy-security API Reference, canopy-persons API Reference, canopy-snap API Reference — the per-service endpoint pages
-
Plan: Operational Infrastructure — Step 11
programs visibility predicate to the audit-events export; the quality_control role the original plan named is implemented and admitted today.