Naalya Handbook
School features

School settings

The /school routes. The signed-in school's identity and current year, its settings and sign-in credentials, branding, and the two public lookups the login pages use.

Read this page when you change a school-wide setting, the school's branding, or a login page that has to find a school before anyone signs in. Every route below lives on SchoolController in apps/server/src/app/school/school.controller.ts. The logic is in school.service.ts in the same folder. Both were read at API fbb63d51. On 20 November 2026 the controller was read again at f57b8103 and the nine routes, the body filter, the audit change keys, and the logo checks match this page. school.service.ts was not re-opened at that tip. Nothing here was run against a live app.

This is the only page for these routes. A second "My school" page was drafted and never published, and nothing in the handbook links to it. The docs app has no alias map for an old page address.

Creating, suspending, and impersonating schools is operator work. It lives on the platform routes on School operations, not here.

The routes

All routes are under /api/v1/school. Except for the two public routes, each one works on the caller's own school, which comes from schoolId in their JWT. No route takes a school id in the path.

Method and pathOperation idWho can call it
GET /megetMySchoolAny signed-in staff, student, guardian, or guest
GET /publiclistPublicSchoolsAnyone (@Public())
GET /by-reference/:referencegetSchoolByReferenceAnyone (@Public())
GET /configgetMySchoolConfigread on school
PATCH /configupdateMySchoolConfigupdate on school
PATCH /config/identityupdateMySchoolIdentityConfigThe Super Admin system role and update on school
GET /brandinggetMyBrandingAny signed-in staff, student, guardian, or guest
PATCH /brandingupdateMyBrandingupdate on school
POST /branding/logouploadMyLogoupdate on school

Each PATCH route and the logo upload carry @Audit with action update on resource school, and a change context of config, identity, branding, or logo. The two config routes also record a before and after snapshot of the config row.

The school and its current year

GET /me returns the school row plus a context block. buildContext lists every campus by name and, for each one, the campus academic year and term whose isCurrent flag is set. A campus with no current year gets currentAcademicYear: null, and one with no current term gets currentTerm: null. The year carries lockedAt, so a client can tell from this one call whether the current year accepts changes.

This block is a display pointer. It follows isCurrent, as the rest of the platform does. Writes are gated on the year's lock, not on this flag. See Academic-year scoping.

Settings and sign-in credentials

The config row holds two kinds of field, and each kind has its own route.

  • General settings go through PATCH /config: time zone, contact details, payments, the default campus, and the rest of UpdateMySchoolConfigDto.
  • Sign-in identity goes through PATCH /config/identity. SCHOOL_IDENTITY_FIELDS in dto/school-config.dto.ts lists them: superAdminEmails, microsoftClientId, microsoftClientSecret, microsoftTenantId, teamsBotAppId, and teamsBotAppSecret.

The global validation pipe does not strip unknown fields, so the controller filters the body itself. PATCH /config drops any identity field and the operator-only staffStorageLimitBytes. PATCH /config/identity keeps only identity fields. A dropped field is ignored without an error, so a request can return 200 and still not change the field the caller sent.

updateConfig refuses a defaultCampusId that is not a campus of the same school, with a 404 and Campus not found.. After a write it clears the cached Microsoft client for the school (MicrosoftClientFactory.invalidate), so the next Graph call uses the new credentials. It also sends a realtime invalidation, SCHOOL_UPDATE_CONFIG, so open Hub screens refetch.

In the Education Hub these routes back the tabs under Settings at /staff-hub/school/settings. The identity fields are on the single sign-on tab.

GET /branding never returns 404 for a missing row. A school created before the branding table existed gets default values, so the branding screens still load. PATCH /branding and the logo upload create the row on first write (getOrCreateBranding).

The logo upload takes one file field. ParseFilePipe refuses a file over 5 MB or one that is not PNG, JPEG, or WebP. The service resizes the image to fit inside 512 by 512 pixels, uploads it as storage type SCHOOL_LOGO, and points the branding row at the new storage record. Both branding writes send a realtime invalidation (SCHOOL_UPDATE_BRANDING or SCHOOL_UPLOAD_LOGO).

The public lookups

These two routes run before sign-in, so both run outside the tenant scope (runUnscoped).

  • GET /public lists active schools only, by name, with each school's name, reference, and logo URL when it has one. The optional search query matches the name or the reference, ignoring case. The list is not paginated.
  • GET /by-reference/:reference returns one school's name, status, and branding for its login page, plus four feature flags: admissions, recruitment, student portal, and guardian portal. It returns a suspended school too, with status: "suspended", so the page can say the school is suspended. An unknown reference gets 404 School not found.

The Hub calls both through src/queries/school/school.query.ts, read at Hub 9e84f4c3.

On this page