Scope
The contract covers employee self-service:
Every endpoint is self-scoped: it serves the caller’s own data, resolved from the
session, with no id parameter to swap. There is no HR- or admin-facing public API —
those surfaces are internal to the dashboard.
Generated, not hand-written
The specification is generated from the same Zod schemas the server validates requests and responses against. It is regenerated bynpm run gen:openapi and verified
byte-for-byte in CI, so the published contract cannot drift from the running code.
This is ADR-009. The mobile app regenerates its Dart client from the
artifact, which is why drift would be a cross-repo breakage rather than a documentation
nit.
Do not hand-edit the specification. A change starts in the Zod schema under
src/lib/contracts/portal/, and the spec follows.Base URL
Swiss HR Easy is single-tenant, so each customer install serves the contract from its own host:Getting started
Authentication
Sessions, SSO, and why the mobile client is SSO-only.
Conventions
Response envelopes, error shapes, pagination, and idempotency.