# SIS dictionary — enrollment census

**As of 2026-11-18**: rules last verified against the live system.

Genesis tags: captured / computed / copied / judged / truly unknown.
`resolved.query`, where present, lists the filters applied after defaults and scope clamps.
BRAINLIFT.md holds the doctrine; this dictionary, operative rules.

## What this source is

School-year **enrollment** census for Alpha physical schools and other campuses, not admissions.
SIS applications (`GET /v1/applications`, `sis_list_applications`) are separate.
The admissions wire serves SIS applications in HubSpot shape. Not legacy Django SIS, nor Vin (staff Cognito MCP).

Grain: student + program offering (campus programme/year). A student has one open enrollment per offering: enrolled, confirmed, pending review/deposit, on hold, or re-enrolling; on hold is not a live seat. Exchange seats are excluded. An application is a different object on this wire, not an enrollment row. Acceptance links the student's existing unlinked open enrollment, never creates another.

## Discriminator: programs.program_type

Captured on the program row. Closed set:

- `MAIN` — school year: the roster population.
- `ANCILLARY` — add-on programs. Not the school-year census.
- `SUMMER_CAMP` — summer. Never mix with "Alpha physical school". A
  camp is filed under the school year that starts that autumn: summer 2026
  is offering year 2026 (2026-27).

Summer students at an "Alpha" campus are still `SUMMER_CAMP`.

Compare summer and MAIN with separate measured census cuts for the same year
(`programType=SUMMER_CAMP` and `programType=MAIN`); report both counts.

## Roster statuses (enrollments.status)

Judged by admissions/registrar workflow. The roster cohort is exactly:

- `PENDING_REVIEW`
- `CONFIRMED`
- `ENROLLED`

`PENDING_REVIEW` students are eligible to attend, with paperwork pending. An applications
Enrolled count (`CONVERTED` on `GET /v1/applications`, `sis_list_applications`) trails the roster:
the application behind a `PENDING_REVIEW` enrollment reads `ACCEPTED` or later.

Source: `ACTIVE_ROSTER_STATUSES` in
`packages/dtos/src/core-sis/constants/enrollment-status.constant.ts`.
Every other stored value is off the roster. Closure outcomes on an enrollment are
`WITHDRAWN`, `COMPLETED`, `TRANSFERRED`, and `CANCELLED`. `RE_ENROLLING` and
`PENDING_DEPOSIT` stay in play but off the roster (Trap 1). `ON_HOLD` is neither
on the roster nor closed — a parked enrollment, application-owned, and by default it does not by itself
put a student on `GET /v1/students`. `EXCHANGE` is a visit, not a
roster enrollment (Trap 18). `NON_TERMINAL_ENROLLMENT_STATUSES` in the same file
names the in-play set; those eight plus the roster three are all eleven
values `EnrollmentStatus` can return.
On `GET /v1/students` the three roster statuses gate the one headline enrollment
the picker chose per student — see the Coverage bullet — not a school-year
MAIN census. Omitting `CONFIRMED` undercounts. Size the gap at your own instant:

`GET /v1/enrollments?programType=MAIN&academicYears={year}&status=CONFIRMED`
→ `pagination.total`

`CONFIRMED` is roster-bound and paperwork-complete. It is **not** the
deposit-paid set. Deposit is a FinalSite reading
(`applications.finalsite_deposit_state`), served as `finalsiteDeposit` on `GET /v1/applications` rows (under `items`, not `data`), not on enrollments or the expanded student's `applications[]`. An enrollment's deposit fields are its terms. Deposit-paid families sit mostly in `PENDING_REVIEW` and `ENROLLED`, and some hold no enrollment, so
`status=CONFIRMED` is not a deposit-paid headcount: at a campus with deposits
paid it can return nothing. A school-year deposit-paid headcount is the
`GET /v1/applications?year={year}&programType=MAIN` rows whose `finalsiteDeposit.state` is `PAID`. There is no deposit filter, so walk every page and count
those rows; `pagination.total` is every application matching the filters, paid or not. A null
`state` is "no reading", not unpaid: only FinalSite-synced applications carry one.
The `CONFIRMED` bucket shrinks as enrollments move to `ENROLLED` when the year starts.

A roster status describes an enrollment on ITS OWN offering year, and nothing moves it when that
year ends. Pin `academicYears` on every roster read: omitting it returns every year's rows,
past-year leftovers included (Trap 20).

### Trap 1 — three-status roster vs four-status "active" talk

`RE_ENROLLING` is stored and non-terminal (`ENROLLED`, `RE_ENROLLING`, `CONFIRMED`,
`PENDING_REVIEW`, `PENDING_DEPOSIT`), but off-roster. It is an intent marker, not a roster
enrollment. The row's year is its `academicYear`; do not infer it from status. A
`RE_ENROLLING` row neither implies nor excludes that student's roster enrollment in any
year; the intersect below settles it.

Size the set at your own instant:
`GET /v1/enrollments?status=RE_ENROLLING` — each row carries its own
`studentId` and `academicYear`. Intersect those `studentId` values with
`GET /v1/enrollments?programType=MAIN&academicYears={year}&status=PENDING_REVIEW,CONFIRMED,ENROLLED`
to see the overlap. Do not carry a prior count.

Do not add `RE_ENROLLING` to a census count of "who is on the roster this
year".

### Trap 18 — `EXCHANGE` is a visit at a second campus, not a roster enrollment

`EXCHANGE` is a stored status on a SECOND enrollment row. It records a bounded
stay at another campus while the student's enrollment of record, headcount and
billing stay at their home campus (educrm-tracker/1388). The row points at the
VISITED campus: `campusId` / `campusName` are the host's, `programType` is
`MAIN`, `academicYear` is the same year as the home enrollment, and grade and level are
copied from home. Recognise one by `primaryEnrollmentId` — non-null on an
exchange row, null on an ordinary enrollment — with `enrollmentEndDate` as the planned
last day of the visit.

It is NOT in `ACTIVE_ROSTER_STATUSES`, and that exclusion is the point: the
student already holds a roster enrollment at home, so counting the visit as well counts them twice and credits a campus they are not enrolled at. Excluding
`EXCHANGE` from a MAIN census loses nobody — an exchange row is only ever created
against a live home enrollment in `PENDING_REVIEW` / `CONFIRMED` / `ENROLLED`.

`GET /v1/students` never lists a student on the strength of an exchange row: that
list by default applies the three roster statuses to the enrollment of record, and an
exchange row never becomes one. But `?campusId={visitedCampus}` DOES return the
visiting student, with their home campus on the row, because the campus filter is
satisfied by any enrollment at that campus. `GET /v1/students/roster` defaults to
the three roster statuses and returns exchange rows only when you ask for
`status=EXCHANGE` explicitly.

The status is not permanent. Once the window passes the row reads `COMPLETED`,
at a campus where the student never completed a year; a visit that never took
place reads `CANCELLED`, with no `withdrawnDate`. `primaryEnrollmentId` stays
non-null on both; use it to keep them out of a "completed a year here" answer.

Inside the platform, `ROSTER_STATUSES_WITH_EXCHANGE` in
`packages/dtos/src/core-sis/constants/enrollment-status.constant.ts` is the roster
cohort plus `EXCHANGE`, and exactly two consumers use it: attendance (the visited
campus marks the visitor present) and guide assignment (it gives them a local
guide). Attendance is not available through this skill, for visitors or anyone
else. `GET /v1/guides/{guideId}/students` lists guide
ASSIGNMENTS — a visiting student appears there once the host campus assigns them a
guide, not by cohort membership.

Size the set at your own instant:
`GET /v1/enrollments?programType=MAIN&academicYears={year}&status=EXCHANGE`
→ `pagination.total`.

## When the current status began

`applicationDate` (nullable DATE) ages an application: the sent date, else today; HubSpot sends `application_date`, else `createdate`; FinalSite `application_submit_date`. A migrated row can hold null; count those apart (`IS_EMPTY`). `createdAt` is insert time, or the legacy admission date when migrated. `statusEnteredAt` is when the `status` began, not `modifiedAt`. Null means
not recorded: before recording started, or a repair. It dates the write,
not a backdated day. The list dates the served status; the detail
dates the stored status. `statusOlderThanDays=N` on `GET /v1/enrollments` and
`GET /v1/applications` keeps a stamp at least N whole UTC days old; a null
stamp never matches.

## Status history of one application or enrollment

`GET /v1/applications/{id}/status-history` and `GET /v1/enrollments/{id}/status-history`
(MCP `sis_get_application_status_history`, `sis_get_enrollment_status_history`) return
status changes oldest first as `{ eventId, from, to, at, actor: { kind, name }, cause }`.
`from` is null on the creating entry. It reads the activity log: a SQL repair leaves no
entry, and entries past retention are gone. It needs the parent's permission; out of scope is `404`.

## Seated today vs committed for the year

A roster enrollment whose `enrolledDate` is after your read instant is a commitment
to start on that date, not a body on campus today. The date is the
discriminator, never the status. Stored statuses are `PENDING_REVIEW` and
`CONFIRMED`. `enrollment_computed_status` promotes `CONFIRMED` on
`enrolled_date <= CURRENT_DATE` and never demotes, so a stored `ENROLLED`
row with a future date is still this class.

`GET /v1/enrollments` takes no date filter. `pagination.total` on a roster
pull is **Committed for the year** (the roster trio, unfiltered). Newly
enrolled this year is that pull plus `priorSchoolYears=0`. **Seated today**
is that pull kept only where `offeringStartDate` is on or before the read
date, minus enrollments whose `enrolledDate` is after the read date or whose `withdrawnDate`, `cancelledDate` or `transferDate` is on or before it. The roster trio already excludes `WITHDRAWN`, `CANCELLED` and `TRANSFERRED`, but the `status` filter reads the stored status, which a scheduled exit flips only on a nightly run. Served `status` reads an arrived withdrawal or cancellation, and a transfer on an `ENROLLED` row; page rows for any other arrived transfer. A blank
`enrolledDate` keeps the enrollment. On an offering that has not started, roster enrollments,
blank `enrolledDate` included, are committed for the year. A missing start date on first day
is under "On the first day". Seated today reads enrollment dates, not attendance. Count it in one call: `sis_count` over `sis_list_enrollments` (roster pins, one campus per call for a by-campus figure), `groupBy` `offeringStartDate`, `enrolledDate`, `status`. Add the groups whose `offeringStartDate` is on or before the read date, whose `enrolledDate` is blank or on or before it, and whose `status` is still one of the trio. Each row lands in one group, so nothing is subtracted twice. That counts
enrollments; a headcount pages rows.

**Trap 21 — a future `enrolledDate` is not a data error.** Place the enrollment.
Size at your own instant: page
`GET /v1/enrollments?programType=MAIN&academicYears={year}&status=PENDING_REVIEW,CONFIRMED,ENROLLED`
and count rows whose `enrolledDate` is after the read date. A zero is a real answer.  Statuses turn over at midnight UTC, and a write that sets `ENROLLED` with a future `enrolledDate` is stored `CONFIRMED`. Between midnight UTC and midnight Pacific, a row starting on the UTC date already reads `ENROLLED`. Outside that window an `ENROLLED` row with a future date is a data issue; report it.
For how many start after today, call
MCP: `sis_query` with `{"useCase": "roster census", "intent": "count roster enrollments that start after today", "grain": "enrollment", "mode": "count", "cohort": {"academicYears": ["2026-27"], "programTypes": ["MAIN"], "statuses": ["PENDING_REVIEW", "CONFIRMED", "ENROLLED"]}, "filters": [{"fieldId": "enrolledDate", "operator": "AFTER", "value": "{today}"}]}`,
`{today}` being the server's date from `GET /skill`.

## Newly enrolled

Judged, not captured. **Newly enrolled means: no prior-year MAIN enrollment.**
`priorSchoolYears` counts earlier MAIN years only — a summer-camp enrollment is
never a prior year, so a camper entering MAIN this year is new, not
returning. And the count is school-wide, not per campus:
`priorSchoolYears` counts earlier MAIN years at any campus, so a student who
moved campuses is returning, not new.

This is **not** `applications.pipeline_type = NEW_ENROLLMENT`.
`pipeline_type` is `NEW_ENROLLMENT` / `RE_ENROLLMENT` / `SUMMER_CAMP`
and answers a different question (which admissions pipe the application sat
in). Using it as "newly enrolled" silently mis-counts.

Pin: `GET /v1/enrollments?priorSchoolYears=0`. That keeps enrollments where
`student_prior_school_years(student_id, academicYear) = 0` — previous
MAIN years enrolled is 0. The function counts distinct earlier MAIN years
in `ENROLLED` / `COMPLETED` / `WITHDRAWN` / `TRANSFERRED`. Each row
is judged against its own `academicYear`. Pair with `academicYears`
when the question is "this year"; omitting the year pin is first-year
enrollments in every year, not an error. Filter the number; do not invent a
boolean pin.

Every census row returns `priorSchoolYears`, the basis to cite. A tenure or
new-vs-returning split is cheapest as one pinned call per bucket: pin
`priorSchoolYears={n}` with `limit=1` and read `pagination.total` for each
bucket (0, 1, 2, …). Do not N+1 `GET /v1/students/{id}/expanded` to derive
tenure, and do not page the full roster to bucket what the pin counts.

**What the count sees.** `priorSchoolYears` counts the MAIN years held for the
student in this SIS, and the migration from the legacy SIS is complete, so
`priorSchoolYears = 0` is new to the school. A row carries `startYear` and no dates: the year rolls on
1 August by the school calendar (`today`, and so `currentAcademicYear`, is read in America/Los_Angeles, not UTC),
and a school's own first and last day are per offering on `GET /v1/program-offerings`.

To see which campuses are all new, run `sis_query` at grain `enrollment` with the year's cohort and roster statuses, `"mode": "group_by"` and `"groupBy": ["campusId", "priorSchoolYears"]`: a campus whose only group is `0` is wholly new.

The census has no brand pin: size a **brand** by grouping campuses on `brand.id` from `GET /v1/campuses`.

"This year" is an explicit school year on `program_offerings.year` /
`enrollments.academicYear`, never "the calendar year of today".
`academicYears` accepts the integer (`2026`) or the display label
(`2026-27`, `2026-2027`). Both pin the same offering year. The label
on each row (`academicYearLabel`) is display, not a second year.

Offering `admissionsSource`: `FINALSITE` or `SIS` owns admissions. `chargedInSis`: SIS takes payments. Campuses: `admissionsSources`.

## App access

`appAccess` (`app_access` on canonical) needs the offering's `grantsAppAccess`. `PENDING_REVIEW`, `CONFIRMED`, `ENROLLED` hold it; `COMPLETED` until `appAccessEndsAt`. `ON_START_DATE` delays it to `offeringStartDate`. `appAccessEarlyStart` grants it early before enrollment. Dates flip it unwritten: `updatedSince` misses that.

## First day of school

Copied: first day for an enrollment is `program_offerings.start_date`, returned
as `offeringStartDate` on census and expanded enrollments. Do not N+1
`GET /v1/program-offerings/{id}` — that route needs `campuses:read`,
which a census-only key does not hold.

An `offeringStartDate` more than two months after your read instant is
provisional — see the `offeringStartDate` genesis bullet for the two-month
rule and why nothing on the wire flags it.

First day here is per-enrollment: the offering start date on one enrollment row.
Whether a campus is opening, and which cycle it belongs to, is campus-grain
and a different source: red2, at
`https://data-source-skills.vercel.app/red2/DICTIONARY.md` § `opening`
(public, keyless). Do not answer a campus-opening question from
`offeringStartDate`, and do not answer a per-enrollment first-day question from
red2's opening date.

`enrolledDate` is captured and nullable. On a `SYNCED` row, `enrolledDate` is the date the inbound sync sent, not the SIS row's `createdAt` (`enrolledDateSource` is `SYNCED` or `MANUAL`, served only on `GET /v1/enrollments/{id}`). A one-day cluster after `offeringStartDate` still follows the rule below: disclose the cluster, and that it cannot tell a real first day from a bulk value. FinalSite-created
`CONFIRMED` / `PENDING_REVIEW` rows often keep a null `enrolledDate`
for their whole life.

`effectiveEnrolledDate` is the date to READ: the
recorded `enrolledDate` when there is one, else the date the SIS derives
at read time for a student enrolled in an already-started offering — the
earliest of that student's non-cancelled MAIN enrollments (a recorded date counts even before its offering starts), so a returning student reads as joining when they first joined. Null
means no date was recorded, and the enrollment is not a MAIN `ENROLLED` row on
a started offering. Nothing stores it, so never PATCH it back.

A null `enrolledDate` means nobody recorded a date, not "enrolled from the offering start". `effectiveEnrolledDate` says whether one exists.

On the first day of school means:

`effectiveEnrolledDate` present and on or before `offeringStartDate`

Read `effectiveEnrolledDate` for this question, never the stored `enrolledDate` on its own.
Dates on or before the offering start count (including early enrolls such as 2026-07-15 when
first day is 2026-08-01). Dates after `offeringStartDate` are mid-year / late enrolls — not on
first day.

A null `effectiveEnrolledDate` is a missing start date. Leave that enrollment
out of a first-day versus mid-year answer, state how many enrollments had a
missing start date, and never drop it from a headcount.

An `offeringStartDate` more than two
months after your read instant is provisional — see the `offeringStartDate`
genesis bullet for the two-month rule and why nothing on the wire flags it.

**Trap 4 — equality, or the stored column alone.** Filtering
`enrolledDate = offeringStartDate` drops early enrolls and every enrollment the SIS dates for you.
Treating a missing `enrolledDate` as first day counts the missing-start-date enrollments as first day.

**Trap 5 — `enrollmentStartDate` is not first day of school.** It is the enrollment's own first day, with
`enrollmentStartDateSource` naming its origin. The first-day pin is `offeringStartDate`.

**Window.** `enrollmentEndDate` is the enrollment's last day, with `enrollmentEndDateSource` (`SCHOOL_YEAR` is the offering's date). It ends the seat, not app access. Recognise an exchange by `primaryEnrollmentId`.

Do not invent a boolean first-day flag. Compare `effectiveEnrolledDate` against
`offeringStartDate` on the row, and say in the same answer how many rows had a
null `effectiveEnrolledDate` and that `enrollmentStartDate` was not used.

## Withdrawals, completions, transfers

Three stored statuses, not one "left" bucket. Explain a cancellation
from the enrollment `cancellationReason` (`status=CANCELLED`), then the
application `status`, `closureReason` (`NOT_ENROLLING`, `WITHDRAWN`,
`OTHER`) and `lossReason` (notes). The not-enrolling pick-list is not served on this wire.

A withdrawal question ("how many withdrew last school year, and why?") is
answered by querying first, never by describing or asking:

1. Resolve last school year as the offering year before the current one (2025 when this year is 2026-27); run that default and disclose it.
2. ALWAYS run and report `GET /v1/enrollments?programType=MAIN&academicYears={lastYear}&status=WITHDRAWN` (tool: the census form below with `"status": ["WITHDRAWN"]` and this year pin). Without this query's measured count, the answer is incomplete.
3. When a campus is named ("Alpha Austin"), resolve it to its `campusId` on `GET /v1/campuses` first and pin `campusId` — campus names are editable display text. A name that matches several campuses ("Austin") gets one count per campus, no combined total, then ask which one was meant.
4. With the count, disclose all three: WITHDRAWN is not TRANSFERRED, so state whether campus movers count as leavers; `withdrawnDate` is nullable, so say how undated leavers were handled; count rows with `withdrawalReason` on your cut (see below; often none) rather than skipping "why." The reason may be unanswerable, but the count is not.

- `WITHDRAWN` — the family left (last year: prior `academicYears`,
  `programType=MAIN`). A roster row with a future `withdrawnDate` is a
  scheduled withdrawal: on the roster until that date, then `WITHDRAWN`.
- `TRANSFERRED` — a campus move recorded on the origin enrollment. Staff mark the
  origin `TRANSFERRED` and normally create a destination enrollment, which is not
  guaranteed to be active. An aborted transfer leaves it `CANCELLED`. A `TRANSFERRED`
  origin without another row for that year is a transfer still in flight: the destination
  follows the origin update, so the student has neither left Alpha nor arrived anywhere
  countable during the gap. Read the destination row's own `status` against the roster
  statuses; an active destination may be any of the three, including `PENDING_REVIEW`,
  and `CONFIRMED` is usual while the transfer date is in the future. To count the student as still in Alpha, verify the destination; the origin alone is not
  enrollment evidence, and a gap past the transfer date is a data defect to report, not a departure.
- `COMPLETED` — the year closed on that enrollment. The routine writer is
  the daily 06:00 UTC reconciliation job, which persists the computed
  flip; a staff `PATCH /v1/enrollments/{id}` remains possible as the
  exception. Census `status` on `GET /v1/enrollments` is computed, not
  the stored column — see the incremental-reads trap.

The reason is captured on the same row: `withdrawalReason`, constrained
on write to `WITHDRAWAL_REASONS`
(`packages/dtos/src/core-sis/constants/withdrawal-reasons.constant.ts`).
Null means `withdrawalReason` was not recorded, not that the student did not withdraw. `withdrawnDate` is captured and nullable; a `WITHDRAWN` row can lack a leave date. Dropping null dates from a leave-date timeline undercounts leavers, so size the null share on your own cut by paging
`GET /v1/enrollments?programType=MAIN&academicYears={year}&status=WITHDRAWN`
and count rows whose `withdrawnDate` is null against `pagination.total`.
The share varies by year; remeasure it. `withdrawnDate` can precede
`offeringStartDate`. That is a withdrawal before first day: the family left while
the enrollment was ahead of them, so the enrollment never started and is not an
in-year loss of a child who started. Both dates are on the census row:
`withdrawnDate < offeringStartDate` is pre-start; on or after it is a departure
from a started enrollment. A recorded `enrolledDate` does not move a row out of
this class; `withdrawnDate` still precedes first day. The class can be empty in
one offering year and material in the next; last year's cut does not predict this year's. As of 2026-09-16,
`withdrawalReason` is populated on `WITHDRAWN` rows on this wire; how
many carry one is the reader's own measurement, below. Capture is uneven
by campus and by year, and it is recent. An empty reason column is a
statement about capture practice on the cut you pulled, never about
whether the column exists. Size the non-null share on your own cut, per
campus when the question names one: page
`GET /v1/enrollments?programType=MAIN&academicYears={year}&status=WITHDRAWN`
and count rows with a non-null `withdrawalReason` against
`pagination.total`. An all-null campus is the normal case, not a failed
read. `WITHDRAWAL_REASONS`
(`packages/dtos/src/core-sis/constants/withdrawal-reasons.constant.ts`)
is the vocabulary the SIS write path enforces on
`PATCH /v1/enrollments/{id}`. It is not a guarantee about what you read:
the stored column is free text, and direct writes have left values not on the list. The list is what you
may WRITE; the column is an open string you must READ. Parse it into a
closed enum and a leaver-reason report throws or drops rows. An off-list
value is not a legal write and not a reason to widen the list. When
`withdrawalReason` is `Other`, the write path requires
`withdrawalReasonNotes`, so the notes always hold something: an
operator's sentence on some rows, an automation stamp such as
`Updated via update_sis_user` on others, which records that a sync
touched the row and states no cause. Count an `Other` row as "reason
recorded" only after reading its notes. The notes field is nullable when
the reason is not `Other`. A PATCH fills an empty reason or replaces an
`Other` holding only such a stamp; it never replaces another reason and
appends its value to the notes instead. Notes are only appended.

Transfer fields on the origin row: `transferDate`, `transferCampus`,
`transferReason`. `transferReason` is free text: count it filled, never print it. `transferCampus` is the destination campus NAME on every `TRANSFERRED` origin with a destination enrollment, regardless of system or write order. It is not a key. Never join on it; the destination row's `campusId` is the structural answer.

Empty means one thing: NO DESTINATION ENROLLMENT EXISTS YET — information, not a
gap. Two exceptions keep a stored value rather than naming the destination:
an origin with enrollments at two destination campuses (left empty, logged
ambiguous), and one whose stored name disagrees with the destination enrollment
(the stored name is kept, so it stays visible). Today: one disagreement,
none ambiguous.

Until the backfill has been applied, some rows still hold a campus id, or
nothing, where a destination exists; an operator pass corrects those.
`transferDate` is captured and nullable. A `TRANSFERRED` origin can carry no
transfer date at all, and a whole year's movers can be undated, so size the
null share on your own cut before you date a move: page the enrollments census
with `programType=MAIN`, `academicYears` pinned to the year, and
`status=TRANSFERRED`, and count rows whose `transferDate` is null against
`pagination.total`.
Do not fall back to `modifiedAt`. It is restamped by every write, so it routinely sits after the transfer date it appears to mark: it dates the last touch, never the move.
Where a dispute needs the move dated and the row does not date it, this wire
has no further answer, and the question has a destination off it. The SIS
records audited staff and sync writes — the actor, the timestamp and the
changed fields — to an internal activity log, read on the student's History
tab in the staff surface by a staff grant, `students:history:view`, that
most registrar templates do not carry. Four limits travel with that answer,
and a reader who omits them has replaced one wrong answer with another: it
holds audited writes only, so a data repair run in SQL leaves no entry; it
does not reach back before enrollment audit events started being recorded on
this wire; on a campus move
it carries one transfer event on the destination enrollment rather than the origin
enrollment's own close; and its timestamp is when the move was recorded, not when
the family moved.

**Trap 6 — `WITHDRAWN` is not `TRANSFERRED`.** Unioning them as
"left last year" counts campus movers as leavers.

**Trap 7 — campus transfer looks like attrition at the origin.** A 2025
Jupiter `COMPLETED` or `TRANSFERRED` enrollment plus a 2026 Mars roster
enrollment is still at Alpha. Pin campus only when the question is
campus-level. Alpha-level "did they come back?" ignores origin
`campusId`.

The trap does not run the other way: a `TRANSFERRED` origin with no
active roster enrollment anywhere is not a campus move to discount, and this
wire does not say where that student went. Read the enrollment, not the origin
status.

Did not re-enroll, but had a completed enrollment, is a set difference
on `studentId`. Not a boolean pin.

1. Last-year completed MAIN, keeping only rows with a null
   `primaryEnrollmentId` — a non-null one is a finished exchange visit
   (Trap 18), and that exclusion holds however the base is widened (Trap 20):
   `GET /v1/enrollments?programType=MAIN&academicYears={lastYear}&status=COMPLETED`
2. Current-year MAIN roster:
   `GET /v1/enrollments?programType=MAIN&academicYears={thisYear}&status=PENDING_REVIEW,CONFIRMED,ENROLLED`
3. Keep last-year `studentId` values that do not appear in the
   current-year roster.

**Trap 8 — `RE_ENROLLING` is not "re-enrolled".** That status is an
intent marker sitting on the row's own year, not a roster enrollment. Do not
treat a `RE_ENROLLING` row as proof they came back, and do not use it as
the definition of "did not re-enroll".

**Trap 9 — summer `COMPLETED` is not a school-year completion.** Omit
`programType=MAIN` and summer-camp completions leak in.
Do not invent a boolean non-return flag. Page both lists and subtract
`studentId`.

**Trap 20 — a past-year roster status is residue, not a resolution.** An enrollment still in
`PENDING_REVIEW`, `CONFIRMED` or `ENROLLED` after its offering year ended was closed by
nobody. Two of the three change face on the wire and the third never does: a stored
`CONFIRMED` publishes `ENROLLED` once the offering has started, a stored `ENROLLED`
publishes `COMPLETED` once it has ended, and `PENDING_REVIEW` matches no branch of the
read-time status in any program type, so it publishes `PENDING_REVIEW` for as long as the
row exists. These rows are neither completions nor withdrawals. Read them as their own
class:

- Pin the year. A read with no `academicYears` adds them to this year's roster count.
- A "did last year's students return" walk keyed on `COMPLETED` alone drops them, and they
  held an enrollment. Take last year's students as
  `status=PENDING_REVIEW,CONFIRMED,ENROLLED,COMPLETED` — leavers are a separate question
  (WITHDRAWN vs TRANSFERRED above) — or name the statuses your number leaves out.
- Real leftover past-year enrollments are stored `PENDING_REVIEW` or they already resolved to
  stored `COMPLETED`. When staff close the year on a leftover `PENDING_REVIEW` enrollment, the
  intended outcome is stored `COMPLETED`. There is no stored `PENDING_REVIEW` → `COMPLETED`
  publish rule; only stored `ENROLLED` publishes `COMPLETED` once the offering has ended.
  Staff record stored `COMPLETED` on that write path. Until then the row stays
  `PENDING_REVIEW` on both filter and published field.
- What the wire does NOT say is whether a past-year `PENDING_REVIEW` is a held enrollment or an
  application nobody adjudicated. Nothing on the row separates them; do not report either.

Size it on your own cut:
`GET /v1/enrollments?programType=MAIN&academicYears={pastYear}&status=PENDING_REVIEW,CONFIRMED,ENROLLED`
→ `pagination.total`. It shrinks as staff close rows; do not carry a prior figure.

## Physical vs online: campuses.delivery_mode

Captured on `campuses.delivery_mode`. Closed set:

- `PHYSICAL` — a brick-and-mortar Alpha school.
- `ONLINE` — remote. Seeded ONLINE names include Alpha Anywhere
  (Homeschool), GT Anywhere, and Alpha Anywhere Sandbox.

`deliveryMode` is operator-entered: necessary but not sufficient.

A "physical schools" population question is two pins on the census, not a
name filter:

1. `GET /v1/campuses` first, to see the estate and each campus's
   `deliveryMode`. Keep Alpha Anywhere Center — it is a real PHYSICAL
   campus; filter on deliveryMode and campus id, never on the word
   "Anywhere" — and SAY in the answer that Alpha Anywhere Center is
   included despite its name.
2. `deliveryMode` is a query pin on `GET /v1/enrollments`: pin
   `deliveryMode=PHYSICAL` on the wire rather than filtering campus names
   client-side, together with `programType=MAIN`, `academicYears={year}`
   and `status=PENDING_REVIEW,CONFIRMED,ENROLLED`. Without
   `programType=MAIN` a campus's summer camp is in the count — say the
   figure is MAIN only and that summer enrollments are excluded.
3. Fixture campuses are PHYSICAL and their students are often not flagged as test: drop E2e, Sandbox and test campuses by name, and name those you dropped.

**Trap 2 — Alpha Anywhere Center is a real SIS PHYSICAL campus.** GT Anywhere
and Alpha Anywhere (Homeschool) are ONLINE and were historically absent from
this SIS. Do not drop Alpha Anywhere Center when filtering "physical". Do not
treat every campus with "Anywhere" in the name as virtual.

**Trap 3 — `GET /v1/campuses` now returns `deliveryMode`.** Filter
physical vs online from that field. Name matching ("Anywhere") is the
failure mode that drops Alpha Anywhere Center.

`brands` is **not** modality — see the hierarchy section below for
what it is. A brand carries theming attributes (colors, fonts, logo
keys) as well, but reading it as a theming table is what leaves a
consumer unable to parent a campus.

## Organizational hierarchy: brands are the district level

**This SIS has exactly two org levels, and `brands` is the upper one.**

- **Brand = district.** The parent. `brands` was originally added for
  theming, and its color/font/logo columns are still there, but it is
  the hierarchy: it is the only thing on this wire that says which
  district a campus belongs to.
- **Campus = school.** The leaf. **Every campus is a School** — there is
  no campus-under-campus nesting and no campus type that means
  "district". A campus record carries no parent of its own beyond its
  brand.

There is no third level. Do not look for a parent of a brand, a
sub-campus, or a region; two levels is the whole model.

Group campuses on `brand.id`. A district rollup places the null-brand
campuses explicitly and names its grouping key ("grouped on brand.id").
An unfiltered sum counts every brand's campuses. An Alpha count names
its filter: the Alpha physical pin or `brand.slug` `alpha-school`.
The two sets differ.

**Where the district-to-brand mapping lives.** What IS on this wire is which brand each campus sits under, and that is what groups schools into their district.

**Read it from `GET /v1/campuses`.** Each campus carries a `brand`
object: `{ id, name, slug }`, or `null`. Rebuild the hierarchy by
grouping campuses on `brand.id`:

- `brand.id` is the stable SIS brand UUID and is **the join key**.
- `brand.slug` is unique among live brands — a readable handle, still
  not the key.
- `brand.name` is **mutable display text.** Do not group or join on
  it. `brand.id` is the key, and that is why it is published.
- `brand` is `null` when the campus is unbranded or its brand has been
  deleted. It is never half-populated: a present `brand` always has all
  three of id, name and slug, so an absent `brand` means "no district
  known", never "district known but unnamed".

**Trap 11 — do not parent campuses by name.** Neither by campus name nor
by brand name. Both are editable free text; `campus.id` and `brand.id`
are the keys.

**Trap 17 — there is NO NUMERIC BRAND IDENTIFIER on this wire.**
Campuses publish `numericCampusId`; brands do **not** have a counterpart to
it. Do not synthesise one, and do not read the absence as a field that
merely has not shipped yet — those two readings lead to opposite decisions.

Whether brands SHOULD get one is an open question (educrm-tracker/1951);
this document does not answer it, and nothing here should be read as saying
a number will or will not arrive. What is settled is the constraint on
answering it yes, and that is durable:

- `campus_th_org_id_seq` was created with no `MAXVALUE`, so it runs to the
  bigint maximum. Campuses may take any integer from 500 upward, and **no
  range could be reserved for a second org type without capping the campus
  allocator first.**
- From 499 down, the values are inherited from the legacy
  `org_org.identifier` window, which that system allocates across school,
  district, department, local and national orgs alike — so "a number that
  does not clash with the campus ones" has no stable target there either.
- And they are not unique in any case: Trap 14 names the live collision.

If a uuid is inconvenient, `brand.slug` is the readable handle: it is
unique among live brands, which `numericCampusId` is **not** — see Trap 14.

The counts are NOT quoted here, because they move with the estate.
`docs/external-api/campus-identity-key.md` carries them with an as-of date,
and `pnpm script report-campus-identity-reconciliation` re-derives them as
a `brand identity` block.

## Campus identity: which key to join a legacy estate onto

**Join on `campus.id`**, the stable SIS campus UUID. For a migrated campus, `campus.id` is the same value as the legacy SIS `org_org.sourced_id`, because the migrator copies it. A campus created in this SIS has no legacy counterpart. A legacy miss means this SIS does not hold that campus. Checking it needs legacy SIS access, not a read on this wire; `docs/external-api/campus-identity-key.md` holds the method.

Campuses can share a street; keep each. A street is where students attend only on a `PHYSICAL` campus; online, it is an office. Blank does not mean no students.

`allExternalIds.finalsite` is the site opening FinalSite enrollment keys. **To TimeBack, join on the recorded TimeBack id.** SIS campuses and students usually carry one in their external ids: `allExternalIds.timeback` on `GET /v1/campuses` (the TimeBack organization id), `timeback_user_id` on `GET /v1/students` (below, with its fallback and the analytics exception). That is the link for TimeBack platform joins; TimeBack mints its own ids, so never join on `campus.id` or the campus name. A campus with no `timeback` entry has no recorded link yet, which tells you nothing about whether TimeBack holds it.

**`timeback_production` is TimeBack's platform store, with its own ids.** Join its organizations through the same external id, `allExternalIds.timeback`.

**Trap 12 — the legacy row carries TWO uuids and only one is the key.**
`org_org.sourced_id` is the key. `org_org.id` is the legacy Django primary
key, used over there only for foreign keys; it matches **no** campus
here. The two are indistinguishable by looking, so if you stored "the SIS
uuid" years ago, check which one you stored before concluding the join is
broken.

**Where the decoy can and cannot reach you.** The legacy SIS **API** never
serves `org_org.id`: `/api/v1/orgs` serializes `sourced_id` and looks orgs
up by it (`lookup_field = "sourced_id"`), and the Django pk is in no serialized field. So a uuid you pulled from that API **is** the
`sourced_id` — the decoy only reaches you through direct database access or
an import that went around the API.

**If you never stored it, recover it from the legacy `/orgs` feed** while that
feed is still up: each org carries `sourced_id` alongside `identifier` and
`name`, so you can re-key an existing estate once and then join here on the
uuid forever after.

**Recovering THROUGH `identifier` is not a lookup — it is a review.** The
number is not unique inside the legacy feed either, so a straight
identifier-to-`sourced_id` map silently picks a winner. Measured in that one
feed: `1` is Alpha Austin, Alpha Austin High School **and** Austin Preschool,
all three `active`; `6` is Brownsville Preschool and a retired
`Brownsvile Preschool`; `10` is Brownsville: Starbase and a retired
`Brownsville : Starbase`. Pull `identifier`, `name` and `status`
together, treat any number that returns more than one org as something a human
resolves by name, and prefer `status = active` — which disposes of the retired
twins but NOT of the Austin three, where all three are live and only the names
separate them.

This is still not a licence to join on `numericCampusId` across the two
systems (Trap 14). Both sides here are the legacy system's own rows, so the
number has not been REUSED underneath you, and visible ambiguity beats a
confident wrong row.

**Trap 13 — `migrated_to_new_sis` is a lower bound, not the predicate.** Orgs
it flags are here. More are here with the flag reading false, because
campuses also arrive by paths that never set it. Deciding what to join by
reading that flag drops part of the estate. Attempt the join for every org
and let a miss be a miss.

**Trap 14 — `numericCampusId` is not a join key.** It is published for
display and for reconciling against legacy reports. It fails **four** separate
ways and every one of them is silent:

- **Not unique.** `1` is Alpha Austin _and_ Alpha Austin High School — legacy
  K-8 / High-School pairs legitimately share one number, and the schema says so
  (`1802200000000_campus-th-org-id-sequence.sql`). Joining on it merges the two
  into one. Worse, a third legacy campus this SIS does not hold,
  `Austin Preschool` (also `1`, and still `active` over there), lands on
  BOTH of them at once.
- **Not universal.** Some campuses do not carry `numericCampusId`, so they vanish
  from the join rather than erroring. Count them on `GET /v1/campuses`.
- **Not stable.** A number freed by a **retired** campus gets reused, so
  legacy campuses this SIS has never held come back attached to a real,
  unrelated live school: retired `Alpha Phoenix` (20) lands on Alpha
  Scottsdale, retired `Austin: Esports Academy` (5) on NextGen Academy,
  retired `2hour Learning` (0) on Alpha Anywhere (Homeschool). Each returns a confident wrong row where the answer was "absent".
- **Not canonical.** Some campuses store it **zero-padded** — `028` where the
  legacy row holds `28`. A raw string comparison drops those with no
  collision, no error and nothing to notice. Normalize both sides before
  comparing anything.

The device asset-inventory system prefixes each site name with the same
number, zero-padded (`001 - Alpha Austin`), so campuses that share a number
share a site: not a device join key either.

Joining on that identifier produces a row count that is neither the input
count nor a subset of it, because collisions add rows while absences remove
them. A row count that looks plausible is the whole problem. Re-derive it
with `pnpm script report-campus-identity-reconciliation`.

The schema says the same thing. Uniqueness on `th_org_id` is enforced by a
PARTIAL index covering only values from 500 up — the range this SIS allocates
itself. Every legacy-inherited value below that is unconstrained, which is
where all the collisions are.

**Trap 15 — name matching is the unsafe fallback, and it is worse than it
looks.** Not a hypothetical: shared campuses are named differently in the
two systems today — `Alpha School Miami` here is `Alpha Miami`,
`Montessorium Cedar Park` is `Montessorium - Cedar Park`. A name join loses
part of the estate before any rename happens. And renames do happen. Under
name matching a rename splits the campus's roster across two records. Count
the mismatches with `pnpm script report-campus-identity-reconciliation`.

**Trap 16 — there is a SECOND campus list on this API, and its `id` is a
HubSpot id.** `POST /v1/jobs` accepts `kind: "listCampuses"`, reachable with
the same `campuses:read` grant, and `GET /v1/jobs/{id}` returns its result.
That result comes from the HubSpot admissions adapter, so each row's `id` is a
HubSpot `p_programs` **object id**, not the SIS UUID and not a campus join key.
Everything above applies to `GET /v1/campuses` only. A SIS campus `id` is a
UUID; a HubSpot program id is a short numeric string.

Same shape one level down: `externalIds.hubspot` on `GET /v1/campuses` carries the `hubspot_program` external-id row, a HubSpot program id the SIS holds as a claim, which `/v1/applications/stream` takes as its `campusId`. `allExternalIds.hubspot` is the recorded HubSpot `campus__c` name (text); `allExternalIds.hubspot_program` is the numeric Program id, the one `externalIds.hubspot` carries. A campus with no `externalIds.hubspot` has no HubSpot program id recorded; this wire does not require one. HubSpot serves only Alpha and sister schools; the SIS also holds other schools, such as partner schools, that never have a HubSpot program, so no `externalIds.hubspot` is expected for them. The stored label can differ from HubSpot's live option until a campus rename writes it; only a rename or the campus migration writes it. `GET /v1/applications` (`sis_list_applications`) takes the SIS UUID `id`, and accepts this id too.

## Test records

Captured: `students.isTest`. `includeTest` defaults to false on `GET /v1/enrollments`, `GET /v1/students/roster`, `GET /v1/applications`, `GET /v1/shadow-day-visits`, `GET /v1/shadow-day-feedback`, `GET /v1/path-to-yes`, and `GET /v1/guides/{guideId}/students`, so fixtures stay out of the page and of `pagination.total`. On every route that accepts `includeTest`, explicit `includeTest=true` requires `students:test:view` and returns HTTP 403 without it. `GET /v1/students` takes no `includeTest`: a key holding `students:test:view` gets test students in the page and `pagination.total`, with `isTest` on every row; other keys never. Drop them by filtering on `isTest`. Every enrollment census row carries `isTest`: true for a test student's enrollment and false for a real student's enrollment. `testAccountKind` (`shadow_day`/`general`) exists. `deviceProvisioned`, `deviceCount`, `devices[]` and `deviceCacheRefreshedAt` (last successful run, same on every row) are a daily 05:00 UTC shadow-day copy from the device-tracking system, matched on email local part. Empty `devices[]` means that run found no checkout only for a shadow-day test student existing then, whose device-tracking email contains `shadow`. The fields do not say which enrolled student holds a device. `GET /v1/tech-stack` (`sis_get_tech_stack`) returns the student's current-campus configuration, not a device read.
`POST /v1/students/onboard` can set `testAccountKind` on a test student. An omitted kind is left unset on create and unchanged on a recognized student.

Primary test-campus rule: `brand.slug` is `test`. Backup name signals are `Sandbox`, `_test_`, and `E2e*` — name contains `Sandbox`, `_test_`,
or `E2e*`. Re-derive from `GET /v1/campuses`. They are not operating
campuses. The same rows exist on `GET /v1/enrollments`.

**Trap 10 — drop test campuses, not keep.** "Alpha physical" means
`deliveryMode = PHYSICAL` and campusName starts with Alpha, minus test
campuses. `deliveryMode` is
operator-entered; this pin is necessary but not sufficient. Re-derive from
`GET /v1/campuses`: keep Alpha Anywhere Center (PHYSICAL). Drop test campuses (rule above) from an Alpha-physical count.

Starts with Alpha is the pin for schools named Alpha. It is not the whole
SIS. Physical non-Alpha schools exist too. Examples, not a closed list:
NextGen Academy, GT School, Nova Academy Austin, Waypoint Academy, Texas Sports Academy — ask for those campuses by name.
Ask by the exact `name` on `GET /v1/campuses`. A substring
(`Nova Academy`) is ambiguous. Derive the rest: `deliveryMode = PHYSICAL`,
name does not start with `Alpha`, minus test campuses.
PHYSICAL alone is required too: Alpha Anywhere
(Homeschool) starts with Alpha and is ONLINE.

## Student identity and existence

**To TimeBack, join a student on the `externalIds` entry with type `timeback_user_id` first**, which `GET /v1/students` serves: the TimeBack platform (OneRoster) user `sourcedId`, the `timeback_production` user id, not an EduBridge analytics student id. It is absent until TimeBack has created the user. A student with no `timeback_user_id` is not yet linked to TimeBack, or is outside the reading key's scope. TimeBack mints its own ids, so the student `id` is not a TimeBack id. Only when it is absent, fall back to `studentId` (TimeBack's `legacyStudentId`) below.

**Trap 19 — absence is not nonexistence.** `GET /v1/students` answers
"who holds a roster enrollment right now" when `status` is omitted.
status filters on the current enrollment; use ALL to look a student up.
`email=` and `search=` apply the same gate. A named status matches the
current enrollment, not any seat. ALL also returns a child with no current
enrollment (a lead, a shadow-day applicant, an application-only record, or an ON_HOLD-only seat)
for a key that can already `GET /v1/students/{id}`. A caller who needs a
seat in status X uses `GET /v1/enrollments?status=X`. An omitted `status`
on `GET /v1/students` still means no current roster enrollment. Absence on
that call is not proof the SIS has no record.
Lookup: `GET /v1/students/lookup`.

Does the SIS know this child? On `canonical:read`, `GET /v1/canonical/users`
answers it at population scale: every student, parent and staff record in
every state, and absence on that route means absence. Its `status` splits
what a deleted flag conflates: `merged` — the record lost a merge and
`merged_into` names the live record that absorbed it, so the child exists
under that id — from `deleted`, removed as invalid with no survivor. Test
records carry `real: false` rather than being filtered out. A key without
`canonical:read` gets `403 {"message": "Missing permission: canonical:read"}`
on that route.

The roster reads answer a narrower question — which enrollments a child holds.
`GET /v1/students/roster?status=ALL` is every student holding any
enrollment in any year; `GET /v1/enrollments` with no `status` pin, or
`status=ALL`, is every enrollment. `ALL` combined with a named status is
rejected. A key without `canonical:read` reads a miss on both as no live enrollment in your campus scope, not that the child was never known. It still hides a child with no live enrollment row, a
soft-deleted or merged-away record, a child whose only enrollments sit outside
a scoped key's campuses, and a parent or staff person. A reader who holds
the SIS `id` can call `GET /v1/students/{id}` on `students:read`: `200`
for a live record with no enrollment, `404` when no live row exists, and on a
campus-scoped key `403` when the record holds no in-scope enrollment —
which separates "holds a record, holds no enrollment" from "no live row" but
no further, because `404` still conflates never-known with soft-deleted
and merged-away, and a name or email search leaves no id to try. Report
the double miss as no enrollment on this wire, not as the SIS has no record of
this child.

**Email is not a student join key.** Emails on this estate carry variants (`.1` suffixes, domain swaps across `alpha.school` / `2hourlearning.com` / `gt.school`, misspellings), change on merges, and stay unchanged on the other system after they change here — an
exact-email join against a neighbouring estate measurably loses between
one real match in eight and one in four. The roster row publishes the
keys to use instead: `studentId`
is the numeric Alpha id (the same value TimeBack accounts carry as
`legacyStudentId`), `originalEmail` holds the pre-change address, and
`dateOfBirth` is the tie-breaker. Against legacy or other estates, join on `studentId` first, fall back
to name plus `dateOfBirth`, and use email only to generate candidates —
never to conclude a child is absent.

## Incremental reads: what `updatedSince` selects

Every SIS-backed collection on this wire takes `updatedSince`: `GET /v1/students`, `GET /v1/students/roster`,
`GET /v1/enrollments`, `GET /v1/campuses`, `GET /v1/guardians` in its
collection mode, `GET /v1/academic-years`, `GET /v1/guides`, `GET /v1/staff`,
`GET /v1/guides/{guideId}/students`, and `GET /v1/applications`.

A "what changed since X" question runs on the wire, then names its blind
spots:

1. Both `GET /v1/enrollments` and `GET /v1/students/roster` take
   `updatedSince`: enrollments for enrollment-grain changes, the roster for
   student-grain ones.
2. Departures are absences, never rows: a student who leaves the cohort
   stops appearing in a filtered window, so a delta needs a second pass
   over `WITHDRAWN`, `TRANSFERRED` and `COMPLETED` with the same window.
3. `students.modified_at` is restamped by every write, including a
   scheduled sync that changes nothing — treat the window as candidates
   and diff payloads rather than trusting the timestamp.

`/v1/families/{id}` (`sis_get_family`) is a keyed read of one family and does NOT take it.
`/v1/marketing-events` (`sis_list_marketing_events`) cannot: it is served out of HubSpot, not
from a `modified_at` this platform writes. `/v1/jobs` and `/v1/webhook-subscriptions` are infrastructure,
not rostering data, and do NOT take it either.

**One meaning, on every route that serves it.** `updatedSince` is
inclusive (`>=`) and takes an ISO 8601 instant with an offset; a value
with no offset is a 400 on every one of them. It is additive — omit it and
a route returns exactly what it returned before, and a cutoff older than
every record returns the whole collection. Routes differ only in the PROBE SET: which related rows count as a
change to the record.

**The rule that decides a probe set.** A record enters the delta when the
change touched its own row; a row it OWNS whose values that response
projects (its external ids, its duplicate enrollments); or a row that decides
whether it is in your scope at all (a guardian's student links). A record
does NOT enter the delta when the change touched a row merely JOINED FOR
DISPLAY — an enrollment's `campusName` comes from `campuses`, and
`GET /v1/campuses?updatedSince=` is the surface that reports a campus
change. Probing it on both would put a campus's whole roster in the delta for a
typo fix in its name. The single exception is a
joined parent with no collection of its own: `brands` IS probed by
`GET /v1/campuses`, because there is no `GET /v1/brands` and nothing else
would ever report a district rename.

Per collection, then:

- `GET /v1/enrollments` — the enrollment row, every OTHER enrollment of
  the same student including soft-deleted ones, the
  `enrollment_external_ids` rows behind `externalIds`, and the
  `program_offerings` and `programs` rows of each of that student's LIVE
  enrollments. Student-keyed, not
  row-keyed: this list collapses same-stint rows and ranks
  them by status, so a filter that admits one twin and not the other
  would change the winner. Two consequences to
  size a window against: touching one of a student's enrollments returns all of
  them, and editing an offering or programme returns every enrollment of every
  student who holds a live enrollment on that offering — their enrollments on
  OTHER offerings included, not only the enrollments on it.
  Only `campusName` and `deliveryMode` are unprobed, and
  `GET /v1/campuses?updatedSince=` is the collection that reports those.
  The offering and programme ARE probed: they have no collection of their
  own on this wire, and `academicYear`, `offeringStartDate` and
  `programType` come from them — as does `status`. Census `status` on
  `GET /v1/enrollments` is computed by the `enrollment_computed_status`
  SQL function from the stored status, the offering dates and today.

  **Trap — `status` moves on the calendar with no write behind it.** The
  flip itself restamps nothing. A `CONFIRMED` enrollment with a non-null
  `enrolledDate` reads `ENROLLED` when `enrolledDate` is on or before
  the offering's first day, and still `CONFIRMED` when `enrolledDate`
  is after it. The trigger is `enrolledDate`, not the first day, so an
  early enroll already reads `ENROLLED` before first day. A `CONFIRMED`
  enrollment with a null `enrolledDate` becomes `ENROLLED` on the first day.
  An enrollment in `ENROLLED` becomes `COMPLETED` once the offering ends.

  The daily 06:00 UTC reconciliation persists those flips and restamps
  `modified_at`, so they reach an `updatedSince` consumer up to a day
  late rather than never. A census-only key does not need the offering
  end date to see the flip. A reader who needs the date sooner calls
  `GET /v1/program-offerings/{id}`, which requires `campuses:read`. `GET /v1/students` drifts the same way.

  Paging is stable where it matters: the order is `created_at DESC, id ASC`, and nothing
  writes `enrollments.created_at` after the insert, so an edit landing
  mid-walk does not move a row between pages — unlike `GET /v1/students`,
  whose leading sort key is a status band that concurrent writes DO move. It
  is still offset-paged, so a row ENTERING or LEAVING the window mid-walk
  shifts every later page boundary; page until
  `page > pagination.totalPages` and make the consumer idempotent.

- `GET /v1/campuses` — the campus row, its `campus_external_ids` rows
  (behind `externalIds` and `allExternalIds`; `externalIds.hubspot`
  carries the `hubspot_program` id), and its brand,
  including the brand being soft-deleted, which flips `brand` to `null`.
  Unpaginated, so a filtered read is one response.
- `GET /v1/guardians` (collection mode) — the guardian row and that
  guardian's external ids, which together are what this endpoint
  publishes, plus the two things that decide SCOPE rather
  than payload: that guardian's student links, and, for a scoped key, the
  `enrollments` of those students. A campus-scoped key reaches a guardian
  only through a student enrolled at its campus, so BOTH can move a
  guardian into your collection with nothing on the guardian row touched —
  a new link, or a family that already had a link and re-enrolled, which
  writes an enrollment and no link row. The OFFERING of those live
  enrollments is probed too, because scope is the COMPUTED status and that
  reads the offering dates: extending an offering's `end_date` past today
  moves an enrollment back into the non-terminal set, and the guardian back into
  your collection, with no write on the enrollment at all. The PROGRAMME is
  NOT probed here: `enrollment_computed_status` takes nothing from it and
  this response publishes no `programType`. The enrollment leg is scoped-key
  only: an unscoped key already sees every guardian. `guardian_external_ids` ARE probed,
  because this response now publishes them — a sync writing a binding
  moves no guardian row.
- `GET /v1/academic-years` — `created_at`, not a `modified_at`: the table
  has no such column and a row is only ever created. It answers only
  "which years were added since my cutoff".
- `GET /v1/guides` — the guide row, every one of its campus postings
  INCLUDING a soft-deleted one, and every one of its assignments including a
  soft-deleted one. Create, end or unassign moves the guide's watermark, and
  `assignedStudentCount` and `modifiedAt` are the only fields that move. This collection answers WHICH guides moved; for WHAT changed, ask
  the guide-grained read —
  `GET /v1/guides/{guideId}/students?updatedSince=` returns only the
  assignment rows that changed, ended ones included, without re-reading the list. It needs `guides:read`, not
  `students:read`. Three traps. `status` defaults to `ACTIVE`, so a guide deactivated inside your window LEAVES the delta instead of arriving in it — pass
  `status=ACTIVE,INACTIVE` to see a deactivation. `limit` defaults to 20
  and caps at 100. And the order is `lastName`, `firstName`, `id`, so a name
  edit moves a row between pages mid-walk the way `GET /v1/students` does;
  page until `page > pagination.totalPages`. For a campus-scoped key the
  posting probe decides SCOPE as well as payload: a posting soft-deleted
  inside your window still admits the guide, so a guide who left your campus
  arrives as a row whose `campuses` array no longer lists it — the one
  departure on this wire that is a row rather than an absence. A deleted
  guide is an absence here; it arrives as `guide.deleted`.
- `GET /v1/staff` — person-grained across `guides`, `users` (including a
  guide's login row), `guide_postings`, and `user_campus_scopes`. Only
  changes to roles visible in the caller's campus scope select a person;
  activity on an out-of-scope role does not leak into the window. A staff
  member who leaves the caller's campus is an absence, not a tombstone row,
  so periodic full reconciliation remains necessary.
- `GET /v1/guides/{guideId}/students` — the guide assignment row only.
  Enrollment, offering, campus, and student rows shape or filter the response
  but are joined for display and are not probed. A delta includes an assignment
  ended inside the window even though `activeOnly` defaults to true; a full read
  with no cutoff keeps that default and returns open assignments only.
- `GET /v1/applications` (`sis_list_applications`) — inside `year`: the row, FinalSite
  deposit reading, student, `externalIds` and shadow visits (removals included), offering,
  programme; not `campusName`.
- `GET /v1/students` and `GET /v1/students/roster` — unchanged, and set
  out below.

`GET /v1/students/roster` is the student-grained incremental surface. It needs
`students:read`, and each `include=` expansion needs its own grant on top.
By default `GET /v1/students/roster` and `sis_list_student_roster` return only
students who have at least one enrollment record, in any status. A student with
only an application, or with no enrollment record at all, is not returned at
any `updatedSince`. The one exception is `shadow=include` or `shadow=only`,
which also returns High School shadow-day students whose only link is an
application with a shadow-day visit.
`limit` defaults to 100 and caps at 1000, the same bulk
ceiling the census list takes — EXCEPT with `include=contacts`, which clamps
it to 500, and with `include=photos`, which clamps
it to 200. The request is not rejected:
the page is served at the lower limit and `pagination.limit` reports it, so
page by `pagination.totalPages` rather than by the limit you asked for.
With both, the lower applies.
`status` defaults to the roster cohort (ENROLLED, CONFIRMED,
PENDING_REVIEW) and is overridable. `includeTest` defaults to `false` (see
**Test records**).

On the two student-grained routes it is not a filter on one column: it
matches when the student row or one of a set of linked rows carries a
`modified_at` at or after that instant, and the set differs between the
two of them.

- `GET /v1/students` — the student row, plus enrollments, applications,
  guide assignments, demographics, assessments, household membership,
  guardian relationships, and the external-id rows of students,
  applications, enrollments and guardians. Medical is never probed here.
- `GET /v1/students/roster` — the student row, plus enrollments including
  an enrollment's soft-delete, always. Household, contacts, guides, consents, photos, accommodations and medical are probed only when you request the matching `include=` (or filter on `hasMedical`) and the key holds that grant. Shapes, grants and whose
  they are live under **The nine roster `include=` expansions**, not in
  this delta rule. External-id rows are not probed here at all.

**Trap — the delta you get depends on which route you asked.** Binding a
`hubspot_deal_id` to an enrollment puts that student in the `GET /v1/students`
delta and not in the roster delta. A medical edit does the opposite: it
enters the roster delta when you asked for medical, and never enters the
`GET /v1/students` delta.

**A timestamp inside your window is not evidence a value changed.**
`students.modified_at` is stamped `NOW()` by every write, with no
comparison against the value already stored, and a scheduled inbound sync
rewrites each student it matches on every run. Rows restamped with
identical values are normal. Size the window
on your own cut and diff the payloads yourself. Do not carry a prior
figure.

**Trap — departures are absences, never rows.** Both routes return only
students in the cohort their `status` selects. A student who leaves it
stops appearing, and nothing marks them as changed. A soft-deleted student
is returned by neither route at any `updatedSince`. `GET /v1/students`
by default pins the three roster statuses; a named status or ALL widens it,
matched on the current enrollment. On `GET /v1/students/roster`, `status`
is a caller parameter: a second pass over the terminal statuses is the
served way to see who left.

**Trap — the `GET /v1/students` cohort moves with the calendar.** That
route matches on the read-time promoted status, computed against today's
date, so an enrollment can leave the cohort as a date passes with no row written
anywhere — and therefore nothing in any delta.
`GET /v1/students/roster` filters the stored status and does not drift
this way.

Paging a window: `GET /v1/students/roster` orders by `id`, a total order
that no write moves, so an edit landing mid-walk does not reshuffle the
pages you have already read. `GET /v1/students` orders by an
enrollment-status band, then name, then `id`; the first two move under
concurrent writes, so a walk there can reshuffle under you. Both are offset-paged, so a student who joins or leaves mid-walk shifts every later page boundary. Page until `page > pagination.totalPages`, start the
next window behind your last run rather than trusting a watermark, and
make the consumer idempotent.

## Off-roster students: `GET /v1/students/off-roster`

No `updatedSince` or `status`. Needs a key with no campus restriction (else 403): state is computed
across every campus before `campusId` filters. Roster rows plus `offRoster`; fields in the OpenAPI text.

Listed: no enrollment whose status is live (anything but `WITHDRAWN`, `COMPLETED`, `TRANSFERRED`,
`CANCELLED`, `EXCHANGE`) on an unended offering, and no open application. Not the roster complement:
current `ON_HOLD` or `PENDING_DEPOSIT` students are not listed. `offRosterAt` can be future and is unordered
against `lastEnrollmentEndedAt`; `offRosterSince` is inclusive, `offRosterBefore` exclusive, and undated students
appear only unfiltered.

Offboarding: `offRosterBefore=today-N`, keep rows whose `lastEnrollmentEndedAt` is also before it, skip a
`latestEnrollmentCreatedAt` after your last run, and send non-empty `staleActiveEnrollmentIds` to review.

## Sizing a full pass

Eight collections accept a `limit` of 1000:
`GET /v1/students`, `GET /v1/students/roster`, `GET /v1/enrollments`,
`GET /v1/applications`, `GET /v1/staff`, `GET /v1/shadow-day-visits`,
`GET /v1/shadow-day-feedback` and `GET /v1/path-to-yes`. A pass costs `ceil(pagination.total / limit)`
requests. Other collections state their own cap
— most cap `limit` at 100, `GET /v1/guardians` at 500.

SIX of the eight are safe to walk in full under concurrent writes:
`GET /v1/students/roster` (by `id`), `GET /v1/enrollments`, default-sorted
`GET /v1/applications` (by `created_at`, `id`), `GET /v1/shadow-day-visits` with
`sortBy=id` (by `id`), `GET /v1/shadow-day-feedback` (by visit id, then when the filing was started) and
`GET /v1/path-to-yes` (by visit id).
Those keys are immutable, so an edit landing mid-walk does not reshuffle the pages already
read.

`GET /v1/students` is NOT one of them. It orders by a mutable status band then name, so an offset-paged walk repeats or skips rows silently. Use the
larger page for FILTERED reads on that route, and
`GET /v1/students/roster` for a full student pass.

`GET /v1/staff` is not one of them either, for the same reason: it orders by `personKey`, which is the LOWERCASED
EMAIL, and an email change moves the row exactly as a status change moves
one on `GET /v1/students`. Use its `updatedSince` window for incremental reads and still page it in full periodically, matching rows on `staffMemberId` when set, then `roles[].recordId`, not on position or `personKey`. A row with `roles: []` (staff with no login
and no guide record) has no `recordId`; match it on `staffMemberId`.
`recordId` survives an email change but not a delete and recreate, so fall back to the email.

Change webhooks do not retire the periodic full pass: deletions are
absences, and only a full pass reconciles them.

The limits that apply, so the pass can be sized rather than guessed at:

- **100 requests per second,
  burst 200.** Over that, the gateway
  returns 429; retry with exponential backoff. The rate is applied twice —
  once per API key, and once across all clients of the API — so one key can reach it while the API is otherwise idle.
- **A request is abandoned after
  29 seconds** and the gateway
  returns 504. Retry a 504 with backoff; if it repeats, drop `include=` expansions or halve `limit`.
- **A page whose response exceeds 6 MB fails as 502, not 504**, and retrying does not recover it; the same two inputs do.
  `GET /v1/students/roster` with `include=photos` clamps `limit` to
  200 for exactly this reason: it carries
  a presigned URL for every photo in every returned student's library, and
  the library is unbounded, so a full 1000-row page
  of it would cross the ceiling. `include=contacts` clamps it to
  500 because contacts are unbounded per student and push a page with the
  other expansions over it.

## HubSpot deal bindings

`PUT /v1/enrollments/{id}/hubspot-deal` and
`DELETE /v1/enrollments/{id}/hubspot-deal` bind and clear the
`hubspot_deal_id` on one enrollment. They are write routes requiring
`enrollments:write`, and they never write to HubSpot. A census read never
calls them. They are named for the cardinality they enforce, a database invariant that holds however the row arrived:

- at most one live enrollment holds a given `hubspot_deal_id`;
- at most one live `hubspot_deal_id` per enrollment.

So a roster-to-HubSpot join on that type matches at most one row on each
side among live enrollments: the risk on that join is the entries that are
missing, not fan-out. A rebind is refused with 409 while another
enrollment still holds the deal, including a deleted enrollment whose
binding was never retired. A binding can be retired and rebound, so a deal
seen on one enrollment can later sit on another. It dates the claim; it
does not establish an equivalence.

An exception-list question ("which roster enrollments have no HubSpot deal /
no FinalSite record linked?") IS served on this wire — do not route it
away as a multi-system question. The claims live on each census row's
`externalIds`:

1. Page `GET /v1/enrollments?programType=MAIN&academicYears={year}&status=PENDING_REVIEW,CONFIRMED,ENROLLED`.
2. Keep the rows whose `externalIds` carry no entry of the claim type —
   that list of enrollments is the worklist. No HubSpot or FinalSite lookup is needed; a missing linked id is what the question asks for. (Whether a record exists unlinked in the OTHER system is the
   half this wire cannot see — disclose that, don't refuse over it.)
3. `externalIds` is sparse on the roster, so size the coverage: count
   rows carrying the claim type against `pagination.total`, and report
   that share with the worklist. Do not carry a prior fill rate.

Applications form: page `GET /v1/applications?year={year}&programType=MAIN`; keep rows whose `externalIds` carry no `hubspot_deal_id`. A stored id is the row's claim; whether HubSpot has since merged or deleted that deal is outside this wire.

## The same pins on the MCP wire

Every route in this section is also an MCP tool on `POST /dss/mcp`
(`sis_list_enrollments`, `sis_list_campuses`, `sis_list_student_roster`,
and so on; the front's `how.native.mcp.tools` lists them). Same key, same
campus scope, same permissions, same rows. The pins are the same names
passed as tool arguments, and the wire accepts
all three spellings of a multi-value filter: **a JSON array, a single
value, or the comma-joined string the REST examples show.**
`"status": ["CONFIRMED","ENROLLED"]`, `"status": "CONFIRMED,ENROLLED"` and
`"programType": "MAIN"` all reach the route as the same list. The
array-valued pins are `programType`, `academicYears`, `deliveryMode`,
`campusId` and `status` on `sis_list_enrollments`; `status`, `include`
and `programType` on `sis_list_student_roster`, which takes `academicYear` or `academicYears` (with both, the union); `guideType`, `status` and `levelId` on
`sis_list_guides`; `assignmentType` and `status` on
`sis_list_guide_students`; `campusId`, `academicYear`, `gradeLevel`, `guideId`, `status`,
`applicationId` and `studentId` on `sis_list_shadow_day_visits`; `campusId`, `academicYear` and
`visitId` on `sis_list_shadow_day_feedback`. A pin that is NOT array-valued does not widen
this way: `campusId` on `sis_list_student_roster` is one id, and a
one-element array is refused. **`sis_list_staff` carries no array-valued
query pin**; its `includeInactive` takes the string `"true"` / `"false"`
as on the route, or a JSON `true` / `false`, and so does `includeTest` on
the roster, both guide tools and both shadow day lists.

The census composition written here as
`GET /v1/enrollments?programType=MAIN&academicYears=2026-27&status=PENDING_REVIEW,CONFIRMED,ENROLLED`
is, on the tool —
MCP: `sis_list_enrollments` with

```json
{
  "programType": ["MAIN"],
  "academicYears": ["2026-27"],
  "status": ["PENDING_REVIEW", "CONFIRMED", "ENROLLED"],
  "limit": 1000,
  "useCase": "school-year roster census",
  "intent": "count MAIN enrollments on the 2026-27 roster"
}
```

That form returns rows. For a number or breakdown, call
`sis_query` with grain `enrollment`, the same pins as `cohort`, `"mode": "group_by"` and
`"groupBy": ["campusId"]`; `deliveryMode` goes in `filters`, not `cohort`, which takes only `academicYears`, `programTypes` and `statuses`; grain `student` counts students (group by `cohort.campusId` at grain student). Same key and scope; person fields refused. The `group_by` `count` is distinct grain rows: a student at two campuses counts once in a `student` total, per campus in a breakdown. `enrollment` and `sis_count` count enrollments; `distinctField` `studentId` counts students once. `sis_count` pages a list tool for breakdowns `sis_query` lacks. `sis_query` takes at most 5 years, 3 `groupBy` fields and 50 list rows. A campus goes in `filters` as `{"fieldId": <campus field>, "operator": "EQUALS", "value": <campus id>}`, never inside `cohort`; the field is `campusId` at grains enrollment and application, `cohort.campusId` at student, `enrolledAtCampusId` at household. Each `sis_query` answer echoes its reach in `resolved`:
`campusScope` is `"all"` on an all-campus key, else `{"campusIds": [...]}`, the campuses
counted; `includeTest` says whether test students counted. A campus filter outside
that scope is refused, so a zero is never scope on a named campus.

### The per-collection delta forms

Every SIS-backed collection takes `updatedSince` at its own grain
(ENABLEMENT, incremental composition). On REST:
`GET /v1/enrollments?updatedSince={lastRunStart}&limit=1000`,
`GET /v1/campuses?updatedSince={lastRunStart}`,
`GET /v1/guardians?updatedSince={lastRunStart}&limit=500`,
`GET /v1/academic-years?updatedSince={lastRunStart}`,
`GET /v1/guides?updatedSince={lastRunStart}&status=ACTIVE,INACTIVE&limit=100`,
`GET /v1/staff?updatedSince={lastRunStart}&includeInactive=true`,
`GET /v1/applications?year={year}&updatedSince={lastRunStart}`
and `GET /v1/guides/{guideId}/students?updatedSince={lastRunStart}`, whose
`{guideId}` you discover from the guides delta above it.

On the tools, each its own call with its own `useCase` and `intent` — none
is a delta on another:

MCP: `sis_list_enrollments` with `{"updatedSince": "{lastRunStart}",
"limit": 1000, "page": 1, "useCase": "nightly sync",
"intent": "enrollment rows changed since the last run"}`.
MCP: `sis_list_campuses` with `{"updatedSince": "{lastRunStart}",
"useCase": "nightly sync", "intent": "campus rows changed since the last run"}`.
MCP: `sis_list_guardians` with `{"updatedSince": "{lastRunStart}",
"limit": 500, "page": 1, "useCase": "nightly sync",
"intent": "guardian rows changed since the last run"}`.
MCP: `sis_list_academic_years` with `{"updatedSince": "{lastRunStart}",
"useCase": "nightly sync", "intent": "academic-year rows changed since the run"}`.
MCP: `sis_list_guides` with `{"updatedSince": "{lastRunStart}",
"status": ["ACTIVE", "INACTIVE"], "limit": 100, "page": 1,
"useCase": "nightly sync", "intent": "guide rows changed since the last run"}`.
MCP: `sis_list_staff` with `{"updatedSince": "{lastRunStart}",
"includeInactive": "true", "limit": 100, "page": 1,
"useCase": "nightly sync", "intent": "staff rows changed since the last run"}`.

The guides call needs `guides:read`, defaults to `status=ACTIVE` so a
deactivation never arrives unless you pass `status=ACTIVE,INACTIVE`, and
caps `limit` at 100. Staff defaults `includeInactive=false`, so an
inactivated person never arrives unless you pass `includeInactive=true`. A
guide assignment created, ended or unassigned moves `GET /v1/guides`, which
names the guide; the assignment rows themselves come from the per-guide call
listed above, and no other collection reports it.

MCP: `sis_list_guide_students` with `{"guideId": "{guideId}",
"updatedSince": "{lastRunStart}", "limit": 100, "page": 1,
"useCase": "nightly sync", "intent": "assignment rows changed on this guide"}`.

The canonical view takes `updatedSince` too, on `canonical:read`, and is
REST-only — no MCP tool:
`GET /v1/canonical/users?updatedSince={lastRunStart}&limit=1000`, and the
same for `/schools` and `/enrollments`. **Its deltas carry merged and
deleted records as ROWS**, not absences.

An unfiltered `GET /v1/marketing-events` is a 400: pass at least one of
`programInterest`, `programName`, or `startDate`. `startDate` and `endDate`
are Unix epoch milliseconds, and a value more than 24 months ahead is
refused.

**Trap 22 — a refused argument is a wrong VALUE, never a filter to
drop.** A tool that refuses an argument names it and says what it
expected. Dropping the pin returns every status and every year: the
wrong roster, with no error. A refusal means the value is wrong
(`"status": "NOPE"`, a one-element array on a scalar pin). Correct the value and keep
the pin. Scalars (`page`, `limit`, `studentId`, `priorSchoolYears`,
`updatedSince`) stay scalars. `useCase` and `intent` are required on every
data tool; they are recorded with the call and filter nothing.

## Shadow days

Eight reads, all `GET`, all on `shadow_days:view` and nothing else:
`GET /v1/shadow-day-visits`, `GET /v1/shadow-day-visits/{visitId}`,
`GET /v1/shadow-day-visits/{visitId}/feedback`, `GET /v1/shadow-day-feedback`,
`GET /v1/shadow-day-feedback-templates/{templateId}`, `GET /v1/path-to-yes`,
`GET /v1/shadow-day-visits/{visitId}/path-to-yes` and `GET /v1/path-to-yes-templates/{templateId}`. They read SIS records, the rows behind
the Shadow Days page, as does `shadowDay` on `/v1/applications/stream` and `/batch`. On the MCP six of them are
`sis_list_shadow_day_visits`, `sis_get_shadow_day_visit`, `sis_list_shadow_day_visit_feedback`,
`sis_list_shadow_day_feedback`, `sis_list_path_to_yes` and `sis_get_shadow_day_visit_path_to_yes`; the two template routes are REST-only. `sis_count` counts and breaks down
`sis_list_shadow_day_visits`, `sis_list_shadow_day_feedback` and `sis_list_path_to_yes` (`groupBy`, `distinctField`),
and walks the visits in `id` order whatever `sortBy` you pass. One filtered total is also
`pagination.total` on any of those lists. One visit's feedback has no population to count.

**Two ids share one path segment.** The visit `id` and `{visitId}` are SIS visit ids. The
scheduling POSTs (`POST /v1/shadow-day-visits` and `POST /v1/shadow-day-visits/{id}/reschedule|accept|recommendation|decline`)
take an application id or HubSpot deal id, and a visit id from these reads is not accepted by
them. The visit writes and candidate lists take a visit id. `studentId` is the SIS student UUID,
the one `GET /v1/applications` serves. `alphaStudentId` is the numeric Alpha id, which
`GET /v1/students/roster` calls `studentId`.

**Writes.** Five writes and two candidate lists take a visit id and need `shadow_days:write`:
`PUT /v1/shadow-day-visits/{visitId}/guides` (the full guide set; `GET /v1/shadow-day-visits/{visitId}/guide-candidates`
lists who may host), `POST /v1/shadow-day-visits/{visitId}/guide-reminders`,
`PATCH /v1/shadow-day-visits/{visitId}/feedback-waiver`, `POST /v1/shadow-day-visits/{visitId}/no-show` and
`PUT /v1/shadow-day-visits/{visitId}/shadow-campus` (`GET /v1/shadow-day-visits/{visitId}/shadow-campus/candidates`
lists the campuses). The staff portal's rules apply: a refused write is a 400 with the staff message; the host-campus check on guides and the applying-campus check on the shadow campus answer 403; a visit outside the key's scope answers 404.
A waiver's `reason` and `note` apply only when waiving; an undo ignores them. Creating,
rescheduling, accepting and declining a booking, and `/recommendation`, need `applications:write`.
`/recommendation` does not record a no-show or file feedback.
Schedule and reschedule take an optional `scheduledEndDate`, the last day (end after start, at most 14 days in all). A reschedule of a live booking that omits it keeps the length; `null` makes one day; a rebook or a new booking without it is one day. A started visit keeps its start day. HubSpot-backed bookings refuse an end that differs from the start.
An API change reads `<person> via API key <key name>`, both names as
they were at the time (`API: <key name>` with no person). Shadow day changes are not pushed to subscribers; re-read them with `updatedSince`.

**Who hosts.** Hosting is per campus: `guide_postings.is_shadow_day_host`, ticked only by a
registrar. A guide is offered, auto-assigned or (as a Lead Guide) involved by level only where their
live posting at the campus hosting the day is ticked. An assignment outlives the tick, so a
visit's `guides` field can name a guide no longer offered. The column is not served; the guide
candidates route reads it for one visit.

**Scope.** A visit is in scope when its applying campus or its live shadow campus is in the key's
campus scope, its program type is in scope, and it is not a test student unless the key holds
`students:test:view` and, on the lists, asks with `includeTest=true`. A list request with
`includeTest=true` and no `students:test:view` returns HTTP 403. A single read of a test student's
visit works whenever the key holds `students:test:view`. An out-of-scope visit is absent from lists
and a 404 by id. An explicit `campusId` outside the key's scope is a 403; `campusId` matches the
applying campus or the shadow campus.

**Visit fields.** Names follow the roster. `visitDate` is the first day and `visitEndDate` the last day, null for one day. `campusId` and `campusName` are the applying campus;
`shadowCampusId` and `shadowCampusName` are set whenever a live shadow campus is set. `gradeLevel`
is the application's, else the student's, and can be null. `guides` lists active guides only.
`feedbackWaiver` is `{ waivedAt, reason, note, waivedByName }` or null; `waivedByName` is
`<person> via API key <key name>` for a key. `outcome` is the visit
result, or null. `level`, `currentGradeLevel` (the grade the child is in on the visit date, at the campus the visit happens at), `timeZone` (the zone `startAt` and `endAt` are shown in) and `guideAssignmentMode` describe the offering and campus. `guides[]` items are `{ guideId, name, guideType, levelScopeEnabled, levelScopeEnabledSource, autoReason, filingState, filedByName }`. `deletedAt` is null except in `updatedSince` reads. Rows are ordered by
visit date, newest first, then id, which a reschedule moves; `sortBy=id` orders by `id` alone,
for a full pass. Filters: `campusId`, `academicYear` (2026 or
2026-27), `dateFrom` and `dateTo` (inclusive YYYY-MM-DD; visits that overlap the window), `gradeLevel`, `guideId` (an active
guide), `status`, `grouping`, `noGuides`, `feedbackOverdue`, `applicationId`, `studentId`.

**One filing per visit.** `filingState` is the staff page's reading of a guide: `FILED` (their own login filed), `NOT_NEEDED` (someone else filed, named in `filedByName`; once anyone files, every other assigned guide is `NOT_NEEDED`), `NOT_FILED` (nobody has), `NOT_APPLICABLE` (feedback waived or visit cancelled, for every guide).

**Single read only.** `GET /v1/shadow-day-visits/{visitId}` (`sis_get_shadow_day_visit`) adds, on `shadow_days:view` alone: `schoolBackground` (name, type, dates, city, state; never street, postal code or country); `studentRecordSchool` (the student record's school, shown as the current school when `schoolBackground.current` is null); `applicationAnswers` (`referral`, `familyInformation`, `whyApplied`); `medicalAnswers` (`consentToTreat`, `allergy`, `noAllergiesReported`, `iep504`, the staff shadow day page subset; medications, dietary needs and emergency contacts are never served); `mockAccountEmail`, `ownAccountEmail`, `mockAccountUncovered`; and `previousVisit` `{ visitId, date, attendance, outcome, feedbackReadable }`. The mock account password is never served. Lists and `updatedSince` rows omit these because they are heavy. For a high school applicant (grades 9-12 applied for), show `ownAccountEmail` (null: no student email) as the login when no mock account is held or the visit is upcoming and scheduled, else `mockAccountEmail`; every other applicant uses `mockAccountEmail`. `mockAccountUncovered` is true for a scheduled multi-day visit with a day from the campus's today onward holding no mock account; false for a single-day visit and for a high school applicant. `previousVisit` is the student's earlier visit, and its date, attendance and outcome are returned even when that visit is outside the key's scope, as on the staff page; `feedbackReadable` is true when `GET /v1/shadow-day-visits/{visitId}/feedback` can read it with your scope, and can be false for an earlier visit loaded from the legacy system. The read fails like the staff page when a stored application answer is malformed.

**Read-time groupings.** `grouping` is `completed` when the visit is CANCELLED, its feedback is
waived, or a submitted filing exists; else `awaiting_feedback` when the last day (`visitEndDate`, else `visitDate`) is on or before today at the effective campus (a blank campus
timezone counts as Central time); else `upcoming`. `feedbackOverdue` is awaiting feedback with its due day
before today: the last day, or the day of the latest void when a result was voided. `noGuides` is a SCHEDULED
visit with no active guide. All three are computed when you read, so they change with the calendar
and with guide status without any row being written; the filters use the same values. Re-read open
visits around each campus day instead of waiting for them to appear in a delta.

**Feedback.** Only submitted filings are served; drafts never appear. `GET /v1/shadow-day-feedback`
filters by `campusId` (applying or shadow campus), `academicYear`, `visitId`, `includeTest` and
`updatedSince`, and is ordered by visit id, then when the filing was started; a correction does
not move it, so it walks in full like `GET /v1/enrollments`. `filedBy` is
`{ userId, guideId, name, role, apiKeyName, levelScopeEnabled, levelScopeEnabledSource }` with role `GUIDE`, `STAFF` or `API`; `guideId`
and the level-scope pair are null unless a GUIDE filing whose guide is live or still on the visit's roster. A key's filing has `userId` null, `apiKeyName` set and `name` `<person> via API key <key name>`,
and ranks as staff for `countsAsResult`.
A visit takes one filing: a filing by anyone else (including POST .../no-show) is a 400; the filer's own same-day no-show correction is allowed.
`decision` is `DID_NOT_ATTEND` for a no-show, else the guide decision, else null.
`countsAsResult` marks the one filing that sets the visit result, ruled over every submitted
filing of the visit and not just the page, so a visit has one `true` (a legacy visit may hold two filings, and
the guide's governs). `answers` is `[{ questionId, question, value, answer }]`: `value` is the stored value,
`answer` reads it as a person would (an option label, `Yes` or `No`, text, `;`-joined labels for
a multi-select, JSON for other objects). Unanswered questions are omitted;
`GET /v1/shadow-day-feedback-templates/{templateId}` is REST-only and lists every question of the filing's
`templateId` and `formVersion`. A template block that cannot be read is skipped, its stored
answer appears with `question` set to its id, and the template stays readable. When the whole
template is unavailable every stored key is listed and `formVersion` is null. The template route
is a 404 for a form that is not a shadow day feedback form.

**Path to Yes.** A Path to Yes is what a person files after a Not Approved recommendation. It is owed by the person whose Not Approved filing counts as the visit result; a filing by an API key owes none (`NOT_REQUIRED`, `FILED_BY_INTEGRATION`). One record per visit, derived when you read, not a stored row. `GET /v1/path-to-yes` (`sis_list_path_to_yes`) lists them, ordered by visit id, with the feedback list's filters (`campusId`, `academicYear`, `visitId`, `includeTest`, `updatedSince`), and walks in full. `GET /v1/shadow-day-visits/{visitId}/path-to-yes` (`sis_get_shadow_day_visit_path_to_yes`) reads one. `GET /v1/path-to-yes-templates/{templateId}` lists every question of the record's `templateId` and is REST-only. `status` is `DUE` (owed, nothing filed), `DRAFT`, `SUBMITTED`, `WAIVED`, `SUPERSEDED` (the outcome changed after one was started, or the decision predates a re-stamped launch) or `NOT_REQUIRED`, with `notRequiredReason` `NOT_REJECTED`, `VISIT_CANCELLED` or `FILED_BY_INTEGRATION`. The list includes `NOT_REQUIRED` entries: to count what is owed or filed, use `sis_count` with `groupBy` `status`; REST callers read the `status` of each entry. `BEFORE_LAUNCH` appears only on the single read, when the Not Approved predates launch and no Path to Yes was started; the list omits such visits. `answers` is filled only once `SUBMITTED`; a draft's answers are never served, and unanswered questions are omitted. A ticked Other's text appears only inside that answer's `answer` string (as `Other: <text>`), not as its own entry. `filedBy` and `feedbackFiledAt` name the Not Approved filing. Both are null when `notRequiredReason` is `NOT_REJECTED` or `VISIT_CANCELLED`, even if a person's Not Approved once existed; a cancelled visit that has a Path to Yes row reads `SUPERSEDED` and keeps its filer. For `FILED_BY_INTEGRATION`, `filedBy` is the API key's filing, with role `API` and `userId` null. `updatedAt` is the newest of the visit, its submitted feedback and its Path to Yes rows, deletions included, and is never null. With `updatedSince` (inclusive, an ISO 8601 instant with an offset) a live visit returns when its visit row, its submitted feedback, any Path to Yes row on it (an edited draft counts) or its application changed or was deleted. `updatedAt` leaves the application out, so a visit returned for an application change can carry an `updatedAt` OLDER than `updatedSince`: do not filter on `updatedAt >= updatedSince`, diff the payload instead. A visit, application or student deleted at or after the cutoff returns as a row with `deletedAt`. A visit whose only Not Approved filing was deleted, whose launch was re-stamped past it, whose qualifying Not Approved filing was corrected to another decision while it was `DUE` (no row yet), or whose only Path to Yes row is soft-deleted (a row-only visit) stops appearing without a row; so does one that leaves scope. A voided Path to Yes while a qualifying Not Approved filing is still live leaves the visit `DUE`, in the full read. A voided qualifying filing with none other live drops the visit from the full read; an `updatedSince` read returns it as `NOT_REQUIRED` (`NOT_REJECTED`) only when `updatedSince` is at or before the void time. Do a periodic full pull to reconcile. Path to Yes is never sent to HubSpot.

**Changes since.** Shadow day deltas carry deleted visits and filings as ROWS, unlike the roster
collections. With `updatedSince` (inclusive, an ISO 8601 instant with an offset), a live visit
returns when its row, a guide assignment on it, a feedback row on it (an edited draft counts,
although a draft is never served) or its application changed or was deleted. A filing returns
when it, a sibling filing of the same visit (which can flip `countsAsResult`), its visit row,
that visit's application, or (for a `GUIDE` filing, whose `guideId` follows them) its visit's guide roster or
its filer's guide rows changed. A visit or filing whose visit, application or student was deleted at or after the cutoff, and a
filing deleted on its own, returns with `deletedAt` set to the earliest of those deletions; only a row live at the cutoff is
returned that way, and without `updatedSince` deleted rows are never returned. A voided shadow day result is reported as removed at its void time: its filing returns with `deletedAt` set to the void time, and a voided filing is never returned without `updatedSince`. `updatedAt` is the
row's own modified time and can be older than the cutoff on a row returned for a child change.

**Not rows, and what does not mark a visit changed.** A visit that leaves scope without being
deleted simply stops appearing: a moved shadow campus, an application moved to another offering
or campus, a student marked as a test account, a deleted campus or offering, a campus purge
(which hard-deletes). Do a periodic full pull to reconcile these. A guide renamed, deactivated
or reactivated, a student, campus or programme renamed or re-graded, and a student un-marked as
a test account change the served values without marking the visit changed. So do `guideType`, `levelScopeEnabled`, `levelScopeEnabledSource`, `filingState` and `filedByName` (a guide's type, level access, login link or name), `currentGradeLevel` and `level` (student grade, offering calendar) and `timeZone` (campus zone, offering hours).

## National Admissions

A National Admissions request asks permission for a student to attend some of Session 1 to Session 5 of a school year at another campus. The student's own campus is the home campus; the campus asked for is the transfer campus. A request is filed from the student's enrollment (`subjectKind` `ENROLLED`) or application (`APPLICANT`). Approving it records the decision and changes no enrollment or application.

**Statuses and who moves them.** The owner starts a `DRAFT`, changes it, and submits it, which makes it `SUBMITTED`. Review has two stages, `reviewStage`. At `PRIMARY` a primary reviewer at the home campus gives the first approval, recorded as `primaryApproval` (`byName`, `at`, `note`), and it is `SUBMITTED` at `SECONDARY`, where a secondary reviewer gives final approval (`APPROVED`). Either stage's reviewer can instead reject (`REJECTED`) or ask a question (`NEEDS_INFO`); the owner's reply makes it `RESUBMITTED` at the same stage. The portal labels `SUBMITTED` and `RESUBMITTED` at `SECONDARY` Final review and Final resubmit. `status=SUBMITTED` and `RESUBMITTED` match either stage; `FINAL_REVIEW` and `FINAL_RESUBMIT` match `SECONDARY` only. The owner can withdraw a `SUBMITTED`, `NEEDS_INFO` or `RESUBMITTED` request (`WITHDRAWN`) and can discard a draft, which deletes it. `APPROVED`, `REJECTED` and `WITHDRAWN` are closed and read-only. `capabilities` (`canDecide`, `canReply`, `canWithdraw`, `canStartNew`) says what your key may do with a request now.

**Scope.** Every route checks the key's own grants and campus scope; the grants of the person the key acts for are never read. A request is in scope when its home campus is one of the key's campuses; requests count as the MAIN programme, so a key whose program-type scope leaves out MAIN sees none. The transfer campus never brings a request into scope, so a key scoped only to the destination gets a 404 by id and finds nothing in lists. A test student's request follows the shadow day rule: lists show it only with `includeTest=true`, which needs `students:test:view` (403 without), and by id it is a 404 without `students:test:view`. An explicit `homeCampusId` outside the key's scope is a 403. Reads need `national_admissions:view`; filing needs `national_admissions:requests:submit`, `national_admissions:write` and `national_admissions:view`; deciding needs `national_admissions:requests:approve` (primary reviewer) or `national_admissions:requests:final_approve` (secondary reviewer), with `national_admissions:write` and `national_admissions:view`. Neither reviewer grant is part of full access.

**The key is the actor and the owner.** Everything a key does (drafts, requests, replies, decisions, withdrawals, documents) is recorded as the key's. Only those acting as the key see its drafts: its owner using the secret, its MCP sign-in person, anyone else holding the secret. A person's own portal drafts stay separate; neither sees the other's. Only the key edits, submits, discards, withdraws or replies to what it created; another key's or a person's request is a 404 on those routes. A person is named only as attribution: a change reads `<person> via API key <key name>`, or `API: <key name>` for a key that acts for nobody, both names as they were when it acted. That text fills `submittedByName`, `closedByName`, `primaryApproval.byName` and a message's `authorName`, and the matching `submittedByUserId`, `closedByUserId` and `authorUserId` are null.

**Disabled keys and notices.** A disabled key's drafts and open requests stay as they are. Reviewers can still decide a request waiting on them; one waiting on the key's reply stays open, since only the key can reply. Enabled again, the key acts on them again. No notification is sent to a key and nothing is pushed: re-read on demand, where `modifiedAt` moves on every change.

**Reads.** `GET /v1/national-admissions-requests` (`sis_list_national_admissions_requests`) filters by `status`, `homeCampusId`, `transferCampusId` (any campus), `subjectKind`, `academicYear` (`2026` or `2026-27`), `session` (numbers of Session 1 to Session 5, any overlap), `studentId`, `decidable` and `includeTest`, sorted `newest` (the default) or `oldest` by submit time, or start time for a draft. `decidable=true` lists the `SUBMITTED` and `RESUBMITTED` requests your key may decide at their current stage; with no `homeCampusId` it covers every campus in the key's scope, and a key holding neither reviewer grant gets an empty page. `status=DRAFT` lists only your key's own drafts, and `studentId` narrows them to one student. Rows carry `id`, `status` and `reviewStage`; `GET /v1/national-admissions-requests/{requestId}` (`sis_get_national_admissions_request`) adds `modifiedAt`, `primaryApproval`, answers, documents, messages and `capabilities`. `GET /v1/national-admissions-question-sets` (`sis_list_national_admissions_question_sets`) lists the question set for each `subjectKind`, the same at every campus, and `GET /v1/national-admissions-question-sets/{templateId}` (`sis_get_national_admissions_question_set`) reads one, an older version included; pass a request's `contentTemplateId`.

**Filing.** These need the filing grants. `POST /v1/national-admissions-requests` (`sis_create_national_admissions_draft`, with `subject` `enrollment` or `application` and `subjectId`) starts a draft from exactly one of `enrollmentId` and `applicationId`. `GET /v1/national-admissions-requests/{requestId}/transfer-campus-candidates` (`sis_list_national_admissions_transfer_campuses`) lists every active campus but the home campus with `academicYears`, the start years it can be requested for, whatever the key's scope, for the key's draft or a request waiting on its reply. `PATCH /v1/national-admissions-requests/{requestId}` (`sis_update_national_admissions_draft`) changes a draft. `POST /v1/national-admissions-requests/{requestId}/submit` (`sis_submit_national_admissions_request`) sends it to the primary reviewers; every required question must be answered, with a transfer campus, a school year that campus can be requested for and at least one of Session 1 to Session 5, and answers to hidden questions are dropped. `POST /v1/national-admissions-requests/{requestId}/resubmit` (`sis_reply_to_national_admissions_request`) answers a question with `reply`. `POST /v1/national-admissions-requests/{requestId}/withdraw` (`sis_withdraw_national_admissions_request`) takes an optional `note`. `DELETE /v1/national-admissions-requests/{requestId}` discards the key's draft with its documents, on `national_admissions:view` alone, and is REST-only.

**Creating a draft.** Create with no draft fields returns your key's open draft for that enrollment or application (200), or a new one (201). Create with draft fields saves them into a new draft (201); if your key already has a draft for the subject, it is a 409 naming that draft's id: change it with `PATCH`. A refused create writes nothing. An enrollment or application outside the key's scope is a 404, and one that cannot be used for a request is a 400.

**Draft patch.** Create, `PATCH`, submit and resubmit take any of `transferCampusId`, `academicYear`, `sessions` and `answers`. `academicYear` in a body is the start year as a number (`2026`). A field left out keeps its stored value; `null` clears `transferCampusId` or `academicYear`, and an empty `sessions` clears the sessions. `answers` is keyed by `questionId` of the request's question set and merges into the stored answers; a `null` answer clears that question, and a choice takes its option `value`. Sessions are numbers from 1 to 5 within the school year: Session 1 to Session 5 of the transfer campus's school year (**Sessions of a school year**). A supporting document is never required to submit.

**Session dates.** List rows and the detail carry `sessionDates`: the first and last day (YYYY-MM-DD) of each of Session 1 to Session 5 the request asks for, in order, as the transfer campus's school year for the request's `academicYear` sets them. A session without dates is left out: the year has none set, or a later date change left it outside. Each entry carries `number`, `startDate` and `endDate`. `sessionDates` is never null, and it is empty while no transfer campus or year is chosen. `sessionLabel` reads like `Sessions 3–4, 2026–27`, and adds the dates, as in `Sessions 3–4, 2026–27 · Jan 5 – May 22, 2027`, only when every school-year session asked for has them. Each transfer campus candidate adds `sessions`, the dated Session 1 to Session 5 of each of its `academicYears`. A key reads these dates whatever its campus scope.

**Round tokens.** `expectedModifiedAt` goes in the JSON body (or the MCP arguments) as the exact `modifiedAt` string of your last read. Approve, reject, request-information, resubmit and `PATCH` require it, and so does a submit that carries draft fields; a submit with none, and withdraw, do not. A request that changed since your read is a 400 ("This request has changed since you opened it. Reload to see the latest."): read it again and reapply.

**Decisions.** These need the decision grants. `POST /v1/national-admissions-requests/{requestId}/approve` and `POST /v1/national-admissions-requests/{requestId}/reject` take `reason`; `POST /v1/national-admissions-requests/{requestId}/request-information` takes `question`. The request must be `SUBMITTED` or `RESUBMITTED`; anything else is a 400 saying why. A key decides only the stage its grant reviews, never a request it or the person it acts for submitted or gave the first approval on; each is a 403. `closingNote` holds the reason or the withdrawal note.

**Text.** `reason`, `question` and `reply` take 1 to 10,000 characters, and a withdrawal `note` up to 10,000. A text answer takes up to 10,000 characters. A blank reason, question or reply, or any longer text, is a 400.

**Wire answers.** `answers` on a request is `[{ questionId, question, value, answer }]` for each answered question, in the order of the question set it was filed on (`contentTemplateId`, `formVersion`). `value` is the stored answer and `answer` reads it as a person would: a choice's option label, else the text. Unanswered questions are omitted. Supporting documentation is `documents`, never an answer.

**MCP arguments.** Every write tool but create takes `requestId`. `sis_create_national_admissions_draft` takes `subject` (`enrollment` or `application`) and `subjectId`, which become the REST `enrollmentId` or `applicationId` and read back as `subjectKind` `ENROLLED` or `APPLICANT`, plus the draft patch fields. `sis_update_national_admissions_draft` takes `expectedModifiedAt` and the draft patch fields; `sis_submit_national_admissions_request` the same, with `expectedModifiedAt` optional. `sis_reply_to_national_admissions_request` takes `reply`, `expectedModifiedAt` and the draft patch fields. `sis_withdraw_national_admissions_request` takes an optional `note`. `sis_add_national_admissions_link` takes `url` and an optional `name`. `sis_decide_national_admissions_request` takes `decision` (`approve`, `reject` or `request_information`), `text` and `expectedModifiedAt`; `text` is the REST `reason`, or `question` for `request_information`.

**Calling the routes.** Send the key as the `x-api-key` header, or as `Authorization: Bearer <key>`. An error answers `{ "message": "..." }`, the staff portal's message on a 400. The OpenAPI document named under **Coverage of today's REST wire** declares every body and response shape.

**Files and links.** A file takes three REST steps: `POST /v1/national-admissions-requests/{requestId}/documents/upload-url` returns `uploadUrl` and `s3Key`, you PUT the bytes there with the same content type, and `POST /v1/national-admissions-requests/{requestId}/documents/files` attaches it; a PDF, Word document, JPEG, PNG or GIF of up to 10 MB. A link is `POST /v1/national-admissions-requests/{requestId}/documents/links` (`sis_add_national_admissions_link`) with `url` (`http` or `https`) and an optional `name`, the only document write on the MCP. `DELETE /v1/national-admissions-requests/{requestId}/documents/{documentId}` removes a document and `POST /v1/national-admissions-requests/{requestId}/documents/{documentId}/restore` puts one back, both REST-only. Documents change only on the key's draft or on its request waiting on its reply; meanwhile an addition or removal reads `pending` to the key and reaches the reviewers with the reply. `GET /v1/national-admissions-requests/{requestId}/documents/{documentId}/download-url` gives a short-lived address on `national_admissions:view` and is REST-only.

## Sessions of a school year

Each school year (a MAIN offering) at a campus has Session 1 to Session 5, back to back from the year's first day to its last, or none set. Session 1 always starts on the offering's own `startDate` and Session 5 ends on its `endDate`; each later one starts the day after the one before ends, so the year stores only `sessionEndDates`, the last days of Session 1 to Session 4 as YYYY-MM-DD. Back to back does not mean equal lengths: the caller chooses each end date, and the staff portal suggests a near-equal split of the year's days. A summer offering has none. These dates say nothing about whether an enrollment's offering has started: that stays `offeringStartDate` (**Seated today vs committed for the year**).

**Read.** `GET /v1/program-offerings/{id}/sessions` (`sis_get_program_offering_sessions`) takes a program offering id and returns the offering's first and last day as `yearStartDate` and `yearEndDate`, then `sessionEndDates` and `sessions`, Session 1 to Session 5 in order with `startDate`, `endDate` and `outsideAcademicYear`, or null and empty when none are set. A non-MAIN offering is a 400 ("Sessions apply to school years only.").

**Write.** `PUT /v1/program-offerings/{id}/sessions` is REST-only and replaces the whole set: `sessionEndDates` is the last days of Session 1 to Session 4 in order, or null to clear. Setting needs each of Session 1 to Session 5 to have a day inside the year, and is refused for a non-MAIN offering, for a year with no last day ("Set the academic year's end date before setting its sessions."), and for a Session 1 to Session 4 that ends before it starts or a Session 5 that would start after the year's last day, each with the staff portal's message. A past academic year, one whose offering `year` is before the current school year (which turns over on 1 August, UTC), refuses setting and clearing alike ("Sessions of a past academic year can't be changed."). Clearing is allowed on a non-MAIN offering too, unless its year is past. The change is recorded as `<person> via API key <key name>`, or `API: <key name>` for a key that acts for nobody.

**Grants and scope.** The read needs `campuses:academic_year:view` and `campuses:read`; the write needs `campuses:academic_year:write` and `campuses:read`. An unknown offering, or one at a campus outside a campus-scoped key's list, is a 404; a key with no campus list reaches every campus.

**When the year's dates move.** Saved end dates stay as they are. Moving the year's first day earlier lengthens Session 1, and moving its last day later lengthens Session 5. A school-year session the change leaves without a day inside the year, or Session 5 when the year loses its last day, reads `outsideAcademicYear: true` with null `startDate` and `endDate`, National Admissions treats it as undated, and saving the same end dates again is refused until they fit.

## Future-year commitment: applications, not enrollments

A future-year question ("committed for 2027-28") has TWO parts, BOTH required:

1. ALWAYS report the early roster-enrollment count. On this wire:
   `GET /v1/enrollments?programType=MAIN&academicYears={futureYear}&status=PENDING_REVIEW,CONFIRMED,ENROLLED`
   (on the tool, the census form below). Disclose it is the early handful.
2. The commitment population: `FUTURE_ENROLLMENT` is the application status for a family
   committed to a _later_ school year. It is served per student
   (`GET /v1/students/{id}/expanded`, `applications[].status`) and per year on
   `GET /v1/applications` (`sis_list_applications`). That `year` is the year the application is
   for: a year's commitment is `pagination.total` of
   `GET /v1/applications?year={year}&status=FUTURE_ENROLLMENT&programType=MAIN`, one line per year
   when none is named. Count rows as stored; never move one to another year.
3. Item 1's URL minus its `status` pin also returns parked `ON_HOLD` seats and `CANCELLED`
   residue beyond the roster trio. Count parked seats with `status=ON_HOLD`.
   Size all three reads with `limit=1` and read `pagination.total`.
4. `FUTURE_ENROLLMENT` applications are mostly new children; a returning child who defers also shows here, with the current seat `ON_HOLD`. `pipelineType` reads `NEW_ENROLLMENT` either way: use `priorSchoolYears` to tell new from returning. Other returners signal with a `RE_ENROLLING` enrollment, created when re-enrollment runs. The SIS holds no opening date.
5. `ACADEMIC_HOLD` and `FINANCIAL_HOLD` are parked application statuses, mapped from FinalSite's academic and financial holds. They create no enrollment and are not `FUTURE_ENROLLMENT`; report them as their own line. The enrollment-side `ON_HOLD` with `holdReason` Academic or Financial shares only the cause.
6. "Applied" for a year is every application row except the pre-application status `COMMUNITY_COMMITMENT`. `APPLIED` is only the entry stage, so it is not the applied count.
7. These wait on the school's decision: `APPLIED`, `PENDING_ALPHA_X_PROJECT`, the four `SHADOW_` statuses, `RESHADOW_REQUESTED`, `GUIDE_APPROVED`, `POST_SHADOW_MEETING_SCHEDULED`. Decided: `GUIDE_NOT_APPROVED`, `OFFERED`, `REJECTED`. The holds, `FUTURE_ENROLLMENT` and `COMMUNITY_COMMITMENT` are parked, not waiting. Count the stored `status`; a closed deal beside it is a disagreement to report, never a reclassification. GT Anywhere `APPLIED` is unsettled: report it as its own line, never in the waiting count.

## Coverage of today's REST wire

- `GET /v1/enrollments` is the census list. Query pins: `programType`,
  `academicYears`, `deliveryMode`, `campusId`, `status`, `gradeLevel`, `level`, `studentId`,
  `priorSchoolYears`, `updatedSince`, `statusOlderThanDays`, and `email` (exact match after trim
  and lower, enrollment or student address). An omitted pin means no filter on that axis — not
  "this year" and not "the roster". The `?status=` filter reads the stored
  `enrollments.status` column, not the computed value the row projects.
  During the divergence window `?status=CONFIRMED` returns a row whose
  `status` field reads `ENROLLED`, and `?status=ENROLLED` does not
  return it. An exchange row carries
  `status = EXCHANGE`, so the three-status roster pin
  (`PENDING_REVIEW,CONFIRMED,ENROLLED`) excludes it; a
  `programType=MAIN` walk with no `status` pin includes it and counts
  a visiting student as a second enrollment. `priorSchoolYears=0` is prior MAIN
  years = 0 on each row's `academicYear`. Same-stint rows collapse to one
  enrollment (same student, offering, and start: `enrollmentStartDate` if set,
  else `enrolledDate`). No dates: no collapse. Later start stays.
  A student may hold two roster enrollments in one offering year across two offerings, and
  `pagination.total` counts those enrollments after collapse, not students.
  Count distinct `studentId` for a headcount. Test students (`isTest = true`) are omitted. `limit` defaults to 100 and
  caps at 1000. Page until
  `page > pagination.totalPages`. Request `limit=1000`, so the walk completes in the
  fewest trips. The census row is exactly these fields: `id`, `studentId`,
  `isTest`, `programOfferingId`, `applicationId`, `status`, `statusSource`, `primaryEnrollmentId`,
  `enrollmentEndDate`, `gradeLevel`, `level`, `levelSource`,
  `campusId`, `campusName`, `deliveryMode`, `academicYear`,
  `offeringYear`, `academicYearLabel`, `programType`, `priorSchoolYears`,
  `componentTypes`, `enrolledDate`, `effectiveEnrolledDate`, `enrollmentStartDate`,
  `offeringStartDate`, `offeringEndDate`, `enrollmentStartDateSource`, `enrollmentEndDateSource`,
  `withdrawnDate`, `withdrawalReason`, `withdrawalReasonNotes`,
  `cancelledDate`, `cancellationReason`, `cancellationReasonNotes`,
  `transferDate`, `transferCampus`, `transferReason`, `createdAt`,
  `modifiedAt`, `statusEnteredAt`, `appAccess`, `appAccessBasis`, `appAccessEarlyStart`, `appAccessEarlyStartReason`, `appAccessEndsAt`, `externalIds`, `checkChartGrade`, `checkChartGradeSource`. `gradeLevel` is nullable. Null is an
  ungraded enrollment — the row carries no PR/PK/K/1–12 value — so a
  grade-band composition must place that enrollment on one side of the split
  instead of dropping it. `offeringId` on `sis_query` is this row's `programOfferingId`. First-day questions keep rows whose `effectiveEnrolledDate` is present and on or before `offeringStartDate`. An `offeringStartDate` more than two
  months after your read instant is provisional — see the `offeringStartDate` genesis bullet for the two-month rule and why nothing on the wire flags it. Withdrawal and "did not re-enroll" questions use `status` plus
  `studentId` set difference — see above.
- `GET /v1/enrollments/{id}` is the keyed read of ONE enrollment. It needs `enrollments:read`. **It is not the census shape.** It drops `programType`, `campusId`, `offeringStartDate`. It carries `statusSource`, `level`, `levelSource`, and the enrollment's terms: `paymentMode` (`MONTHLY` / `FULL`), `depositType` (`FLAT` / `PERCENTAGE` / null), `depositValue` (cents when `FLAT`, basis points when `PERCENTAGE`), and `depositAdjustmentMethod` (`FIRST_INVOICE` / `SPREAD_ACROSS_ALL` / null). Captured on the enrollment; null means no enrollment-level override. They are not `applications.finalsite_deposit_state` and say nothing about whether a deposit was paid. `ON_HOLD` is the generic parked status: the sync also parks deferral, no-seat-yet and Community Commitment rows, and staff park by hand. Every `ON_HOLD` row stays off the roster. A FinalSite hold is an `ON_HOLD` row whose `holdReason` is `Academic` or `Financial`. The sync writes `holdReason` and `holdDate` (the day FinalSite's hold was first seen); a staff edit can set `holdReason` but not `holdDate`. A null `holdReason` usually means another park, not a hold missing its reason; a null `holdDate` means not recorded. Out-of-scope answers 403.
- `GET /v1/campuses` returns `deliveryMode` (`PHYSICAL` / `ONLINE`)
  and `brand` (`{ id, name, slug }` or `null`) — the district this
  campus sits under, and the only hierarchy on this wire. Group on
  `brand.id`. **Join on `id`**, the stable SIS campus UUID. For a migrated campus, `id` is the same value as the legacy SIS `org_org.sourced_id`, because the migrator copies it. `docs/external-api/campus-identity-key.md` holds the method. Do NOT join on `numericCampusId`, and do not match on campus name; see Campus identity above (Traps 12-16).** It also takes `updatedSince`;
  `GET /v1/campuses/{id}` takes no query parameters and returns the list keys plus `emailDomain`,
  plus `depositType`, `depositValue` and `fullProgramTuitionCents` only for a key holding
  `students:finances:tuition:view` (absent, not null, otherwise).
  Both carry `address` (formatted; parts alongside), `timezone` (IANA) and
  `minGrade` / `maxGrade`, the SIS grade range (`PR` preschool, `PK`,
  `K`, `1`-`12`); each is null when unset. The SIS does not refuse an enrollment whose grade is outside it.
  A campus is listed only once this SIS holds a row for it, and there is no planned status. HubSpot carries pre-announcement and pre-launch schools on purpose, so a HubSpot program with no campus here is expected. When you compare the SIS with HubSpot, the finance warehouse or Edu Ops buildings, name what each includes: the SIS tracks campuses, not buildings.
  Campus status is ACTIVE, INACTIVE or ARCHIVED, set in the Staff Portal.
  It is not enrollments.status, and it is not a test-campus flag.
  INACTIVE and ARCHIVED mean the campus is not active; leave it out.
  ACTIVE does not mean the campus is operating. An ACTIVE campus can have
  no enrolled students for the year, for example because:
  - It was created ahead of a future opening.
  - It is in the planning stage and taking applications, but won't open
    physically until applications pass a threshold.
  - It is a row left behind after a rename, whose applications moved to a
    new campus row.
  - It is winding down.
  Those are examples, not the full list, and the SIS does not record which
  one applies. To tell whether a campus is operating for a year, read MAIN enrollments in roster statuses (PENDING_REVIEW, CONFIRMED, ENROLLED) for that
  year on GET /v1/enrollments. GET /v1/applications lists a campus's SIS applications for a year (on the MCP,
  `sis_list_applications`); pass the campus `id` as campusId and `programType=MAIN` for the school year.
  When a campus has no roster, report what the data shows: no MAIN roster
  enrollments for the year, whether it has applications, and which years it
  has offerings for.
  A campus whose only enrollments are test students reads as empty, because
  the census list omits them: name that kind. Give the reasons above as possibilities, and send "why" to the campus team. Never pick one reason
  for a named campus. Of two look-alike names, the one holding MAIN roster
  enrollments is the live campus.
- `POST /v1/query` (`sis_query`) answers a count, breakdown or id list in one SQL query, no paging. Body: `grain` (`student`, `household`, `enrollment`, `application`), `cohort` (required: `academicYears`, `programTypes`; `statuses` required on grains `student`, `household` and `enrollment`, optional on `application`, where omitted means every status), `filters` (each `{fieldId, operator, value}`, `fieldId` from `sis_query_fields`), `related`, `mode` (`count`, `group_by`, `list`), `groupBy`, `limit`, `includeTest`. There is no `ALL`: for every enrollment status list `ENROLLED`, `RE_ENROLLING`, `CONFIRMED`, `WITHDRAWN`, `COMPLETED`, `TRANSFERRED`, `PENDING_REVIEW`, `PENDING_DEPOSIT`, `ON_HOLD`, `CANCELLED`, `EXCHANGE`; for a roster count use only `PENDING_REVIEW`, `CONFIRMED`, `ENROLLED` (Trap 18). No `useCase` or `intent`: the body refuses unknown keys. Roster by campus: `POST /v1/query` with `{"grain": "enrollment", "cohort": {"academicYears": ["2026-27"], "programTypes": ["MAIN"], "statuses": ["PENDING_REVIEW", "CONFIRMED", "ENROLLED"]}, "mode": "group_by", "groupBy": ["campusId"]}`. No group for that year and key scope: no students enrolled there yet.
- A roster student can have no live household: `household.count` is `0`. Schools that provide no parent data have no households or guardians here, so a family or guardian count there is empty. To see where, group student-grain roster students by `cohort.campusId` and `household.count` in one `sis_query` call.
- `GET /v1/query/fields` (`sis_query_fields`) takes `grain` (omitted: every grain) and lists each field's type, operators, values, permission: `GET /v1/query/fields?grain=household`. `GET /v1/applications` rows carry `primaryHouseholdId`, absent without `households:read`. Applicant families: grain `application`, `group_by` `primaryHouseholdId`; null means no live primary household; check `groupsDropped`.
- `GET /v1/guardians` has two modes on one path. Pass exactly one of
  `email` / `externalId` and it resolves ONE guardian as a bare object.
  Pass neither and it is the guardian collection: a
  `{data, pagination}` envelope ordered by `id` ascending, taking
  `search`, `updatedSince`, `page` and `limit` (default 100, cap 500).
  `search` matches accent-folded first, middle and last name and email
  case-insensitively. With `search`, campus scope includes
  household members. Rows carry
  `id`, `firstName`, `middleName`, `lastName`, `email`, `phone` and
  `externalIds` in either mode — `externalIds` is always present, `[]`
  when the guardian holds none, so it needs no presence check. It is the
  key to resolve a guardian BY: stamp your own id with
  `PATCH /v1/guardians/{id}` and read it back through
  `?externalId=<type>:<identifier>`, rather than joining on email, which
  changes, is shared across a household, and attaches the wrong person
  instead of failing. Two types are system-owned and are refused on that
  PATCH: `finalsite_contact_id` (`site:contactId`, or a bare contact id that does not name its site) and `hubspot_contact_id`; omitting them
  does not retire them. A campus-scoped key never sees a guardian
  outside its campuses. Passing BOTH parameters is a
  400, and so is sending `updatedSince` or `search` together with either
  — those parameters belong to collection mode, and accepting
  and discarding them on a lookup would let a consumer read a
  resolved guardian as "changed inside my window".
- `GET /v1/guardians/{id}` is the keyed read of one guardian. It needs `guardians:read`. Out-of-scope answers **404, not 403**.
- `GET /v1/families/{id}` (`sis_get_family`) takes a guardian's SIS id or `hubspot_contact_id`
  and returns SIS ids. Its children are one child's siblings.
- `GET /v1/academic-years` takes `updatedSince` (on `created_at`) and needs `campuses:read`.
- `GET /v1/program-offerings/{id}` needs `campuses:read`. `GET /v1/program-offerings?campusId=`
  lists offerings. A campus-scoped key gets **404,
  not 403**, for an offering outside its campuses, so a miss does not tell you
  whether the id is unknown or out of scope. `capacity` is the maximum
  declared for that one offering year, and **it constrains nothing**: no route
  refuses an enrollment because an offering is full, no places-remaining figure
  is served, and rosters above the cap are a live condition rather than a
  contradiction. **A zero is not a cap of zero**: the staff write path refuses a
  non-positive capacity, so read 0 as no usable cap, never as full or closed.
  A fill question
  is the census grouped on `programOfferingId`, then one keyed read per
  distinct offering, reporting the share of offerings with no usable cap
  instead of dividing by one.
  `identifier` is a label, not a stable campus name: two years of one campus can differ in it, and a campus rename does not rewrite it. Join on `campusId` (and `programId`), never on identifier text.
- `GET /v1/program-offerings/{id}/sessions` (`sis_get_program_offering_sessions`) reads one school year's Session 1 to Session 5
  on `campuses:academic_year:view` and `campuses:read`, and `PUT /v1/program-offerings/{id}/sessions` sets or clears them
  on `campuses:academic_year:write` and `campuses:read`, REST-only. **Sessions of a school year** above holds their rules.
- `GET /v1/students` query: `campusId`, `email`, `username`,
  `search`, `status`, `externalIdType` / `externalId`, `updatedSince`.
  **No `programType` filter.** The list is student-grain via the
  current-enrollment picker, which ranks one headline enrollment per student across
  all offering years and all programme types — a student whose only current
  enrollment is a summer-camp enrollment is on this list and is not on a
  `programType=MAIN` school-year roster. `campusId` means the student holds
  any non-deleted enrollment at that campus, not that the headline enrollment is
  there. The picker still applies the three roster statuses by default to that chosen
  row only. For a school-year census, use `GET /v1/enrollments` with
  `programType` and `academicYears` pinned.
  It carries no grade and no enrollment rows: read the enrollment's grade from
  `GET /v1/enrollments`, or from `enrollments[]` on
  `GET /v1/students/{id}/expanded`, where `currentEnrollmentId` names the
  headline enrollment this list's picker chooses, or is null when that enrollment is an
  exchange visit; see Genesis notes below.
- `GET /v1/students/{id}/expanded` returns the full nested student state
  in a single fetch: the student's enrollment rows across every year
  (including summer), plus applications, guardians, household
  memberships and active guide assignments. It needs `students:read`,
  and two of those sections need a grant of their own on top:
  `guardians` (with `suppressedGuardianIds` and
  `retiredGuardianIds`) needs `guardians:read`, and `households`
  (with `mailingAddress`) needs `households:read`. The student row has no address: the student's home is the primary household address, `mailingAddress` (null if none or `address1` is blank; `isPrimaryHousehold` on roster `include=household`). A guardian `address` is their own. A key without one
  of those gets no error and no empty list: **the
  key is ABSENT**, so test for it and never read absence as "none".
  Disclose both with every expanded read: the sections your key could not
  see, and which years and programme types `enrollments` held. Rows can disagree: name each and leave which is right to the registrar.
  Every other key — `assessments`, `enrollments`, `applications`, `demographics`, `guideAssignments`, `level`, `currentEnrollmentId` and the base student fields — still ships on `students:read` alone.
  It is the set of rows as
  they stand now, not the change history of any row — nothing here tells
  you what a field held before, or when it moved, and no route on this
  wire serves that. For where a campus-move dispute goes instead, and the
  limits on what that destination can prove, read the transfer-fields
  paragraph in the withdrawals section. It is not required to judge "newly
  enrolled" — use `priorSchoolYears=0` on the census list.
- `GET /v1/students/roster` defaults to **every programme**: a summer
  enrollment and a school-year enrollment sit in the same result set. Pin
  `programType=MAIN` for the school year; the nested enrollments follow
  the same pins. A count comes from `sis_count` over
  `GET /v1/enrollments?programType=MAIN`, never from the roster, which is
  for names and details; that count is enrollment rows unless `distinctField` is
  `studentId`. A roster row is a
  student. `id` is the SIS student uuid and is the key that matches
  census `studentId`. Roster `studentId` is a different value: the
  integer SIS student number, the one staff read on a screen. Every
  `studentId` this wire accepts as a path id or a filter is the uuid;
  the integer is accepted by none of them, and `GET /v1/students?search=`
  matches it only as substring text, on the current roster only (Trap 19):
  no match is "no current roster enrollment", not a wrong id. A student's
  HubSpot id is `externalIdType=hubspot_student_id`. Each nested enrollment carries
  `academicYear` (the integer offering year) and `academicYearLabel`.
  There is no `offeringYear` on a roster row, so a filter written with
  that deprecated alias matches nothing rather than erroring. The rest of
  the roster row — every remaining field and every `include=` block — is in
  `/docs/openapi.json`.
- A guide's `onboardingStage` (`ONBOARDING`/`TRAINING`/`FULL_ACCESS`) is training
  progress, set by hand; it is not `status`.
- A guide's `levelScopeEnabled` says whether they see all students in their
  levels: true for lead and head guides by role, the "Can see all students in
  their levels" checkbox for guides and reading specialists, else false.
  `levelScopeEnabledSource` (`GUIDE_TYPE`/`LEVEL_SCOPE_OPT_IN`) names
  which. Every guide object carries both (`guide`-prefixed on expanded
  `guideAssignments`). It does not cover shadow-day visits: only lead and head
  guides reach visits beyond their own, whatever this field says.
- Guide assignments are native to this SIS, not pass-through. One row
  links one **enrollment** to one guide. `assignmentType` is the role of this assignment on that enrollment
  (`MAIN_GUIDE` / `CO_GUIDE` / `LEAD_GUIDE`), stored as given, never copied from the guide's `guideType`: a `LEAD_GUIDE` guide can hold a `MAIN_GUIDE` assignment, and a `LEAD_GUIDE` assignment is the lead role there; one shown guide prefers `MAIN_GUIDE`, never `CO_GUIDE`. It runs over a start/end window (`startDate` is the date supplied at create, else campus-local today; ending never moves it, and a reassign ends the old row and opens a new one with its own `startDate`), and staff and
  guide workflows author them here; no external platform feeds them.
  THREE reads serve them, with deliberately different grants.
  Student-grained: `GET /v1/students/{id}/expanded`
  (`guideAssignments`, active only), which needs only `students:read`,
  and `GET /v1/students/roster?include=enrollments,guides`, which needs a
  `guide_assignments:read` grant on top of `students:read` (see the
  expanded entry above). The roster puts `guides` on each `enrollments[]`
  row (active only, `[]` when none), never on the
  student row. Without that grant:
  `{"message": "Missing permission: guide_assignments:read"}` — not
  `guides:read`. Guide-grained: `GET /v1/guides/{guideId}/students` needs
  `guides:read` AND `students:read`; one row per assignment, not per
  student. Without `guides:read`:
  `{"message": "Missing permission: guides:read"}`, same 403 as
  `GET /v1/guides?limit=1` without it. Without it, `GET /v1/staff` (`staff:read`) lists active staff by default; keep rows with an active `GUIDE` role (recipe below), not assignments. `assignedStudentCount` on
  `GET /v1/guides` (`guides:read` alone) counts distinct students with an
  open (`end_date IS NULL`) `MAIN_GUIDE` assignment, not rows or `CO_GUIDE`, under the same
  `includeTest`; a future end date is active, not open. Cancelled, withdrawn,
  or transferred enrollments end those assignments on the exit date. On-hold
  and undated cancellations, including an exchange cancel, can still hold one.
- `GET /v1/staff` is the staff directory. It needs `staff:read`. The
  envelope is `{data, pagination}`; **one row is one person**, keyed
  `personKey` (the lowercased email — derived, so it moves when the
  email moves).
  Query pins: `campusId` (uuid) **both filters rows and narrows what is
  inside them** — a scoped read returns staff holding a role at that
  campus plus all-campuses staff, and `campuses` / `roles[].campuses` on
  those rows are narrowed; a role held only elsewhere is absent from
  `roles[]` rather than present with an empty list. A `campusId`
  outside the key's scope is `403`, not an empty page. `includeInactive`
  takes `true` / `false` as strings and `includeInactive` defaults to
  `false`; it filters per staff **record** jointly with campus scope and
  never trims a returned person's `roles[]`. `updatedSince`, `page` and
  `limit` are documented above.
  Row fields: `personKey`, `email`, `name` (a display string, always populated; with no guide record it is the login account's display value and may be the email local part, so do not read it as a legal name when `firstName` and `lastName` are null), `firstName`, `lastName`
  (null without a guide record), `username` (sign-in email, null without a login; may differ from `personKey`), `userId` (the login `users.id`, null when there is none —
  **not a role key**; matching roles on it silently drops a guide
  record), `isActive` (any record active now: `GUIDE` status `ACTIVE`, `USER` login active, staff-member email live; the row and `roles[]` carry no start or end date), `allCampuses`,
  `roles[]`, `campuses[]` (deduplicated union across roles, name order),
  `createdAt` (earliest creation time among the person's records here, not a start date), `modifiedAt` (from staff records, not campuses),
  `staffMemberId` (the staff-member id, null without one; the only key
  on a row with `roles: []`), `assignments[]` (`affiliation` `INTERNAL` ours, `EXTERNAL` the school's; undeleted position rows at `campusId`, else the key's campuses; `startDate` and `endDate` date the position, not the active flag; `[]` means none there).
  `roles[]` carries `recordId`, `source`, `role`, `isActive`,
  `allCampuses`, `campuses[]`, `levelScopeEnabled`/`levelScopeEnabledSource` (null on `USER`). **`source` discriminates two DIFFERENT
  vocabularies**: `GUIDE` means `role` is a guide type; `USER` means a
  staff role or `null` for individually-set permissions (an open list). A `GUIDE` `role` is one of `HEAD_GUIDE`, `LEAD_GUIDE`, `GUIDE`, `READING_SPECIALIST`, `MATH_SPECIALIST`, `SPECIAL_EDUCATION`, `SPEECH_THERAPIST`, `OCCUPATIONAL_THERAPIST`, `SCHOOL_PSYCHOLOGIST`, `SCHOOL_COUNSELOR`, `INSTRUCTIONAL_COACH`, `SUBSTITUTE_GUIDE`, `TEACHING_ASSISTANT`, `STUDENT_TEACHER`, `ENRICHMENT_INSTRUCTOR`, `ADMINISTRATIVE_SUPPORT` today; legacy values are served as stored (open list). A `GUIDE` `recordId` is the `guideId` on
  `GET /v1/students/roster?include=guides` and on
  `GET /v1/students/{id}/expanded` → `guideAssignments[]`, **not the
  `assignmentId`**; a `USER` `recordId` is the staff-user id.
  **`allCampuses` appears at BOTH levels** — on a role it means that
  record serves every campus; on the row it is the OR across records.
  Active guides at one campus: `GET /v1/staff?campusId=<uuid>` (inactive
  excluded by default), then keep rows with a `roles[]` entry whose
  `source` is `GUIDE` and `isActive` is true — and say whether
  all-campuses staff count as "at" that campus, because the wire includes
  them. No role or brand filter: specialist types and district-branded campuses count. `LEAD_GUIDE` and `HEAD_GUIDE` manage assignments, `GUIDE` and `READING_SPECIALIST` get level scope by per-guide opt-in (`levelScopeEnabled`), every other listed type is assignment-only.
  `POST /v1/staff` (`staff:write`) creates a guide or a non-guide staff
  member. A non-guide member has no login unless `canLogin` is `true`.
  `canLogin: true` creates the login and never sends an invite. That login
  carries no SIS role; permissions are set in the staff portal. Name
  `canLogin`, `affiliation` (`INTERNAL` or `EXTERNAL`, required) and exactly one of `positionId` or `positionCode`. The former non-guide values
  `campus_coordinator`, `registrar`, and `head_guide` are not accepted as
  `role`; send `canLogin`, `affiliation` and `positionCode` instead. A taken email changes nothing.
- **This wire is not read-only.** `PATCH` changes a record on
  `/v1/enrollments/{id}`, `/v1/students/{id}`, `/v1/guardians/{id}` and
  `/v1/applications/{id}`, among others. `PUT` and `DELETE` carry, among
  others, the `hubspot-deal` binding, `/v1/students/{id}/admission-status`
  and the student delete; the shadow day and National Admissions sections
  name their own writes. Each needs a grant a read-only census key does
  not hold — a `:write` grant, except `DELETE /v1/students/{id}`,
  which needs `students:destructive:delete` and is NOT covered by
  `students:write`. So a census reader calls none of them — but
  a row you read can move under you because another caller did.
- National Admissions requests are read and written under `/v1/national-admissions-requests`, with `PATCH` and
  `DELETE` on a key's own draft, and their question sets are read under `/v1/national-admissions-question-sets`.
  **National Admissions** above holds the routes, their grants and their MCP tools.
- `statusSource` is the write-ownership latch on an enrollment's
  `status`: `SYNCED` or `MANUAL` on `enrollments.status_source`,
  defaulting to `SYNCED`. On `PATCH /v1/enrollments/{id}` it is the
  caller's declared intent, and a write that omits it or sends `SYNCED`
  is refused when the stored row already reads `MANUAL` — that is what
  keeps a registrar's deliberate move from being reverted by the next
  inbound sync run. **Two reads serve it: `GET /v1/enrollments/{id}` and the census row of
  `GET /v1/enrollments`**, same value for the same enrollment, so a census walk or an
  `updatedSince` catch-up tells a person's `MANUAL` move from a synced one. Not the expanded
  student graph or the roster's nested enrollments — those carry `level` and `levelSource`, not this.
- `level` is the enrollment's band: `WONDER_LAB`, `LEARNING_LAB`, `LEVEL_1`, `LEVEL_2`, `MIDDLE_SCHOOL`, `HIGH_SCHOOL` or null. Level derives from `checkChartGrade`, which derives from `gradeLevel`. `DERIVED` follows its input. `MANUAL` stays locked even when equal to the calculation. Reads: `GET /v1/enrollments/{id}`, `enrollments[]` on `GET /v1/students/{id}/expanded`, `GET /v1/students/roster?include=enrollments`, census `GET /v1/enrollments`. All four carry chart fields. `GET /v1/program-offerings/{id}` does not. `?level=` and `?gradeLevel=` filter census. `RESET` alone or explicit null unlocks and recalculates. Overwriting a lock requires source (409/no save). OpenAPI write sources: `MANUAL`/`RESET`. `DERIVED` is accepted only as an echo of the stored state.
- The wire describes itself, but arguments and column meanings sit on
  different surfaces. Over MCP the tool listing (`tools/list` on
  `POST /dss/mcp`, mirrored at the front's `how.native.mcp.tools`)
  carries each tool's `inputSchema`: that is the argument contract. For
  what a returned column means, read `GET /docs/openapi.json` — keyless,
  answers 200, declares every path with its query parameters and
  response shape, the roster material at
  `paths./v1/students/roster.get.description`. An MCP reader needs that
  document too, and `sis_get_skill` with no arguments names its URL at
  `skill.how.native.selfDescribe`.

`externalIds` is copied from `enrollment_external_ids`. Each entry is
`{type, identifier}`. Observed types: `hubspot_deal_id`, and
`finalsite_enrollment` as `site:contactId:year` (FinalSite has no stable enrollment id). A student's `finalsite_student_id` is `site:contactId`, one per site alias; when the contact ids differ, read the enrollment key for the enrollment and the student key for the student. The array is sparse — many roster enrollments are
`[]`. An entry is a claim owned by the origin system, ratified there,
not a standing equivalence between an enrollment and a deal. Joining the
roster to HubSpot on `hubspot_deal_id` without sizing coverage first
silently drops every enrollment whose array lacks that type — size that coverage
the way **HubSpot deal bindings** step 3 says.

`applicationId` is `enrollments.application_id`: a SIS application UUID, or null. Null means
no linked SIS application, not an unwritten column, and not a missing HubSpot deal. Deals are
`externalIds` type `hubspot_deal_id`.
**That UUID resolves against the SIS `applications` table.** Read it with
`GET /v1/applications/{applicationId}` (`sis_get_application`, needs
`applications:read`): the row `GET /v1/applications` lists, with the fields of
the expanded entry whose `applications[].id` matches, plus `videoUrl` and
`accommodationsAcknowledged`, present only with `applications:info:view`.
`GET /v1/applications/{id}` also accepts a HubSpot deal id. `/stream` and `/batch` add `id` (this UUID)
and stable `applicationId`: the pinned deal id, else this UUID. Unmigrated campuses: HubSpot.

A `GET /v1/applications` (`sis_list_applications`) row is the SIS application, not the HubSpot deal. It
carries no `dealstageId` or `admissionsStage`; its HubSpot deal id is the
`externalIds` entry of type `hubspot_deal_id`; none means no deal is bound on the row, and the wire does not say whether one should be. `gradeLevel` is the grade that
application was made for, nullable; null means none was stored. It is not the
enrollment grade or level. Its `status` can differ from the
deal's stage (SIS `ACCEPTED` where HubSpot reads `CONVERTED`). HubSpot deals with no
SIS application, including summer-camp deals, are not listed: re-enrollment and summer deals never create an application, exchange deals never touch one, and a New Enrollment deal without one has none bound. The year is the offering's year.
`shadowDate` is the date of the latest SCHEDULED or ATTENDED visit: null if all were cancelled or missed, absent if none. A later visit replaces it: count past-week visits on `sis_list_shadow_day_visits` (`dateFrom`/`dateTo`). `finalsiteGuideDecision` holds FinalSite's guide-approved and denied dates, kept once filled, separate from `status`. `offerStatus` (`PENDING`, `EXTENDED`, `NOT_EXTENDED`) and `offerDecidedAt` (latest decision write) stay null until one is recorded, even on an `OFFERED` row. No `campusId` reads
every campus in scope. Test students are left out unless `includeTest=true`, so
the default `pagination.total` is a real headcount. Each row also carries `studentName`, the
student's displayed name, beside `studentId`: a count-only read tallies in memory or drops it before writing rows.

### The nine roster `include=` expansions

`GET /v1/students/roster` takes exactly nine `include=` members — on
the `sis_list_student_roster` tool the same nine names go in the
`include` argument, as a JSON array or as one comma-joined string. Each
needs its own grant on top of `students:read`, and is omitted entirely
rather than nulled when the grant is absent. Six of the nine —
`contacts`, `household`, `medical`, `photos`, `consents`,
`accommodations` — are student-grain family, health and media data that
no `GET /v1/enrollments` row carries.

- `enrollments` — the enrollments matching the caller's pins, nested per
  student; not the student's full history. Needs `enrollments:read`.
- `consents` — per-enrollment consent records nested inside each
  enrollment row. Needs `enrollments:read`, and a 400 unless
  `include=enrollments` is also asked.
- `guides` — the guide assignments already described above. Needs
  `guide_assignments:read`, and a 400 unless `include=enrollments` is
  also asked.
- `household` — the households the student belongs to, with their
  postal address; an address and its membership, not a contactability
  list. Needs `households:read`.
- `contacts` — everyone a school may have to phone about this student.
  "A parent with a phone" is a guardian row here with `phone` set; say
  whether non-guardian contact rows were counted too.
  Guardian rows hold a recorded relationship to this student and
  contact rows are the student's own non-guardian contacts; not the
  household roll; do not derive contactability by joining `household`.
  Needs `guardians:read`.
- `medical` — health records per granted category, filtered to the
  categories the key holds (`students:medical:<category>:view`), so two
  keys receive different answers to the identical call. `hasMedical` is
  true for a record in any granted category, the general health form
  included; allergies and medications are categories of their own.
- `photos` — the student's photo library and the staff-selected photo.
  Needs `students:photos:view`.
- `accommodations` — the testing accommodations a school must honour.
  Needs `students:education:view`. To count, `sis_query` filters `assessments.hasMapAccommodation` and `assessments.hasAcademicTestingAccommodations`.
- `shadowVisits` — High School shadow visits under `shadow=include` or
  `shadow=only`. Needs `applications:read`. A 400 unless `shadow` is set.
  Without the grant the roster returns and the key is omitted.

The field-level contract for all nine — what each column means, which
are null on which row, how to read the medical source states — lives in
the route's own description, `paths./v1/students/roster.get.description`
at the keyless `/docs/openapi.json`.
Not here.

## Stripe accounts: payment_provider_accounts

Captured. One Stripe account per legal entity and mode (`TEST`, `LIVE`); a shared `TEST` row lacks `legalEntityId`. `status` is `PENDING_ONBOARDING`, `ACTIVE`, `RESTRICTED` or `DISABLED`; charge only when `chargesEnabled`. `provider_events`, the Stripe event log, is not on this wire.

## Payments: payments

Captured: one attempt to pay a fee or deposit, `TEST` or `LIVE`; only `LIVE` is real money. `status`: `PENDING`, `PAID`, `FAILED`, `EXPIRED`, `REFUNDED`, `PARTIALLY_REFUNDED`, `DISPUTED`. `GET /v1/applications/{id}/payments` (`sis_list_application_payments`), `financials:payment:read`, campus-scoped; `sisPayments` says what is paid. `POST /v1/applications/{id}/payment-link` needs `financials:payment_link:write`.

## Health reminders: not on this wire

None is served here. `[code]`

`immunization_reminder_episode_events`, `immunization_reminder_ledger`, `health_reminder_opt_outs`, `immunization_reminder_campus_runs`, `immunization_reminder_campus_progress`, `immunization_reminder_address_sends`.

## Data Health

Four nightly audits: `internal`, `finalsite`, `clever`, `timeback`; needs `data_health:audits:view`. The `timeback` audit tests statements, not one roster-coverage figure; among them an active child who cannot use TimeBack (`A2.1.1`), whose TimeBack home or student/parent role org matches none of their Pending Review, Confirmed or Enrolled seats in the latest started offering year, not 1 August's (`A3.1`), differing (`A5.2`) or not learning (`L1`: no `timeback.learning_days` row, where any XP or question counts, on any date since the first of the last ten school days: weekdays in the seat's offering dates without a HOLIDAY, BREAK or IN_SERVICE entry, judged once ten have passed since the seat started; another TimeBack table applies neither rule, so its count differs). On the nightly TimeBack mirror, an active, enabled, non-test student account is `A2.3.1` in a mapped school, `A2.3.1.info` (unscored) in an unmapped one, when its ids are malformed, a placeholder-like name has no live non-test SIS match, or nothing matches; it may have a SIS child. A campus-limited key reads its campuses' counts and findings; scores, runs and Time to TimeBack are 403. `[code]`

- `GET /v1/data-health/scores` (`sis_get_data_health_scores`): each audit's score and overview cards. A score is the percent of covered children with nothing to fix; only `inScore` statements lower it, and colour follows the worst finding.
- `GET /v1/data-health/audits/{audit}` (`sis_get_data_health_audit`): latest completed run and every statement (title, unit, certainty, counts).
- `GET /v1/data-health/audits/{audit}/runs` (`sis_list_data_health_runs`): completed runs, newest first, with statement counts. FinalSite runs add `sourceReadyAt`, `sisReadAt` and `campuses` (per site: `result` `match`/`differences`/`could_not_compare`/`not_in_scope`, `reason`, `differenceCount`). `from` and `to` pick run dates.
- `GET /v1/data-health/audits/{audit}/statements/{statementId}/findings` (`sis_list_data_health_findings`): one statement's findings in one tab. Filters: `findingKey`, `recordId` (student or related record), `campusId` (comma-separated ids), `how` (only with `tab=resolved`: `fixed`, `not_a_problem`, `expected_by_rule`).
- `GET /v1/data-health/findings` (`sis_search_data_health_findings`): findings across every statement; needs `recordId`, `findingKey` or `campusId`. Takes `tab`, and `how` with `tab=resolved`. Each item names its audit and statement.
- `POST /v1/data-health/audits/{audit}/statements/{statementId}/findings/decisions` (`sis_decide_data_health_finding`): mark a finding `not_a_problem` or `resolved`, or `undo` that; the first two need `why`. Needs `data_health:findings:write`. Answers the finding and a `change`. `undo` on a `different_child_at_gate` pair returns 409; duplicate review undoes it.
- `POST /v1/data-health/audits/{audit}/statements/{statementId}/findings/references` (`sis_add_data_health_finding_reference`): attach a `kayako` case (number or `central-supportdesk.kayako.com` address), a `github` issue or PR address, or a `note`.  Needs `data_health:findings:write`.
- `GET /v1/data-health/time-to-timeback/runs` (`sis_list_time_to_timeback_runs`): nightly test student and time to reach TimeBack.
- `GET /v1/data-health/held-records` (`sis_list_data_health_held_records`) and `.../{studentId}` (`sis_get_data_health_held_record`): records the gate holds, and one student's case; `duplicates[].rule` names the gate rule or is `null` on an audit-only `merge_requested` pair. Needs `data_health:held_records:view`.
- `GET /v1/data-health/intake-refusals` (`sis_list_data_health_intake_refusals`) and `.../{id}/history` (`sis_get_data_health_intake_refusal_history`): refused intake writes (`reason`, `detail`, `candidateStudentIds`) and one refusal's episode history. Needs `data_health:intake_gate:view`.

Tabs: `needs_action` holds undecided findings; `resolved` holds findings marked fixed or not a problem, gate-decided "different child" pairs (`resolution.kind` `different_child_at_gate`, with optional `reason`, `decidedBy`, `decidedAt`, and `undoable: false`), rows an audit rule expects, and findings the latest run no longer finds. `scored` false marks a `needs_action` finding that does not lower the score: a statement outside the score, a duplicate pair the model does not read as the same child, or a FinalSite row waiting on FinalSite data or held at the intake gate. On FS-S1, FS-S4 and FS-E3 a rule-explained row carries `expectedReason`: an expected difference is `resolved` (`resolution.kind` `expected_by_rule`), a waiting or held one stays `needs_action`. Each finding carries `references` (`kind`, `value`, `url`, `addedBy`, `addedAt`).  Items carry full `rows` (names included) and `campuses` (`id`, `name`).

`aiJudgment` (pairs): `verdict`, `model`, `confidence`, `reasoning`. `investigation`: newest AI investigation (`result`, staff `reviews`) or null. Advice only.

Source tables: `data_health_runs`, `data_health_run_statements` (with `explanation`), `data_health_run_campuses`, `data_health_findings`, `data_health_finding_decisions` (user, or API key id and name), `data_health_finding_references`, `data_health_kayako_cases`, `data_health_kayako_posts`, `data_health_finding_investigations`, `data_health_investigation_reviews`, `data_health_intake_refusals`, `data_health_intake_refusal_history`, `data_health_intake_corrections`, `student_duplicate_findings`, `student_duplicate_finding_decisions` and `data_health_time_to_timeback_runs`.

Not on this wire as tables: `data_health_email_sends`, `campuses.data_owner_user_ids`.

## Correcting intake

**Correcting intake (any source)**

- A correction is a value for one field of one source record, with a mode. The sync for that source decides how to use it. It is not tied to a refusal. A refusal on the Intake gate is the usual signal to set one.
- Only send a value someone who knows it confirmed. Never infer it or copy it from another system. Say where it came from in `valueSource`.
- `mode`: `FALLBACK` (used only when the source sends no value). `OVERRIDE` is not enabled yet.
- Send everything known about a record in one `sis_apply_data_health_intake_corrections` call, one `SET` item per field. On 400, follow `fix`.
- `REVOKE` ends the active correction for a field.
- `GET /v1/data-health/intake-corrections` (`sis_list_data_health_intake_corrections`) lists active corrections, with history through `includeEnded=true`. Needs `data_health:intake_corrections:view`.
- `POST /v1/data-health/intake-corrections` (`sis_apply_data_health_intake_corrections`) applies 1 to 50 `SET` or `REVOKE` items atomically. Needs `data_health:intake_corrections:write`. Both routes require an org-wide key. Who changed a correction is in the activity log.

**Naming the record (any source)**

- A record is `source` + `sourceRecordIdentity`. The identity is opaque: take it where the source's block says, never build or parse it.

**Clever**

- `source` is `CLEVER`. `sourceRecordIdentity` = the Clever refusal's `sourceRecordId`, unchanged. Today it is the Clever student id, but that format may change.
- Fields: `DATE_OF_BIRTH` for `dob_missing`. `FIRST_NAME` / `LAST_NAME` for `name_missing`. Mode `FALLBACK` only.
- Other refusal reasons cannot be fixed with a correction (e.g. `dob_implausible` is fixed by the district).

## Parent reads: `/v1/me`

`/v1/me` serves a signed-in parent's own household, children, applications, enrollments, forms, documents and shadow days. It takes parent portal tokens only: staff keys and MCP tokens are refused, and it is not an MCP tool. `[code]`

Parents never see internal statuses or the guide verdict; the API maps them. Application status (also on a child's `latestApplication`): `APPLIED`; `SHADOW_DAY_SCHEDULED` (shadow scheduled, forms signed); `RESHADOW_REQUESTED` (the guide asked for another shadow day; the parent books it); `IN_REVIEW` (everything after the shadow day up to an offer, including guide approved or not, holds, future enrollment and any unknown status); `OFFERED`; `OFFER_ACCEPTED`; `ENROLLED` (converted); `CLOSED` (rejected, closed). Enrollment status: `ENROLLED` (enrolled, re-enrolling, confirmed, exchange), `PENDING` (pending review, pending deposit, on hold, any unknown), `COMPLETED`, `WITHDRAWN` (withdrawn, transferred, cancelled). Shadow day status: `SCHEDULED`, `ATTENDED`, `CANCELLED` (cancelled, did not attend). Staff reads, MCP and the activity log keep the raw values. `[code]`

A parent's form list leaves out staff-only form types (today `SHADOW_DAY_FEEDBACK`), so it shows neither the row nor a count. `[code]`

## Genesis notes

- `primaryEnrollmentId` — captured on `enrollments.primary_enrollment_id`.
  A uuid of another enrollment, or null. Null is an ordinary enrollment;
  non-null means this row is an exchange visit hanging off that primary,
  whose campus is the one on this row.
- `enrollmentEndDate` — captured on `enrollments.enrollment_end_date`.
  The **planned** last day of an exchange window; null on an ordinary
  enrollment. An exchange that ends early is recorded as `withdrawnDate` plus
  stored `COMPLETED`, so `enrollmentEndDate` is not the date the enrollment
  actually ended.
- `academicYear` — copied from the program offering. `offeringYear` is
  the same value under its deprecated older spelling; read `academicYear`.
- `academicYears` — the same year as `academicYear`. Accepts `2026`
  or the label `2026-27`. **Mind the plural**: the filter is
  `academicYears`, and the row field is `academicYear`. An unknown query parameter is refused
  with a 400 naming it, the closest declared key and the accepted keys, on every /v1 GET.
- `brand` — captured on `campuses.brand_id`. Served on `GET /v1/campuses`,
  **not** on the census row. Null on a deleted brand or unbranded campus.
- "Newly enrolled" — judged, not stored, and new to **the school**; see `## Newly enrolled`.
- `offeringStartDate` — copied from `program_offerings.start_date`.
  First day of school for that enrollment. **Provisional until the offering's
  calendar is defined**: a start date is a placeholder until then, and the
  calendar is usually defined about two months out.
  A start more than two months after your read instant is provisional and
  can move. A start inside two months is defined; read it as correct.
  Nothing on the wire flags it per record. The offering record behind
  `GET /v1/program-offerings/{id}` carries no provisional or verified
  flag, and it is the record this value is copied from, so re-reading it
  shows copy drift and nothing else; `GET /v1/academic-years` serves
  `startYear`, no start dates: no served calendar to test against. Say so when a first-day answer
  rests on a provisional start.
- `enrolledDate` — captured; on a `SYNCED` row (`enrolledDateSource`, served only on `GET /v1/enrollments/{id}`) it is the date the inbound sync sent, not the SIS row's `createdAt`. Null means nobody recorded a date, NOT
  "enrolled from the offering start". Read `effectiveEnrolledDate` for
  that question. May be changed while the enrollment is not closed and
  the student has not started. Tuition calculation reads it.
- "Seated today" vs "committed for the year" — judged: started offerings, a
  blank `enrolledDate` kept; an unstarted offering is committed. Rule and count:
  Seated today vs committed for the year.
- "On the first day" — judged:
  `effectiveEnrolledDate` present and on or before
  `offeringStartDate`. A null is a missing start date: leave it out of
  the first-day answer, state the count, and keep it in a headcount.
  Truly unknown as a stored flag.
  An `offeringStartDate` more than two months after your read instant is
  provisional — see the `offeringStartDate` genesis bullet for the two-month
  rule and why nothing on the wire flags it.
- `withdrawalReason` / `withdrawnDate` — captured, both nullable; the withdrawals section reads them. A dated `withdrawnDate` can precede the row's `offeringStartDate`: a withdrawal before first day.
- `cancelledDate` / `cancellationReason` / `cancellationReasonNotes` —
  captured, nullable, on `GET /v1/enrollments`,
  `GET /v1/students/{id}/expanded` and `GET /v1/enrollments/{id}`.
  `Other` keeps its cause in the notes. Pin `status=CANCELLED`, never
  date presence. `PATCH /v1/enrollments/{id}` accepts `cancellationReason`,
  `cancellationReasonNotes` (required for `Other`), an unstored boolean
  `neverAttended`, and `cancelledDate` (on or before today, UTC) on a
  CANCELLED row or beside `status=CANCELLED`. Refused: a later date, a bare
  null, any value (null included) beside another `status`.
  A cancellation sent without `cancelledDate` is dated today (UTC) with
  `cancelledDateSource` `OBSERVED`, a placeholder any real date replaces.
- `gradeLevel` — captured; nullable. Null is an ungraded enrollment, not a
  campus or delivery-mode rule. This row's value is the grade of that
  enrollment in that offering year — the census value, and the only valid
  source of a student's grade.
  Grade lives on the enrollment row. The student object on `GET /v1/students`,
  `GET /v1/students/{id}` and `GET /v1/students/{id}/expanded` carries no
  `gradeLevel`, and `PATCH /v1/students/{id}` refuses one — set a grade on
  the enrollment, through `POST /v1/enrollments` or
  `PATCH /v1/enrollments/{id}`. On
  `POST /v1/students/onboard`, `students[].gradeLevel` seeds the grade
  of the enrollment it creates, so that input reaches the census row.
  `GET /v1/students/roster` serves no student-object grade — its
  `?gradeLevel=` filters the enrollment, and the grade is read from
  `enrollments[].gradeLevel`.
- `email` on create — optional on `POST /v1/enrollments`. Stored as
  given. Fills a blank student email. Does not replace one already set.
- `transferDate` and kin: see Withdrawals, completions, transfers; never print `transferReason`.

## Homeschool learning documents

`homeschool_filings.learning_facts`/`learning_summary`: audit copies saved with `learning_summary_saved_at`, preserved by Lock. Filing views and `GET /v1/homeschool/filing-periods/{periodId}/students/{studentId}/learning-summary` compute live.

## Homeschool AI prompts

`program_offering_homeschool_settings.ai_prompts`: campus-year overrides (`homeschool-ai-prompts-v1`). Null/missing=default. Keys: `QUARTERLY_MATERIAL_COVERED`, `QUARTERLY_UNDER_80_EXPLANATION`. External settings GET: `homeschool_forms:view`, campus-scoped, variable schemas included.

## Homeschool filing PDFs

`homeschool_filings.revision`: default 1. Lock freezes `pdf_s3_key`/`pdf_sha256`. Legacy locks materialize on demand. Unlock clears both. Drafts rebuild. Links expire after 5m. Downloads audit portal/draft/revision/hash, previews don't.

`PUT`/`DELETE /v1/homeschool/deliveries`: SHA-only mark/reset. Strict `pdfSha256` (either case), optional source `note`, PUT-only `deliveredAt`. Scoped live locked lookup. Permissions: `homeschool_forms:filings:manage` + `homeschool_forms:view`. Missing/ambiguous: 422 `PDF_NOT_ON_FILE`/409 `PDF_AMBIGUOUS`, no writes. `homeschool_filings.delivered_at`/`delivered_pdf_sha256`/`delivery_note`: persisted mark, preserved on unlock, cleared on reset. `delivery:{state,deliveredAt,note}`: locked matching/different PDF = `CURRENT`/`OLDER_VERSION`, otherwise `NONE`/null/null. Hashes never returned. Replays preserve timestamp/note/audit. Reset note is audit-only.
