Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Roadmap and website: v1.3.11 and v1.3.12 before the new exercise database, no em dashes
Duarte Santosf049465c1e47
diff --git a/README.md b/README.mdindex ce3394baf..a1ed63e85 100644--- a/README.md+++ b/README.md@@ -4,7 +4,7 @@**A self-hosted gym and body-weight tracker you actually own.**-Plan your week, run guided workouts, log every set and your body weight —<br>+Plan your week, run guided workouts, log every set and your body weight,<br>on your phone, synced across your devices, behind your own passkey login.[](https://discord.gg/e62jY6fwVb)@@ -261,14 +261,19 @@ The [documentation index](docs/README.md) sorts every guide by who it's for. TheA release roughly every two weeks, each small and themed. The full plan is in[ROADMAP.md](ROADMAP.md), and the issues sit in the-[GitHub milestones](https://github.com/DuarteSantos8/openGym/milestones). The next release is a-new exercise database; the plan after it is being reshuffled around that.+[GitHub milestones](https://github.com/DuarteSantos8/openGym/milestones). The next two releases+finish the community wishes, then comes a new exercise database and a themed release every+two weeks after it.| Release | When | Theme ||---|---|---|| v1.3.10 | released Oct 2026 | New design, rotation, swipe actions, safer sync |-| v1.4.0 | next | A new exercise database |-| later | | Google Play and an iOS app, programmes, the progression engine, cardio, database storage |+| v1.3.11 | next | Fixes, about thirty community pull requests, Health Connect, measurements |+| v1.3.12 | Nov 2026 | Community features: focus view, widget, timer rework |+| v1.4.0 | Nov 2026 | A new exercise database |+| v1.4.1 to v1.4.4 | Dec 2026 and Jan 2027 | Programmes, the progression engine, cardio |+| v1.4.5 to v1.4.10 | Jan to Apr 2027 | Search, accounts, the iOS app, Android and health, looks |+| later | | Database storage |## Communitydiff --git a/ROADMAP.md b/ROADMAP.mdindex ac6d19551..44a1d8ff6 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -10,14 +10,14 @@ block, the date does not move. Version numbers follow the release rule, not thethe next release is the last published one plus one patch (1.3.7 → 1.3.8), and a minor bump isreserved for something that breaks compatibility, like the new exercise database (v1.4.0).-- Milestones: https://github.com/DuarteSantos8/openGym/milestones — every open issue sits in exactly one-- Tracks, in order: promised items → history editing → queue and programmes → the progression- engine → cardio → **the foundation (database, then search)** → accounts → the iOS app → Android- and health → exercises → looks and social+- Milestones: https://github.com/DuarteSantos8/openGym/milestones (every open issue sits in exactly one)+- Tracks, in order: fixes and community features → the new exercise database → programmes → the progression+ engine → cardio → search → accounts → the iOS app → Android and health → looks and social,+ with database storage after that----## v1.3.2 and v1.3.3 — Cleaner workout (released 2026-09-05)+## v1.3.2 and v1.3.3: Cleaner workout (released 2026-09-05)**Theme: the workout screen gets out of the way.** Fewer things to tap, the things you tap every setstay where they are, everything else moves one tap away. Compared with Hevy or Strong the screen was@@ -30,7 +30,7 @@ Shipped: v1.3.2 is the contributors' batch, v1.3.3 the redesign and the bug roun- One menu per exercise (note, details, progression, bar weight, warm-up, superset, swap, move,remove) and one per set (drop set, rest-pause burst, remove) (#20)- Settings → During a workout → "Workout controls": +/− buttons, drop/burst shortcuts, superset- buttons, move/swap/remove buttons — each switch brings an old button row back+ buttons, move/swap/remove buttons; each switch brings an old button row back- Colour-coded RIR/RPE picker with a plain-language explanation per level; the empty cell is onebutton, a logged rating is tinted by how close to failure it was (!91, #32)- Automatic working weight, no confirmation prompt, no auto-advance (!92, #18)@@ -60,7 +60,7 @@ Left over from this block:- A real pause for the workout timers (#29 asked for it)- Discord announcement (owner)-## v1.3.6 and v1.3.7 — Sync, push and the phone (released 2026-09-12)+## v1.3.6 and v1.3.7: Sync, push and the phone (released 2026-09-12)Signed in, the server's profile is the truth: sign-in adopts it, two devices merge on a serverrevision instead of overwriting each other, the app polls for changes and works offline with a@@ -72,9 +72,9 @@ the phone, nginx resolver, custom-exercise equipment, per-side data, warm-up resQA sweep of every screen. Left over: routine reordering (#142), the Smith-bar "no bar" option(#138), two decimals (#139), delete user in the admin (#107).-## v1.3.8 — Promised items (released 2026-09-20, a week early)+## v1.3.8: Promised items (released 2026-09-20, a week early)-All four promises, plus the iOS keyboard, the assisted machines and a QA sweep of every screen —+All four promises, plus the iOS keyboard, the assisted machines and a QA sweep of every screen:twenty-four reports in total. See the changelog for the full list.- Reorder routines in Plan; the Start sheet follows that order (#142)@@ -86,15 +86,15 @@ twenty-four reports in total. See the changelog for the full list.- The small open pull requests: unknown-path redirect (#185), manifest behind an auth proxy (#184),standard ß (#190); the distance mode (#177, #178) moves to a later release-## v1.3.9 — Editing history (released 2026-09-28, two weeks early)+## v1.3.9: Editing history (released 2026-09-28, two weeks early)-Edit a saved workout, its date, start time and duration, with photos and videos on it — plus the+Edit a saved workout, its date, start time and duration, with photos and videos on it, plus thetwo Discord reports (a paired phone that silently stopped syncing, a plan that opened at the wrongreps) fixed at the root, and a good part of later milestones pulled forward: password sign-in andextra passkeys, custom-exercise pictures, the Android rest notification, plate loading per set,Structural Balance, Ukrainian and Arabic. Thirty-nine community pull requests. See the changelog.-- **Edit a finished workout** — date, start time, duration, sets, weights, exercises; progression+- **Edit a finished workout**: date, start time, duration, sets, weights, exercises; progressionand 1RM history re-read the corrected session (#143, #203, #263, #218)- Save a logged workout as a routine (#111, #211); repeating a past workout from History andundo finish (#58, GitLab !130) move to v1.3.10@@ -122,19 +122,43 @@ the full list.- Still to come from the old block: undo finish (GitLab !130), relabelling an "Unknown" exerciseafter an import, body measurements (PR #82), drag-and-drop on touch (#114)-## Next: v1.4.0, a new exercise database+## v1.3.11: Fixes, community pull requests and the most-asked features (2026-10-18)-The next release brings a new exercise database. Details follow once it is ready. The blocks-below keep their themes, but their version numbers and dates move once it is out.+The round right after the redesign. Already on gym-test as a release candidate: about thirty+community pull requests, the rest chime that plays with the screen off, pairing the Android app+over plain http on your own network, smoother exercise swipes and pyramid weights over MCP. On top,+the things people asked for most on Discord: Health Connect (#371), body measurements (#82), a 1RM+formula picker (#195), collapsing finished exercises (#241), editing supersets (#292, #293) and time+per side (#444).-## v1.3.11 — Programmes & phases (2026-11-08)+## v1.3.12: Community features (2026-11-01)++The long-waiting community pull requests that need a rebase or a design call: a focus view (#222),+the timer rework (#165), a home-screen widget (#299), distance for cardio (#177) and showing last and+next on the finish sheet (#324).++## v1.4.0: A new exercise database (2026-11-15)++**The one compatibility step.** The exercise catalogue is replaced by a new, licensed one with+proper animations, which means exercise ids change. Your history, routines, custom exercises,+favourites and import aliases are migrated on first start, so nothing you logged gets lost. Old+apps keep working until they update. Details follow once it is ready.++- New catalogue with names, muscles, equipment and instructions in every app language+- Bench with flat / adjustable, TRX / suspension, lats and the three delts as their own+ categories, exercises that should not carry weight, more routine icons (#132, #188; Discord)+- Media on built-in exercises and picking a picture from the catalogue for your own (#259)+- One progress line per set number (#145); custom heatmap targets per muscle; a shareable image+ after a workout (Discord)++## v1.4.1: Programmes & phases (2026-11-29)- Programmes: routines grouped into a named block over weeks, with deload and rest weeks, severalper profile (#159, GitLab !98; Discord "Programme mode", "folders", "major good ideas" 1)-- Session phases — mobility / work / accessory / cooldown — with completion-only exercises for+- Session phases (mobility / work / accessory / cooldown) with completion-only exercises forstretching that stay out of volume and PRs (#57, #140; Discord "non-typed exercises")-## v1.3.12 — Progression engine I (2026-11-22)+## v1.4.2: Progression engine I (2026-12-13)- A universal AMRAP / "to failure" flag and rep or set ranges per set (#154; Discord "Sets toFailure", "More types of sets")@@ -142,14 +166,14 @@ below keep their themes, but their version numbers and dates move once it is out- Multi-formula 1RM with Epley as the default shown (#155); assisted exercises as negative addedweight (#176)-## v1.3.13 — Progression engine II (2026-12-06)+## v1.4.3: Progression engine II (2026-12-27)- Load as %1RM or auto with a stored training max, target RPE/RIR (#153)- Wave / percentage progression, 5/3/1 style (#70; PR #168)- A warm-up generator that picks the ramp from load and lift (#156)- Periodisation extras on top: mesocycle blocks, auto-regulation on RPE (#120)-## v1.3.14 — Cardio, alternatives, groups (2026-12-20)+## v1.4.4: Cardio, alternatives, groups (2027-01-10)- Cardio: incline and intervals (rounds × work/rest), interval programmes such as C25k, rucking asdistance + pace + load (#132, #169; Discord "incline treadmill", "cardio programs", "rucking")@@ -157,19 +181,9 @@ below keep their themes, but their version numbers and dates move once it is out(#110)- Complexes and interval groups beside supersets (Discord)-## Later: database storage--**The one compatibility break.** Storage moves from one JSON file per profile to a database (#191):-tables for workouts, sets, routines, weigh-ins, custom exercises, favourites, credentials, push-subscriptions and Coach data; an idempotent migration on first start; the old files kept until the-admin removes them. The state file stays the import/export and backup format, and the revision/merge-contract from v1.3.6 stays the client contract. Which database is decided in the issue — embedded by-default so `docker compose up` stays one line, a server database as an option (Discord-"Postgres/SQLite"). Nothing else rides on this release; it gets the three-week slot over the holidays.+## v1.4.5: Search (2027-01-24)-## v1.4.1 — Foundation: search (2027-01-24)--- Search rebuilt over catalogue names in every language, import aliases, custom exercises and+- Search rebuilt over the new catalogue names in every language, import aliases, custom exercises andhistory: typo tolerance (GitLab !122), a live result count (!31), filters that compose, built onceper catalogue version (#192)- Shared custom exercises between accounts on one instance (#151)@@ -177,29 +191,29 @@ default so `docker compose up` stays one line, a server database as an option (Dshared (Discord "How to deal with different gyms")- Admin: per-user export, invite management, audit log filters-## v1.4.2 — Accounts: password & OIDC (2027-02-07)+## v1.4.6: Accounts: password & OIDC (2027-02-07)- Optional username + password login next to passkeys (#118; Discord "Basic login", the- password-manager thread) — shipped early in v1.3.9, behind `PASSWORD_LOGIN`+ password-manager thread), shipped early in v1.3.9, behind `PASSWORD_LOGIN`- OIDC login for PocketID / Authelia-style setups (#130, #72; GitLab !132 is the candidate)-## v1.4.3 — Trainer & MCP write (2027-02-21)+## v1.4.7: Trainer & MCP write (2027-02-21)- Personal-trainer role: invite students by code, open a student read-only, write their plan (#119,GitLab !79; Discord "Trainer & Student Management")-- MCP write tools — routines, log corrections, equipment — in pieces (#116); remote MCP over OAuth+- MCP write tools (routines, log corrections, equipment) in pieces (#116); remote MCP over OAuthfor hosted AI clients (GitLab !88)- Switching kg ↔ lb converts stored values instead of relabelling them (#22)-## v1.4.4 — iOS app (2027-03-07)+## v1.4.8: iOS app (2027-03-07)- App Store / TestFlight build of the existing Capacitor target, HealthKit weight and workoutexport, the Home Screen icon and timer-sound issues gone for good (#90; Discord "Google Health")- Apple Watch rest timer later, once the app is in the store-## v1.4.5 — Android & health (2027-03-21)+## v1.4.9: Android & health (2027-03-21)-- Health Connect for weight and sessions (Discord "Use health connect"); Withings and other scales+- Health Connect for weight and sessions (Discord "Use health connect", pulled forward into v1.3.11); Withings and other scales(#127)- The rest timer as an ongoing notification on the lock screen (#122, PR #296) (shipped in v1.3.9); ahome-screen widget (#125)@@ -207,21 +221,10 @@ default so `docker compose up` stays one line, a server database as an option (Dsecond half)- Media for the routine's exercises cached on the phone, so a session works with no signal (#123;Discord "Download all videos")-- Firefox-on-Windows QR and third-party passkey providers stay documented, not fixed — platform+- Firefox-on-Windows QR and third-party passkey providers stay documented, not fixed: platformbehaviour (#103, #101)-## v1.4.6 — Exercises & catalogue (2027-04-04)--- Pictures for custom exercises: upload a photo, GIF or video and a link per exercise (shipped in v1.3.9)- (#126, #170); picking one from the catalogue and media on built-in exercises (#259) stay here- (Discord "custom images/GIFs", "upload videos")-- Catalogue: bench as equipment with flat / adjustable, TRX / suspension, lats and the three delts- as their own categories, exercises that should not carry weight, more routine icons (#132, #188;- Discord)-- Choose what the "last time" line shows on the logger (#173) (shipped in v1.3.9); one progress line per set number- (#145); custom heatmap targets per muscle; a shareable image after a workout (Discord)--## v1.4.7 — Looks, social, plugins (2027-04-18)+## v1.4.10: Looks, social, plugins (2027-04-04)- Skins alongside the accent colour, backgrounds as part of a skin, a big-screen layout (#129,#134, #135)@@ -229,9 +232,19 @@ default so `docker compose up` stays one line, a server database as an option (D- Native NixOS module (GitLab !83) and Azure deployment (!35) only if someone maintains them;Arabic and right-to-left (GitLab !36) (shipped in v1.3.9)+## Later: database storage++**The one compatibility break.** Storage moves from one JSON file per profile to a database (#191):+tables for workouts, sets, routines, weigh-ins, custom exercises, favourites, credentials, push+subscriptions and Coach data; an idempotent migration on first start; the old files kept until the+admin removes them. The state file stays the import/export and backup format, and the revision/merge+contract from v1.3.6 stays the client contract. Which database is decided in the issue: embedded by+default so `docker compose up` stays one line, a server database as an option (Discord+"Postgres/SQLite"). It gets a version number once the work starts, and nothing else rides on that release.+## How things moveAn issue sits in exactly one milestone; a milestone is a Sunday, and whatever is not merged and-tested on gym-test by the Friday before rolls into the next one — the date stays. Contributor pull requests from returning contributors get their pipeline started here+tested on gym-test by the Friday before rolls into the next one, and the date stays. Contributor pull requests from returning contributors get their pipeline started hereautomatically; a first PR is started by hand after a look at the diff. Anything in review is on gym-test.duarte-santos.ch. Releasesbundle whatever has passed that test, with a changelog section per contributor.diff --git a/api/openapi.yaml b/api/openapi.yamlindex a59b8e394..1859eae2d 100644--- a/api/openapi.yaml+++ b/api/openapi.yaml@@ -1,4 +1,4 @@-# openGym HTTP API — hand-written OpenAPI 3.1 spec.+# openGym HTTP API: hand-written OpenAPI 3.1 spec.# Source of truth: api/server.js (a single framework-free Node file). Every route the# server registers is documented here; if you add a route there, add it here too.# Browsable version: https://opengym.duarte-santos.ch/api.html@@ -9,7 +9,7 @@ info:version: 1.3.10summary: Passkey (WebAuthn) auth + per-user state storage for openGymdescription: |- The backend of [openGym](https://opengym.duarte-santos.ch) — a free, open-source+ The backend of [openGym](https://opengym.duarte-santos.ch), a free, open-sourcegym & body-weight tracker. A plain Node server, no framework, JSON-file storage,HMAC-signed session cookies.@@ -32,8 +32,8 @@ info:across them, and wrong answers (a password, a reset code, an invite code on passwordsignup, an e-mail address already in use) pause the address from the 21st on, for 30 s,doubling up to 15 min. Wrong passwords also pause the *account* they were tried- against from the 6th on, for 1 min doubling up to 1 h — the same pause whether the account- was named by its name or its e-mail — and an identifier that names no account is+ against from the 6th on, for 1 min doubling up to 1 h (the same pause whether the account+ was named by its name or its e-mail), and an identifier that names no account ispaused the same way, as typed. A password check counts from the moment itstarts, so checks sent at once get no more tries than checks sent one by one. Apaused caller gets `429 {"error": …, "code": "locked", "retryAfter": <s>}` with a@@ -70,29 +70,29 @@ info:the only one a passkey can be created for.### Environment-dependent behavior- - `INVITE_ONLY=1` — registration requires a valid invite code (minted by an admin).- - `ALLOW_GUEST=0` — hides the client-side "continue without account" mode; the+ - `INVITE_ONLY=1`: registration requires a valid invite code (minted by an admin).+ - `ALLOW_GUEST=0`: hides the client-side "continue without account" mode; theserver merely reports the flag via `GET /api/config` (guest mode never talks tothis API at all).- - `ADMIN_UIDS=<uid>,<uid>` — user ids treated as admins (a `"admin": true` flag on+ - `ADMIN_UIDS=<uid>,<uid>`: user ids treated as admins (a `"admin": true` flag onthe user record in `db.json` works too). Admins get the `/api/admin/*` routes.- - `FIRST_USER_ADMIN` (default off; `1` turns it on) — the first profile registered+ - `FIRST_USER_ADMIN` (default off; `1` turns it on): the first profile registeredon an instance with no profiles gets that `"admin": true` flag. Decided atregistration only, never applied to an instance that already has profiles.- `AUDIT_LOG` (default on), `AUDIT_MAX` (default 5000 events), `AUDIT_DAYS`- (default 90), `AUDIT_IP` (`off` | `net` | `full`, default off) — shape the audit+ (default 90), `AUDIT_IP` (`off` | `net` | `full`, default off) shape the auditlog served by `GET /api/admin/audit`.- - `PASSWORD_LOGIN=1` — adds the `password` routes and `password_login: true` in+ - `PASSWORD_LOGIN=1`: adds the `password` routes and `password_login: true` in`GET /api/config`. Off by default.- - `DEFAULT_LANG` (e.g. `pt-BR`; unset by default) — `default_lang` in `GET /api/config`,+ - `DEFAULT_LANG` (e.g. `pt-BR`; unset by default): `default_lang` in `GET /api/config`,the language of the sign-in screen and of every profile that never picked one.- - `TRUST_PROXY=1` — the throttle reads the client address from proxy headers (set by+ - `TRUST_PROXY=1`: the throttle reads the client address from proxy headers (set bythe bundled `docker-compose.yml`, where only the web container can reach the API).- `MEDIA_UPLOADS` (default on; `0` removes the `media` routes and the `media` block of`GET /api/config`), `MEDIA_QUOTA_MB` (200 per profile, `0` = no cap),`MEDIA_IMAGE_MAX_MB` (2), `MEDIA_GIF_MAX_MB` (8), `MEDIA_VIDEO_MAX_MB` (40),`MEDIA_VIDEO_MAX_SEC` (60), `MEDIA_GC_GRACE_DAYS` (14), `MEDIA_UPLOADS_PER_HOUR` (600- per profile), `MEDIA_MIN_FREE_MB` (512, `0` = no floor) — photos and videos of custom+ per profile), `MEDIA_MIN_FREE_MB` (512, `0` = no floor): photos and videos of customexercises (tag `media`). Every MB here is 2^20 bytes.### Conventions@@ -109,7 +109,7 @@ info:as `{}`. A body over 5 MiB is `413 {"error":"body too large"}`; the rest of theupload is discarded so the answer reaches the client.- CORS: the request's `Origin` is reflected in `Access-Control-Allow-Origin`- **without** `Allow-Credentials` — cross-origin callers can only ever+ **without** `Allow-Credentials`, so cross-origin callers can only everauthenticate with a Bearer token, never with the cookie.license:name: AGPL-3.0-or-later@@ -137,7 +137,7 @@ tags:while the flag is off.- name: passkeysdescription: >-- More than one passkey on a profile: list, add, rename, remove — and one-time device+ More than one passkey on a profile: list, add, rename, remove, plus one-time devicelinks, which let another device of the same person add a passkey of its own.- name: datadescription: Per-user state sync (the whole app state as one JSON blob)@@ -146,7 +146,7 @@ tags:- name: activitydescription: Live-workout presence heartbeat- name: admin- description: Admin dashboard — requires an admin session (`ADMIN_UIDS` or `admin:true`)+ description: Admin dashboard. Requires an admin session (`ADMIN_UIDS` or `admin:true`)- name: mediadescription: >-The photo, GIF or video of a user's own custom exercise, and the photos and videos@@ -155,7 +155,7 @@ tags:404 when the instance runs with `MEDIA_UPLOADS=0`.- name: coachdescription: >-- AI Coach — plans, reviews and debriefs. Every route here answers 503 unless the+ AI Coach: plans, reviews and debriefs. Every route here answers 503 unless theinstance has the Coach switched on and a provider connected.security:@@ -201,7 +201,7 @@ paths:A caller with a valid session also gets a `coach` key: the block when theinstance has the AI Coach switched on **and** a provider connected, and `null`- when it has not. A caller with no session gets no key at all — the block names+ when it has not. A caller with no session gets no key at all. The block namesthe provider this instance talks to, which is the same fact`GET /api/coach/disclosure` will not hand out unauthenticated.@@ -249,7 +249,7 @@ paths:const: truedescription: >-Present (and true) only when the instance runs with- PASSWORD_LOGIN=1 — the client then offers name-and-password+ PASSWORD_LOGIN=1; the client then offers name-and-passwordsign-in next to passkeys.default_lang:type: string@@ -291,7 +291,7 @@ paths:type: objectproperties:user: { $ref: '#/components/schemas/SessionUser' }- token: { type: string, description: 'Bearer sessions past half their lifetime only — the renewed token.' }+ token: { type: string, description: 'Bearer sessions past half their lifetime only: the renewed token.' }'401': { $ref: '#/components/responses/Unauthorized' }/api/register/options:@@ -324,7 +324,7 @@ paths:code:type: stringdescription: >-- Invite code — required (and validated) only when the instance+ Invite code, required (and validated) only when the instanceruns with INVITE_ONLY. Compared case-insensitively.example: { name: "Ada", code: "3F9C21A07B54D688" }responses:@@ -420,7 +420,7 @@ paths:summary: 'Start passkey login (WebAuthn ceremony, step 1)'description: |Returns `PublicKeyCredentialRequestOptions`- (`generateAuthenticationOptions` with an empty `allowCredentials` — discoverable+ (`generateAuthenticationOptions` with an empty `allowCredentials`; discoverablecredentials / resident keys are required at registration, so the browser offersthe user their passkeys itself) plus a one-shot challenge id `cid`.CSRF-exempt. Takes no request body.@@ -503,7 +503,7 @@ paths:operationId: logoutsummary: Sign out (this device)description: >-- Clears the session cookie. Always succeeds — an invalid or missing session is+ Clears the session cookie. Always succeeds: an invalid or missing session isa no-op. The token itself stays cryptographically valid until it expires; use/api/logout/all to revoke tokens.security: []@@ -525,7 +525,7 @@ paths:summary: Sign out everywheredescription: |Bumps the account's session version, which invalidates **every** cookie and- Bearer token ever issued for it — on every device, including a copy someone+ Bearer token ever issued for it, on every device, including a copy someonewalked off with. Passkeys are untouched; signing back in works immediately.Also clears the caller's own cookie. Unredeemed pairing codes for the accountare voided too.@@ -572,7 +572,7 @@ paths:summary: Redeem a pairing code for a Bearer tokendescription: |Called from the mobile app with the code shown in the browser. No session- required — the code *is* the credential (one-shot, 5-minute TTL). Returns the+ required: the code *is* the credential (one-shot, 5-minute TTL). Returns thesame HMAC-signed session token the cookie would carry; the app sends it as`Authorization: Bearer <token>` from then on. CSRF-exempt.security: []@@ -602,7 +602,7 @@ paths:user: { $ref: '#/components/schemas/SessionUser' }'400':description: >-- Code unknown, already used, expired — or the account behind it is gone or+ Code unknown, already used, expired, or the account behind it is gone ordisabled (deliberately the same message for all of these).content:application/json:@@ -666,7 +666,7 @@ paths:schema: { $ref: '#/components/schemas/Error' }example: { error: "name and password required", code: "missing" }'401':- description: Wrong name or password — deliberately one answer for every cause.+ description: Wrong name or password. Deliberately one answer for every cause.content:application/json:schema: { $ref: '#/components/schemas/Error' }@@ -693,8 +693,8 @@ paths:of the passwords guessing scripts try first; no two profiles with a password mayshare a name. An optional `email` is stored as the profile's sign-in e-mail (see`POST /api/account/email`); one that is not an address is refused with `400- email-invalid`, one that is in use with `409 email-taken` — asked only after the- hash and the second invite check, so without a valid code it is never answered —+ email-invalid`, one that is in use with `409 email-taken`. Both are asked only after the+ hash and the second invite check, so without a valid code it is never answered,which counts against the caller's address like a wrong invite code. **Not**CSRF-exempt.security: []@@ -726,8 +726,8 @@ paths:user: { $ref: '#/components/schemas/SessionUser' }'400':description: >-- The password breaks the policy — `too-short` (under 10 characters), `too-long`- (over 256) or `too-common` — a field is `missing`, or `email-invalid`: the+ The password breaks the policy with `too-short` (under 10 characters), `too-long`+ (over 256) or `too-common`; a field is `missing`; or `email-invalid`: the`email` given is not an e-mail address.content:application/json:@@ -743,7 +743,7 @@ paths:example: { error: "a valid invite code is required", code: "invite" }'409':description: >-- `name-taken` (see NameTaken) or `email-taken` — the e-mail is in use by another+ `name-taken` (see NameTaken) or `email-taken`: the e-mail is in use by anotherprofile.content:application/json:@@ -794,7 +794,7 @@ paths:user: { $ref: '#/components/schemas/SessionUser' }'400':description: >-- `reset-invalid` (wrong, used or expired code — one answer for all),+ `reset-invalid` (wrong, used or expired code; one answer for all),`missing`, or a password-policy code.content:application/json:@@ -842,7 +842,7 @@ paths:description: |Proof first: `current` when the profile has a password, or a passkey assertion madefor this request (`cid` from `POST /api/login/options`, `credential` signed by one of- *this* profile's passkeys) — the only way to set a first password, and the way to+ *this* profile's passkeys). The passkey is the only way to set a first password, and the way toreplace a forgotten one. A session alone is never enough. Wrong `current` valuescount toward the same pause as wrong sign-ins. On success the session version isbumped, which ends every other session and pending pairing code of the account; the@@ -872,7 +872,7 @@ paths:type: objectproperties:ok: { type: boolean, const: true }- token: { type: string, description: 'Bearer callers only — the token to use from now on.' }+ token: { type: string, description: 'Bearer callers only: the token to use from now on.' }'400': { $ref: '#/components/responses/PasswordPolicy' }'401': { $ref: '#/components/responses/Unauthorized' }'403':@@ -893,7 +893,7 @@ paths:summary: Remove this profile's passworddescription: >-Refused while the profile has no passkey: the password would be its last way in.- Otherwise the body carries the same proof setting one takes — `current`, the+ Otherwise the body carries the same proof setting one takes: `current`, thepassword itself, or a passkey assertion made for this request (`cid` from`POST /api/login/options`, `credential` signed by one of *this* profile'spasskeys). A session alone is never enough: a stolen cookie must not take away@@ -931,8 +931,8 @@ paths:summary: Set, change or remove the e-mail this profile may sign in withdescription: |An e-mail address to type at `POST /api/login/password` instead of the profile- name. No mail is ever sent to it — there is no verification and no reset mail;- resets stay the admin's one-time code — so it is only an identifier. Stored+ name. No mail is ever sent to it (there is no verification and no reset mail;+ resets stay the admin's one-time code), so it is only an identifier. Storedtrimmed, NFKC-normalised and lower-cased; at most 254 characters; unique acrossevery profile, and never another password-holding profile's name. An empty or null`email` removes it (as `DELETE` does).@@ -941,7 +941,7 @@ paths:alone is never enough. Saving the address the profile already has answers 200 withno proof asked. An address in use by another profile is refused only after theproof, with `409 email-taken`, and counts against the caller's address and account- (20 free, then 30 s doubling to 15 min) — so the answer never costs less than a+ (20 free, then 30 s doubling to 15 min), so the answer never costs less than apasskey prompt or a password check, and runs out after a few tries. It says anaddress is in use somewhere on this instance, never by whom. Audited as`auth.email.set` / `auth.email.change` with the address masked (`a…@e…`).@@ -1023,7 +1023,7 @@ paths:`POST /api/login/password-reset`. Issuing it removes the profile's current passwordand bumps its session version (every session and pending pairing code ends);passkeys keep working. A newer code replaces an older one. Admin accounts are- refused — an admin sets their own password in Settings. Audited as+ refused; an admin sets their own password in Settings. Audited as`admin.password.reset`.requestBody:required: true@@ -1144,7 +1144,7 @@ paths:everywhere". The body carries the same proof `POST /api/account/password` takes:a passkey assertion made for this request (`cid` from `POST /api/login/options`,`credential` signed by one of *this* profile's passkeys), or `current`, the- profile's password — only while `PASSWORD_LOGIN` is on. With it off, a password+ profile's password, only while `PASSWORD_LOGIN` is on. With it off, a passwordkept from before is not checked at all and the answer is `passkey-required`, so apassword-only profile has to move onto a passkey while the flag is still on. Wrongpasswords count toward the sign-in pause.@@ -1212,7 +1212,7 @@ paths:example: { error: "challenge expired, try again", code: "challenge-expired" }'401':description: >-- Not signed in — including a session that was ended ("sign out everywhere", a+ Not signed in, including a session that was ended ("sign out everywhere", anew password) after step 1.content:application/json:@@ -1341,7 +1341,7 @@ paths:description: |Verifies the attestation against the challenge from step 1 (which must have beenmade for this very code), stores the passkey on the code's profile, burns the code- and sets the session cookie — the passkey just made is what signs the device in.+ and sets the session cookie; the passkey just made is what signs the device in.Of two requests racing with one code, one wins. Audited as `auth.link.ok`, and everyrefusal as `auth.link.fail`. **Not** CSRF-exempt.security: []@@ -1419,12 +1419,12 @@ paths:summary: Push the account's app statedescription: |Replaces the stored state wholesale (atomic write; there is no merge on the- server). The `active` field — an in-progress workout — is stripped before+ server). The `active` field (an in-progress workout) is stripped beforesaving: a running session belongs to the device running it. Body limit 5 MiB.With `baseRev` the write is conditional: it goes through only when `baseRev`equals the document's current revision, and answers 409 with the current- document otherwise — the client merges the two and pushes again with the+ document otherwise; the client merges the two and pushes again with therevision it was given. Without `baseRev` the write is unconditional (clientsfrom before revisions, and deliberate replaces such as a backup import). Theserver stamps the new revision into the document as `_rev`; a `_rev` sent by@@ -1506,7 +1506,7 @@ paths:description: The write id (`_wid`) of the stored document.'409':description: >-- `baseRev` is not the current revision — another client wrote since this one+ `baseRev` is not the current revision: another client wrote since this onelast read. Carries the current document so the client can merge and retry.content:application/json:@@ -1522,7 +1522,7 @@ paths:'400':description: >-`state` missing or not an object, `state` an array or an object with nothing of- the profile in it (`_rev`/`_ts` do not count — both would empty the profile), or+ the profile in it (`_rev`/`_ts` do not count; both would empty the profile), or`workouts`/`routines` set to anything other than an array or null. Entries insidethose two arrays that are not objects (`null`, numbers, nested arrays) are droppedbefore the write rather than refused, so a client with a damaged copy still syncs.@@ -1572,7 +1572,7 @@ paths:`Content-Type` from the sniffed type (never `text/*` or SVG),`X-Content-Type-Options: nosniff`, `Content-Security-Policy: default-src 'none'; sandbox`,`Cross-Origin-Resource-Policy: same-origin`, `Content-Disposition: inline`,- `X-Robots-Tag: noindex` and `Cache-Control: private, no-store` — the app keeps its own+ `X-Robots-Tag: noindex` and `Cache-Control: private, no-store`. The app keeps its ownverified copy, and an HTTP-cache copy would outlive signing out.No `Range` and no `ETag`: the app downloads a file once, checks it against its hash and@@ -1594,7 +1594,7 @@ paths:video/webm: { schema: { type: string, format: binary } }'401': { $ref: '#/components/responses/Unauthorized' }'404':- description: Not in the caller's folder — never uploaded, removed by the sweep, or someone else's.+ description: Not in the caller's folder. Never uploaded, removed by the sweep, or someone else's.content:application/json:schema: { $ref: '#/components/schemas/Error' }@@ -1610,7 +1610,7 @@ paths:Idempotent: uploading a file the server already has answers 200 with `existed: true`.What is stored is decided by the file's first bytes, not by the declared type. The- declared type only has to be in the same category — a still (JPEG, PNG, WebP, GIF) or a+ declared type only has to be in the same category, a still (JPEG, PNG, WebP, GIF) or avideo (MP4, MOV, WebM): a JPEG declared as a GIF is stored as the JPEG it is, a videodeclared as an image is refused. The cap of the kind the bytes turned out to be applies(`MEDIA_IMAGE_MAX_MB`, `MEDIA_GIF_MAX_MB`, `MEDIA_VIDEO_MAX_MB`), and an MP4 or MOV must@@ -1673,9 +1673,9 @@ paths:example: { error: "the upload stalled", code: "timeout" }'413':description: |- - `media-too-large` — over the cap of its kind; `maxMB` says the cap.- - `media-quota` — the profile's space is full; `usedMB` and `quotaMB` say how full.- - `media-too-long` — a video longer than `maxSec` seconds.+ - `media-too-large`: over the cap of its kind; `maxMB` says the cap.+ - `media-quota`: the profile's space is full; `usedMB` and `quotaMB` say how full.+ - `media-too-long`: a video longer than `maxSec` seconds.content:application/json:schema: { $ref: '#/components/schemas/Error' }@@ -1685,8 +1685,8 @@ paths:tooLong: { value: { error: "that video is too long", code: "media-too-long", maxSec: 60 } }'415':description: >-- `media-type` — the declared type is not one of the seven, the bytes are none of- them, or they are a video declared as an image (or the reverse). `media-invalid` —+ `media-type`: the declared type is not one of the seven, the bytes are none of+ them, or they are a video declared as an image (or the reverse). `media-invalid`:an MP4 or MOV whose boxes do not add up.content:application/json:@@ -1696,7 +1696,7 @@ paths:invalid: { value: { error: "that video could not be read", code: "media-invalid" } }'429':description: >-- `locked` — more than `MEDIA_UPLOADS_PER_HOUR` uploads this hour; `busy` — two+ `locked`: more than `MEDIA_UPLOADS_PER_HOUR` uploads this hour; `busy`: twouploads of this profile are already in flight (`retryAfter` 5).headers:Retry-After: { schema: { type: integer } }@@ -1774,7 +1774,7 @@ paths:Without this call nothing is lost either: the hourly sweep removes a file once thestate has not referenced it for `MEDIA_GC_GRACE_DAYS` days (14), and only for profiles- whose state reads — a missing or unreadable state, or a profile missing from `db.json`,+ whose state reads. A missing or unreadable state, or a profile missing from `db.json`,never deletes anything.requestBody:content:@@ -1836,11 +1836,11 @@ paths:summary: Register a Web-Push subscriptiondescription: |Stores the browser's `PushSubscription` for this account. Only `endpoint` and- the two protocol keys are kept. The endpoint must be a public `https://` URL —+ the two protocol keys are kept. The endpoint must be a public `https://` URL;private/loopback/link-local addresses are refused (here and again at sendtime, against DNS rebinding). At most 20 subscriptions per user; the oldestare dropped first. Re-subscribing an existing endpoint replaces it and keeps- its original `created` — the client re-sends its subscription on every+ its original `created`. The client re-sends its subscription on everysigned-in boot, so a row the instance lost comes back on its own.requestBody:required: true@@ -1883,8 +1883,8 @@ paths:description: >-Whether the caller's account has a stored subscription with exactly this`endpoint`. The browser's `PushManager.getSubscription()` says nothing about- the server's side — a row pruned after a dead send (404/410/403) leaves the- browser subscribed to nowhere — so the client asks here before showing the+ the server's side: a row pruned after a dead send (404/410/403) leaves the+ browser subscribed to nowhere. So the client asks here before showing thenotifications switch as on, and re-registers when the answer is no. A storedsubscription also names the `deviceId` it is stored with, and the clientre-registers when that is not its own: a row stored without one (from before@@ -1947,7 +1947,7 @@ paths:description: >-Sends a test push to all of the caller's subscriptions (localized with the`lang` in their synced state). Returns 200 even if delivery to individual- endpoints fails — dead endpoints (404/410, and 403 for a subscription made+ endpoints fails; dead endpoints (404/410, and 403 for a subscription madeagainst a VAPID key the instance no longer has) are pruned as a side effect.responses:'200':@@ -1965,11 +1965,11 @@ paths:description: |Schedules one push after `seconds` (a number or numeric string ≥ 1, clamped to3600). One pending timer per- device — `deviceId`, the same token the subscription was registered with; a+ device, keyed by `deviceId`, the same token the subscription was registered with; anew call from the same device replaces it, and the push goes only to thatdevice's subscriptions. Without a `deviceId` there is one timer per accountand the push goes to every subscription, as before. The client schedules this- on rest start/extend and cancels on skip or on-screen completion — the push+ on rest start/extend and cancels on skip or on-screen completion. The pushonly actually fires when the tab was backgrounded/suspended and never got tocancel it. Timers live in memory: an API restart drops them.requestBody:@@ -2100,7 +2100,7 @@ paths:password_login: { type: boolean, description: Present (true) with PASSWORD_LOGIN=1. }now:type: number- description: Server time (ms) — for rendering relative times.+ description: Server time (ms), for rendering relative times.'401': { $ref: '#/components/responses/Unauthorized' }'403': { $ref: '#/components/responses/Forbidden' }@@ -2110,7 +2110,7 @@ paths:operationId: adminUsersummary: 'Admin: one user in detail'description: >-- Drill-down — full workout history (newest first) and body-weight log for one+ Drill-down: full workout history (newest first) and body-weight log for oneuser. Admin only. Anything in `routines`, `bodyweight` or `workouts` that is notan object is left out, and a list that is not an array reads as empty: PUT/api/data drops those entries now, but a state file written before it did still@@ -2191,7 +2191,7 @@ paths:Removes the account for good: the user record, their passkeys, their pushsubscriptions, their live presence, their training history file, their uploadedphotos and videos (`DATA_DIR/uploads/<uid>/`) and any Coach credential stored for- them. Not reversible — `/api/admin/user/disable` is the+ them. Not reversible; `/api/admin/user/disable` is thereversible one. An admin cannot delete their own account, and the last admincannot be deleted. Audited by name, since the id stops meaning anything.requestBody:@@ -2255,7 +2255,7 @@ paths:operationId: adminInviteNewsummary: 'Admin: mint an invite code'description: >-- Creates a fresh single-use invite code (16 hex chars = 64 bits — the code+ Creates a fresh single-use invite code (16 hex chars = 64 bits; the codeitself is the thing that isn't worth guessing; rate limiting is the reverseproxy's job). Audited.requestBody:@@ -2324,7 +2324,7 @@ paths:summary: 'Admin: read the activity log'description: |The audit log (sign-ins, failed attempts, admin actions), newest first, paged- by event id (`before` cursor — offset paging would repeat rows as new events+ by event id (`before` cursor; offset paging would repeat rows as new eventsland). Retention (`AUDIT_MAX` events / `AUDIT_DAYS` days) is applied on readas well as on the hourly compaction. When `AUDIT_LOG` is off the route stillanswers, with `enabled: false` and whatever was logged before.@@ -2343,7 +2343,7 @@ paths:type: stringenum: [auth, admin, fail]description: >-- Filter — `fail` keeps only failed events; any other value keeps events+ Filter: `fail` keeps only failed events; any other value keeps eventswhose name starts with `<cat>.` (in practice `auth` or `admin`).responses:'200':@@ -2385,7 +2385,7 @@ paths:summary: 'Admin: clear the activity log'description: >-Deletes the log file. The clear is itself the first event of the fresh log,- and event ids are never reset — a wipe always leaves a visible id gap.+ and event ids are never reset, so a wipe always leaves a visible id gap.responses:'200':description: Cleared.@@ -2397,7 +2397,7 @@ paths:# ---------------------------------------------------------------- AI Coach# The routes live in api/coach/routes.js and are mixed into the same route table as- # everything above; they are inert — 503 — while the instance has no Coach enabled+ # everything above; they are inert (503) while the instance has no Coach enabled# and connected./api/coach/disclosure:@@ -2407,7 +2407,7 @@ paths:summary: What the consent screen must saydescription: |The categories of data a Coach job would send, and the provider it would go to,- read straight from the module that builds the payload — so the consent screen+ read straight from the module that builds the payload, so the consent screencannot drift from what actually leaves the box.Needs a session but *not* a connected Coach: the screen that collects consent@@ -2441,7 +2441,7 @@ paths:summary: The running job, the waiting proposal and today's budgetdescription: |What the Coach screen polls. Also the only place a proposal past its 14-day- expiry is retired — a phone that stays closed never polls, so nothing else+ expiry is retired. A phone that stays closed never polls, so nothing elsewould notice.responses:'200':@@ -2460,7 +2460,7 @@ paths:description: |Queues a `create` job. With `intake` it builds a plan from the answers given onthe intake screen; with `refine` it reworks the proposal already waiting, in the- words of the person reading it. The answer is 202 and a job id — the result+ words of the person reading it. The answer is 202 and a job id; the resultarrives through `GET /api/coach/status`.requestBody:required: false@@ -2498,7 +2498,7 @@ paths:operationId: postCoachReviewsummary: Ask for a review of the training since the last onedescription: |- Queues a `review` job — the same job the weekly cadence queues on its own. The+ Queues a `review` job, the same job the weekly cadence queues on its own. Theanswer is either a change-set to accept or reject, or "nothing to change" withthe reason, both delivered through `GET /api/coach/status`.requestBody:@@ -2534,7 +2534,7 @@ paths:operationId: postCoachDebriefsummary: Ask for a read of one sessiondescription: |- Queues a `debrief` job: one workout, read closely. It changes nothing — the card+ Queues a `debrief` job: one workout, read closely. It changes nothing; the cardit produces is kept in the profile's log. With no `workoutId` the most recentsession is read.requestBody:@@ -2605,7 +2605,7 @@ paths:description: |Medians only, and only when at least three profiles on the instance share. Nothingat all for a profile that does not share itself, or on an instance where the admin- has not switched the comparison on — each of those is a 200 saying which it is.+ has not switched the comparison on. Each of those is a 200 saying which it is.responses:'200':description: The comparison, or the reason there isn't one.@@ -2673,7 +2673,7 @@ paths:connected: { type: boolean }reason:oneOf: [{ type: string }, { type: 'null' }]- description: Why not, when `connected` is false — e.g. `shared-account`.+ description: Why not, when `connected` is false (e.g. `shared-account`).message:oneOf: [{ type: string }, { type: 'null' }]description: The refusal in the app's own voice, ready to show.@@ -2690,7 +2690,7 @@ paths:for a sync to carry the news. A job already running is cancelled where the adapterallows it and writes nothing back either way.- Today's job count is the one thing that survives — it is the spending record the+ Today's job count is the one thing that survives. It is the spending record thedaily cap reads, and forgetting must not hand out a fresh cap.Needs a session only: a profile must be able to be forgotten on an instance whose@@ -2710,11 +2710,11 @@ paths:summary: 'Admin: the Coach card'description: |Everything the admin screen renders in one round trip, including a live check of- the configured provider — for a runtime provider "is the runtime there", for an+ the configured provider: for a runtime provider "is the runtime there", for anHTTPS one the model list its stored key can see.Counts and outcomes only: no intake answers, no payloads, no proposals, and never- a credential — only whether one is filed and what it is labelled.+ a credential, only whether one is filed and what it is labelled.responses:'200':description: The card.@@ -2730,7 +2730,7 @@ paths:operationId: postAdminCoachConfigsummary: 'Admin: change the Coach settings'description: |- A patch — every field is optional and only what is sent is changed. Model,+ A patch: every field is optional and only what is sent is changed. Model,endpoint and credential are all keyed by provider, so switching provider neverdrops any of them.requestBody:@@ -2788,7 +2788,7 @@ paths:summary: 'Admin: run one round trip against the provider'description: |Checks the runtime, then asks the model for one fixed JSON object and validates- the shape that comes back — the whole path a job takes, on nobody's profile.+ the shape that comes back. That is the whole path a job takes, on nobody's profile.Always 200: the outcome is in the body, because "the provider refused" is ananswer to the question the button asks, not a failure of the request. It brings@@ -2808,7 +2808,7 @@ paths:description: What the runtime reported, when it could be asked.error:type: string- description: Present when `ok` is false — the provider's own words, trimmed.+ description: Present when `ok` is false. The provider's own words, trimmed.examples:ok: { value: { ok: true, version: "1.2.3" } }refused: { value: { ok: false, error: "401 invalid x-api-key" } }@@ -2870,7 +2870,7 @@ paths:account:type: stringmaxLength: 120- description: A label for whose account this is — shown on the card.+ description: A label for whose account this is, shown on the card.example: { type: apikey, token: "sk-…", account: "[email protected]" }responses:'200':@@ -2933,7 +2933,7 @@ components:description: >-The same signed session token, carried as `Authorization: Bearer <token>` bythe paired mobile app (obtained from `POST /api/pair/redeem`). Bearer requests- skip the CSRF origin check — a browser never attaches this header on its own.+ skip the CSRF origin check; a browser never attaches this header on its own.responses:Unauthorized:@@ -2950,7 +2950,7 @@ components:example: { error: "forbidden" }CoachOff:description: >-- The Coach is not set up on this instance — switched off, or no provider connected.+ The Coach is not set up on this instance (switched off, or no provider connected).Every Coach route answers this rather than pretending, so an unconfigured instancerenders exactly the app it was before the feature existed. `code` is `off`, theclass a job refused at enqueue for the same reason carries; the app shows its own@@ -2981,11 +2981,11 @@ components:description: |The Coach will not take this job, and says which reason in `code`:- - `busy` (409) — a job for this profile is already running.- - `shared` (409) — instance mode, and the credential belongs to another profile.- - `cap` (429) — this profile's or the instance's daily limit is spent.- - `consent` (403) — no consent recorded for this profile.- - `unprivileged` (503) — the privilege drop cannot be performed, so no job runs.+ - `busy` (409): a job for this profile is already running.+ - `shared` (409): instance mode, and the credential belongs to another profile.+ - `cap` (429): this profile's or the instance's daily limit is spent.+ - `consent` (403): no consent recorded for this profile.+ - `unprivileged` (503): the privilege drop cannot be performed, so no job runs.The message is the one to show; the raw provider detail never reaches the user.content:@@ -3019,8 +3019,8 @@ components:example: { error: "the server is busy, try again in a moment", code: "busy" }PasswordPolicy:description: >-- The new password breaks the policy — `too-short` (under 10 characters),- `too-long` (over 256) or `too-common` — or a field is `missing`.+ The new password breaks the policy (`too-short` under 10 characters,+ `too-long` over 256, or `too-common`), or a field is `missing`.content:application/json:schema: { $ref: '#/components/schemas/Error' }@@ -3037,7 +3037,7 @@ components:ProofRefused:description: >-No acceptable proof that the owner is here: `passkey-required` (no password that- counts — none is set, or `PASSWORD_LOGIN` is off — so a passkey has to confirm),+ counts, because none is set or `PASSWORD_LOGIN` is off, so a passkey has to confirm),`passkey` (the assertion did not verify, belongs to another profile, or was madefor another challenge, one handed out for another ceremony or one already used),`current-required` or `current-wrong`.@@ -3053,7 +3053,7 @@ components:example: { error: "a profile can have at most 20 passkeys", code: "passkey-limit" }LinkInvalid:description: >-- The code is wrong, used, replaced or expired, or its profile is gone or disabled —+ The code is wrong, used, replaced or expired, or its profile is gone or disabled:one answer for all of them.content:application/json:@@ -3077,7 +3077,7 @@ components:`quotaMB`).retryAfter:type: integer- description: 429 only — the same number of seconds as the Retry-After header.+ description: 429 only. The same number of seconds as the Retry-After header.Ok:type: object@@ -3114,7 +3114,7 @@ components:type: objectdescription: >-Either a passkey assertion made for this request (`cid` + `credential`), or the- profile's current password (`current`) — which counts only while `PASSWORD_LOGIN`+ profile's current password (`current`), which counts only while `PASSWORD_LOGIN`is on. Each assertion is good for one request: its challenge is spent by it.properties:cid: { type: string, description: 'From POST /api/login/options.' }@@ -3133,12 +3133,12 @@ components:# ------------------------------------------------------------------ WebAuthn# These mirror @simplewebauthn/server v13's JSON shapes (themselves the W3C# WebAuthn Level 3 JSON serialization). Clients normally never build them by- # hand — @simplewebauthn/browser converts them to/from the navigator.credentials+ # hand; @simplewebauthn/browser converts them to/from the navigator.credentials# calls. Documented loosely on purpose; the library owns the details.WebAuthnRegistrationOptions:type: objectdescription: >-- PublicKeyCredentialCreationOptionsJSON — pass to+ PublicKeyCredentialCreationOptionsJSON. Pass to`startRegistration()` (@simplewebauthn/browser) or decode for`navigator.credentials.create()`. Resident keys are required; attestationis `none`.@@ -3167,7 +3167,7 @@ components:WebAuthnRegistrationCredential:type: objectdescription: >-- RegistrationResponseJSON — the value `startRegistration()` resolves with+ RegistrationResponseJSON: the value `startRegistration()` resolves with(the created credential plus the authenticator's attestation response),sent back verbatim.properties:@@ -3182,14 +3182,14 @@ components:transports:type: arrayitems: { type: string }- description: e.g. ["internal", "hybrid"] — stored for later logins.+ description: e.g. ["internal", "hybrid"], stored for later logins.additionalProperties: trueadditionalProperties: trueWebAuthnAuthenticationOptions:type: objectdescription: >-- PublicKeyCredentialRequestOptionsJSON — pass to `startAuthentication()`.+ PublicKeyCredentialRequestOptionsJSON. Pass to `startAuthentication()`.`allowCredentials` is empty: the browser offers the user's discoverablepasskeys itself.properties:@@ -3202,7 +3202,7 @@ components:WebAuthnAuthenticationCredential:type: objectdescription: >-- AuthenticationResponseJSON — the value `startAuthentication()` resolves+ AuthenticationResponseJSON: the value `startAuthentication()` resolveswith, sent back verbatim.properties:id: { type: string, description: base64url credential id }@@ -3224,7 +3224,7 @@ components:description: |The whole app state as one blob. The server treats it as opaque (it onlystrips `active` on save and reads a few fields for reminders and the admin- dashboard) — the schema below is **representative, not enforced** (except+ dashboard). The schema below is **representative, not enforced** (except`workouts` and `routines`, which must be arrays (or null) when present), and growswith the app. Concurrent writes are caught by the server's revision (`_rev`,see PUT /api/data); the client merges the two documents and decides by `_ts`@@ -3262,7 +3262,7 @@ components:unit: { type: string, enum: [kg, lb] }lang:type: string- description: UI language code ("en", "de", "pt", …) — also localizes pushes.+ description: UI language code ("en", "de", "pt", …); also localizes pushes.theme: { type: string }accent: { type: string }workouts:@@ -3275,7 +3275,7 @@ components:queue:type: objectnullable: true- description: A planner's floating week {ids, since, startsOn, label} — the week's sessions as an ordered queue, the first undone one is today's. Written by an API client or by the app's own rotation feature, read by the reminder tick.+ description: A planner's floating week {ids, since, startsOn, label}. The week's sessions as an ordered queue, the first undone one is today's. Written by an API client or by the app's own rotation feature, read by the reminder tick.week:type: objectdescription: 'Weekly plan: weekday (0=Sunday … 6) → routine id.'@@ -3337,9 +3337,9 @@ components:format: urimaxLength: 2048description: >-- One link — a video or a guide. http(s) only, no credentials. Neither the app nor+ One link: a video or a guide. http(s) only, no credentials. Neither the app northe server ever fetches it: the app opens it in a new browsing context on a tap.- _ts: { type: number, description: 'When this entry was last edited, ms — for merging two devices'' copies.' }+ _ts: { type: number, description: 'When this entry was last edited, ms, for merging two devices'' copies.' }additionalProperties: trueMediaRef:@@ -3361,7 +3361,7 @@ components:codec: { type: string, enum: [avc1, hvc1, av01, vp09, vp8, vp9, other], description: Videos only. }poster:type: object- description: A still of at most 480 px — always for images and GIFs, when possible for videos.+ description: A still of at most 480 px, always for images and GIFs, when possible for videos.properties:hash: { type: string, pattern: '^[0-9a-f]{64}$' }mime: { type: string, enum: [image/webp, image/jpeg] }@@ -3402,7 +3402,7 @@ components:properties:ok: { type: boolean, const: true }hash: { type: string }- mime: { type: string, description: 'What the bytes are — not necessarily what was declared.' }+ mime: { type: string, description: 'What the bytes are, not necessarily what was declared.' }size: { type: integer }existed: { type: boolean, description: The server already had this file. }@@ -3447,11 +3447,11 @@ components:items:$ref: '#/components/schemas/MediaRef'description: >-- Photos and videos attached to this workout (a progress photo, a form-check clip) —+ Photos and videos attached to this workout (a progress photo, a form-check clip),at most six in the app. Refs only; the bytes are behind `/api/media/{hash}`, and theserver keeps every file any entry here names (the GC walks this list as it walkseach custom exercise's `media`).- _ts: { type: number, description: 'When this workout was last edited after it was logged, ms — for merging two devices'' copies.' }+ _ts: { type: number, description: 'When this workout was last edited after it was logged, ms, for merging two devices'' copies.' }additionalProperties: trueRoutine:@@ -3478,7 +3478,7 @@ components:# ------------------------------------------------------------------ pushPushSubscription:type: object- description: The browser's PushSubscription.toJSON() — only these fields are stored.+ description: The browser's PushSubscription.toJSON(); only these fields are stored.required: [endpoint, keys]properties:endpoint:@@ -3517,10 +3517,10 @@ components:description: Currently training, or null.password:type: boolean- description: PASSWORD_LOGIN instances only — the profile has a password.+ description: PASSWORD_LOGIN instances only. The profile has a password.email:oneOf: [{ type: string }, { type: 'null' }]- description: PASSWORD_LOGIN instances only — the e-mail the profile signs in with, if any.+ description: PASSWORD_LOGIN instances only. The e-mail the profile signs in with, if any.Presence:type: object@@ -3549,10 +3549,10 @@ components:password: { type: boolean, description: PASSWORD_LOGIN instances only. }email:oneOf: [{ type: string }, { type: 'null' }]- description: PASSWORD_LOGIN instances only — the sign-in e-mail, if any.+ description: PASSWORD_LOGIN instances only. The sign-in e-mail, if any.resetUntil:oneOf: [{ type: number }, { type: 'null' }]- description: PASSWORD_LOGIN instances only — expiry (ms) of an unused reset code.+ description: PASSWORD_LOGIN instances only. Expiry (ms) of an unused reset code.unit: { type: string, enum: [kg, lb] }lastSync: { oneOf: [{ type: number }, { type: 'null' }] }routines:@@ -3595,7 +3595,7 @@ components:properties:id:type: integer- description: Monotonic, never reset — a cleared log leaves a visible id gap.+ description: Monotonic, never reset; a cleared log leaves a visible id gap.ts: { type: number, description: ms since epoch. }ev:type: string@@ -3613,13 +3613,13 @@ components:msg:type: stringdescription: >-- Short detail — a failure reason code, or the invite code involved.+ Short detail: a failure reason code, or the invite code involved.Rejected invite guesses and unknown credential ids are deliberatelynever recorded.ip:type: stringdescription: >-- Only when AUDIT_IP is on — the full address (`full`) or just the+ Only when AUDIT_IP is on: the full address (`full`) or just thenetwork, /24 or /48 (`net`).example:id: 421@@ -3674,7 +3674,7 @@ components:oneOf: [{ type: string }, { type: 'null' }]description: e.g. `provider`, `unusable`, `restart`, `forgotten`, `consent`, `noworkout`.at: { type: integer, description: Epoch ms. }- reading: { type: string, description: "Present on `nochange` — why there was nothing to change." }+ reading: { type: string, description: "Present on `nochange`: why there was nothing to change." }- type: 'null'CoachProposal:@@ -3683,13 +3683,13 @@ components:The answer waiting for a decision, from whichever kind of job produced it. Itexpires 14 days after it was made; the first status poll after that retires it.`changes` comes from a review, `bundle` from a plan, `score`/`highlights` from a- debrief — one of the three, never more.+ debrief. One of the three, never more.properties:id: { type: string, description: The job's id. }kind: { type: string, enum: [create, review, debrief] }createdAt: { type: integer, description: Epoch ms. }expiresAt: { type: integer, description: Epoch ms. }- planHash: { type: string, description: The plan this was written against — a later edit makes it stale. }+ planHash: { type: string, description: The plan this was written against. A later edit makes it stale. }iteration: { type: integer, description: "1, or higher after a refine." }summary: { type: string, maxLength: 1200 }changes:@@ -3705,7 +3705,7 @@ components:sec, cardio, reorder, superset, routine-prog, exercise-prog, inc,add-routine, remove-routine, rename-routine, week]why: { type: string }- before: { description: What the plan says now — the client checks it before applying. }+ before: { description: What the plan says now. The client checks it before applying. }after: { description: What it would say. }additionalProperties: trueevidence:@@ -3720,7 +3720,7 @@ components:items: { type: string }bundle:type: object- description: A whole plan, from a `create` job — routines, week and any custom exercises.+ description: A whole plan, from a `create` job (routines, week and any custom exercises).properties:opengym_plan: { type: integer, const: 1 }name: { type: string, maxLength: 40 }@@ -3769,7 +3769,7 @@ components:sharing: { type: boolean }people: { type: integer }minPeople: { type: integer, description: Three. Below it nothing is computed at all. }- unit: { type: string, enum: [kg, lb], description: The reader's own unit — every number below is in it. }+ unit: { type: string, enum: [kg, lb], description: The reader's own unit. Every number below is in it. }sessionsPerWeek:type: objectproperties:@@ -3791,7 +3791,7 @@ components:AdminCoach:type: object- description: The whole admin card in one answer. Never a credential — only whether one is filed.+ description: The whole admin card in one answer. Never a credential, only whether one is filed.properties:disabledByEnv: { type: boolean, description: "COACH_DISABLED is set, so nothing the admin toggles matters." }enabled: { type: boolean }@@ -3815,7 +3815,7 @@ components:defaultModel: { oneOf: [{ type: string }, { type: 'null' }] }connected: { type: boolean, description: Whether a credential is already filed for it. }model: { type: string, description: The model in force for the active provider. }- models: { type: object, description: Model per provider — switching provider keeps them all. }+ models: { type: object, description: Model per provider. Switching provider keeps them all. }baseUrl: { oneOf: [{ type: string }, { type: 'null' }] }knownModels:oneOf: [{ type: array, items: { type: string } }, { type: 'null' }]@@ -3843,7 +3843,7 @@ components:type: objectdescription: >-Whether a credential is filed, and whose. `unreadable` is its own state because it- has a specific cause and a specific fix — ./data restored without its `secret`.+ has a specific cause and a specific fix: ./data restored without its `secret`.properties:state: { type: string, enum: [not-required, none, optional, connected, unreadable] }type: { oneOf: [{ type: string }, { type: 'null' }] }@@ -3863,7 +3863,7 @@ components:lastError: { description: "The last failure the instance log recorded, or null." }recent:type: array- description: The last 20 jobs, newest first — counts and outcomes only, never contents.+ description: The last 20 jobs, newest first. Counts and outcomes only, never contents.items:type: objectproperties:diff --git a/scripts/build-api-docs.mjs b/scripts/build-api-docs.mjsindex fa2aee5d1..df8b7e389 100644--- a/scripts/build-api-docs.mjs+++ b/scripts/build-api-docs.mjs@@ -1,5 +1,5 @@#!/usr/bin/env node-// Builds website/api.html — the static API reference — from api/openapi.yaml.+// Builds website/api.html (the static API reference) from api/openapi.yaml.//// node scripts/build-api-docs.mjs// node scripts/build-api-docs.mjs --check # fail if stale, never write (CI)@@ -7,7 +7,7 @@// Deterministic: the same spec always produces byte-identical output (no// timestamps), so re-running it only dirties the file when the spec changed.// The page is plain HTML in the site's own design (styles.css + site.js) with-// native <details> cards per endpoint — no Swagger UI, no runtime rendering.+// native <details> cards per endpoint. No Swagger UI, no runtime rendering.//// js-yaml lives in the repo-root package.json (devDependency, build-time only).@@ -31,7 +31,7 @@ const esc = s => String(s)const mdInline = s => esc(String(s).trim()).replace(/`([^`]+)`/g, '<code>$1</code>').replace(/\*\*([^*]+)\*\*/g, '<b>$1</b>')- .replace(/(^|[\s(—>])\*([^*\n]+)\*(?=[\s.,;:)—]|$)/g, '$1<i>$2</i>')+ .replace(/(^|[\s(\u2014>])\*([^*\n]+)\*(?=[\s.,;:)\u2014]|$)/g, '$1<i>$2</i>').replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" rel="noopener">$1</a>')// One description onto one line (for table cells and card subtitles).@@ -131,7 +131,7 @@ const TAGS = {push: { title: 'Push', side: 'Notifications & rest timer' },activity: { title: 'Activity', side: 'Live presence' },media: { title: 'Media', side: 'Photos & videos of your exercises & workouts' },- // A tag missing from this map renders nowhere at all, silently — so every tag in the+ // A tag missing from this map renders nowhere at all, silently, so every tag in the// spec needs a line here.coach: { title: 'AI Coach', side: 'Plans, reviews, debriefs' },admin: { title: 'Admin', side: 'Users, invites, audit log, Coach' }@@ -146,17 +146,17 @@ const sumText = s => {function authOf (op, tag) {if (Array.isArray(op.security) && op.security.length === 0) {- return { chip: 'public', line: 'Public — no authentication required.' }+ return { chip: 'public', line: 'Public: no authentication required.' }}if (tag === 'admin') {return {chip: 'admin',- line: 'Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.'+ line: 'Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.'}}return {chip: null,- line: 'Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.'+ line: 'Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.'}}@@ -211,7 +211,7 @@ function endpointCard (pathKey, method, op) {type: fmtType(p.schema),desc: p.description || ''}))- // p.name may contain markup now; ptab escapes r.name — build rows pre-escaped instead:+ // p.name may contain markup now; ptab escapes r.name, so build rows pre-escaped instead:const paramTab = params.length? `<p class="ep-h">Query parameters</p><div class="ptab">` + params.map(r => `<div class="prow">@@ -244,7 +244,7 @@ ${bodyHtml}/* -------------------------------------------------------------- schema cards */// A schema has no summary of its own, so the collapsed row borrows the first-// sentence of its description — and the body then starts at the second, rather+// sentence of its description, and the body then starts at the second, rather// than repeating what the reader just read on the way in.function schemaCard (name, s) {const desc = (s.description || '').trim()@@ -269,7 +269,7 @@ ${rows.length ? ptab(rows) : '<p class="p-desc">Free-form object.</p>'}/* ----------------------------------------------------------------- overview */-// The spec's info.description carries "### Heading" sections — each becomes a card.+// The spec's info.description carries "### Heading" sections; each becomes a card.const infoParts = spec.info.description.split(/^### /m).slice(1).map(chunk => {const nl = chunk.indexOf('\n')return { title: chunk.slice(0, nl).trim(), body: chunk.slice(nl + 1) }@@ -316,7 +316,7 @@ const railTags = Object.keys(TAGS).map(tag =>const css = `/* ------------------------------------------------------------- API reference- Generated page — the reference itself is static HTML in the site's design.+ Generated page. The reference itself is static HTML in the site's design.Layout: one 880px column of per-endpoint <details> cards. */main.api-main { max-width: 880px; margin: 0 auto; padding: clamp(44px, 7vw, 72px) var(--pad) 0; }main.api-main h1 { font-size: clamp(36px, 6.5vw, 60px); letter-spacing: -.03em; }@@ -431,12 +431,12 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon/* The header, the navigation sheet and the contents drawer belong to the site, notto this page: .navsheet, .toc-btn, .side and .rail-close live in styles.css andsite.js and behave identically here, on the docs page and on the home page. This- file deliberately adds nothing of its own to them — one implementation is the+ file deliberately adds nothing of its own to them. One implementation is theonly way the two rail pages can feel like the same rail. */`const js = `-/* Jumping to an anchor inside a collapsed card opens the card — and re-aligns, since+/* Jumping to an anchor inside a collapsed card opens the card and re-aligns, sincethe browser scrolled to where the target was while it was still collapsed. */;(() => {const openTo = id => {@@ -472,7 +472,7 @@ const html = `<!DOCTYPE html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">-<title>API — openGym</title>+<title>openGym: API</title><meta name="description" content="The complete openGym HTTP API, documented as an OpenAPI spec: passkey auth, state sync, push notifications, pairing and admin routes."><meta name="theme-color" content="#000000"><meta name="robots" content="index,follow,max-image-preview:large">@@ -482,7 +482,7 @@ const html = `<!DOCTYPE html><meta property="og:image" content="https://opengym.duarte-santos.ch/img/social.jpg"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">-<meta property="og:image:alt" content="openGym — your training, your data, your server. Two phones showing the home and workout screens.">+<meta property="og:image:alt" content="openGym: your training, your data, your server. Two phones showing the home and workout screens."><meta property="og:url" content="https://opengym.duarte-santos.ch/api.html"><meta property="og:type" content="website"><meta property="og:site_name" content="openGym">@@ -493,7 +493,7 @@ const html = `<!DOCTYPE html><link rel="icon" type="image/png" sizes="512x512" href="icon-512.png"><link rel="icon" type="image/png" sizes="180x180" href="icon-180.png"><link rel="apple-touch-icon" href="icon-180.png">-<link rel="stylesheet" href="styles.css?v=22">+<link rel="stylesheet" href="styles.css?v=23"><script>document.documentElement.className += ' js'</script><!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). --><script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script>@@ -526,7 +526,7 @@ const html = `<!DOCTYPE html><!-- The navigation sheet: the header's links again, for the widths where the bar hasroom only for the brand and the download. Byte-identical on every page, like the- bar above it — nothing is ever dropped because of which page you are on. -->+ bar above it, so nothing is ever dropped because of which page you are on. --><div class="navsheet" id="sitemenu" role="navigation" aria-label="Site" aria-hidden="true"><div class="nl-rows"><a class="nl" href="/#features">Features</a>@@ -549,7 +549,7 @@ const html = `<!DOCTYPE html></button><!-- The contents drawer: one list, one way in, one way out. Closed by default at- every width, and no preference is remembered — see .side in styles.css. -->+ every width, and no preference is remembered. See .side in styles.css. --><aside class="side" id="menu" aria-label="Contents" aria-hidden="true"><div class="side-top"><p class="side-title">Contents</p>@@ -567,8 +567,8 @@ ${railTags}<main id="main" class="api-main"><h1>API</h1>- <p class="lead">Every route the openGym backend serves — passkey auth, state sync,- push, pairing, admin — as one hand-written+ <p class="lead">Every route the openGym backend serves (passkey auth, state sync,+ push, pairing, admin) as one hand-writtenOpenAPI spec. The same file lives<a href="https://github.com/DuarteSantos8/openGym/blob/main/api/openapi.yaml" rel="noopener">in the repository</a>at <code>api/openapi.yaml</code>, next to the one server file it documents.</p>@@ -603,7 +603,7 @@ ${tagSections}<section class="api-sec" id="schemas"><h2>Schemas</h2><p class="sub">The named shapes the endpoints above link to. The <code>State</code> blob- is <b>representative, not enforced</b> — the server stores it opaquely and the app+ is <b>representative, not enforced</b>: the server stores it opaquely and the appgrows it over time.</p><div class="eps">${schemaCards}@@ -623,7 +623,7 @@ ${schemaCards}</div></div></footer>-<script src="site.js?v=22" defer></script>+<script src="site.js?v=23" defer></script><script>${js}</script></body></html>@@ -633,17 +633,17 @@ const rel = path.relative(root, outPath)const summary = `${ops.length} endpoints, ${Object.keys(spec.components.schemas).length} schemas, ${(html.length / 1024).toFixed(1)} KB`// --check is what build-coach-assets.mjs has had all along, for the same reason: the page is// generated and committed, so a spec change that forgets to regenerate it ships a reference-// that describes the previous version of the API. It also catches the other direction — an+// that describes the previous version of the API. It also catches the other direction: an// edit made to the page by hand, which the next regeneration would silently undo.if (check) {let current = nulltry { current = fs.readFileSync(outPath, 'utf8') } catch { /* missing counts as stale */ }if (current !== html) {- console.error(`${rel} is out of date — run: node scripts/build-api-docs.mjs`)+ console.error(`${rel} is out of date. Run: node scripts/build-api-docs.mjs`)process.exit(1)}- console.log(`${rel} in sync — ${summary}`)+ console.log(`${rel} in sync: ${summary}`)} else {fs.writeFileSync(outPath, html)- console.log(`wrote ${rel} — ${summary}`)+ console.log(`wrote ${rel}: ${summary}`)}diff --git a/website/about.html b/website/about.htmlindex a5c92ba0d..9abb52aba 100644--- a/website/about.html+++ b/website/about.html@@ -3,7 +3,7 @@<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">-<title>About — openGym</title>+<title>openGym: About</title><meta name="description" content="The story behind openGym: a gym tracker that started as a tiny personal app on a homelab server and grew into an open-source project."><meta name="theme-color" content="#000000"><meta name="robots" content="index,follow,max-image-preview:large">@@ -13,7 +13,7 @@<meta property="og:image" content="https://opengym.duarte-santos.ch/img/social.jpg"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">-<meta property="og:image:alt" content="openGym — your training, your data, your server. Two phones showing the home and workout screens.">+<meta property="og:image:alt" content="openGym: your training, your data, your server. Two phones showing the home and workout screens."><meta property="og:url" content="https://opengym.duarte-santos.ch/about.html"><meta property="og:type" content="website"><meta property="og:site_name" content="openGym">@@ -24,7 +24,7 @@<link rel="icon" type="image/png" sizes="512x512" href="icon-512.png"><link rel="icon" type="image/png" sizes="180x180" href="icon-180.png"><link rel="apple-touch-icon" href="icon-180.png">-<link rel="stylesheet" href="styles.css?v=22">+<link rel="stylesheet" href="styles.css?v=23"><script>document.documentElement.className += ' js'</script><!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). --><script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script>@@ -56,7 +56,7 @@<!-- The navigation sheet: the header's links again, for the widths where the bar hasroom only for the brand and the download. Byte-identical on every page, like the- bar above it — nothing is ever dropped because of which page you are on. -->+ bar above it, so nothing is ever dropped because of which page you are on. --><div class="navsheet" id="sitemenu" role="navigation" aria-label="Site" aria-hidden="true"><div class="nl-rows"><a class="nl" href="/#features">Features</a>@@ -79,7 +79,7 @@</button><!-- The contents drawer: one list, one way in, one way out. Closed by default at- every width, and no preference is remembered — see .side in styles.css. -->+ every width, and no preference is remembered. See .side in styles.css. --><aside class="side" id="menu" aria-label="Contents" aria-hidden="true"><div class="side-top"><p class="side-title">Contents</p>@@ -132,7 +132,7 @@community go through the same review. The app itself needs no AI: the coach and the MCPserver are optional and off by default.</p>- <p class="who">— <a href="https://duarte-santos.ch" rel="noopener">Duarte Santos</a></p>+ <p class="who"><a href="https://duarte-santos.ch" rel="noopener">Duarte Santos</a></p><h2 id="milestones-h">Milestones</h2><!-- The releases below are a static fallback: site.js replaces them with the live list@@ -141,7 +141,7 @@<ul class="tl" id="milestones"><li><b>The personal app</b><span class="when">early summer 2026</span><p>A hand-written vanilla-JS page on my own server. One user, zero ambitions.</p></li>- <li data-fallback><b>v1.0.0 — open-sourced</b><span class="when">July 20, 2026</span>+ <li data-fallback><b>v1.0.0: open-sourced</b><span class="when">July 20, 2026</span><p>Docker Compose self-hosting, passkey profiles, guided workouts, a 1,324-exerciselibrary. AGPL from day one.</p></li><li data-fallback><b>Every release since</b><span class="when">ongoing</span>@@ -178,6 +178,6 @@</div></div></footer>-<script src="site.js?v=22" defer></script>+<script src="site.js?v=23" defer></script></body></html>diff --git a/website/api.html b/website/api.htmlindex aa94dfc40..78fadce49 100644--- a/website/api.html+++ b/website/api.html@@ -6,7 +6,7 @@<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">-<title>API — openGym</title>+<title>openGym: API</title><meta name="description" content="The complete openGym HTTP API, documented as an OpenAPI spec: passkey auth, state sync, push notifications, pairing and admin routes."><meta name="theme-color" content="#000000"><meta name="robots" content="index,follow,max-image-preview:large">@@ -16,7 +16,7 @@<meta property="og:image" content="https://opengym.duarte-santos.ch/img/social.jpg"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">-<meta property="og:image:alt" content="openGym — your training, your data, your server. Two phones showing the home and workout screens.">+<meta property="og:image:alt" content="openGym: your training, your data, your server. Two phones showing the home and workout screens."><meta property="og:url" content="https://opengym.duarte-santos.ch/api.html"><meta property="og:type" content="website"><meta property="og:site_name" content="openGym">@@ -27,13 +27,13 @@<link rel="icon" type="image/png" sizes="512x512" href="icon-512.png"><link rel="icon" type="image/png" sizes="180x180" href="icon-180.png"><link rel="apple-touch-icon" href="icon-180.png">-<link rel="stylesheet" href="styles.css?v=22">+<link rel="stylesheet" href="styles.css?v=23"><script>document.documentElement.className += ' js'</script><!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). --><script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script><style>/* ------------------------------------------------------------- API reference- Generated page — the reference itself is static HTML in the site's design.+ Generated page. The reference itself is static HTML in the site's design.Layout: one 880px column of per-endpoint <details> cards. */main.api-main { max-width: 880px; margin: 0 auto; padding: clamp(44px, 7vw, 72px) var(--pad) 0; }main.api-main h1 { font-size: clamp(36px, 6.5vw, 60px); letter-spacing: -.03em; }@@ -148,7 +148,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon/* The header, the navigation sheet and the contents drawer belong to the site, notto this page: .navsheet, .toc-btn, .side and .rail-close live in styles.css andsite.js and behave identically here, on the docs page and on the home page. This- file deliberately adds nothing of its own to them — one implementation is the+ file deliberately adds nothing of its own to them. One implementation is theonly way the two rail pages can feel like the same rail. */</style></head>@@ -179,7 +179,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<!-- The navigation sheet: the header's links again, for the widths where the bar hasroom only for the brand and the download. Byte-identical on every page, like the- bar above it — nothing is ever dropped because of which page you are on. -->+ bar above it, so nothing is ever dropped because of which page you are on. --><div class="navsheet" id="sitemenu" role="navigation" aria-label="Site" aria-hidden="true"><div class="nl-rows"><a class="nl" href="/#features">Features</a>@@ -202,7 +202,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</button><!-- The contents drawer: one list, one way in, one way out. Closed by default at- every width, and no preference is remembered — see .side in styles.css. -->+ every width, and no preference is remembered. See .side in styles.css. --><aside class="side" id="menu" aria-label="Contents" aria-hidden="true"><div class="side-top"><p class="side-title">Contents</p>@@ -230,8 +230,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<main id="main" class="api-main"><h1>API</h1>- <p class="lead">Every route the openGym backend serves — passkey auth, state sync,- push, pairing, admin — as one hand-written+ <p class="lead">Every route the openGym backend serves (passkey auth, state sync,+ push, pairing, admin) as one hand-writtenOpenAPI spec. The same file lives<a href="https://github.com/DuarteSantos8/openGym/blob/main/api/openapi.yaml" rel="noopener">in the repository</a>at <code>api/openapi.yaml</code>, next to the one server file it documents.</p>@@ -263,7 +263,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="ov"><h3>Throttling</h3>-<p>The <code>password</code> routes are counted per client address: at most 60 requests a minute across them, and wrong answers (a password, a reset code, an invite code on password signup, an e-mail address already in use) pause the address from the 21st on, for 30 s, doubling up to 15 min. Wrong passwords also pause the <i>account</i> they were tried against from the 6th on, for 1 min doubling up to 1 h — the same pause whether the account was named by its name or its e-mail — and an identifier that names no account is paused the same way, as typed. A password check counts from the moment it starts, so checks sent at once get no more tries than checks sent one by one. A paused caller gets <code>429 {"error": …, "code": "locked", "retryAfter": <s>}</code> with a <code>Retry-After</code> header. Passkey sign-up and sign-in and the pairing routes are not throttled (their failures reach the audit log at most ten a minute per address). The two routes that redeem a one-time device link (tag <code>passkeys</code>) share the per-address budget, and wrong codes pause the address for link redemption only, from the 21st on, the way wrong reset codes do. Adding or removing a passkey in Settings (<code>POST /api/account/passkeys/options</code>, <code>DELETE /api/account/passkeys</code>) and making a device code (<code>POST /api/account/device-link</code>) spend the per-address budget too, and a current password given there as proof counts like one given at sign-in. The address is the socket's, or with <code>TRUST_PROXY=1</code> the one a trusted proxy put in <code>CF-Connecting-IP</code> / the last <code>X-Forwarded-For</code> entry / <code>X-Real-IP</code>; IPv6 clients are counted by /64. Counters live in memory and reset on restart.</p>+<p>The <code>password</code> routes are counted per client address: at most 60 requests a minute across them, and wrong answers (a password, a reset code, an invite code on password signup, an e-mail address already in use) pause the address from the 21st on, for 30 s, doubling up to 15 min. Wrong passwords also pause the <i>account</i> they were tried against from the 6th on, for 1 min doubling up to 1 h (the same pause whether the account was named by its name or its e-mail), and an identifier that names no account is paused the same way, as typed. A password check counts from the moment it starts, so checks sent at once get no more tries than checks sent one by one. A paused caller gets <code>429 {"error": …, "code": "locked", "retryAfter": <s>}</code> with a <code>Retry-After</code> header. Passkey sign-up and sign-in and the pairing routes are not throttled (their failures reach the audit log at most ten a minute per address). The two routes that redeem a one-time device link (tag <code>passkeys</code>) share the per-address budget, and wrong codes pause the address for link redemption only, from the 21st on, the way wrong reset codes do. Adding or removing a passkey in Settings (<code>POST /api/account/passkeys/options</code>, <code>DELETE /api/account/passkeys</code>) and making a device code (<code>POST /api/account/device-link</code>) spend the per-address budget too, and a current password given there as proof counts like one given at sign-in. The address is the socket's, or with <code>TRUST_PROXY=1</code> the one a trusted proxy put in <code>CF-Connecting-IP</code> / the last <code>X-Forwarded-For</code> entry / <code>X-Real-IP</code>; IPv6 clients are counted by /64. Counters live in memory and reset on restart.</p></div><div class="ov"><h3>Sessions</h3>@@ -275,11 +275,11 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="ov"><h3>Environment-dependent behavior</h3>-<ul><li><code>INVITE_ONLY=1</code> — registration requires a valid invite code (minted by an admin).</li><li><code>ALLOW_GUEST=0</code> — hides the client-side "continue without account" mode; the server merely reports the flag via <code>GET /api/config</code> (guest mode never talks to this API at all).</li><li><code>ADMIN_UIDS=<uid>,<uid></code> — user ids treated as admins (a <code>"admin": true</code> flag on the user record in <code>db.json</code> works too). Admins get the <code>/api/admin/*</code> routes.</li><li><code>FIRST_USER_ADMIN</code> (default off; <code>1</code> turns it on) — the first profile registered on an instance with no profiles gets that <code>"admin": true</code> flag. Decided at registration only, never applied to an instance that already has profiles.</li><li><code>AUDIT_LOG</code> (default on), <code>AUDIT_MAX</code> (default 5000 events), <code>AUDIT_DAYS</code> (default 90), <code>AUDIT_IP</code> (<code>off</code> | <code>net</code> | <code>full</code>, default off) — shape the audit log served by <code>GET /api/admin/audit</code>.</li><li><code>PASSWORD_LOGIN=1</code> — adds the <code>password</code> routes and <code>password_login: true</code> in <code>GET /api/config</code>. Off by default.</li><li><code>DEFAULT_LANG</code> (e.g. <code>pt-BR</code>; unset by default) — <code>default_lang</code> in <code>GET /api/config</code>, the language of the sign-in screen and of every profile that never picked one.</li><li><code>TRUST_PROXY=1</code> — the throttle reads the client address from proxy headers (set by the bundled <code>docker-compose.yml</code>, where only the web container can reach the API).</li><li><code>MEDIA_UPLOADS</code> (default on; <code>0</code> removes the <code>media</code> routes and the <code>media</code> block of <code>GET /api/config</code>), <code>MEDIA_QUOTA_MB</code> (200 per profile, <code>0</code> = no cap), <code>MEDIA_IMAGE_MAX_MB</code> (2), <code>MEDIA_GIF_MAX_MB</code> (8), <code>MEDIA_VIDEO_MAX_MB</code> (40), <code>MEDIA_VIDEO_MAX_SEC</code> (60), <code>MEDIA_GC_GRACE_DAYS</code> (14), <code>MEDIA_UPLOADS_PER_HOUR</code> (600 per profile), <code>MEDIA_MIN_FREE_MB</code> (512, <code>0</code> = no floor) — photos and videos of custom exercises (tag <code>media</code>). Every MB here is 2^20 bytes.</li></ul>+<ul><li><code>INVITE_ONLY=1</code>: registration requires a valid invite code (minted by an admin).</li><li><code>ALLOW_GUEST=0</code>: hides the client-side "continue without account" mode; the server merely reports the flag via <code>GET /api/config</code> (guest mode never talks to this API at all).</li><li><code>ADMIN_UIDS=<uid>,<uid></code>: user ids treated as admins (a <code>"admin": true</code> flag on the user record in <code>db.json</code> works too). Admins get the <code>/api/admin/*</code> routes.</li><li><code>FIRST_USER_ADMIN</code> (default off; <code>1</code> turns it on): the first profile registered on an instance with no profiles gets that <code>"admin": true</code> flag. Decided at registration only, never applied to an instance that already has profiles.</li><li><code>AUDIT_LOG</code> (default on), <code>AUDIT_MAX</code> (default 5000 events), <code>AUDIT_DAYS</code> (default 90), <code>AUDIT_IP</code> (<code>off</code> | <code>net</code> | <code>full</code>, default off) shape the audit log served by <code>GET /api/admin/audit</code>.</li><li><code>PASSWORD_LOGIN=1</code>: adds the <code>password</code> routes and <code>password_login: true</code> in <code>GET /api/config</code>. Off by default.</li><li><code>DEFAULT_LANG</code> (e.g. <code>pt-BR</code>; unset by default): <code>default_lang</code> in <code>GET /api/config</code>, the language of the sign-in screen and of every profile that never picked one.</li><li><code>TRUST_PROXY=1</code>: the throttle reads the client address from proxy headers (set by the bundled <code>docker-compose.yml</code>, where only the web container can reach the API).</li><li><code>MEDIA_UPLOADS</code> (default on; <code>0</code> removes the <code>media</code> routes and the <code>media</code> block of <code>GET /api/config</code>), <code>MEDIA_QUOTA_MB</code> (200 per profile, <code>0</code> = no cap), <code>MEDIA_IMAGE_MAX_MB</code> (2), <code>MEDIA_GIF_MAX_MB</code> (8), <code>MEDIA_VIDEO_MAX_MB</code> (40), <code>MEDIA_VIDEO_MAX_SEC</code> (60), <code>MEDIA_GC_GRACE_DAYS</code> (14), <code>MEDIA_UPLOADS_PER_HOUR</code> (600 per profile), <code>MEDIA_MIN_FREE_MB</code> (512, <code>0</code> = no floor): photos and videos of custom exercises (tag <code>media</code>). Every MB here is 2^20 bytes.</li></ul></div><div class="ov"><h3>Conventions</h3>-<ul><li>Every response body is JSON with <code>Cache-Control: no-store</code>. The one exception is <code>GET /api/media/{hash}</code>, which answers with the stored file itself (<code>Cache-Control: private, no-store</code>).</li><li>Errors are always <code>{"error": "<human-readable message>"}</code>. The <code>password</code>, throttle and <code>media</code> routes add a stable <code>code</code> for the client to word in its own language.</li><li>Unknown method+path pairs return <code>404 {"error":"not found"}</code>; an unhandled exception returns <code>500 {"error":"server error"}</code>.</li><li>Request bodies are parsed as JSON regardless of Content-Type. A body that does not parse, or parses to anything but an object (<code>null</code>, a string, an array), is <code>400 {"error":"invalid json"}</code> on every route that reads one; an empty body counts as <code>{}</code>. A body over 5 MiB is <code>413 {"error":"body too large"}</code>; the rest of the upload is discarded so the answer reaches the client.</li><li>CORS: the request's <code>Origin</code> is reflected in <code>Access-Control-Allow-Origin</code> <b>without</b> <code>Allow-Credentials</code> — cross-origin callers can only ever authenticate with a Bearer token, never with the cookie.</li></ul>+<ul><li>Every response body is JSON with <code>Cache-Control: no-store</code>. The one exception is <code>GET /api/media/{hash}</code>, which answers with the stored file itself (<code>Cache-Control: private, no-store</code>).</li><li>Errors are always <code>{"error": "<human-readable message>"}</code>. The <code>password</code>, throttle and <code>media</code> routes add a stable <code>code</code> for the client to word in its own language.</li><li>Unknown method+path pairs return <code>404 {"error":"not found"}</code>; an unhandled exception returns <code>500 {"error":"server error"}</code>.</li><li>Request bodies are parsed as JSON regardless of Content-Type. A body that does not parse, or parses to anything but an object (<code>null</code>, a string, an array), is <code>400 {"error":"invalid json"}</code> on every route that reads one; an empty body counts as <code>{}</code>. A body over 5 MiB is <code>413 {"error":"body too large"}</code>; the rest of the upload is discarded so the answer reaches the client.</li><li>CORS: the request's <code>Origin</code> is reflected in <code>Access-Control-Allow-Origin</code> <b>without</b> <code>Allow-Credentials</code>, so cross-origin callers can only ever authenticate with a Bearer token, never with the cookie.</li></ul></div></div></section>@@ -303,7 +303,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Always public. Also reports how many user accounts exist.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Responses</p>@@ -326,9 +326,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="ep-body"><p>The flags the login screen needs before anyone is signed in. Both reflect environment variables on the server (<code>INVITE_ONLY</code>, <code>ALLOW_GUEST</code>), and so does <code>password_login</code>, which is there only when <code>PASSWORD_LOGIN=1</code>, and <code>default_lang</code>, which is there only when <code>DEFAULT_LANG</code> is set.</p><p><code>media</code> is there unless the instance runs with <code>MEDIA_UPLOADS=0</code>, for everybody: the caps are not a secret, and its absence is how the app knows this server does not store photos and videos at all.</p>-<p>A caller with a valid session also gets a <code>coach</code> key: the block when the instance has the AI Coach switched on <b>and</b> a provider connected, and <code>null</code> when it has not. A caller with no session gets no key at all — the block names the provider this instance talks to, which is the same fact <code>GET /api/coach/disclosure</code> will not hand out unauthenticated.</p>+<p>A caller with a valid session also gets a <code>coach</code> key: the block when the instance has the AI Coach switched on <b>and</b> a provider connected, and <code>null</code> when it has not. A caller with no session gets no key at all. The block names the provider this instance talks to, which is the same fact <code>GET /api/coach/disclosure</code> will not hand out unauthenticated.</p><p>The key is always present for a session, <code>null</code> included, so a client that caches this answer can tell "no Coach on this instance" from "you were not signed in when you asked" and knows whether asking again would change it.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Responses</p>@@ -357,7 +357,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Resolves the current session to a user. A paired phone (bearer token) whose token is past half of <code>SESSION_DAYS</code> also receives a fresh <code>token</code> to use from now on; it carries the account's current session version, so "sign out everywhere" revokes it like the old one. Cookie sessions never get one.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -384,7 +384,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="ep-body"><p>Returns <code>PublicKeyCredentialCreationOptions</code> (from <code>@simplewebauthn/server</code>'s <code>generateRegistrationOptions</code>) plus a challenge id <code>cid</code>. The client passes <code>options</code> to <code>navigator.credentials.create()</code> (or <code>@simplewebauthn/browser</code>'s <code>startRegistration</code>) and sends the result to <code>/api/register/verify</code> together with the <code>cid</code>. Challenges are one-shot and expire after 5 minutes.</p><p>CSRF-exempt (the challenge is the credential). No session required.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -395,7 +395,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">code</span><span class="p-type">string</span>- <span class="p-desc">Invite code — required (and validated) only when the instance runs with INVITE_ONLY. Compared case-insensitively.</span>+ <span class="p-desc">Invite code, required (and validated) only when the instance runs with INVITE_ONLY. Compared case-insensitively.</span></div></div><pre><code>{@@ -429,7 +429,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Verifies the authenticator's attestation response against the stored challenge (<code>verifyRegistrationResponse</code>), creates the user + credential, and signs the caller in (sets the session cookie). On an invite-only instance the invite is re-checked and burned here. CSRF-exempt.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -473,8 +473,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Start passkey login (WebAuthn ceremony, step 1)</span></summary><div class="ep-body">-<p>Returns <code>PublicKeyCredentialRequestOptions</code> (<code>generateAuthenticationOptions</code> with an empty <code>allowCredentials</code> — discoverable credentials / resident keys are required at registration, so the browser offers the user their passkeys itself) plus a one-shot challenge id <code>cid</code>. CSRF-exempt. Takes no request body.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+<p>Returns <code>PublicKeyCredentialRequestOptions</code> (<code>generateAuthenticationOptions</code> with an empty <code>allowCredentials</code>; discoverable credentials / resident keys are required at registration, so the browser offers the user their passkeys itself) plus a one-shot challenge id <code>cid</code>. CSRF-exempt. Takes no request body.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Responses</p>@@ -496,7 +496,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Verifies the assertion (<code>verifyAuthenticationResponse</code>), updates the signature counter, and signs the caller in (sets the session cookie). CSRF-exempt.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -544,8 +544,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Sign out (this device)</span></summary><div class="ep-body">-<p>Clears the session cookie. Always succeeds — an invalid or missing session is a no-op. The token itself stays cryptographically valid until it expires; use /api/logout/all to revoke tokens.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+<p>Clears the session cookie. Always succeeds: an invalid or missing session is a no-op. The token itself stays cryptographically valid until it expires; use /api/logout/all to revoke tokens.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Responses</p>@@ -566,8 +566,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Sign out everywhere</span></summary><div class="ep-body">-<p>Bumps the account's session version, which invalidates <b>every</b> cookie and Bearer token ever issued for it — on every device, including a copy someone walked off with. Passkeys are untouched; signing back in works immediately. Also clears the caller's own cookie. Unredeemed pairing codes for the account are voided too.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Bumps the account's session version, which invalidates <b>every</b> cookie and Bearer token ever issued for it, on every device, including a copy someone walked off with. Passkeys are untouched; signing back in works immediately. Also clears the caller's own cookie. Unredeemed pairing codes for the account are voided too.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -600,7 +600,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Called from an already signed-in browser tab (Settings → "Pair the mobile app"). Returns an 8-character code (alphabet without 0/O/1/I) the phone redeems within 5 minutes via /api/pair/redeem. One-shot. One live code per profile: minting a new one retires the previous one.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -625,8 +625,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Redeem a pairing code for a Bearer token</span></summary><div class="ep-body">-<p>Called from the mobile app with the code shown in the browser. No session required — the code <i>is</i> the credential (one-shot, 5-minute TTL). Returns the same HMAC-signed session token the cookie would carry; the app sends it as <code>Authorization: Bearer <token></code> from then on. CSRF-exempt.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+<p>Called from the mobile app with the code shown in the browser. No session required: the code <i>is</i> the credential (one-shot, 5-minute TTL). Returns the same HMAC-signed session token the cookie would carry; the app sends it as <code>Authorization: Bearer <token></code> from then on. CSRF-exempt.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -646,7 +646,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">400</span>- <span class="p-desc">Code unknown, already used, expired — or the account behind it is gone or disabled (deliberately the same message for all of these).<span class="r-sig"><code>{"error":"invalid or expired code"}</code></span></span>+ <span class="p-desc">Code unknown, already used, expired, or the account behind it is gone or disabled (deliberately the same message for all of these).<span class="r-sig"><code>{"error":"invalid or expired code"}</code></span></span></div></div></div>@@ -668,7 +668,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Only a profile that has set a password can sign in this way. The identifier is the profile's display name or the e-mail address it added (<code>POST /api/account/email</code>), compared trimmed, NFKC-normalised and case-insensitively. Send it as <code>identifier</code> (what the app sends), <code>name</code> (the original field, still accepted) or <code>email</code>. In <code>identifier</code> and <code>name</code>, a value with an <code>@</code> is looked up as an e-mail first and then as a name; <code>email</code> is looked up only as an e-mail. A wrong password, an unknown name and a name whose profile has no password all get the same <code>401</code> after the same scrypt work, so neither the answer nor its timing says which names exist. So does a password that was right when its check started but was changed, reset or removed before the check finished. Five wrong passwords for an account are free and the sixth pauses it, whichever identifier they named it by (see <i>Throttling</i>); passkey sign-in is never paused by this. Sets the same session cookie as <code>/api/login/verify</code>. <b>Not</b> CSRF-exempt.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -704,7 +704,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">401</span>- <span class="p-desc">Wrong name or password — deliberately one answer for every cause.<span class="r-sig"><code>{"error":"wrong name or password"}</code></span></span>+ <span class="p-desc">Wrong name or password. Deliberately one answer for every cause.<span class="r-sig"><code>{"error":"wrong name or password"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">403</span>@@ -730,8 +730,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Create a profile with a name and password</span></summary><div class="ep-body">-<p>For browsers that cannot make a passkey (plain http on a LAN address, some Firefox setups). Creates the profile and signs it in. The same invite rules as passkey registration apply: on an invite-only instance the code is checked first, checked again after hashing, and burned. The password must be 10–256 characters and not one of the passwords guessing scripts try first; no two profiles with a password may share a name. An optional <code>email</code> is stored as the profile's sign-in e-mail (see <code>POST /api/account/email</code>); one that is not an address is refused with <code>400 email-invalid</code>, one that is in use with <code>409 email-taken</code> — asked only after the hash and the second invite check, so without a valid code it is never answered — which counts against the caller's address like a wrong invite code. <b>Not</b> CSRF-exempt.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+<p>For browsers that cannot make a passkey (plain http on a LAN address, some Firefox setups). Creates the profile and signs it in. The same invite rules as passkey registration apply: on an invite-only instance the code is checked first, checked again after hashing, and burned. The password must be 10–256 characters and not one of the passwords guessing scripts try first; no two profiles with a password may share a name. An optional <code>email</code> is stored as the profile's sign-in e-mail (see <code>POST /api/account/email</code>); one that is not an address is refused with <code>400 email-invalid</code>, one that is in use with <code>409 email-taken</code>. Both are asked only after the hash and the second invite check, so without a valid code it is never answered, which counts against the caller's address like a wrong invite code. <b>Not</b> CSRF-exempt.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -768,7 +768,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">400</span>- <span class="p-desc">The password breaks the policy — <code>too-short</code> (under 10 characters), <code>too-long</code> (over 256) or <code>too-common</code> — a field is <code>missing</code>, or <code>email-invalid</code>: the <code>email</code> given is not an e-mail address.<span class="r-sig"><code>{"error":"this password is too easy to guess"}</code> · <code>{"error":"that is not an e-mail address"}</code></span></span>+ <span class="p-desc">The password breaks the policy with <code>too-short</code> (under 10 characters), <code>too-long</code> (over 256) or <code>too-common</code>; a field is <code>missing</code>; or <code>email-invalid</code>: the <code>email</code> given is not an e-mail address.<span class="r-sig"><code>{"error":"this password is too easy to guess"}</code> · <code>{"error":"that is not an e-mail address"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">403</span>@@ -776,7 +776,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">409</span>- <span class="p-desc"><code>name-taken</code> (see NameTaken) or <code>email-taken</code> — the e-mail is in use by another profile.<span class="r-sig"><code>{"error":"another profile already uses this e-mail address"}</code></span></span>+ <span class="p-desc"><code>name-taken</code> (see NameTaken) or <code>email-taken</code>: the e-mail is in use by another profile.<span class="r-sig"><code>{"error":"another profile already uses this e-mail address"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">429</span>@@ -799,7 +799,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Redeems the code from <code>POST /api/admin/user/password-reset</code> (valid 24 h, single use, stored only as a hash; dashes, spaces and case do not matter) and signs in. A new password that breaks the policy is refused without using up the code. Every other session of the account ends. Wrong codes count against the caller's address only (see <i>Throttling</i>), never against the name, so they cannot keep a real code from working. The profile is named by its name or its sign-in e-mail, in <code>identifier</code>, <code>name</code> or <code>email</code> as at sign-in. <b>Not</b> CSRF-exempt.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -836,7 +836,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">400</span>- <span class="p-desc"><code>reset-invalid</code> (wrong, used or expired code — one answer for all), <code>missing</code>, or a password-policy code.<span class="r-sig"><code>{"error":"that reset code is wrong or has expired"}</code></span></span>+ <span class="p-desc"><code>reset-invalid</code> (wrong, used or expired code; one answer for all), <code>missing</code>, or a password-policy code.<span class="r-sig"><code>{"error":"that reset code is wrong or has expired"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">403</span>@@ -867,7 +867,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body">- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -892,8 +892,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Set or change this profile's password</span></summary><div class="ep-body">-<p>Proof first: <code>current</code> when the profile has a password, or a passkey assertion made for this request (<code>cid</code> from <code>POST /api/login/options</code>, <code>credential</code> signed by one of <i>this</i> profile's passkeys) — the only way to set a first password, and the way to replace a forgotten one. A session alone is never enough. Wrong <code>current</code> values count toward the same pause as wrong sign-ins. On success the session version is bumped, which ends every other session and pending pairing code of the account; the caller's own continues on a fresh cookie, or a fresh <code>token</code> for a Bearer caller.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Proof first: <code>current</code> when the profile has a password, or a passkey assertion made for this request (<code>cid</code> from <code>POST /api/login/options</code>, <code>credential</code> signed by one of <i>this</i> profile's passkeys). The passkey is the only way to set a first password, and the way to replace a forgotten one. A session alone is never enough. Wrong <code>current</code> values count toward the same pause as wrong sign-ins. On success the session version is bumped, which ends every other session and pending pairing code of the account; the caller's own continues on a fresh cookie, or a fresh <code>token</code> for a Bearer caller.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -925,7 +925,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">400</span>- <span class="p-desc">The new password breaks the policy — <code>too-short</code> (under 10 characters), <code>too-long</code> (over 256) or <code>too-common</code> — or a field is <code>missing</code>.<span class="r-sig"><code>{"error":"this password is too easy to guess"}</code></span></span>+ <span class="p-desc">The new password breaks the policy (<code>too-short</code> under 10 characters, <code>too-long</code> over 256, or <code>too-common</code>), or a field is <code>missing</code>.<span class="r-sig"><code>{"error":"this password is too easy to guess"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">401</span>@@ -959,8 +959,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Remove this profile's password</span></summary><div class="ep-body">-<p>Refused while the profile has no passkey: the password would be its last way in. Otherwise the body carries the same proof setting one takes — <code>current</code>, the password itself, or a passkey assertion made for this request (<code>cid</code> from <code>POST /api/login/options</code>, <code>credential</code> signed by one of <i>this</i> profile's passkeys). A session alone is never enough: a stolen cookie must not take away the owner's way in where passkeys do not work. The last-way-in refusal comes before the proof is checked, and is checked again after it. Wrong <code>current</code> values count toward the same pause as wrong sign-ins. Existing sessions are left alone (<code>POST /api/logout/all</code> ends them). A profile without a password gets 200 as well, with no proof asked. Audited as <code>auth.password.remove</code>.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Refused while the profile has no passkey: the password would be its last way in. Otherwise the body carries the same proof setting one takes: <code>current</code>, the password itself, or a passkey assertion made for this request (<code>cid</code> from <code>POST /api/login/options</code>, <code>credential</code> signed by one of <i>this</i> profile's passkeys). A session alone is never enough: a stolen cookie must not take away the owner's way in where passkeys do not work. The last-way-in refusal comes before the proof is checked, and is checked again after it. Wrong <code>current</code> values count toward the same pause as wrong sign-ins. Existing sessions are left alone (<code>POST /api/logout/all</code> ends them). A profile without a password gets 200 as well, with no proof asked. Audited as <code>auth.password.remove</code>.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body</p><p class="p-desc"><a href="#schema-OwnerProof">OwnerProof</a></p><p class="ep-h">Responses</p>@@ -975,7 +975,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts — none is set, or <code>PASSWORD_LOGIN</code> is off — so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span>+ <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts, because none is set or <code>PASSWORD_LOGIN</code> is off, so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>@@ -1001,9 +1001,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Set, change or remove the e-mail this profile may sign in with</span></summary><div class="ep-body">-<p>An e-mail address to type at <code>POST /api/login/password</code> instead of the profile name. No mail is ever sent to it — there is no verification and no reset mail; resets stay the admin's one-time code — so it is only an identifier. Stored trimmed, NFKC-normalised and lower-cased; at most 254 characters; unique across every profile, and never another password-holding profile's name. An empty or null <code>email</code> removes it (as <code>DELETE</code> does).</p>-<p>The body carries the same proof as setting a password (see OwnerProof): a session alone is never enough. Saving the address the profile already has answers 200 with no proof asked. An address in use by another profile is refused only after the proof, with <code>409 email-taken</code>, and counts against the caller's address and account (20 free, then 30 s doubling to 15 min) — so the answer never costs less than a passkey prompt or a password check, and runs out after a few tries. It says an address is in use somewhere on this instance, never by whom. Audited as <code>auth.email.set</code> / <code>auth.email.change</code> with the address masked (<code>a…@e…</code>).</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>An e-mail address to type at <code>POST /api/login/password</code> instead of the profile name. No mail is ever sent to it (there is no verification and no reset mail; resets stay the admin's one-time code), so it is only an identifier. Stored trimmed, NFKC-normalised and lower-cased; at most 254 characters; unique across every profile, and never another password-holding profile's name. An empty or null <code>email</code> removes it (as <code>DELETE</code> does).</p>+<p>The body carries the same proof as setting a password (see OwnerProof): a session alone is never enough. Saving the address the profile already has answers 200 with no proof asked. An address in use by another profile is refused only after the proof, with <code>409 email-taken</code>, and counts against the caller's address and account (20 free, then 30 s doubling to 15 min), so the answer never costs less than a passkey prompt or a password check, and runs out after a few tries. It says an address is in use somewhere on this instance, never by whom. Audited as <code>auth.email.set</code> / <code>auth.email.change</code> with the address masked (<code>a…@e…</code>).</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><pre><code>{@@ -1026,7 +1026,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts — none is set, or <code>PASSWORD_LOGIN</code> is off — so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span>+ <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts, because none is set or <code>PASSWORD_LOGIN</code> is off, so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>@@ -1053,7 +1053,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>The profile then signs in by its name only. Takes the same proof as setting one (OwnerProof); a profile without an e-mail gets 200 with none asked. Audited as <code>auth.email.remove</code>.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body</p><p class="p-desc"><a href="#schema-OwnerProof">OwnerProof</a></p><p class="ep-h">Responses</p>@@ -1068,7 +1068,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts — none is set, or <code>PASSWORD_LOGIN</code> is off — so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span>+ <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts, because none is set or <code>PASSWORD_LOGIN</code> is off, so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">429</span>@@ -1086,7 +1086,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<section class="api-sec" id="passkeys"><h2>Passkeys</h2>- <p class="sub">More than one passkey on a profile: list, add, rename, remove — and one-time device links, which let another device of the same person add a passkey of its own.</p>+ <p class="sub">More than one passkey on a profile: list, add, rename, remove, plus one-time device links, which let another device of the same person add a passkey of its own.</p><div class="eps"><details class="ep" id="op-listPasskeys">@@ -1098,7 +1098,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Every passkey that signs this profile in, without key material. <code>created</code> and <code>lastUsed</code> are null for a passkey made before they were recorded.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -1125,7 +1125,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="ep-body"><p>Refused while it is the profile's last way in: its only passkey, and no password that can sign in (a password counts only while <code>PASSWORD_LOGIN</code> is on). Otherwise the body carries the same proof adding one takes (<code>OwnerProof</code>): a session alone is never enough, since a stolen cookie could otherwise choose which of the owner's passkeys is left. Any of the profile's passkeys may confirm, the one being removed included. The 404 and 409 refusals come before the proof is checked, and the last-way-in rule is checked again after it. Audited as <code>auth.passkey.remove</code>. An unused device code of the profile is dropped too, so one made with the removed passkey cannot add another afterwards.</p><p>Sessions are not tied to the passkey that opened them, so a session it already opened carries on; <code>POST /api/logout/all</code> ends those.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Query parameters</p><div class="ptab"><div class="prow"><span class="p-name">id<em class="p-req" title="required">required</em></span>@@ -1146,7 +1146,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts — none is set, or <code>PASSWORD_LOGIN</code> is off — so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span>+ <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts, because none is set or <code>PASSWORD_LOGIN</code> is off, so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">404</span>@@ -1176,9 +1176,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Add a passkey (step 1): prove it is you, get creation options</span></summary><div class="ep-body">-<p>A session alone is never enough to add a way in that outlives "sign out everywhere". The body carries the same proof <code>POST /api/account/password</code> takes: a passkey assertion made for this request (<code>cid</code> from <code>POST /api/login/options</code>, <code>credential</code> signed by one of <i>this</i> profile's passkeys), or <code>current</code>, the profile's password — only while <code>PASSWORD_LOGIN</code> is on. With it off, a password kept from before is not checked at all and the answer is <code>passkey-required</code>, so a password-only profile has to move onto a passkey while the flag is still on. Wrong passwords count toward the sign-in pause.</p>+<p>A session alone is never enough to add a way in that outlives "sign out everywhere". The body carries the same proof <code>POST /api/account/password</code> takes: a passkey assertion made for this request (<code>cid</code> from <code>POST /api/login/options</code>, <code>credential</code> signed by one of <i>this</i> profile's passkeys), or <code>current</code>, the profile's password, only while <code>PASSWORD_LOGIN</code> is on. With it off, a password kept from before is not checked at all and the answer is <code>passkey-required</code>, so a password-only profile has to move onto a passkey while the flag is still on. Wrong passwords count toward the sign-in pause.</p><p>The options use the profile's own user handle and list its passkeys in <code>excludeCredentials</code>, so an authenticator that already holds one refuses. The challenge is good for 5 minutes, for this profile, and only while the session version is unchanged.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body</p><p class="p-desc"><a href="#schema-OwnerProof">OwnerProof</a></p><p class="ep-h">Responses</p>@@ -1193,7 +1193,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts — none is set, or <code>PASSWORD_LOGIN</code> is off — so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span>+ <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts, because none is set or <code>PASSWORD_LOGIN</code> is off, so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>@@ -1220,7 +1220,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Verifies the attestation against the challenge from step 1 and stores the passkey on this profile. Audited as <code>auth.passkey.add</code>, with the proof that allowed it.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1251,7 +1251,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">401</span>- <span class="p-desc">Not signed in — including a session that was ended ("sign out everywhere", a new password) after step 1.<span class="r-sig"><code>{"error":"not signed in"}</code></span></span>+ <span class="p-desc">Not signed in, including a session that was ended ("sign out everywhere", a new password) after step 1.<span class="r-sig"><code>{"error":"not signed in"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>@@ -1270,7 +1270,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>An empty name clears it; the app then shows a numbered "Passkey n".</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1311,7 +1311,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>For adding another device of the same person: returns a code of 12 characters from the pairing alphabet (60 bits), which the app also shows as a QR code of <code><app>?link=<code></code>. The other device redeems it with <code>/api/device-link/*</code> by creating a passkey of its own. The code is shown once, stored only as a SHA-256, good for 10 minutes and for one passkey; a newer one replaces it, and signing out everywhere, a new password, an admin reset or a disable drop it. Same proof as adding a passkey. Audited as <code>auth.link.create</code>.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body</p><p class="p-desc"><a href="#schema-OwnerProof">OwnerProof</a></p><p class="ep-h">Responses</p>@@ -1326,7 +1326,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts — none is set, or <code>PASSWORD_LOGIN</code> is off — so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span>+ <span class="p-desc">No acceptable proof that the owner is here: <code>passkey-required</code> (no password that counts, because none is set or <code>PASSWORD_LOGIN</code> is off, so a passkey has to confirm), <code>passkey</code> (the assertion did not verify, belongs to another profile, or was made for another challenge, one handed out for another ceremony or one already used), <code>current-required</code> or <code>current-wrong</code>.<span class="r-sig"><code>{"error":"confirm with your passkey first"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>@@ -1353,7 +1353,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Called on the other device, which has no session: the code is the credential. Returns creation options for the profile the code belongs to, and that profile's id and name. Does not use the code up, so a dismissed passkey prompt can be tried again. Wrong codes count toward a per-address pause of link redemption (see <i>Throttling</i>). <b>Not</b> CSRF-exempt.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1373,7 +1373,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">400</span>- <span class="p-desc">The code is wrong, used, replaced or expired, or its profile is gone or disabled — one answer for all of them.<span class="r-sig"><code>{"error":"that code is wrong, used or expired"}</code></span></span>+ <span class="p-desc">The code is wrong, used, replaced or expired, or its profile is gone or disabled: one answer for all of them.<span class="r-sig"><code>{"error":"that code is wrong, used or expired"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>@@ -1395,8 +1395,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Redeem a device link (step 2): store the passkey and sign this device in</span></summary><div class="ep-body">-<p>Verifies the attestation against the challenge from step 1 (which must have been made for this very code), stores the passkey on the code's profile, burns the code and sets the session cookie — the passkey just made is what signs the device in. Of two requests racing with one code, one wins. Audited as <code>auth.link.ok</code>, and every refusal as <code>auth.link.fail</code>. <b>Not</b> CSRF-exempt.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+<p>Verifies the attestation against the challenge from step 1 (which must have been made for this very code), stores the passkey on the code's profile, burns the code and sets the session cookie; the passkey just made is what signs the device in. Of two requests racing with one code, one wins. Audited as <code>auth.link.ok</code>, and every refusal as <code>auth.link.fail</code>. <b>Not</b> CSRF-exempt.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1458,7 +1458,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Returns the caller's entire app state as one JSON blob, or <code>{"state": null}</code> if nothing has been synced yet, together with <code>rev</code>, the server's revision of that document (0 when there is none). A client keeps the <code>rev</code> it last read or wrote and sends it back as <code>baseRev</code> on the next push, which lets the server refuse a write over a document the client never saw (see the 409 on PUT).</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -1483,12 +1483,12 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Push the account's app state</span></summary><div class="ep-body">-<p>Replaces the stored state wholesale (atomic write; there is no merge on the server). The <code>active</code> field — an in-progress workout — is stripped before saving: a running session belongs to the device running it. Body limit 5 MiB.</p>-<p>With <code>baseRev</code> the write is conditional: it goes through only when <code>baseRev</code> equals the document's current revision, and answers 409 with the current document otherwise — the client merges the two and pushes again with the revision it was given. Without <code>baseRev</code> the write is unconditional (clients from before revisions, and deliberate replaces such as a backup import). The server stamps the new revision into the document as <code>_rev</code>; a <code>_rev</code> sent by the client is ignored.</p>+<p>Replaces the stored state wholesale (atomic write; there is no merge on the server). The <code>active</code> field (an in-progress workout) is stripped before saving: a running session belongs to the device running it. Body limit 5 MiB.</p>+<p>With <code>baseRev</code> the write is conditional: it goes through only when <code>baseRev</code> equals the document's current revision, and answers 409 with the current document otherwise; the client merges the two and pushes again with the revision it was given. Without <code>baseRev</code> the write is unconditional (clients from before revisions, and deliberate replaces such as a backup import). The server stamps the new revision into the document as <code>_rev</code>; a <code>_rev</code> sent by the client is ignored.</p><p>The records of removals (<code>deleted</code>) and of edits (<code>edited</code>) never shrink: the stored ones are joined into the write (a reset keeps its own). A writer that does not stamp its own changes (no <code>stamped: true</code>; an API script, an older app) and sends the current <code>baseRev</code> gets them stamped by the server, at the server's time: every entry it removed (a workout, routine, custom exercise, weigh-in, card, profile or favourite), every setting and plan day it changed (<code>queue</code>, <code>week.<day></code>, …), and every entry it edited (<code>_ts</code>, per field <code>_f</code>). That keeps a planner's new week, or a routine it removed, from being undone by a phone that reconnects later with an older change. A setting, plan day or entry field whose stored stamp (<code>edited</code>, <code>_f</code>) is later than the one the writer sends back keeps the stored value: the writer never saw that change, so send back the <code>edited</code> and <code>_f</code> you read. A writer that sends no <code>edited</code> at all is not held to it. An entry the document holds while a removal on record says it was deleted after its last edit is kept and marked as added back.</p><p>Such a writer also cannot delete what it does not know: a field of the stored document, of a stored routine, workout, custom exercise, card or profile, of a routine's exercise, or of a logged exercise or set that its copy leaves out comes back from the stored copy (an older app rebuilds an exercise from the fields it knows, which dropped pyramid sets made on an updated device). Only the fields v1.3.9 itself removes (a superset link, a note, a cleared set value, …) can be removed this way. Send <code>stamped: true</code> to remove anything else.</p><p>Every accepted write also starts the grace period of each stored file (tag <code>media</code>) the new state no longer references, and stops it for each one it references again. That bookkeeping never changes the answer.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1520,7 +1520,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">400</span>- <span class="p-desc"><code>state</code> missing or not an object, <code>state</code> an array or an object with nothing of the profile in it (<code>_rev</code>/<code>_ts</code> do not count — both would empty the profile), or <code>workouts</code>/<code>routines</code> set to anything other than an array or null. Entries inside those two arrays that are not objects (<code>null</code>, numbers, nested arrays) are dropped before the write rather than refused, so a client with a damaged copy still syncs.<span class="r-sig"><code>{"error":"state required"}</code> · <code>{"error":"invalid state"}</code></span></span>+ <span class="p-desc"><code>state</code> missing or not an object, <code>state</code> an array or an object with nothing of the profile in it (<code>_rev</code>/<code>_ts</code> do not count; both would empty the profile), or <code>workouts</code>/<code>routines</code> set to anything other than an array or null. Entries inside those two arrays that are not objects (<code>null</code>, numbers, nested arrays) are dropped before the write rather than refused, so a client with a damaged copy still syncs.<span class="r-sig"><code>{"error":"state required"}</code> · <code>{"error":"invalid state"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">401</span>@@ -1528,7 +1528,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">409</span>- <span class="p-desc"><code>baseRev</code> is not the current revision — another client wrote since this one last read. Carries the current document so the client can merge and retry.</span>+ <span class="p-desc"><code>baseRev</code> is not the current revision: another client wrote since this one last read. Carries the current document so the client can merge and retry.</span></div></div></div>@@ -1543,7 +1543,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>The <code>rev</code> that <code>GET /api/data</code> would return, without the document. Signed-in clients poll this while open and on every return to the foreground and fetch the document only when the number changed.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -1576,7 +1576,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>The instance's Web-Push application server key (generated once at first boot), for <code>PushManager.subscribe({applicationServerKey})</code>. Public.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public — no authentication required.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Public: no authentication required.</span></p><p class="ep-h">Responses</p>@@ -1597,8 +1597,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Register a Web-Push subscription</span></summary><div class="ep-body">-<p>Stores the browser's <code>PushSubscription</code> for this account. Only <code>endpoint</code> and the two protocol keys are kept. The endpoint must be a public <code>https://</code> URL — private/loopback/link-local addresses are refused (here and again at send time, against DNS rebinding). At most 20 subscriptions per user; the oldest are dropped first. Re-subscribing an existing endpoint replaces it and keeps its original <code>created</code> — the client re-sends its subscription on every signed-in boot, so a row the instance lost comes back on its own.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Stores the browser's <code>PushSubscription</code> for this account. Only <code>endpoint</code> and the two protocol keys are kept. The endpoint must be a public <code>https://</code> URL; private/loopback/link-local addresses are refused (here and again at send time, against DNS rebinding). At most 20 subscriptions per user; the oldest are dropped first. Re-subscribing an existing endpoint replaces it and keeps its original <code>created</code>. The client re-sends its subscription on every signed-in boot, so a row the instance lost comes back on its own.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1638,8 +1638,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Does the server hold this subscription?</span></summary><div class="ep-body">-<p>Whether the caller's account has a stored subscription with exactly this <code>endpoint</code>. The browser's <code>PushManager.getSubscription()</code> says nothing about the server's side — a row pruned after a dead send (404/410/403) leaves the browser subscribed to nowhere — so the client asks here before showing the notifications switch as on, and re-registers when the answer is no. A stored subscription also names the <code>deviceId</code> it is stored with, and the client re-registers when that is not its own: a row stored without one (from before device ids) sends that device's rest-timer alerts to every subscription of the account.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Whether the caller's account has a stored subscription with exactly this <code>endpoint</code>. The browser's <code>PushManager.getSubscription()</code> says nothing about the server's side: a row pruned after a dead send (404/410/403) leaves the browser subscribed to nowhere. So the client asks here before showing the notifications switch as on, and re-registers when the answer is no. A stored subscription also names the <code>deviceId</code> it is stored with, and the client re-registers when that is not its own: a row stored without one (from before device ids) sends that device's rest-timer alerts to every subscription of the account.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Query parameters</p><div class="ptab"><div class="prow"><span class="p-name">endpoint<em class="p-req" title="required">required</em></span>@@ -1671,7 +1671,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Removes the caller's subscription with the given endpoint. Idempotent.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1702,8 +1702,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Send a test notification</span></summary><div class="ep-body">-<p>Sends a test push to all of the caller's subscriptions (localized with the <code>lang</code> in their synced state). Returns 200 even if delivery to individual endpoints fails — dead endpoints (404/410, and 403 for a subscription made against a VAPID key the instance no longer has) are pruned as a side effect.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Sends a test push to all of the caller's subscriptions (localized with the <code>lang</code> in their synced state). Returns 200 even if delivery to individual endpoints fails; dead endpoints (404/410, and 403 for a subscription made against a VAPID key the instance no longer has) are pruned as a side effect.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -1728,8 +1728,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Schedule a server-side rest-timer push</span></summary><div class="ep-body">-<p>Schedules one push after <code>seconds</code> (a number or numeric string ≥ 1, clamped to 3600). One pending timer per device — <code>deviceId</code>, the same token the subscription was registered with; a new call from the same device replaces it, and the push goes only to that device's subscriptions. Without a <code>deviceId</code> there is one timer per account and the push goes to every subscription, as before. The client schedules this on rest start/extend and cancels on skip or on-screen completion — the push only actually fires when the tab was backgrounded/suspended and never got to cancel it. Timers live in memory: an API restart drops them.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Schedules one push after <code>seconds</code> (a number or numeric string ≥ 1, clamped to 3600). One pending timer per device, keyed by <code>deviceId</code>, the same token the subscription was registered with; a new call from the same device replaces it, and the push goes only to that device's subscriptions. Without a <code>deviceId</code> there is one timer per account and the push goes to every subscription, as before. The client schedules this on rest start/extend and cancels on skip or on-screen completion. The push only actually fires when the tab was backgrounded/suspended and never got to cancel it. Timers live in memory: an API restart drops them.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1774,7 +1774,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Cancels the caller's scheduled rest-timer push, if any. With a <code>deviceId</code> only that device's timer; without one, every pending timer of the account. Idempotent.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span> <span class="p-hint">(optional)</span></p><div class="ptab"><div class="prow">@@ -1813,7 +1813,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>The client pings this every ~20 s while a workout is on screen; the admin dashboard reads who is training right now. Purely ephemeral, in-memory, never persisted; entries expire ~70 s after the last ping. <code>{"active": false}</code> drops the caller's entry immediately.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -1890,9 +1890,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Download one of your photos or videos</span></summary><div class="ep-body">-<p>The stored file, whole, from the caller's own folder only: another profile's file answers exactly like one that was never uploaded (404). The body is the file, not JSON, with headers that keep a browser from ever treating it as a page: <code>Content-Type</code> from the sniffed type (never <code>text/*</code> or SVG), <code>X-Content-Type-Options: nosniff</code>, <code>Content-Security-Policy: default-src 'none'; sandbox</code>, <code>Cross-Origin-Resource-Policy: same-origin</code>, <code>Content-Disposition: inline</code>, <code>X-Robots-Tag: noindex</code> and <code>Cache-Control: private, no-store</code> — the app keeps its own verified copy, and an HTTP-cache copy would outlive signing out.</p>+<p>The stored file, whole, from the caller's own folder only: another profile's file answers exactly like one that was never uploaded (404). The body is the file, not JSON, with headers that keep a browser from ever treating it as a page: <code>Content-Type</code> from the sniffed type (never <code>text/*</code> or SVG), <code>X-Content-Type-Options: nosniff</code>, <code>Content-Security-Policy: default-src 'none'; sandbox</code>, <code>Cross-Origin-Resource-Policy: same-origin</code>, <code>Content-Disposition: inline</code>, <code>X-Robots-Tag: noindex</code> and <code>Cache-Control: private, no-store</code>. The app keeps its own verified copy, and an HTTP-cache copy would outlive signing out.</p><p>No <code>Range</code> and no <code>ETag</code>: the app downloads a file once, checks it against its hash and keeps it. A paired phone fetches with its bearer token; <code><img src></code> cannot carry one. Not throttled.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -1907,7 +1907,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">404</span>- <span class="p-desc">Not in the caller's folder — never uploaded, removed by the sweep, or someone else's.<span class="r-sig"><code>{"error":"no such file"}</code></span></span>+ <span class="p-desc">Not in the caller's folder. Never uploaded, removed by the sweep, or someone else's.<span class="r-sig"><code>{"error":"no such file"}</code></span></span></div></div></div>@@ -1922,10 +1922,10 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>The body is the raw file; <code>Content-Type</code> must be one of the seven types below and <code>Content-Length</code> is optional (chunked uploads are capped while they stream). The path names the SHA-256 of the bytes, and the file is stored only if they hash to it. Idempotent: uploading a file the server already has answers 200 with <code>existed: true</code>.</p>-<p>What is stored is decided by the file's first bytes, not by the declared type. The declared type only has to be in the same category — a still (JPEG, PNG, WebP, GIF) or a video (MP4, MOV, WebM): a JPEG declared as a GIF is stored as the JPEG it is, a video declared as an image is refused. The cap of the kind the bytes turned out to be applies (<code>MEDIA_IMAGE_MAX_MB</code>, <code>MEDIA_GIF_MAX_MB</code>, <code>MEDIA_VIDEO_MAX_MB</code>), and an MP4 or MOV must be a well-formed file no longer than <code>MEDIA_VIDEO_MAX_SEC</code> (+1 s), read from its headers. HEIC/AVIF, SVG, HTML and every other type are refused; the app converts HEIC photos before uploading. The server never decodes or alters a file: the app has already re-encoded photos and removed video metadata on the device.</p>+<p>What is stored is decided by the file's first bytes, not by the declared type. The declared type only has to be in the same category, a still (JPEG, PNG, WebP, GIF) or a video (MP4, MOV, WebM): a JPEG declared as a GIF is stored as the JPEG it is, a video declared as an image is refused. The cap of the kind the bytes turned out to be applies (<code>MEDIA_IMAGE_MAX_MB</code>, <code>MEDIA_GIF_MAX_MB</code>, <code>MEDIA_VIDEO_MAX_MB</code>), and an MP4 or MOV must be a well-formed file no longer than <code>MEDIA_VIDEO_MAX_SEC</code> (+1 s), read from its headers. HEIC/AVIF, SVG, HTML and every other type are refused; the app converts HEIC photos before uploading. The server never decodes or alters a file: the app has already re-encoded photos and removed video metadata on the device.</p><p>Checked in this order: session (401), the hourly budget and at most two uploads at once per profile (429), the declared type (415), a declared length over the cap (413 before a byte is read), already stored (200), the quota (413 <code>media-quota</code>; files the profile already dropped get one hour instead of the grace to make room), free disk (507), then while and after streaming: size (413), hash (400), sniffed type (415), sniffed cap (413), video checks (415/413). No bytes for 60 s ends the upload with 408. A refused upload is read and discarded up to twice its cap, so the answer reaches the client.</p><p>A new file that the profile's state does not reference yet starts its grace period at once, so a state push that never comes does not keep it forever.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -1956,15 +1956,15 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">413</span>- <span class="p-desc">- <code>media-too-large</code> — over the cap of its kind; <code>maxMB</code> says the cap. - <code>media-quota</code> — the profile's space is full; <code>usedMB</code> and <code>quotaMB</code> say how full. - <code>media-too-long</code> — a video longer than <code>maxSec</code> seconds.<span class="r-sig"><code>{"error":"that file is too large"}</code> · <code>{"error":"your space for photos and videos is full"}</code> · <code>{"error":"that video is too long"}</code></span></span>+ <span class="p-desc">- <code>media-too-large</code>: over the cap of its kind; <code>maxMB</code> says the cap. - <code>media-quota</code>: the profile's space is full; <code>usedMB</code> and <code>quotaMB</code> say how full. - <code>media-too-long</code>: a video longer than <code>maxSec</code> seconds.<span class="r-sig"><code>{"error":"that file is too large"}</code> · <code>{"error":"your space for photos and videos is full"}</code> · <code>{"error":"that video is too long"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">415</span>- <span class="p-desc"><code>media-type</code> — the declared type is not one of the seven, the bytes are none of them, or they are a video declared as an image (or the reverse). <code>media-invalid</code> — an MP4 or MOV whose boxes do not add up.<span class="r-sig"><code>{"error":"that file type is not accepted"}</code> · <code>{"error":"that video could not be read"}</code></span></span>+ <span class="p-desc"><code>media-type</code>: the declared type is not one of the seven, the bytes are none of them, or they are a video declared as an image (or the reverse). <code>media-invalid</code>: an MP4 or MOV whose boxes do not add up.<span class="r-sig"><code>{"error":"that file type is not accepted"}</code> · <code>{"error":"that video could not be read"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">429</span>- <span class="p-desc"><code>locked</code> — more than <code>MEDIA_UPLOADS_PER_HOUR</code> uploads this hour; <code>busy</code> — two uploads of this profile are already in flight (<code>retryAfter</code> 5).<span class="r-sig"><code>{"error":"too many uploads, try again later"}</code> · <code>{"error":"too many uploads at once, try again in a moment"}</code></span></span>+ <span class="p-desc"><code>locked</code>: more than <code>MEDIA_UPLOADS_PER_HOUR</code> uploads this hour; <code>busy</code>: two uploads of this profile are already in flight (<code>retryAfter</code> 5).<span class="r-sig"><code>{"error":"too many uploads, try again later"}</code> · <code>{"error":"too many uploads at once, try again in a moment"}</code></span></span></div><div class="prow rrow"><span class="r-code s5">507</span>@@ -1983,7 +1983,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>The app sends every hash its state references and uploads only what comes back, so the same call moves a guest's files into a new account, a phone's into its pairing, a backup's into the server, and re-sends a file the sweep removed while a device still had it. Answered from the caller's own folder only.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -2023,8 +2023,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>What "Reset everything" does after pushing the empty state: every stored file of the caller that the stored state does not reference goes now, without the grace period. A state that cannot be read removes nothing. At most 10 an hour per profile (429 <code>locked</code>). Recorded in the activity log as <code>media.sweep</code>.</p>-<p>Without this call nothing is lost either: the hourly sweep removes a file once the state has not referenced it for <code>MEDIA_GC_GRACE_DAYS</code> days (14), and only for profiles whose state reads — a missing or unreadable state, or a profile missing from <code>db.json</code>, never deletes anything.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Without this call nothing is lost either: the hourly sweep removes a file once the state has not referenced it for <code>MEDIA_GC_GRACE_DAYS</code> days (14), and only for profiles whose state reads. A missing or unreadable state, or a profile missing from <code>db.json</code>, never deletes anything.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><pre><code>{}</code></pre>@@ -2054,7 +2054,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<section class="api-sec" id="coach"><h2>AI Coach</h2>- <p class="sub">AI Coach — plans, reviews and debriefs. Every route here answers 503 unless the instance has the Coach switched on and a provider connected.</p>+ <p class="sub">AI Coach: plans, reviews and debriefs. Every route here answers 503 unless the instance has the Coach switched on and a provider connected.</p><div class="eps"><details class="ep" id="op-getCoachDisclosure">@@ -2065,9 +2065,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">What the consent screen must say</span></summary><div class="ep-body">-<p>The categories of data a Coach job would send, and the provider it would go to, read straight from the module that builds the payload — so the consent screen cannot drift from what actually leaves the box.</p>+<p>The categories of data a Coach job would send, and the provider it would go to, read straight from the module that builds the payload, so the consent screen cannot drift from what actually leaves the box.</p><p>Needs a session but <i>not</i> a connected Coach: the screen that collects consent runs before there is anything to consent to.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -2092,8 +2092,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">The running job, the waiting proposal and today's budget</span></summary><div class="ep-body">-<p>What the Coach screen polls. Also the only place a proposal past its 14-day expiry is retired — a phone that stays closed never polls, so nothing else would notice.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>What the Coach screen polls. Also the only place a proposal past its 14-day expiry is retired. A phone that stays closed never polls, so nothing else would notice.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -2108,7 +2108,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s5">503</span>- <span class="p-desc">The Coach is not set up on this instance — switched off, or no provider connected. Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span>+ <span class="p-desc">The Coach is not set up on this instance (switched off, or no provider connected). Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span></div></div></div>@@ -2122,8 +2122,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Ask for a training plan</span></summary><div class="ep-body">-<p>Queues a <code>create</code> job. With <code>intake</code> it builds a plan from the answers given on the intake screen; with <code>refine</code> it reworks the proposal already waiting, in the words of the person reading it. The answer is 202 and a job id — the result arrives through <code>GET /api/coach/status</code>.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Queues a <code>create</code> job. With <code>intake</code> it builds a plan from the answers given on the intake screen; with <code>refine</code> it reworks the proposal already waiting, in the words of the person reading it. The answer is 202 and a job id; the result arrives through <code>GET /api/coach/status</code>.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span> <span class="p-hint">(optional)</span></p><div class="ptab"><div class="prow">@@ -2165,19 +2165,19 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">429</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s5">503</span>- <span class="p-desc">The Coach is not set up on this instance — switched off, or no provider connected. Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span>+ <span class="p-desc">The Coach is not set up on this instance (switched off, or no provider connected). Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span></div></div></div>@@ -2191,8 +2191,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Ask for a review of the training since the last one</span></summary><div class="ep-body">-<p>Queues a <code>review</code> job — the same job the weekly cadence queues on its own. The answer is either a change-set to accept or reject, or "nothing to change" with the reason, both delivered through <code>GET /api/coach/status</code>.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Queues a <code>review</code> job, the same job the weekly cadence queues on its own. The answer is either a change-set to accept or reject, or "nothing to change" with the reason, both delivered through <code>GET /api/coach/status</code>.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span> <span class="p-hint">(optional)</span></p><div class="ptab"><div class="prow">@@ -2218,19 +2218,19 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">429</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s5">503</span>- <span class="p-desc">The Coach is not set up on this instance — switched off, or no provider connected. Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span>+ <span class="p-desc">The Coach is not set up on this instance (switched off, or no provider connected). Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span></div></div></div>@@ -2244,8 +2244,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Ask for a read of one session</span></summary><div class="ep-body">-<p>Queues a <code>debrief</code> job: one workout, read closely. It changes nothing — the card it produces is kept in the profile's log. With no <code>workoutId</code> the most recent session is read.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Queues a <code>debrief</code> job: one workout, read closely. It changes nothing; the card it produces is kept in the profile's log. With no <code>workoutId</code> the most recent session is read.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span> <span class="p-hint">(optional)</span></p><div class="ptab"><div class="prow">@@ -2271,19 +2271,19 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s4">403</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">409</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s4">429</span>- <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409) — a job for this profile is already running. - <code>shared</code> (409) — instance mode, and the credential belongs to another profile. - <code>cap</code> (429) — this profile's or the instance's daily limit is spent. - <code>consent</code> (403) — no consent recorded for this profile. - <code>unprivileged</code> (503) — the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span>+ <span class="p-desc">The Coach will not take this job, and says which reason in <code>code</code>: - <code>busy</code> (409): a job for this profile is already running. - <code>shared</code> (409): instance mode, and the credential belongs to another profile. - <code>cap</code> (429): this profile's or the instance's daily limit is spent. - <code>consent</code> (403): no consent recorded for this profile. - <code>unprivileged</code> (503): the privilege drop cannot be performed, so no job runs. The message is the one to show; the raw provider detail never reaches the user.<span class="r-sig"><code>{"error":"the Coach is already thinking about your training"}</code></span></span></div><div class="prow rrow"><span class="r-code s5">503</span>- <span class="p-desc">The Coach is not set up on this instance — switched off, or no provider connected. Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span>+ <span class="p-desc">The Coach is not set up on this instance (switched off, or no provider connected). Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span></div></div></div>@@ -2298,7 +2298,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>The client applies the accepted changes to its own state and syncs them through <code>PUT /api/data</code>; this only records the decision and clears the proposal. Sending it when nothing is waiting is a no-op, not an error.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span> <span class="p-hint">(optional)</span></p><div class="ptab"><div class="prow">@@ -2329,7 +2329,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s5">503</span>- <span class="p-desc">The Coach is not set up on this instance — switched off, or no provider connected. Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span>+ <span class="p-desc">The Coach is not set up on this instance (switched off, or no provider connected). Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span></div></div></div>@@ -2343,8 +2343,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">How this profile sits against the others who opted in</span></summary><div class="ep-body">-<p>Medians only, and only when at least three profiles on the instance share. Nothing at all for a profile that does not share itself, or on an instance where the admin has not switched the comparison on — each of those is a 200 saying which it is.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+<p>Medians only, and only when at least three profiles on the instance share. Nothing at all for a profile that does not share itself, or on an instance where the admin has not switched the comparison on. Each of those is a 200 saying which it is.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -2359,7 +2359,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s5">503</span>- <span class="p-desc">The Coach is not set up on this instance — switched off, or no provider connected. Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span>+ <span class="p-desc">The Coach is not set up on this instance (switched off, or no provider connected). Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span></div></div></div>@@ -2374,7 +2374,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Held server-side rather than in the synced state: this flag decides whether the profile's numbers reach other people, and a stale device syncing an older copy must not be able to turn it back on.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -2398,7 +2398,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div><div class="prow rrow"><span class="r-code s5">503</span>- <span class="p-desc">The Coach is not set up on this instance — switched off, or no provider connected. Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span>+ <span class="p-desc">The Coach is not set up on this instance (switched off, or no provider connected). Every Coach route answers this rather than pretending, so an unconfigured instance renders exactly the app it was before the feature existed. <code>code</code> is <code>off</code>, the class a job refused at enqueue for the same reason carries; the app shows its own line for it.<span class="r-sig"><code>{"error":"the Coach is not set up on this instance"}</code></span></span></div></div></div>@@ -2413,7 +2413,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Its own route because both the Coach screen and the admin card have to state it, and neither should be inferring it from settings. In instance mode a personal credential binds to the first profile that spends it; every other profile is refused outright rather than warned, and <code>reason</code> says so.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -2439,9 +2439,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Consent withdrawn, or the Coach switched off for this profile: the job record, the waiting proposal, the history and the sharing flag go at once, without waiting for a sync to carry the news. A job already running is cancelled where the adapter allows it and writes nothing back either way.</p>-<p>Today's job count is the one thing that survives — it is the spending record the daily cap reads, and forgetting must not hand out a fresh cap.</p>+<p>Today's job count is the one thing that survives. It is the spending record the daily cap reads, and forgetting must not hand out a fresh cap.</p><p>Needs a session only: a profile must be able to be forgotten on an instance whose Coach has since been switched off.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session — the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Requires a session: the cookie set at sign-in, or <code>Authorization: Bearer <token></code> from mobile-app pairing.</span></p><p class="ep-h">Responses</p>@@ -2462,7 +2462,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<section class="api-sec" id="admin"><h2>Admin</h2>- <p class="sub">Admin dashboard — requires an admin session (<code>ADMIN_UIDS</code> or <code>admin:true</code>)</p>+ <p class="sub">Admin dashboard. Requires an admin session (<code>ADMIN_UIDS</code> or <code>admin:true</code>)</p><div class="eps"><details class="ep" id="op-adminPasswordReset">@@ -2473,8 +2473,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Issue a one-time password reset code</span></summary><div class="ep-body">-<p>Returns a code (12 characters from the pairing alphabet, 60 bits) that is shown once, stored only as a SHA-256, valid for 24 h and good for one <code>POST /api/login/password-reset</code>. Issuing it removes the profile's current password and bumps its session version (every session and pending pairing code ends); passkeys keep working. A newer code replaces an older one. Admin accounts are refused — an admin sets their own password in Settings. Audited as <code>admin.password.reset</code>.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+<p>Returns a code (12 characters from the pairing alphabet, 60 bits) that is shown once, stored only as a SHA-256, valid for 24 h and good for one <code>POST /api/login/password-reset</code>. Issuing it removes the profile's current password and bumps its session version (every session and pending pairing code ends); passkeys keep working. A newer code replaces an older one. Admin accounts are refused; an admin sets their own password in Settings. Audited as <code>admin.password.reset</code>.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -2522,7 +2522,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>One row per user with workout counts, last sync, push status and live presence. <code>workouts</code> counts only the entries the drill-down can show. Admin only.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Responses</p>@@ -2551,8 +2551,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">One user in detail</span></summary><div class="ep-body">-<p>Drill-down — full workout history (newest first) and body-weight log for one user. Admin only. Anything in <code>routines</code>, <code>bodyweight</code> or <code>workouts</code> that is not an object is left out, and a list that is not an array reads as empty: PUT /api/data drops those entries now, but a state file written before it did still has them and this route has to answer for it. A workout's <code>media</code> (its photos and videos) is left out: they are the owner's own.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+<p>Drill-down: full workout history (newest first) and body-weight log for one user. Admin only. Anything in <code>routines</code>, <code>bodyweight</code> or <code>workouts</code> that is not an object is left out, and a list that is not an array reads as empty: PUT /api/data drops those entries now, but a state file written before it did still has them and this route has to answer for it. A workout's <code>media</code> (its photos and videos) is left out: they are the owner's own.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Query parameters</p><div class="ptab"><div class="prow"><span class="p-name">id<em class="p-req" title="required">required</em></span>@@ -2592,7 +2592,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Sets the <code>disabled</code> flag. A disabled account is locked out everywhere at once (every existing session stops resolving) and dropped from live presence. Admins cannot be disabled. Audited.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -2640,8 +2640,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Delete a user and everything of theirs</span></summary><div class="ep-body">-<p>Removes the account for good: the user record, their passkeys, their push subscriptions, their live presence, their training history file, their uploaded photos and videos (<code>DATA_DIR/uploads/<uid>/</code>) and any Coach credential stored for them. Not reversible — <code>/api/admin/user/disable</code> is the reversible one. An admin cannot delete their own account, and the last admin cannot be deleted. Audited by name, since the id stops meaning anything.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+<p>Removes the account for good: the user record, their passkeys, their push subscriptions, their live presence, their training history file, their uploaded photos and videos (<code>DATA_DIR/uploads/<uid>/</code>) and any Coach credential stored for them. Not reversible; <code>/api/admin/user/disable</code> is the reversible one. An admin cannot delete their own account, and the last admin cannot be deleted. Audited by name, since the id stops meaning anything.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -2685,7 +2685,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>All invite codes, with the redeeming user's name resolved for display.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Responses</p>@@ -2714,8 +2714,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Mint an invite code</span></summary><div class="ep-body">-<p>Creates a fresh single-use invite code (16 hex chars = 64 bits — the code itself is the thing that isn't worth guessing; rate limiting is the reverse proxy's job). Audited.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+<p>Creates a fresh single-use invite code (16 hex chars = 64 bits; the code itself is the thing that isn't worth guessing; rate limiting is the reverse proxy's job). Audited.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span> <span class="p-hint">(optional)</span></p><div class="ptab"><div class="prow">@@ -2751,7 +2751,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>Deletes an unused code. A code that was already redeemed cannot be revoked.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -2794,8 +2794,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Read the activity log</span></summary><div class="ep-body">-<p>The audit log (sign-ins, failed attempts, admin actions), newest first, paged by event id (<code>before</code> cursor — offset paging would repeat rows as new events land). Retention (<code>AUDIT_MAX</code> events / <code>AUDIT_DAYS</code> days) is applied on read as well as on the hourly compaction. When <code>AUDIT_LOG</code> is off the route still answers, with <code>enabled: false</code> and whatever was logged before.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+<p>The audit log (sign-ins, failed attempts, admin actions), newest first, paged by event id (<code>before</code> cursor; offset paging would repeat rows as new events land). Retention (<code>AUDIT_MAX</code> events / <code>AUDIT_DAYS</code> days) is applied on read as well as on the hourly compaction. When <code>AUDIT_LOG</code> is off the route still answers, with <code>enabled: false</code> and whatever was logged before.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Query parameters</p><div class="ptab"><div class="prow"><span class="p-name">limit</span>@@ -2810,7 +2810,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">cat</span><span class="p-type">"auth" | "admin" | "fail"</span>- <span class="p-desc">Filter — <code>fail</code> keeps only failed events; any other value keeps events whose name starts with <code><cat>.</code> (in practice <code>auth</code> or <code>admin</code>).</span>+ <span class="p-desc">Filter: <code>fail</code> keeps only failed events; any other value keeps events whose name starts with <code><cat>.</code> (in practice <code>auth</code> or <code>admin</code>).</span></div></div>@@ -2840,8 +2840,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Clear the activity log</span></summary><div class="ep-body">-<p>Deletes the log file. The clear is itself the first event of the fresh log, and event ids are never reset — a wipe always leaves a visible id gap.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+<p>Deletes the log file. The clear is itself the first event of the fresh log, and event ids are never reset, so a wipe always leaves a visible id gap.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Responses</p>@@ -2870,9 +2870,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">The Coach card</span></summary><div class="ep-body">-<p>Everything the admin screen renders in one round trip, including a live check of the configured provider — for a runtime provider "is the runtime there", for an HTTPS one the model list its stored key can see.</p>-<p>Counts and outcomes only: no intake answers, no payloads, no proposals, and never a credential — only whether one is filed and what it is labelled.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+<p>Everything the admin screen renders in one round trip, including a live check of the configured provider: for a runtime provider "is the runtime there", for an HTTPS one the model list its stored key can see.</p>+<p>Counts and outcomes only: no intake answers, no payloads, no proposals, and never a credential, only whether one is filed and what it is labelled.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Responses</p>@@ -2901,8 +2901,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Change the Coach settings</span></summary><div class="ep-body">-<p>A patch — every field is optional and only what is sent is changed. Model, endpoint and credential are all keyed by provider, so switching provider never drops any of them.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+<p>A patch: every field is optional and only what is sent is changed. Model, endpoint and credential are all keyed by provider, so switching provider never drops any of them.</p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -2990,9 +2990,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">Run one round trip against the provider</span></summary><div class="ep-body">-<p>Checks the runtime, then asks the model for one fixed JSON object and validates the shape that comes back — the whole path a job takes, on nobody's profile.</p>+<p>Checks the runtime, then asks the model for one fixed JSON object and validates the shape that comes back. That is the whole path a job takes, on nobody's profile.</p><p>Always 200: the outcome is in the body, because "the provider refused" is an answer to the question the button asks, not a failure of the request. It brings the two short upstream retry pauses rather than <code>COACH_RETRY_DELAYS_MS</code>, since an admin is watching it through a proxy with a timeout of its own.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Responses</p>@@ -3022,7 +3022,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body"><p>So the card can offer a list rather than a text field that goes stale with every model release. HTTPS providers only; a provider that cannot be asked answers <code>ok: false</code> with an empty list rather than an error status.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Responses</p>@@ -3053,7 +3053,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="ep-body"><p>The token is accepted once and never read back: it is encrypted with the instance secret and leaves again only as an environment variable on a job's child process. <code>type</code> has to match a variable the provider actually declares, so a key for one provider cannot be filed under another and then silently go nowhere.</p><p>A key may be filed for a provider that is not the active one, so the chips can be prepared before switching.</p>- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span></p><div class="ptab"><div class="prow">@@ -3074,7 +3074,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">account</span><span class="p-type">string <span class="p-hint">(≤ 120 chars)</span></span>- <span class="p-desc">A label for whose account this is — shown on the card.</span>+ <span class="p-desc">A label for whose account this is, shown on the card.</span></div></div><pre><code>{@@ -3113,7 +3113,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</summary><div class="ep-body">- <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only — a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p>+ <p class="ep-auth"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg><span>Admin only: a signed-in session whose user is an admin (<code>ADMIN_UIDS</code> or <code>admin:true</code>), as the session cookie or a Bearer token.</span></p><p class="ep-h">Request body <span class="p-hint">(JSON)</span> <span class="p-hint">(optional)</span></p><div class="ptab"><div class="prow">@@ -3149,7 +3149,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<section class="api-sec" id="schemas"><h2>Schemas</h2><p class="sub">The named shapes the endpoints above link to. The <code>State</code> blob- is <b>representative, not enforced</b> — the server stores it opaquely and the app+ is <b>representative, not enforced</b>: the server stores it opaquely and the appgrows it over time.</p><div class="eps">@@ -3175,7 +3175,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">retryAfter</span><span class="p-type">integer</span>- <span class="p-desc">429 only — the same number of seconds as the Retry-After header.</span>+ <span class="p-desc">429 only. The same number of seconds as the Retry-After header.</span></div></div></div>@@ -3256,7 +3256,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<summary><span class="sch-name"><code>OwnerProof</code></span><span class="ep-chev" aria-hidden="true"></span>- <span class="ep-sum">Either a passkey assertion made for this request (<code>cid</code> + <code>credential</code>), or the profile's current password (<code>current</code>) — which counts only while <code>PASSWORD_LOGIN</code> is on.</span>+ <span class="ep-sum">Either a passkey assertion made for this request (<code>cid</code> + <code>credential</code>), or the profile's current password (<code>current</code>), which counts only while <code>PASSWORD_LOGIN</code> is on.</span></summary><div class="ep-body"><p>Each assertion is good for one request: its challenge is spent by it.</p>@@ -3312,10 +3312,10 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<summary><span class="sch-name"><code>WebAuthnRegistrationOptions</code></span><span class="ep-chev" aria-hidden="true"></span>- <span class="ep-sum">PublicKeyCredentialCreationOptionsJSON — pass to <code>startRegistration()</code> (@simplewebauthn/browser) or decode for <code>navigator.credentials.create()</code>.</span>+ <span class="ep-sum">PublicKeyCredentialCreationOptionsJSON.</span></summary><div class="ep-body">-<p>Resident keys are required; attestation is <code>none</code>.</p>+<p>Pass to <code>startRegistration()</code> (@simplewebauthn/browser) or decode for <code>navigator.credentials.create()</code>. Resident keys are required; attestation is <code>none</code>.</p><div class="ptab"><div class="prow"><span class="p-name">challenge</span>@@ -3390,7 +3390,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<summary><span class="sch-name"><code>WebAuthnRegistrationCredential</code></span><span class="ep-chev" aria-hidden="true"></span>- <span class="ep-sum">RegistrationResponseJSON — the value <code>startRegistration()</code> resolves with (the created credential plus the authenticator's attestation response), sent back verbatim.</span>+ <span class="ep-sum">RegistrationResponseJSON: the value <code>startRegistration()</code> resolves with (the created credential plus the authenticator's attestation response), sent back verbatim.</span></summary><div class="ep-body">@@ -3428,7 +3428,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">response.transports</span><span class="p-type">string[]</span>- <span class="p-desc">e.g. ["internal", "hybrid"] — stored for later logins.</span>+ <span class="p-desc">e.g. ["internal", "hybrid"], stored for later logins.</span></div></div></div>@@ -3438,10 +3438,10 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<summary><span class="sch-name"><code>WebAuthnAuthenticationOptions</code></span><span class="ep-chev" aria-hidden="true"></span>- <span class="ep-sum">PublicKeyCredentialRequestOptionsJSON — pass to <code>startAuthentication()</code>.</span>+ <span class="ep-sum">PublicKeyCredentialRequestOptionsJSON.</span></summary><div class="ep-body">-<p><code>allowCredentials</code> is empty: the browser offers the user's discoverable passkeys itself.</p>+<p>Pass to <code>startAuthentication()</code>. <code>allowCredentials</code> is empty: the browser offers the user's discoverable passkeys itself.</p><div class="ptab"><div class="prow"><span class="p-name">challenge</span>@@ -3471,7 +3471,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<summary><span class="sch-name"><code>WebAuthnAuthenticationCredential</code></span><span class="ep-chev" aria-hidden="true"></span>- <span class="ep-sum">AuthenticationResponseJSON — the value <code>startAuthentication()</code> resolves with, sent back verbatim.</span>+ <span class="ep-sum">AuthenticationResponseJSON: the value <code>startAuthentication()</code> resolves with, sent back verbatim.</span></summary><div class="ep-body">@@ -3527,7 +3527,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">The whole app state as one blob.</span></summary><div class="ep-body">-<p>The server treats it as opaque (it only strips <code>active</code> on save and reads a few fields for reminders and the admin dashboard) — the schema below is <b>representative, not enforced</b> (except <code>workouts</code> and <code>routines</code>, which must be arrays (or null) when present), and grows with the app. Concurrent writes are caught by the server's revision (<code>_rev</code>, see PUT /api/data); the client merges the two documents and decides by <code>_ts</code> which side's settings win.</p>+<p>The server treats it as opaque (it only strips <code>active</code> on save and reads a few fields for reminders and the admin dashboard). The schema below is <b>representative, not enforced</b> (except <code>workouts</code> and <code>routines</code>, which must be arrays (or null) when present), and grows with the app. Concurrent writes are caught by the server's revision (<code>_rev</code>, see PUT /api/data); the client merges the two documents and decides by <code>_ts</code> which side's settings win.</p><div class="ptab"><div class="prow"><span class="p-name">_ts</span>@@ -3567,7 +3567,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">lang</span><span class="p-type">string</span>- <span class="p-desc">UI language code ("en", "de", "pt", …) — also localizes pushes.</span>+ <span class="p-desc">UI language code ("en", "de", "pt", …); also localizes pushes.</span></div><div class="prow"><span class="p-name">theme</span>@@ -3592,7 +3592,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">queue</span><span class="p-type">object</span>- <span class="p-desc">A planner's floating week {ids, since, startsOn, label} — the week's sessions as an ordered queue, the first undone one is today's. Written by an API client or by the app's own rotation feature, read by the reminder tick.</span>+ <span class="p-desc">A planner's floating week {ids, since, startsOn, label}. The week's sessions as an ordered queue, the first undone one is today's. Written by an API client or by the app's own rotation feature, read by the reminder tick.</span></div><div class="prow"><span class="p-name">week</span>@@ -3700,12 +3700,12 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">url</span><span class="p-type">string <span class="p-hint">(uri, ≤ 2048 chars)</span></span>- <span class="p-desc">One link — a video or a guide. http(s) only, no credentials. Neither the app nor the server ever fetches it: the app opens it in a new browsing context on a tap.</span>+ <span class="p-desc">One link: a video or a guide. http(s) only, no credentials. Neither the app nor the server ever fetches it: the app opens it in a new browsing context on a tap.</span></div><div class="prow"><span class="p-name">_ts</span><span class="p-type">number</span>- <span class="p-desc">When this entry was last edited, ms — for merging two devices' copies.</span>+ <span class="p-desc">When this entry was last edited, ms, for merging two devices' copies.</span></div></div></div>@@ -3763,7 +3763,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">poster</span><span class="p-type">object</span>- <span class="p-desc">A still of at most 480 px — always for images and GIFs, when possible for videos.</span>+ <span class="p-desc">A still of at most 480 px, always for images and GIFs, when possible for videos.</span></div><div class="prow"><span class="p-name">poster.hash</span>@@ -3892,7 +3892,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">mime</span><span class="p-type">string</span>- <span class="p-desc">What the bytes are — not necessarily what was declared.</span>+ <span class="p-desc">What the bytes are, not necessarily what was declared.</span></div><div class="prow"><span class="p-name">size</span>@@ -4010,12 +4010,12 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">media</span><span class="p-type"><a href="#schema-MediaRef">MediaRef</a>[]</span>- <span class="p-desc">Photos and videos attached to this workout (a progress photo, a form-check clip) — at most six in the app. Refs only; the bytes are behind <code>/api/media/{hash}</code>, and the server keeps every file any entry here names (the GC walks this list as it walks each custom exercise's <code>media</code>).</span>+ <span class="p-desc">Photos and videos attached to this workout (a progress photo, a form-check clip), at most six in the app. Refs only; the bytes are behind <code>/api/media/{hash}</code>, and the server keeps every file any entry here names (the GC walks this list as it walks each custom exercise's <code>media</code>).</span></div><div class="prow"><span class="p-name">_ts</span><span class="p-type">number</span>- <span class="p-desc">When this workout was last edited after it was logged, ms — for merging two devices' copies.</span>+ <span class="p-desc">When this workout was last edited after it was logged, ms, for merging two devices' copies.</span></div></div></div>@@ -4086,7 +4086,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<summary><span class="sch-name"><code>PushSubscription</code></span><span class="ep-chev" aria-hidden="true"></span>- <span class="ep-sum">The browser's PushSubscription.toJSON() — only these fields are stored.</span>+ <span class="ep-sum">The browser's PushSubscription.toJSON(); only these fields are stored.</span></summary><div class="ep-body">@@ -4182,12 +4182,12 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">password</span><span class="p-type">boolean</span>- <span class="p-desc">PASSWORD_LOGIN instances only — the profile has a password.</span>+ <span class="p-desc">PASSWORD_LOGIN instances only. The profile has a password.</span></div><div class="prow"><span class="p-name">email</span><span class="p-type">string | null</span>- <span class="p-desc">PASSWORD_LOGIN instances only — the e-mail the profile signs in with, if any.</span>+ <span class="p-desc">PASSWORD_LOGIN instances only. The e-mail the profile signs in with, if any.</span></div></div></div>@@ -4293,12 +4293,12 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">user.email</span><span class="p-type">string | null</span>- <span class="p-desc">PASSWORD_LOGIN instances only — the sign-in e-mail, if any.</span>+ <span class="p-desc">PASSWORD_LOGIN instances only. The sign-in e-mail, if any.</span></div><div class="prow"><span class="p-name">user.resetUntil</span><span class="p-type">number | null</span>- <span class="p-desc">PASSWORD_LOGIN instances only — expiry (ms) of an unused reset code.</span>+ <span class="p-desc">PASSWORD_LOGIN instances only. Expiry (ms) of an unused reset code.</span></div><div class="prow"><span class="p-name">unit</span>@@ -4409,7 +4409,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">id<em class="p-req" title="required">required</em></span><span class="p-type">integer</span>- <span class="p-desc">Monotonic, never reset — a cleared log leaves a visible id gap.</span>+ <span class="p-desc">Monotonic, never reset; a cleared log leaves a visible id gap.</span></div><div class="prow"><span class="p-name">ts<em class="p-req" title="required">required</em></span>@@ -4449,12 +4449,12 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">msg</span><span class="p-type">string</span>- <span class="p-desc">Short detail — a failure reason code, or the invite code involved. Rejected invite guesses and unknown credential ids are deliberately never recorded.</span>+ <span class="p-desc">Short detail: a failure reason code, or the invite code involved. Rejected invite guesses and unknown credential ids are deliberately never recorded.</span></div><div class="prow"><span class="p-name">ip</span><span class="p-type">string</span>- <span class="p-desc">Only when AUDIT_IP is on — the full address (<code>full</code>) or just the network, /24 or /48 (<code>net</code>).</span>+ <span class="p-desc">Only when AUDIT_IP is on: the full address (<code>full</code>) or just the network, /24 or /48 (<code>net</code>).</span></div></div></div>@@ -4528,7 +4528,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">The answer waiting for a decision, from whichever kind of job produced it.</span></summary><div class="ep-body">-<p>It expires 14 days after it was made; the first status poll after that retires it. <code>changes</code> comes from a review, <code>bundle</code> from a plan, <code>score</code>/<code>highlights</code> from a debrief — one of the three, never more.</p>+<p>It expires 14 days after it was made; the first status poll after that retires it. <code>changes</code> comes from a review, <code>bundle</code> from a plan, <code>score</code>/<code>highlights</code> from a debrief. One of the three, never more.</p><div class="ptab"><div class="prow"><span class="p-name">id</span>@@ -4553,7 +4553,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">planHash</span><span class="p-type">string</span>- <span class="p-desc">The plan this was written against — a later edit makes it stale.</span>+ <span class="p-desc">The plan this was written against. A later edit makes it stale.</span></div><div class="prow"><span class="p-name">iteration</span>@@ -4588,7 +4588,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">changes[].before</span><span class="p-type">object</span>- <span class="p-desc">What the plan says now — the client checks it before applying.</span>+ <span class="p-desc">What the plan says now. The client checks it before applying.</span></div><div class="prow"><span class="p-name">changes[].after</span>@@ -4623,7 +4623,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">bundle</span><span class="p-type">object</span>- <span class="p-desc">A whole plan, from a <code>create</code> job — routines, week and any custom exercises.</span>+ <span class="p-desc">A whole plan, from a <code>create</code> job (routines, week and any custom exercises).</span></div><div class="prow"><span class="p-name">bundle.opengym_plan</span>@@ -4774,7 +4774,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">unit</span><span class="p-type">"kg" | "lb"</span>- <span class="p-desc">The reader's own unit — every number below is in it.</span>+ <span class="p-desc">The reader's own unit. Every number below is in it.</span></div><div class="prow"><span class="p-name">sessionsPerWeek</span>@@ -4837,7 +4837,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<span class="ep-sum">The whole admin card in one answer.</span></summary><div class="ep-body">-<p>Never a credential — only whether one is filed.</p>+<p>Never a credential, only whether one is filed.</p><div class="ptab"><div class="prow"><span class="p-name">disabledByEnv</span>@@ -4927,7 +4927,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">models</span><span class="p-type">object</span>- <span class="p-desc">Model per provider — switching provider keeps them all.</span>+ <span class="p-desc">Model per provider. Switching provider keeps them all.</span></div><div class="prow"><span class="p-name">baseUrl</span>@@ -5002,7 +5002,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">auth</span><span class="p-type">object</span>- <span class="p-desc">Whether a credential is filed, and whose. <code>unreadable</code> is its own state because it has a specific cause and a specific fix — ./data restored without its <code>secret</code>.</span>+ <span class="p-desc">Whether a credential is filed, and whose. <code>unreadable</code> is its own state because it has a specific cause and a specific fix: ./data restored without its <code>secret</code>.</span></div><div class="prow"><span class="p-name">auth.state</span>@@ -5062,7 +5062,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon<div class="prow"><span class="p-name">recent</span><span class="p-type">object[]</span>- <span class="p-desc">The last 20 jobs, newest first — counts and outcomes only, never contents.</span>+ <span class="p-desc">The last 20 jobs, newest first. Counts and outcomes only, never contents.</span></div><div class="prow"><span class="p-name">recent[].at</span>@@ -5113,9 +5113,9 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon</div></div></footer>-<script src="site.js?v=22" defer></script>+<script src="site.js?v=23" defer></script><script>-/* Jumping to an anchor inside a collapsed card opens the card — and re-aligns, since+/* Jumping to an anchor inside a collapsed card opens the card and re-aligns, sincethe browser scrolled to where the target was while it was still collapsed. */;(() => {const openTo = id => {diff --git a/website/docs.html b/website/docs.htmlindex 3f88b29a5..164914649 100644--- a/website/docs.html+++ b/website/docs.html@@ -3,33 +3,33 @@<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">-<title>Docs — openGym</title>+<title>openGym: Docs</title><meta name="description" content="The complete openGym reference: every feature, installing on Android and iPhone, self-hosting with Docker, every .env setting, the AI Coach, importing from FitNotes/Strong/Hevy, backups, the MCP server, and how it's built."><meta name="theme-color" content="#000000"><meta name="robots" content="index,follow,max-image-preview:large"><link rel="preconnect" href="https://stats.duarte-santos.ch">-<meta property="og:title" content="openGym Docs — the complete reference">+<meta property="og:title" content="openGym Docs: the complete reference"><meta property="og:description" content="The complete openGym reference: every feature, self-hosting with Docker, every setting, the AI Coach, imports, backups, MCP, troubleshooting."><meta property="og:image" content="https://opengym.duarte-santos.ch/img/social.jpg"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">-<meta property="og:image:alt" content="openGym — your training, your data, your server. Two phones showing the home and workout screens.">+<meta property="og:image:alt" content="openGym: your training, your data, your server. Two phones showing the home and workout screens."><meta property="og:url" content="https://opengym.duarte-santos.ch/docs.html"><meta property="og:type" content="website"><meta property="og:site_name" content="openGym"><meta name="twitter:card" content="summary_large_image">-<meta name="twitter:title" content="openGym Docs — the complete reference">+<meta name="twitter:title" content="openGym Docs: the complete reference"><meta name="twitter:image" content="https://opengym.duarte-santos.ch/img/social.jpg"><link rel="canonical" href="https://opengym.duarte-santos.ch/docs.html"><link rel="icon" type="image/png" sizes="512x512" href="icon-512.png"><link rel="icon" type="image/png" sizes="180x180" href="icon-180.png"><link rel="apple-touch-icon" href="icon-180.png">-<link rel="stylesheet" href="styles.css?v=22">+<link rel="stylesheet" href="styles.css?v=23"><script>document.documentElement.className += ' js'</script><!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). --><script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script><script type="application/ld+json">-{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Is openGym really free?", "acceptedAnswer": {"@type": "Answer", "text": "Yes — free as in cost and as in freedom (AGPL-3.0). No pro tier, no locked features, no ads, and the license keeps every fork open source too."}}, {"@type": "Question", "name": "Why isn't openGym on the Play Store or App Store?", "acceptedAnswer": {"@type": "Answer", "text": "By choice (and on iOS, by Apple's rules for sideloading). Store accounts cost money, impose terms that sit badly with the AGPL, and put a gatekeeper between you and an app whose whole point is that your data is yours. The signed Android APK is a direct download."}}, {"@type": "Question", "name": "Should I pick the mobile app or self-host?", "acceptedAnswer": {"@type": "Answer", "text": "To simply track your training: the mobile app. For data on your own hardware, synced across devices, with profiles for the people you train with: self-host with Docker. The backup file migrates everything between the two, or pair the app to your server."}}, {"@type": "Question", "name": "What's on the openGym roadmap?", "acceptedAnswer": {"@type": "Answer", "text": "A small, themed release roughly every two weeks: a session queue, programmes and phases, AMRAP/%1RM/5-3-1 progression, cardio intervals, then database storage (v1.4.0), better search, OIDC login, a trainer role and an App Store build. The full plan is in ROADMAP.md on GitHub."}}, {"@type": "Question", "name": "Was openGym written with AI?", "acceptedAnswer": {"@type": "Answer", "text": "openGym is developed with Claude Code, Anthropic's coding agent; a large share of the code, tests and docs is drafted that way, and every change is reviewed, tested and released by the maintainer. The app itself calls no AI service unless an admin switches on the optional AI coach."}}, {"@type": "Question", "name": "Where does the exercise database come from?", "acceptedAnswer": {"@type": "Answer", "text": "From hasaneyldrm/exercises-dataset: 1,324 exercises with animations and instructions. The metadata and instruction text are MIT; the images and animations are third-party media that openGym never redistributes — your instance downloads them from upstream on first run."}}, {"@type": "Question", "name": "What does the AGPL license mean for me?", "acceptedAnswer": {"@type": "Answer", "text": "You can self-host, use, modify and share openGym freely. Only if you run a modified version as a network service must you offer that version's source under the same license. Using or self-hosting it unmodified obliges you to nothing."}}]}+{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Is openGym really free?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, free as in cost and as in freedom (AGPL-3.0). No pro tier, no locked features, no ads, and the license keeps every fork open source too."}}, {"@type": "Question", "name": "Why isn't openGym on the Play Store or App Store?", "acceptedAnswer": {"@type": "Answer", "text": "By choice (and on iOS, by Apple's rules for sideloading). Store accounts cost money, impose terms that sit badly with the AGPL, and put a gatekeeper between you and an app whose whole point is that your data is yours. The signed Android APK is a direct download."}}, {"@type": "Question", "name": "Should I pick the mobile app or self-host?", "acceptedAnswer": {"@type": "Answer", "text": "To simply track your training: the mobile app. For data on your own hardware, synced across devices, with profiles for the people you train with: self-host with Docker. The backup file migrates everything between the two, or pair the app to your server."}}, {"@type": "Question", "name": "What's on the openGym roadmap?", "acceptedAnswer": {"@type": "Answer", "text": "A small, themed release roughly every two weeks: a session queue, programmes and phases, AMRAP/%1RM/5-3-1 progression, cardio intervals, then database storage (v1.4.0), better search, OIDC login, a trainer role and an App Store build. The full plan is in ROADMAP.md on GitHub."}}, {"@type": "Question", "name": "Was openGym written with AI?", "acceptedAnswer": {"@type": "Answer", "text": "openGym is developed with Claude Code, Anthropic's coding agent; a large share of the code, tests and docs is drafted that way, and every change is reviewed, tested and released by the maintainer. The app itself calls no AI service unless an admin switches on the optional AI coach."}}, {"@type": "Question", "name": "Where does the exercise database come from?", "acceptedAnswer": {"@type": "Answer", "text": "From hasaneyldrm/exercises-dataset: 1,324 exercises with animations and instructions. The metadata and instruction text are MIT; the images and animations are third-party media that openGym never redistributes. Your instance downloads them from upstream on first run."}}, {"@type": "Question", "name": "What does the AGPL license mean for me?", "acceptedAnswer": {"@type": "Answer", "text": "You can self-host, use, modify and share openGym freely. Only if you run a modified version as a network service must you offer that version's source under the same license. Using or self-hosting it unmodified obliges you to nothing."}}]}</script></head><body class="topnav dock">@@ -59,7 +59,7 @@<!-- The navigation sheet: the header's links again, for the widths where the bar hasroom only for the brand and the download. Byte-identical on every page, like the- bar above it — nothing is ever dropped because of which page you are on. -->+ bar above it, so nothing is ever dropped because of which page you are on. --><div class="navsheet" id="sitemenu" role="navigation" aria-label="Site" aria-hidden="true"><div class="nl-rows"><a class="nl" href="/#features">Features</a>@@ -82,7 +82,7 @@</button><!-- The contents drawer: one list, one way in, one way out. Closed by default at- every width, and no preference is remembered — see .side in styles.css. -->+ every width, and no preference is remembered. See .side in styles.css. --><aside class="side" id="menu" aria-label="Contents" aria-hidden="true"><div class="side-top"><p class="side-title">Contents</p>@@ -183,7 +183,7 @@<main id="main" class="wrap prose"><h1>Docs</h1>- <p class="lead">The complete reference — every feature, every setting, every way to run+ <p class="lead">The complete reference: every feature, every setting, every way to runopenGym. The same documents live<a href="https://github.com/DuarteSantos8/openGym/blob/main/docs/README.md" rel="noopener">in the repository</a>,next to the code they describe.</p>@@ -203,29 +203,29 @@<p>One codebase, three ways to run it. Everything below applies to all of them unless asection says otherwise.</p><table class="cfg">- <tr><td><b>Mobile app</b></td><td>A sideloadable Android APK (and a buildable iOS app). No account, no server, no sync — the phone <i>is</i> the account, data lives in the app's private storage, workout-day reminders are native notifications. Install-and-done.</td></tr>+ <tr><td><b>Mobile app</b></td><td>A sideloadable Android APK (and a buildable iOS app). No account, no server, no sync: the phone <i>is</i> the account, data lives in the app's private storage, workout-day reminders are native notifications. Install-and-done.</td></tr><tr><td><b>Self-hosted</b></td><td>Two Docker containers on your own machine. Adds passkey profiles, sync across devices, installable as a home-screen PWA, optional admin dashboard, web push notifications. The flavor for households and training groups.</td></tr>- <tr><td><b>Demo</b></td><td><a href="/demo/">The in-browser demo</a> — the real app seeded with example data, storing everything in your browser only. Useful to try before installing, and as a free plan editor (see <a href="#import">Import</a>).</td></tr>+ <tr><td><b>Demo</b></td><td><a href="/demo/">The in-browser demo</a>: the real app seeded with example data, storing everything in your browser only. Useful to try before installing, and as a free plan editor (see <a href="#import">Import</a>).</td></tr></table>- <p>You can start with the mobile app and move to a server later (or the other way round) —+ <p>You can start with the mobile app and move to a server later (or the other way round);the <a href="#backup">backup file</a> migrates everything, and the mobile app can also<a href="#mobile-server">connect directly to your server</a>.</p><h2 id="android">Install on Android</h2><ol><li>Open <a href="/#download">the download</a> on your phone and tap <b>Download for Android</b>.</li>- <li>Your browser will ask whether it may install apps — allow it. This is standard for+ <li>Your browser will ask whether it may install apps. Allow it. This is standard forany app installed outside the Play Store (called <i>sideloading</i>), and you canrevoke the permission right after.</li><li>Open the downloaded <code>openGym.apk</code>, confirm, done. No account, no setup.</li></ol>- <div class="note">openGym is deliberately <b>not</b> on the Play Store — no store account+ <div class="note">openGym is deliberately <b>not</b> on the Play Store: no store accountbetween you and an open-source app. The APK is signed; updates install over the oldversion and keep your data.</div><p>The same signed APK exists in three places, all the same file:</p><ul><li>This site's <a href="/#download">download button</a>.</li>- <li><a href="https://gitlab.com/DuarteSantos8/opengym/-/packages" rel="noopener">GitLab's package registry</a> —+ <li><a href="https://gitlab.com/DuarteSantos8/opengym/-/packages" rel="noopener">GitLab's package registry</a>:every version under <code>opengym-android/<version>/</code>, with a<code>.sha256</code> checksum beside it.</li><li>The <a href="https://github.com/DuarteSantos8/openGym/releases" rel="noopener">GitHub release</a> for that version, with the APK and its <code>.sha256</code> attached.</li>@@ -241,21 +241,21 @@version exists.</p><p>The app requests notification permission only when you switch the workout-day reminderon, and declares <code>SCHEDULE_EXACT_ALARM</code> so reminders fire to the minute.- Reminders are scheduled per calendar date — a day you already trained, or rescheduled+ Reminders are scheduled per calendar date, so a day you already trained, or rescheduledaway, stays quiet. The missed-workout nudge, when switched on, is scheduled the same way.</p><h2 id="iphone">Use on iPhone</h2>- <p>Apple does not allow installing apps outside the App Store, so there is no iOS download —+ <p>Apple does not allow installing apps outside the App Store, so there is no iOS download.that's a platform rule, not a choice we made. What works instead:</p><ul><li><b>Self-host + home screen (recommended):</b> open your own openGym instance inSafari → <b>Share</b> → <b>Add to Home Screen</b>. You get a full-screen app with its- own icon, passkey sign-in and sync — no expiry, no fees.</li>+ own icon, passkey sign-in and sync. No expiry, no fees.</li><li><b>Build it onto your own iPhone:</b> with a Mac and Xcode 15+, the native Capacitorapp runs on your device with a free Apple ID (Apple expires the signature after- 7 days; re-run from Xcode to renew — <b>AltStore</b> can automate that re-signing over+ 7 days; re-run from Xcode to renew; <b>AltStore</b> can automate that re-signing overWi-Fi). See <a href="https://github.com/DuarteSantos8/openGym/blob/main/docs/MOBILE.md" rel="noopener">docs/MOBILE.md</a>.</li>- <li><b>Just looking?</b> Try the <a href="/demo/">in-browser demo</a> — the real app with+ <li><b>Just looking?</b> Try the <a href="/demo/">in-browser demo</a>: the real app withexample data, no account and nothing to install.</li></ul>@@ -267,7 +267,7 @@<li><b>A routine per weekday.</b> The home screen knows what day it is, shows this weekwith what's done and what's planned, and starts today's session with one tap.</li><li><b>Reschedule any day.</b> Sick, missed a session, fewer gym days this week? Move a- workout to another date without touching the weekly plan itself — the override applies+ workout to another date without touching the weekly plan itself. The override appliesto that date only.</li><li><b>Weeks start where you say.</b> Monday or Sunday, in Settings → Plan & schedule. Theweekly plan, the day strip on Home, the calendar grid and every “this week”@@ -283,7 +283,7 @@<h3 id="f-plan">Routines & the plan builder</h3><ul>- <li><b>1,324 exercises</b> — searchable, with animated demonstrations and step-by-step+ <li><b>1,324 exercises</b>: searchable, with animated demonstrations and step-by-stepinstructions, plus a <b>filter for the equipment you actually own</b> (the filteroptions adapt to what you've picked, so every combination on screen has results).</li><li><b>Your own exercises:</b> a name and a body part is enough; they behave like built-in@@ -294,28 +294,28 @@and still shows offline.</li><li><b>Replace an exercise in the routine editor</b> and keep its sets, reps and weight.</li><li><b>Supersets:</b> plan them into a routine, or pair two exercises <i>mid-session</i>- with "make superset with previous/next" — then work through the group back-to-back+ with "make superset with previous/next", then work through the group back-to-backwith a single rest at the end of each round. Unpair any time; a group of onedissolves itself.</li><li><b>Warm-up sets:</b> mark the ramp-up rows as warm-ups and they stay out of every- number that shouldn't see them — no effect on estimated 1RM, progression, or the+ number that shouldn't see them: no effect on estimated 1RM, progression, or thefatigue map, while still being right there in the session. A weight change cascadesdown the rows that share its phase, not across the divide.</li><li><b>Timed exercises:</b> planks, hangs, wall sits and loaded carries are logged by- time, not reps — with a work timer that counts the set itself (separate from the rest+ time, not reps, with a work timer that counts the set itself (separate from the resttimer) and logs the time you actually held. They can carry weight too.</li><li><b>Cardio:</b> logged as time + speed, not weight × reps.</li><li><b>Bodyweight exercises, logged as bodyweight:</b> push-ups, pull-ups, dips and- 300-odd others arrive knowing they carry no load — no weight column, no working-weight+ 300-odd others arrive knowing they carry no load: no weight column, no working-weightprompt, one stepper for the reps. Add a dip belt and it reads as an addition.</li><li><b>Reps per side:</b> for lunges, single-arm rows and the rest. You log the total,the app shows the split ("8 per side"), and targets step in twos so they never landon a number one side can't have.</li>- <li><b>Rest per exercise:</b> heavy triples and curls don't want the same break — give any+ <li><b>Rest per exercise:</b> heavy triples and curls don't want the same break. Give anyexercise its own rest time and it overrides the global timer for that exercise. Asuperset rests once, taking the longest. Travels with shared plans.</li><li><b>Share a plan:</b> send someone your routines and week schedule as a small file- (no workouts, no weigh-ins), or print it as a clean PDF. Importing merges — their own+ (no workouts, no weigh-ins), or print it as a clean PDF. Importing merges; their ownplan is never overwritten.</li><li><b>Muscle preview:</b> while you build a routine, the body diagram shows what ithits.</li>@@ -327,24 +327,24 @@and only change the label.</li></ul>- <h3 id="f-prog">Progression — weights that follow a rule</h3>+ <h3 id="f-prog">Progression: weights that follow a rule</h3><ul><li>Pick a progression program <b>per routine, overridable per exercise</b>:<ul>- <li><b>Linear</b> — add a fixed increment when you hit your reps.</li>- <li><b>Greyskull LP</b> — AMRAP top set, double jumps for beating the target big,+ <li><b>Linear</b>: add a fixed increment when you hit your reps.</li>+ <li><b>Greyskull LP</b>: AMRAP top set, double jumps for beating the target big,10 % resets on a stall.</li>- <li><b>Double progression</b> — through a visible rep range (both bounds editable);+ <li><b>Double progression</b>: through a visible rep range (both bounds editable);reps climb first, then the weight steps and reps reset. Per-side exercises stepin twos.</li>- <li><b>Timed progression</b> — adding seconds instead of weight.</li>+ <li><b>Timed progression</b>: adding seconds instead of weight.</li></ul></li><li>Your weights are already right when the session opens, and <b>every target sayswhy</b> it's that number. Missed reps never advance the load; stalls trigger a deload;- bodyweight exercises progress in reps instead — and past a rep ceiling you set, a set+ bodyweight exercises progress in reps instead, and past a rep ceiling you set, a setis added instead of a rep, up to the point where the honest advice is load or a hardervariation.</li>- <li><b>Planned deloads:</b> flag a routine as excluded from automatic progression — its+ <li><b>Planned deloads:</b> flag a routine as excluded from automatic progression. Itssessions open with the routine's own target weights, stay in your history andstatistics, and never become the baseline your next regular session progressesfrom.</li>@@ -366,7 +366,7 @@<li><b>History without leaving the workout:</b> ⋯ → History shows your best set(or estimated 1RM, longest hold, minutes) over time and the last ten sessions with everyset, the volume and a PR marker. Also in an exercise's details in the library.</li>- <li><b>It asks your body weight first</b> — one habit, one chart.</li>+ <li><b>It asks your body weight first</b>: one habit, one chart.</li><li><b>Plate math for barbell work.</b> Barbell, olympic, EZ, trap bar and Smith machineexercises carry a bar weight — 20 kg / 45 lb and the rest of the usualmarkings, or your own number per exercise — and the set in front of you shows@@ -381,18 +381,18 @@<li><b>Animations are your call:</b> the demo for each exercise can be full size, small, orhidden entirely during a workout (Settings → Workout). Hidden collapsesthe media instead of leaving a gap.</li>- <li><b>The screen stays awake while you train</b> — on for as long as a workout runs,+ <li><b>The screen stays awake while you train</b>: on for as long as a workout runs,released the moment you finish, switchable off in Settings → Workout. (Needs HTTPS orlocalhost; iOS refuses the wake lock in Low Power Mode.)</li><li><b>Change your mind mid-session:</b> add an exercise you decided to do, or remove oneyou didn't, without ending the workout. Removing a member of a superset asks whichone.</li>- <li><b>Freestyle sessions:</b> train without a plan and pick exercises as you go — each+ <li><b>Freestyle sessions:</b> train without a plan and pick exercises as you go. Eacharrives prefilled from the last time you did it, same sets, same reps and weights byposition.</li><li><b>Log a past workout:</b> forgot your phone, trained on paper, switched apps? Add a- session after the fact from History — date, start time, duration, routine or- freestyle, then the normal workout screen. If that day already has a workout you+ session after the fact from History (date, start time, duration, routine or+ freestyle), then the normal workout screen. If that day already has a workout youchoose: replace, keep both, or cancel. Backfilled sessions never claim PRs againstworkouts that came later.</li><li><b>Edit a saved workout:</b> fix a weight, add a forgotten set or exercise, change the@@ -409,10 +409,10 @@10-point scale). Tap the button to pick one of six levels, each with a sentence —"Nothing left, went to failure" through "Easy, warm-up territory" — or type anexact value; a logged rating tints its cell by how close to failure it was. Off by- default; each set keeps the scale it was logged with, and nothing else reads the value- — progression and 1RM are unaffected.</li>+ default; each set keeps the scale it was logged with, and nothing else reads the value,+ so progression and 1RM are unaffected.</li><li><b>See the timer end, not just hear it:</b> an opt-in screen flash when a rest or- work timer finishes — for loud gyms and headphones.</li>+ work timer finishes, for loud gyms and headphones.</li><li><b>Rest-timer push notifications</b> even with the app closed (self-hosted; themobile app uses native notifications).</li></ul>@@ -423,14 +423,14 @@<li><b>Estimated 1RM</b> per exercise, from your best eligible set (it names which one),with its own progress curve and a calculator for sets you haven't done. It won'tguess above 12 reps, and warm-up sets don't count.</li>- <li><b>Muscle map, three ways</b> — a front-and-back body diagram (male or female figure,+ <li><b>Muscle map, three ways:</b> a front-and-back body diagram (male or female figure,your pick) readable as:<ul>- <li><b>Balance</b> — where the volume went, over a week, a month or all time,+ <li><b>Balance</b>: where the volume went, over a week, a month or all time,naming the muscles you <i>haven't</i> trained;</li>- <li><b>Fatigue</b> — what is still recovering, weighted by how close each set was to+ <li><b>Fatigue</b>: what is still recovering, weighted by how close each set was toyour maximum, decaying smoothly rather than expiring at a window edge;</li>- <li><b>Strength</b> — how long since you trained each muscle, and behind every one+ <li><b>Strength</b>: how long since you trained each muscle, and behind every onethe exercises that built it with their estimated 1RM.</li></ul>It also previews what a routine hits while you build it, and shows what you just@@ -439,7 +439,7 @@no effective sets, fatigue, per-muscle strength stimulus, last-trained recency or body-maptraining intensity for that muscle. This is separate from logging an exercise with zeroload. Secondary muscle credit remains <b>0.4</b> when no override is specified.</p></li>- <li><b>Body-weight chart</b> with a goal line you set — gains and losses colored by+ <li><b>Body-weight chart</b> with a goal line you set, gains and losses colored bywhether they move toward it.</li><li><b>PRs</b> detected as you train, listed per exercise.</li><li><b>Structural Balance:</b> compares your lifts with each other against the Poliquin,@@ -454,10 +454,10 @@UK, ZH, ZH-TW, KO, HI, TH, HU, AR, with Arabic laid out right to left. Exercise instructionsare localized in 12 of them, and built-in exercise names are translated in seven(PT-BR, HU, DE, ES, RU, IT, FR). Translations load on demand, so the app stays fast.</li>- <li><b>kg or lb</b> — pick your unit; imports convert.</li>+ <li><b>kg or lb</b>: pick your unit; imports convert.</li><li><b>Workout-day reminder:</b> an optional notification on days you have a workout- planned but haven't logged one. It fires at <i>your</i> local time — each device- reports its own timezone — and follows you if you travel.</li>+ planned but haven't logged one. It fires at <i>your</i> local time (each device+ reports its own timezone) and follows you if you travel.</li><li><b>Missed-workout nudge:</b> opt-in, under the reminder. Skip a planned workout and youget one nudge that evening, in the tone you picked: <i>Friendly</i>, <i>Guilt trip</i>(“I miss you”) or <i>Drill sergeant</i>. Rest days stay quiet, and after@@ -473,7 +473,7 @@<pre><code>git clone https://github.com/DuarteSantos8/openGymcd openGymcp .env.example .env-docker compose pull # prebuilt images (amd64 + arm64) — skip to build from source+docker compose pull # prebuilt images (amd64 + arm64), skip to build from sourcedocker compose up -d</code></pre><p>Open <code>http://localhost:8080</code>, tap <b>Create profile</b>, and you're in. Thefirst launch downloads the exercise media (~140 MB) once into <code>media/img</code>@@ -482,15 +482,15 @@ docker compose up -d</code></pre>curl http://localhost:8080/api/health # {"ok":true,...}</code></pre><p>Logs: <code>docker compose logs -f</code> · stop: <code>docker compose down</code> ·build from source instead of pulling: skip the <code>pull</code> and run- <code>docker compose up -d --build</code> — no Node needed locally either way.</p>+ <code>docker compose up -d --build</code>. No Node needed locally either way.</p><h3 id="sh-passkey">The passkey rule (read this before opening a port)</h3>- <p>openGym signs you in with <b>passkeys</b> (WebAuthn — Face ID, fingerprint, or your+ <p>openGym signs you in with <b>passkeys</b> (WebAuthn: Face ID, fingerprint, or yourpassword manager). Browsers enforce two rules: a passkey is bound to an exact- <b>hostname</b>, and it only works over <b>HTTPS</b> — with one exception,+ <b>hostname</b>, and it only works over <b>HTTPS</b>, with one exception:<code>http://localhost</code>.</p><p>So <code>http://localhost:8080</code> works on the Docker machine, but your phone- <b>cannot</b> use <code>http://192.168.x.x:8080</code> — that's neither localhost nor+ <b>cannot</b> use <code>http://192.168.x.x:8080</code>: that's neither localhost norHTTPS, and the passkey prompt won't appear. To use openGym from your phone you need areal HTTPS hostname (below). Until then, LAN devices can still use <b>guest mode</b>(data stays in that browser) or the <a href="#mobile-server">mobile app's pairing@@ -514,10 +514,10 @@ ORIGIN=https://gym.example.comdocker compose up -d # restart alone does NOT re-read .env</code></pre><p>Visit your domain, create your profile, add it to the home screen (iOS: Share → Add toHome Screen · Android: ⋮ → Add to Home screen).</p>- <div class="note">Changing <code>RP_ID</code> later invalidates existing passkeys — they+ <div class="note">Changing <code>RP_ID</code> later invalidates existing passkeys. Theywere bound to the old hostname, and everyone registers again. Settle the domain beforepeople join.</div>- <p>Want a valid certificate <b>without</b> exposing anything to the internet — HTTPS on a+ <p>Want a valid certificate <b>without</b> exposing anything to the internet, HTTPS on aLAN-only address? That works too (wildcard cert via a DNS challenge, Caddy in front):<a href="https://github.com/DuarteSantos8/openGym/blob/main/docs/SELF_HOSTING_HTTPS.md" rel="noopener">docs/SELF_HOSTING_HTTPS.md</a>.A VPN or an auth proxy (Authelia, Cloudflare Access…) in front composes with all of@@ -532,7 +532,7 @@ docker compose up -d # restart alone does NOT re-read .env</code></pre><code>VAPID_SUBJECT=mailto:[email protected]</code> if you'd rather push services couldreach an inbox than your origin URL.</p><p>Where it works: any desktop browser, Android Chrome, and on iOS only the app <b>added to- the Home Screen</b> (a Safari tab has no Web Push). The Android APK doesn't use Web Push —+ the Home Screen</b> (a Safari tab has no Web Push). The Android APK doesn't use Web Push;its reminder is a local notification scheduled on the phone. A reminder that was due whilethe server was down or restarting is still sent up to 15 minutes late, once; the browserre-registers its subscription with the server on every signed-in start, so one the server@@ -544,13 +544,13 @@ docker compose up -d # restart alone does NOT re-read .env</code></pre><h3 id="sh-sync">Sync between devices</h3><p>Signed in, <b>the profile on the server is the truth</b>. Signing in on a device adopts it- — settings, plan, history — and if that device logged workouts while signed out, one+ (settings, plan, history), and if that device logged workouts while signed out, onedialog asks whether to add them to the profile or keep the profile as it is. While theapp is open it asks the server every 30 seconds (and every time it comes back to theforeground) whether anything changed and fetches only what did, so a session logged on thephone shows up on the desktop within half a minute. Two devices that both changed- something are merged on the server's revision — every workout, routine and weigh-in from- both sides is kept, settings follow the newer copy — instead of one overwriting the other.+ something are merged on the server's revision (every workout, routine and weigh-in from+ both sides is kept, settings follow the newer copy) instead of one overwriting the other.Without a network the app keeps working on the device and says so under the header; thechanges go up when the connection is back.</p>@@ -558,7 +558,7 @@ docker compose up -d # restart alone does NOT re-read .env</code></pre><p>The defaults assume openGym is alone: a service called <code>api</code> on port 3000,nginx on 80 inside the web container. Merging into a compose file that already has an<code>api</code>, or fronting it with your own proxy on another port, is four- <code>.env</code> settings — <code>WEB_PORT</code>, <code>NGINX_PORT</code>,+ <code>.env</code> settings: <code>WEB_PORT</code>, <code>NGINX_PORT</code>,<code>BACKEND</code>, <code>PORT</code>. The web image renders its nginx config fromthese <i>at container start</i>, so they work on a prebuilt image, no rebuild.</p>@@ -580,17 +580,17 @@ docker compose up -d</code></pre>defaults are what you get if you touch nothing.</p><table class="cfg"><tr><td><code>RP_ID</code></td><td>Hostname passkeys are bound to. A <b>bare hostname</b>: no scheme, no port, no slash. Default <code>localhost</code>.</td></tr>- <tr><td><code>ORIGIN</code></td><td>Full URL the app is served from — <i>with</i> scheme, <i>without</i> trailing slash. Must match the address bar exactly. Default <code>http://localhost:8080</code>.</td></tr>+ <tr><td><code>ORIGIN</code></td><td>Full URL the app is served from, <i>with</i> scheme, <i>without</i> trailing slash. Must match the address bar exactly. Default <code>http://localhost:8080</code>.</td></tr><tr><td><code>RP_NAME</code></td><td>Name shown in the passkey prompt. Default <code>openGym</code>.</td></tr><tr><td><code>WEB_PORT</code></td><td>Host port for the web UI. Default <code>8080</code>.</td></tr><tr><td><code>NGINX_PORT</code></td><td>Port the web container listens on, inside the container. Default <code>80</code>.</td></tr>- <tr><td><code>BACKEND</code></td><td>Name of the API service <code>/api</code> is proxied to — change it if yours isn't called <code>api</code>.</td></tr>+ <tr><td><code>BACKEND</code></td><td>Name of the API service <code>/api</code> is proxied to. Change it if yours isn't called <code>api</code>.</td></tr><tr><td><code>PORT</code></td><td>Port the API listens on; the web container proxies to the same value. Default <code>3000</code>.</td></tr><tr><td><code>SESSION_DAYS</code></td><td>How long a sign-in lasts, in days. Default <code>90</code>.</td></tr>- <tr><td><code>ADMIN_UIDS</code></td><td>Comma-separated user ids that get the <a href="#admin">admin dashboard</a>. Default: none — a fresh instance has no admin.</td></tr>+ <tr><td><code>ADMIN_UIDS</code></td><td>Comma-separated user ids that get the <a href="#admin">admin dashboard</a>. Default: none, so a fresh instance has no admin.</td></tr><tr><td><code>INVITE_ONLY</code></td><td>Set <code>1</code> and new profiles need an invite code you generate from the dashboard. Existing accounts keep working. Default: off.</td></tr>- <tr><td><code>ALLOW_GUEST</code></td><td>Set <code>0</code> to remove <b>Continue without account</b>. Guest data isn't deleted — it stays in that browser and returns if you re-enable guests, or moves into a profile created on the same device. Default: on.</td></tr>- <tr><td><code>AUDIT_LOG</code></td><td>Record sign-ins and admin actions to the <a href="#admin-log">activity log</a> — set <code>0</code> to record nothing. Default: on.</td></tr>+ <tr><td><code>ALLOW_GUEST</code></td><td>Set <code>0</code> to remove <b>Continue without account</b>. Guest data isn't deleted: it stays in that browser and returns if you re-enable guests, or moves into a profile created on the same device. Default: on.</td></tr>+ <tr><td><code>AUDIT_LOG</code></td><td>Record sign-ins and admin actions to the <a href="#admin-log">activity log</a>; set <code>0</code> to record nothing. Default: on.</td></tr><tr><td><code>AUDIT_MAX</code></td><td>Events kept in the activity log; <code>0</code> for no limit. Default <code>5000</code>.</td></tr><tr><td><code>AUDIT_DAYS</code></td><td>Days kept in the activity log; <code>0</code> to keep until <code>AUDIT_MAX</code>. Default <code>90</code>.</td></tr><tr><td><code>AUDIT_IP</code></td><td>Record the caller's address: <code>off</code>, <code>net</code> (network only, e.g. <code>203.0.113.0/24</code>) or <code>full</code>. Default <code>off</code>.</td></tr>@@ -606,14 +606,14 @@ docker compose up -d</code></pre><tr><td><code>COACH_DISABLED</code></td><td>Set <code>1</code> to switch the <a href="#coach">AI Coach</a> off harder than any toggle. <code>COACH_JOB_TIMEOUT_MS</code> raises the job budget for slow local models.</td></tr></table><p>Two things that look like settings but aren't: <code>DATA_DIR</code> is pinned to- <code>/data</code> by <code>docker-compose.yml</code> and mapped to <code>./data</code> —+ <code>/data</code> by <code>docker-compose.yml</code> and mapped to <code>./data</code>;change the host side of that volume, not the variable. And<code>VITE_IMG_BASE</code>/<code>VITE_GIF_BASE</code> are <b>build-time</b> values baked- into the frontend bundle — setting them next to <code>docker compose</code> does nothing+ into the frontend bundle, so setting them next to <code>docker compose</code> does nothingto a prebuilt image (see <a href="#troubleshoot">Troubleshooting</a>).</p><h2 id="admin">Multiple users, admin & the activity log</h2>- <p>Anyone who can reach the URL can create their own profile — each gets isolated data.+ <p>Anyone who can reach the URL can create their own profile, and each gets isolated data.That's the default: open signup, no admin. To control who gets in:</p><pre><code>ADMIN_UIDS=youruserid # your id is in ./data/db.json under users[].idINVITE_ONLY=1 # new profiles need an invite code@@ -621,7 +621,7 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre><p>Register your own passkey profile <i>first</i>, then put your id in<code>ADMIN_UIDS</code>. You'll get an <b>Admin dashboard</b> link in Settings → Account: who'straining right now, each user's workout history and body weight, disabling an account- (signed out and locked out everywhere until re-enabled), and — with invite-only on —+ (signed out and locked out everywhere until re-enabled), and, with invite-only on,generating and revoking invite codes. Admin access rides on your passkey and is enforcedserver-side; there is no separate admin login.</p><h3 id="admin-signin">Signing in: passkeys, more devices, passwords</h3>@@ -637,39 +637,39 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre><a href="https://github.com/DuarteSantos8/openGym/blob/main/docs/SELF_HOSTING.md#password-sign-in-optional" rel="noopener">SELF_HOSTING.md</a>.</p><p><code>INVITE_ONLY</code> and <code>ALLOW_GUEST</code> answer different questions and areusually set together: invite-only controls who may <i>create a profile</i>; the guest- button never creates one — guest mode keeps everything in that browser and never talks+ button never creates one: guest mode keeps everything in that browser and never talksto the server at all.</p><h3 id="admin-log">The activity log</h3><p>The dashboard keeps an activity log: sign-ins, sign-outs, failed attempts, refusedsignups, and every admin action. It lives in <code>./data/audit.log</code> as one JSON- object per line — <code>tail -f</code> and <code>jq</code> work on it directly, and the+ object per line, so <code>tail -f</code> and <code>jq</code> work on it directly, and thedashboard reads the same file. On by default, keeping the last 5,000 events or 90 days,whichever comes first.</p><p>What it deliberately does <b>not</b> record: IP addresses (unless you opt in via<code>AUDIT_IP</code>), browser user-agents (a fingerprint), and the passkey id of afailed sign-in (it would let you follow an unknown device between attempts). Guests- never appear — nothing they do touches the server. Clearing the log records the clear+ never appear; nothing they do touches the server. Clearing the log records the clearitself, and event ids keep counting, so a gap is always visible.</p><h2 id="mobile-server">Connecting the mobile app to your server</h2><p>The mobile app normally keeps everything on the phone. It can instead <b>connect to- your self-hosted instance</b> — your data then lives there, synced like the browser PWA.+ your self-hosted instance</b>, and your data then lives there, synced like the browser PWA.Same app, not a different download; offered on first launch and under Settings → Account →<b>Connect to my server</b>.</p><p>Passkeys can't work inside the app's WebView (it never runs at your real hostname), sothe device is <b>paired</b> instead:</p><ol>- <li>In a browser that's already signed in: Settings → Account → <b>Pair the mobile app</b> — shows+ <li>In a browser that's already signed in: Settings → Account → <b>Pair the mobile app</b>. It showsa one-time code, valid 5 minutes.</li><li>In the app: enter your server's address and that code. Done.</li></ol><p>Worth knowing: the pairing exchanges the code for a bearer token that is the same signed- value a session cookie carries — so <b>"sign out everywhere"</b> in the browser revokes+ value a session cookie carries, so <b>"sign out everywhere"</b> in the browser revokespaired apps too. Use an <code>https://</code> address: the phone blocks a plain<code>http://</code> server before anything is sent. Pairing fails while the browser works?A reverse proxy or a login page in front of <code>/api/</code> is answering instead ofopenGym; see <a href="https://github.com/DuarteSantos8/openGym/blob/main/docs/SELF_HOSTING.md#phone-app-and-cors" rel="noopener">Phone app and CORS</a>. A connected app keeps working without a network on the- last copy it synced — it shows an "Offline" line under the header and pushes your changes+ last copy it synced. It shows an "Offline" line under the header and pushes your changesas soon as the connection is back, same as the browser PWA. Settings → Account → <b>Disconnect</b> syncs one lasttime, then drops the device cleanly back to local mode. (For the curious: it's<code>POST /api/pair/create</code> + <code>/api/pair/redeem</code> in@@ -677,7 +677,7 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre><h2 id="coach">Let an AI coach write your plan</h2><p>Separate from the read-only bridge above, openGym has an optional <b>AI Coach</b>. Answer a- few questions — goal, days a week, session length, equipment, anything to work around — and+ few questions (goal, days a week, session length, equipment, anything to work around) andit designs a week of routines. Later it reviews what you actually logged and proposeschanges; you can also ask it to look at <b>one workout</b> (a debrief: a score, what wentwell, what to watch, what to do next time) or to <b>improve a single routine</b> and leave@@ -689,15 +689,15 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre>that, every request works the same way:</p><ol><li>The server builds a JSON payload from a <b>by-name allowlist</b>: your plan, the sets- you logged in the review window, weigh-ins, your intake answers, and a few preferences —+ you logged in the review window, weigh-ins, your intake answers, and a few preferences,under a pseudonym. Your name, e-mail, passkeys and everyone else's data are not in it,by construction: fields are copied in one by one, nothing is passed through.</li>- <li>That payload goes to the provider <b>you</b> configured — there is no openGym service in+ <li>That payload goes to the provider <b>you</b> configured; there is no openGym service inthe middle.</li><li>The answer is parsed and <b>validated against a closed list of change types</b> (add,remove or swap an exercise, sets, reps, schedule, progression policy…). An answer thatnames an exercise that doesn't exist, invents a change type, or breaks a rule is- refused — it gets exactly one repair round, then the job fails rather than guessing.</li>+ refused. It gets exactly one repair round, then the job fails rather than guessing.</li><li>What survives is shown to you as a card, <b>one checkbox per change</b>, each with theevidence behind it. Nothing touches your plan until you accept it, every proposal staysin the chat history whether you said yes or no, and the last accepted change-set can be@@ -708,15 +708,15 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre><p>It is <b>off by default</b>. An admin turns it on in <b>Settings → Account → Admin dashboard</b>,on the <b>AI Coach</b> card, and picks who answers:</p><table class="cfg">- <tr><td><b>Anthropic, OpenAI, Google Gemini</b></td><td>Paste an API key from the provider's console. Plain HTTPS from the api process — runs on the default image.</td></tr>+ <tr><td><b>Anthropic, OpenAI, Google Gemini</b></td><td>Paste an API key from the provider's console. Plain HTTPS from the api process, so it runs on the default image.</td></tr><tr><td><b>OpenAI-compatible endpoint</b></td><td>Any server that speaks the Chat Completions API: <b>Ollama</b>, <b>LM Studio</b>, <b>vLLM</b>, <b>OpenRouter</b>, a gateway of your own. A key only if the endpoint wants one. Also the default image.</td></tr>- <tr><td><b>Claude Agent SDK / Codex CLI</b></td><td>Run a real AI runtime inside the container — the one case that needs the bigger build: <code>API_TARGET=coach docker compose up -d --build api</code></td></tr>+ <tr><td><b>Claude Agent SDK / Codex CLI</b></td><td>Run a real AI runtime inside the container. The one case that needs the bigger build: <code>API_TARGET=coach docker compose up -d --build api</code></td></tr></table>- <h3 id="coach-local">Run it fully local — no cloud, no cost</h3>+ <h3 id="coach-local">Run it fully local: no cloud, no cost</h3><p>A model on your own hardware is just the compatible endpoint with no key. The usual way isan Ollama container next to openGym:</p>- <pre><code># docker-compose.yml — add next to the openGym services (same file = same network)+ <pre><code># docker-compose.yml: add next to the openGym services (same file = same network)ollama:image: ollama/ollamarestart: unless-stopped@@ -731,15 +731,15 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre>Base URL <code>http://ollama:11434</code> → <b>List models</b> → pick the model →<b>Test the Coach</b>. That's the whole setup.</p><p><b>Any model you can pull, you can use.</b> <code>ollama pull</code> whatever you like and- it appears under <i>List models</i> — the admin is free to run anything the box can hold,+ it appears under <i>List models</i>. The admin is free to run anything the box can hold,and each provider remembers its own model choice, so switching around never loses one.Honest sizing, from measuring exactly this on a small box:</p><ul><li>A <b>~3B model at Q4</b> (like <code>qwen2.5:3b</code>) fits a 4–6 GB container and- answers a review in <b>one to a few minutes</b> once its cache is warm — a modern 4-core+ answers a review in <b>one to a few minutes</b> once its cache is warm. A modern 4-coreCPU sits at the fast end, an old low-power box at the slow one.</li><li>A <b>4B model needs ~6 GB+</b> for its container. Squeezed into less, it doesn't- fail — it thrashes, generating at ~1 token/second. Smaller and comfortable beats bigger+ fail; it thrashes, generating at ~1 token/second. Smaller and comfortable beats biggerand swapping.</li><li>The <b>first request after a restart is slow once</b>: the model loads and reads theCoach's rules. The api pre-warms that cache at boot and every half hour, so in practice@@ -753,37 +753,37 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre><h3 id="coach-phone">On the phone</h3><p><b>Settings → AI Coach</b> offers two ways in: pair the phone with your self-hostedinstance and the Coach runs there under the rules above, or bring your own API key and the- phone calls the provider directly — same allowlist, same validator, key in the platform's+ phone calls the provider directly: same allowlist, same validator, key in the platform'ssecure storage, ten runs a day.</p><h3 id="coach-privacy">Privacy and limits</h3><p>Before anyone uses it, a consent screen lists exactly which categories of data leave the- server — generated from the same module that builds the payloads, so it cannot drift from+ server, generated from the same module that builds the payloads, so it cannot drift fromwhat actually happens. The admin can cap runs per person and per instance per day, and<code>COACH_DISABLED=1</code> in the environment switches the feature off harder than any- toggle. The Coach is not a doctor or a physiotherapist — if something hurts, ask a+ toggle. The Coach is not a doctor or a physiotherapist. If something hurts, ask aprofessional. Full details, including exactly what is sent and how credentials are stored:<a href="https://github.com/DuarteSantos8/openGym/blob/main/docs/AI_COACH.md" rel="noopener">docs/AI_COACH.md</a>.</p><h2 id="mcp">Ask an AI about your training (MCP)</h2><p>openGym ships an optional <b>MCP server</b>: a small read-only bridge that lets a client- like Claude Desktop, Cursor or Cline answer questions from your actual log — <i>"what+ like Claude Desktop, Cursor or Cline answer questions from your actual log: <i>"whatdid I bench last week?"</i>, <i>"which muscle have I not trained this month?"</i>. Itruns on your machine, is spawned by the client over stdio, reads the same<code>./data</code> files the API writes, and its numbers come from the <b>same pure- functions the Stats screen uses</b> — so the answers match the app exactly.</p>+ functions the Stats screen uses</b>, so the answers match the app exactly.</p><p>Eight tools in v1:</p><table class="cfg"><tr><td><code>list_routines</code></td><td>What routines are saved? (names + exercise counts)</td></tr><tr><td><code>get_routine</code></td><td>What does one routine prescribe, set by set?</td></tr><tr><td><code>get_week_plan</code></td><td>This week's plan, including any date override.</td></tr>- <tr><td><code>list_workouts</code></td><td>Recent sessions — dates, sets done/planned, volume, duration, PRs.</td></tr>+ <tr><td><code>list_workouts</code></td><td>Recent sessions: dates, sets done/planned, volume, duration, PRs.</td></tr><tr><td><code>get_workout</code></td><td>Full set-by-set breakdown of one session, by id or date.</td></tr><tr><td><code>get_bodyweight</code></td><td>Weigh-ins, the goal line, deltas vs goal.</td></tr><tr><td><code>estimate_1rm</code></td><td>Best 1RM for an exercise + trend, or a PR table across all.</td></tr>- <tr><td><code>muscle_balance</code></td><td>Muscles trained this week/month/all-time, ranked — and the neglected ones.</td></tr>+ <tr><td><code>muscle_balance</code></td><td>Muscles trained this week/month/all-time, ranked, plus the neglected ones.</td></tr></table>- <p>It is <b>not part of the Docker build</b> — if you don't use an AI assistant, it simply+ <p>It is <b>not part of the Docker build</b>. If you don't use an AI assistant, it simplyisn't there. No new auth (the filesystem is the boundary), no telemetry, no network; theLLM never sees passkeys or session secrets. Setup is <code>cd mcp && npminstall</code> plus a few lines of client config:@@ -796,20 +796,20 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre><tr><td><b>FitNotes</b> (Android)</td><td>Settings → Backup/Export → Spreadsheet Export</td></tr><tr><td><b>FitNotes 2</b> (iOS)</td><td>Export workouts as CSV</td></tr><tr><td><b>Strong</b></td><td>Settings → Export Data</td></tr>- <tr><td><b>Hevy</b></td><td>Settings → Export & Import Data (workouts or measurements) — or skip the CSV entirely, below</td></tr>+ <tr><td><b>Hevy</b></td><td>Settings → Export & Import Data (workouts or measurements), or skip the CSV entirely, below</td></tr><tr><td><b>Gravl</b></td><td>Profile → Export Data</td></tr><tr><td><b>Apple Health</b></td><td>Body-weight history straight out of the XML export</td></tr></table><p>Exercise names are matched against the library; anything genuinely ambiguous becomes one- of your own custom exercises instead of being guessed at — nothing in the file is+ of your own custom exercises instead of being guessed at, so nothing in the file isdropped. Session lengths and the RPE they record carry over. A summary shows exactly- what will happen before anything is written, and importing is <b>idempotent</b> —+ what will happen before anything is written, and importing is <b>idempotent</b>:running it twice never duplicates a workout.</p><h3 id="imp-hevy">Hevy, directly over the API</h3><p>With <b>Hevy Pro</b>, skip the CSV: create an API key under<a href="https://hevy.com/settings?developer" rel="noopener">Hevy → Settings → Developer</a>,then in openGym use <b>Settings → Data & backup → Import from Hevy</b>, paste the key (used only for that- import — never saved), and choose any mix of <b>workouts</b>, <b>routines</b> and+ import, never saved), and choose any mix of <b>workouts</b>, <b>routines</b> and<b>weigh-ins</b>. Workout days that already have data here are left alone; importedroutines are always added as new plans.</p><h3 id="imp-csv">Rolling your own CSV</h3>@@ -834,44 +834,44 @@ Leg Day,Leg Press,2026-08-21,200,1</code></pre><p>Routines travel as their own small JSON file (<b>Plan → Share your plan → Export plan file</b> exports every currentroutine; importing merges). Don't want to share everything? Edit the JSON, or use the<a href="/demo/">demo</a> as a free plan editor: import there, prune, export a fresh- file. The demo stores everything in your browser — nothing is public or shared.</p>+ file. The demo stores everything in your browser; nothing is public or shared.</p><h2 id="backup">Backups & your data</h2><h3>Per user</h3>- <p><b>Settings → Data & backup → Export backup (JSON)</b> writes your entire log — plan, workouts,- weights, settings — into one file. On the mobile app it goes out through the share sheet+ <p><b>Settings → Data & backup → Export backup (JSON)</b> writes your entire log (plan, workouts,+ weights, settings) into one file. On the mobile app it goes out through the share sheet(Files, AirDrop, mail…); in the browser it downloads. <b>Import backup</b> restores itanywhere: another phone, your self-hosted instance, or a fresh install. That file is the- whole point of openGym — your training log as a file <i>you</i> own.</p>+ whole point of openGym: your training log as a file <i>you</i> own.</p><h3>Per instance (self-hosted)</h3><p>Everything lives in <code>./data</code> on your host:</p><table class="cfg">- <tr><td><code>db.json</code></td><td>Profiles and <b>public</b> passkeys. Private keys never touch the server — they stay in your phone's secure hardware or password manager.</td></tr>+ <tr><td><code>db.json</code></td><td>Profiles and <b>public</b> passkeys. Private keys never touch the server; they stay in your phone's secure hardware or password manager.</td></tr><tr><td><code>state-<user>.json</code></td><td>One file per user: plan, workouts, body weight, settings.</td></tr>- <tr><td><code>audit.log</code></td><td>The activity log (if on) — one JSON object per line.</td></tr>+ <tr><td><code>audit.log</code></td><td>The activity log (if on), one JSON object per line.</td></tr><tr><td><code>secret</code></td><td>The session-cookie signing key.</td></tr><tr><td><code>vapid.json</code></td><td>Push-notification keys, generated on first run.</td></tr></table><pre><code>tar czf opengym-backup-$(date +%F).tar.gz data/</code></pre>- <p>That archive is everything — profiles, passkeys, history. It also contains+ <p>That archive is everything: profiles, passkeys, history. It also contains<code>audit.log</code> with everyone's sign-in times; worth knowing before shipping itto a backup service you don't run. Restore by unpacking into the project folder.</p><h2 id="arch">How it's built</h2><p>Two containers, one folder, no database server:</p><ul>- <li><b>frontend/</b> — React 19 + Vite (React Router, Zustand), built to static files+ <li><b>frontend/</b>: React 19 + Vite (React Router, Zustand), built to static files<i>inside Docker</i>. The app ships no runtime dependencies beyond React, the routerand Zustand.</li>- <li><b>api/</b> — Node with <b>no framework</b> and two dependencies+ <li><b>api/</b>: Node with <b>no framework</b> and two dependencies(<code>@simplewebauthn/server</code> for passkeys, <code>web-push</code> fornotifications), storing everything as plain JSON files under <code>./data</code>.</li>- <li><b>web/</b> — a multi-stage image that builds the frontend and serves it with nginx,+ <li><b>web/</b>: a multi-stage image that builds the frontend and serves it with nginx,proxying <code>/api</code> to the backend so it's all on <b>one origin</b> (passkeysrequire this).</li></ul>- <p>The training logic — progression rules, 1RM estimation, how a logged session is read- back — lives in pure functions under <code>frontend/src/lib/</code> with tests next to+ <p>The training logic (progression rules, 1RM estimation, how a logged session is read+ back) lives in pure functions under <code>frontend/src/lib/</code> with tests next tothem; the MCP server and the mobile app import the very same functions. Every pullrequest runs the full suites (frontend, api, mcp) on GitHub Actions and builds and boots theapi images. After the merge, CI on the GitLab mirror builds the amd64+arm64 images, signs the@@ -885,7 +885,7 @@ Leg Day,Leg Press,2026-08-21,200,1</code></pre><p>The exercise database comes from<a href="https://github.com/hasaneyldrm/exercises-dataset" rel="noopener">hasaneyldrm/exercises-dataset</a>:1,324 exercises with animations and instructions. The metadata and instruction text are- MIT; the images and animations are third-party media that openGym never redistributes —+ MIT; the images and animations are third-party media that openGym never redistributes;your instance downloads them from upstream on first run (see the<a href="#faq">FAQ</a> for the licensing details).</p>@@ -893,51 +893,51 @@ Leg Day,Leg Press,2026-08-21,200,1</code></pre><p>Everything on this page is built from the public repo:</p><ul><li><b>Web / self-host:</b> <code>docker compose up -d --build</code> builds the frontend- inside the container — no local Node needed.</li>+ inside the container. No local Node needed.</li><li><b>Android APK:</b> <code>npm run build:mobile</code> in <code>frontend/</code>, thenGradle + <code>zipalign</code> + <code>apksigner</code> with your own keystore- (keep it — updates must carry the same signature). Step-by-step:+ (keep it: updates must carry the same signature). Step-by-step:<a href="https://github.com/DuarteSantos8/openGym/blob/main/docs/MOBILE.md" rel="noopener">docs/MOBILE.md</a>.</li>- <li><b>iOS app:</b> the Capacitor project in <code>frontend/ios</code> — open in Xcode,+ <li><b>iOS app:</b> the Capacitor project in <code>frontend/ios</code>; open in Xcode,set your (free) team, run on your device. Same doc.</li><li><b>Development:</b> Node 20+; <code>npm test</code> in <code>frontend/</code>,- <code>api/</code> and <code>mcp/</code> runs the suites. Contributions welcome —+ <code>api/</code> and <code>mcp/</code> runs the suites. Contributions welcome:<a href="https://github.com/DuarteSantos8/openGym/blob/main/CONTRIBUTING.md" rel="noopener">CONTRIBUTING.md</a>.</li></ul><h2 id="troubleshoot">Troubleshooting</h2><h3 id="tr-passkey">Passkeys fail even though the config looks right</h3>- <p>The most common support question — work through these in order:</p>+ <p>The most common support question. Work through these in order:</p><ol><li><b>Ask the server what it actually loaded:</b><code>docker compose logs api | grep 'gym-api on'</code> prints the<code>rpID</code>/<code>origin</code> it runs with. If that disagrees with your<code>.env</code>: <code>docker compose restart</code> does <b>not</b> re-read- <code>.env</code> — use <code>docker compose up -d</code>.</li>+ <code>.env</code>; use <code>docker compose up -d</code>.</li><li><b>Check the exact shape:</b> <code>RP_ID</code> is a bare hostname- (<code>gym.example.com</code> — no <code>https://</code>, no port, no slash);+ (<code>gym.example.com</code>: no <code>https://</code>, no port, no slash);<code>ORIGIN</code> is the full origin with scheme and without trailing slash. Bothmust match the address bar exactly.</li>- <li><b>Behind a tunnel/proxy, use the public hostname</b> — never the container name,+ <li><b>Behind a tunnel/proxy, use the public hostname</b>, never the container name,LAN IP or internal port. The tunnel's own route may point wherever it likes.</li><li><b><code>www.</code> is a different host.</b> A passkey registered on- <code>gym.example.com</code> won't work on <code>www.gym.example.com</code> — pick+ <code>gym.example.com</code> won't work on <code>www.gym.example.com</code>. Pickone, redirect the other.</li><li><b>Changing the hostname invalidates existing passkeys.</b> Everyone registersagain.</li></ol><h3 id="tr-rest">Everything else</h3><table class="cfg">- <tr><td>No passkey prompt on my phone</td><td>You're on <code>http://</code> or a bare IP. Passkeys need HTTPS or localhost — set up a domain, or use guest mode / the mobile app.</td></tr>- <tr><td>"verification failed" on login</td><td><code>RP_ID</code>/<code>ORIGIN</code> don't match the address bar — see the checklist above, starting with what the server logged.</td></tr>+ <tr><td>No passkey prompt on my phone</td><td>You're on <code>http://</code> or a bare IP. Passkeys need HTTPS or localhost. Set up a domain, or use guest mode / the mobile app.</td></tr>+ <tr><td>"verification failed" on login</td><td><code>RP_ID</code>/<code>ORIGIN</code> don't match the address bar. See the checklist above, starting with what the server logged.</td></tr><tr><td>Media didn't download</td><td><code>docker compose logs media</code>, re-run <code>docker compose up -d</code>, or run <code>./scripts/fetch-media.sh</code>.</td></tr><tr><td>Port 8080 already used</td><td><code>WEB_PORT=9090</code> in <code>.env</code> (and update <code>ORIGIN</code> for local testing).</td></tr>- <tr><td>No "Reminders" page in Settings</td><td>Needs a signed-in profile and HTTPS (or localhost) — guest mode and plain HTTP over LAN can't subscribe.</td></tr>+ <tr><td>No "Reminders" page in Settings</td><td>Needs a signed-in profile and HTTPS (or localhost); guest mode and plain HTTP over LAN can't subscribe.</td></tr><tr><td>Day reminder fires at the wrong time</td><td>Toggle it off and on so it re-detects your browser's timezone (also happens on every app load).</td></tr><tr><td>"Keep screen awake" shows as unsupported</td><td>The Wake Lock API needs HTTPS or localhost; iOS also refuses it in Low Power Mode.</td></tr>- <tr><td>Want to reset a stuck login</td><td>Delete the cookie — sessions are just signed cookies. "Sign out everywhere" in Settings → Account ends every session (and paired apps) at once.</td></tr>+ <tr><td>Want to reset a stuck login</td><td>Delete the cookie: sessions are just signed cookies. "Sign out everywhere" in Settings → Account ends every session (and paired apps) at once.</td></tr><tr><td><code>docker compose pull</code> says "denied"</td><td>Build from source instead: <code>docker compose up -d --build</code>.</td></tr>- <tr><td>Exercise images blank in an old build</td><td>Fixed in current images. <code>VITE_IMG_BASE</code>/<code>VITE_GIF_BASE</code> are <b>build-time</b>: they're baked into the bundle when the frontend compiles, so setting them at runtime does nothing to a prebuilt image — redirect media in your reverse proxy instead, or rebuild.</td></tr>+ <tr><td>Exercise images blank in an old build</td><td>Fixed in current images. <code>VITE_IMG_BASE</code>/<code>VITE_GIF_BASE</code> are <b>build-time</b>: they're baked into the bundle when the frontend compiles, so setting them at runtime does nothing to a prebuilt image. Redirect media in your reverse proxy instead, or rebuild.</td></tr></table><p>Still stuck? The <a href="https://discord.gg/e62jY6fwVb" rel="noopener">Discord</a> isthe quickest way to get an answer;@@ -945,41 +945,41 @@ Leg Day,Leg Press,2026-08-21,200,1</code></pre>are better for anything the next person should find by searching, and<a href="https://github.com/DuarteSantos8/openGym/issues" rel="noopener">issues</a> for bugs.</p>- <h2 id="privacy">Privacy — the complete list</h2>+ <h2 id="privacy">Privacy: the complete list</h2><ul><li><b>The app collects nothing.</b> No telemetry, no analytics, no crash reporting, noaccounts on anyone else's server. The mobile app goes online only for exercisemedia from a CDN and, when you open Settings → About & updates, for GitLab's public release list (the updatecheck). In the browser, a self-hosted instance talks only to your own server.</li>- <li><b>Passkey private keys never leave your device</b> — the server stores only public+ <li><b>Passkey private keys never leave your device</b>; the server stores only publickeys.</li><li><b>The optional activity log</b> (self-hosted, admin feature) records sign-in eventsbut no IP addresses, user-agents or failed-attempt passkey ids unless the operator- opts in — <a href="#admin-log">details above</a>.</li>- <li><b>The AI Coach is opt-in twice over</b> — an admin has to enable it, and a consent+ opts in (<a href="#admin-log">details above</a>).</li>+ <li><b>The AI Coach is opt-in twice over</b>: an admin has to enable it, and a consentscreen lists exactly which data categories leave the server before anyone uses it.- Off, nothing is ever sent anywhere — <a href="#coach-privacy">details above</a>.</li>+ Off, nothing is ever sent anywhere (<a href="#coach-privacy">details above</a>).</li><li><b>The MCP server</b> is read-only, local, and never puts your data on thenetwork.</li><li><b>This website</b> uses self-hosted, cookieless <a href="https://umami.is" rel="noopener">Umami</a>- page-view counting — no cookies, no cross-site tracking, and it never sees anything+ page-view counting: no cookies, no cross-site tracking, and it never sees anythingfrom inside the app or the demo.</li></ul><h2 id="faq">FAQ</h2><h3>Is it really free?</h3>- <p>Yes — free as in cost <i>and</i> as in freedom (AGPL-3.0). No pro tier, no locked+ <p>Yes, free as in cost <i>and</i> as in freedom (AGPL-3.0). No pro tier, no lockedfeatures, no ads, and the license keeps every fork open source too. If it replaced a- paid tracker for you, there's a <a href="https://buymeacoffee.com/duartesantos" rel="noopener">coffee button</a> —- a star, a bug report or a pull request is worth just as much.</p>+ paid tracker for you, there's a <a href="https://buymeacoffee.com/duartesantos" rel="noopener">coffee button</a>,+ though a star, a bug report or a pull request is worth just as much.</p><h3>Why isn't it on the Play Store / App Store?</h3><p>By choice (and on iOS, by Apple's rules for sideloading). Store accounts cost money,impose terms that sit badly with the AGPL, and put a gatekeeper between you and an appwhose whole point is that your data is yours.</p>- <h3>Mobile app or self-hosted — which one should I pick?</h3>+ <h3>Mobile app or self-hosted: which one should I pick?</h3><p>If you just want to track your training: the mobile app. If you want your data on yourown hardware, synced across devices, with profiles for the people you train with:- self-host. You can start with the app and move to a server later — the backup file+ self-host. You can start with the app and move to a server later. The backup filemigrates everything, or <a href="#mobile-server">pair the app to your server</a> andkeep using it.</p><h3>What's on the roadmap?</h3>@@ -997,14 +997,14 @@ Leg Day,Leg Press,2026-08-21,200,1</code></pre><h3>Where does the exercise database come from?</h3><p>From <a href="https://github.com/hasaneyldrm/exercises-dataset" rel="noopener">hasaneyldrm/exercises-dataset</a>:1,324 exercises with animations and instructions, localized in 12 of openGym's 17 UI- languages — including openGym's separately curated Brazilian Portuguese translation.+ languages, including openGym's separately curated Brazilian Portuguese translation.That dataset licenses the two halves differently, and so does openGym: the exercisemetadata and instruction text are <b>MIT</b>, while the images and animations are- third-party media used under the dataset's terms rather than openGym's AGPL — their+ third-party media used under the dataset's terms rather than openGym's AGPL; theirownership is currently disputed between<a href="https://gymvisual.com/" rel="noopener">Gym visual</a> and ExerciseDB, and aclarification has been requested.</p>- <p>openGym does not redistribute that media — your instance downloads it from the upstream+ <p>openGym does not redistribute that media. Your instance downloads it from the upstreamsource on first run. If you want to reuse it yourself, commercially or otherwise, clearit with the rights holder first. Full third-party notices, including the body-diagramgeometry, are in@@ -1012,7 +1012,7 @@ Leg Day,Leg Press,2026-08-21,200,1</code></pre><h3>What does the AGPL mean for me?</h3><p>You can self-host, use, modify and share openGym freely. If you run a <i>modified</i>version as a network service, you must offer that version's source under the same- license — that's the clause that keeps openGym from ever becoming someone's closed,+ license. That's the clause that keeps openGym from ever becoming someone's closed,proprietary product. Just using or self-hosting it unmodified obliges you tonothing.</p></main>@@ -1029,6 +1029,6 @@ Leg Day,Leg Press,2026-08-21,200,1</code></pre></div></div></footer>-<script src="site.js?v=22" defer></script>+<script src="site.js?v=23" defer></script></body></html>diff --git a/website/index.html b/website/index.htmlindex 9e079b91e..15d1af3a7 100644--- a/website/index.html+++ b/website/index.html@@ -3,21 +3,21 @@<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">-<title>openGym — free, open-source gym & body-weight tracker</title>-<meta name="description" content="openGym is a free, open-source gym & body-weight tracker. Download the Android app or self-host it with Docker — no account, no cloud, no telemetry.">+<title>openGym: free, open-source gym & body-weight tracker</title>+<meta name="description" content="openGym is a free, open-source gym & body-weight tracker. Download the Android app or self-host it with Docker. No account, no cloud, no telemetry."><meta name="theme-color" content="#000000"><meta name="robots" content="index,follow,max-image-preview:large"><link rel="preconnect" href="https://stats.duarte-santos.ch"><meta name="twitter:card" content="summary_large_image">-<meta name="twitter:title" content="openGym — your workouts, your weights, your data">+<meta name="twitter:title" content="openGym: your workouts, your weights, your data"><meta name="twitter:description" content="Free, open-source gym & body-weight tracker. Android APK or self-hosted with Docker. No account, no cloud, no telemetry."><meta name="twitter:image" content="https://opengym.duarte-santos.ch/img/social.jpg">-<meta property="og:title" content="openGym — your workouts, your weights, your data">+<meta property="og:title" content="openGym: your workouts, your weights, your data"><meta property="og:description" content="Free, open-source gym & body-weight tracker. Android APK or self-hosted with Docker. No account, no cloud, no telemetry."><meta property="og:image" content="https://opengym.duarte-santos.ch/img/social.jpg"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">-<meta property="og:image:alt" content="openGym — your training, your data, your server. Two phones showing the home and workout screens.">+<meta property="og:image:alt" content="openGym: your training, your data, your server. Two phones showing the home and workout screens."><meta property="og:url" content="https://opengym.duarte-santos.ch/"><link rel="canonical" href="https://opengym.duarte-santos.ch/"><meta property="og:type" content="website">@@ -26,12 +26,12 @@<link rel="icon" type="image/png" sizes="180x180" href="icon-180.png"><link rel="apple-touch-icon" href="icon-180.png"><link rel="preload" as="image" type="image/webp" imagesrcset="img/home-480.webp 480w, img/home-600.webp 600w, img/home-1170.webp 1170w" imagesizes="(max-width: 700px) 62vw, 300px" fetchpriority="high">-<link rel="stylesheet" href="styles.css?v=22">+<link rel="stylesheet" href="styles.css?v=23"><!-- Marks that JS is alive before first paint, so the scroll-reveal styles neverhide content from a browser that will not run them. --><script>/* Before first paint: .js arms the scroll reveals, .intro plays the hero entrance once per- tab. Deferred scripts run too late for this — the hero would paint, then vanish and+ tab. Deferred scripts run too late for this; the hero would paint, then vanish andanimate back in. site.js takes .intro off again when the animation ends. */document.documentElement.className += ' js'try {@@ -113,7 +113,7 @@ try {<!-- The navigation sheet: the header's links again, for the widths where the bar hasroom only for the brand and the download. Byte-identical on every page, like the- bar above it — nothing is ever dropped because of which page you are on. -->+ bar above it, so nothing is ever dropped because of which page you are on. --><div class="navsheet" id="sitemenu" role="navigation" aria-label="Site" aria-hidden="true"><div class="nl-rows"><a class="nl" href="/#features">Features</a>@@ -136,7 +136,7 @@ try {</button><!-- The contents drawer: one list, one way in, one way out. Closed by default at- every width, and no preference is remembered — see .side in styles.css. -->+ every width, and no preference is remembered. See .side in styles.css. --><aside class="side" id="menu" aria-label="Contents" aria-hidden="true"><div class="side-top"><p class="side-title">Contents</p>@@ -162,7 +162,7 @@ try {<p class="eyebrow">openGym</p><h1>Your workouts.<br>Your weights.<br><span>Your data.</span></h1><p class="lead">A free, open-source gym and body-weight tracker. No subscription, no- account required, and no telemetry — not now, not later.</p>+ account required, and no telemetry. Not now, not later.</p><div class="actions"><a class="btn" href="#download">Get openGym</a><a class="link" href="#demo">Try the live demo</a>@@ -207,13 +207,13 @@ try {<div class="tile full rv"><div class="ic"><svg><use href="#i-sparkle"/></svg></div><h3>An AI coach, if you want one</h3>- <p>Optional, off by default, and it runs on whatever AI you bring — an Anthropic, OpenAI+ <p>Optional, off by default, and it runs on whatever AI you bring: an Anthropic, OpenAIor Gemini key, any OpenAI-compatible endpoint such as Ollama on your own network, or aClaude Code / Codex runtime in the container. Nothing it proposes is applied on itsown; every change carries its reason and can be undone.</p><div class="trio"><div><b>Plan</b>A week of routines from a few questions: goal, days, session length, equipment, limits.</div>- <div><b>Review</b>Reads what you actually logged — stalls, effort, body weight — and proposes changes with the evidence.</div>+ <div><b>Review</b>Reads what you actually logged (stalls, effort, body weight) and proposes changes with the evidence.</div><div><b>Private</b>An allowlist under an opaque handle leaves your server. Keys stay encrypted; admins see counts, never questions.</div></div></div>@@ -288,7 +288,7 @@ try {<article class="fcard"><span class="fcard-ic"><svg aria-hidden="true"><use href="#i-scale"/></svg></span><b class="fcard-t">Plate math</b>- <span class="fcard-b">Barbell work shows what goes on each side — <i>Bar 20 kg · 30 kg per side</i> — from the bar weight for that exercise. You still log the total.</span>+ <span class="fcard-b">Barbell work shows what goes on each side (<i>Bar 20 kg · 30 kg per side</i>) from the bar weight for that exercise. You still log the total.</span></article><article class="fcard"><span class="fcard-ic"><svg aria-hidden="true"><use href="#i-trend"/></svg></span>@@ -435,7 +435,7 @@ try {</ul><div class="push"><a class="btn" href="openGym.apk" download>Download for Android</a>- <p class="meta">v1.3.10 · 16.2 MB · Android 6.0+ · signed APK. Your browser will ask+ <p class="meta">v1.3.10 · 16.5 MB · Android 6.0+ · signed APK. Your browser will askbefore installing; that is normal outside the Play Store.</p><p class="meta">Every release is also built and signed by CI and attached to the<a href="https://github.com/DuarteSantos8/openGym/releases" rel="noopener">GitHub@@ -530,7 +530,7 @@ try {<span class="pad-body"><b>GitLab mirror</b><span>The same repository, kept in sync automatically.</span>- <span class="rest">Its CI builds the container images and signs every APK — nothing is merged here.</span>+ <span class="rest">Its CI builds the container images and signs every APK. Nothing is merged here.</span></span><span class="pad-go">Open the mirror</span></a>@@ -551,7 +551,7 @@ try {<span class="pad-body"><b>Discord</b><span>Releases, self-hosting help, and somewhere to report a bug.</span>- <span class="rest">Docker, reverse proxies and passkeys — new versions land here first.</span>+ <span class="rest">Docker, reverse proxies and passkeys. New versions land here first.</span></span><span class="pad-go">Join the server</span></a>@@ -575,6 +575,6 @@ try {</div></div></footer>-<script src="site.js?v=22" defer></script>+<script src="site.js?v=23" defer></script></body></html>diff --git a/website/site.js b/website/site.jsindex af252f514..e0daa557b 100644--- a/website/site.js+++ b/website/site.js@@ -1,12 +1,12 @@// Behaviour for the openGym site: the header's navigation sheet, the contents// drawer and its scrollspy, the scroll reveals, the demo frame, and the two things// that come from the GitHub API (repo counts, release timeline).-// Every one of them fails soft — the page is complete without any of this running.+// Every one of them fails soft: the page is complete without any of this running.const GH_REPO = 'https://api.github.com/repos/DuarteSantos8/openGym'// Discord publishes an invite's guild counts to anyone who asks for the invite with-// ?with_counts=1 — no bot token, no widget to enable, and the API reflects the caller's+// ?with_counts=1. No bot token, no widget to enable, and the API reflects the caller's// Origin, so the browser is allowed to read it. The code is the permanent invite in the// nav; if that invite is ever revoked this returns 404 and the count simply stays blank.const DC_INVITE = 'https://discord.com/api/v10/invites/e62jY6fwVb?with_counts=1'@@ -21,7 +21,7 @@ const whenIdle = (fn) => ('requestIdleCallback' in window ? requestIdleCallback(way the two of them can stay indistinguishable to a reader.Both are CLOSED in CSS, so a panel is shut on first paint whatever this script- does — and nothing is read back from storage to reopen one. */+ does, and nothing is read back from storage to reopen one. */const FOCUSABLE = 'a[href],button:not([disabled]),input,select,textarea,[tabindex]:not([tabindex="-1"])'function panel({ opener, panelEl, flag, closeBtn }) {@@ -51,10 +51,10 @@ function panel({ opener, panelEl, flag, closeBtn }) {opener.addEventListener('click', e => { e.stopPropagation(); set(!isOpen()) })panelEl.querySelector(closeBtn)?.addEventListener('click', () => set(false))- // Tapping a link inside navigates, so the panel has to get out of the way —+ // Tapping a link inside navigates, so the panel has to get out of the way,// in-page anchors especially, which do not reload anything.panelEl.addEventListener('click', e => { if (e.target.closest('a')) set(false) })- // The scrim is body::after, so it has no element of its own to listen on — a click+ // The scrim is body::after, so it has no element of its own to listen on. A click// that lands outside both the panel and its opener is a click on the scrim.document.addEventListener('click', e => {if (!isOpen()) return@@ -222,7 +222,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {const mount = () => {if (slot.dataset.mounted) return- if (!slot.offsetParent) return // frame hidden — phone layout+ if (!slot.offsetParent) return // frame hidden: phone layoutslot.dataset.mounted = '1'const f = document.createElement('iframe')f.src = slot.dataset.demo@@ -242,7 +242,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {})()/* ------------------------------------------------------- repo counts (nav + specs)- Back on api.github.com since 2026-09-11 — GitHub is the home of the project again and+ Back on api.github.com since 2026-09-11. GitHub is the home of the project again andGitLab only mirrors it. Unauthenticated, 60 requests an hour per IP, which thesessionStorage cache keeps us well under.@@ -258,7 +258,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {const r = await fetch(GH_REPO)if (!r.ok) returnconst j = await r.json()- // open_issues_count counts open pull requests too — GitHub's own repo header does the+ // open_issues_count counts open pull requests too. GitHub's own repo header does the// same, so the number matches what a visitor sees over there.d = { stars_count: j.stargazers_count, forks_count: j.forks_count, open_issues_count: j.open_issues_count }sessionStorage.setItem('repo_meta_gh2', JSON.stringify(d))@@ -268,7 +268,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {set('forks-n', d.forks_count)// Leave the placeholder standing rather than writing an empty box.if (d.open_issues_count !== '' && d.open_issues_count != null) set('issues-n', d.open_issues_count)- } catch (e) { /* offline / rate-limited — leave placeholders */ }+ } catch (e) { /* offline / rate-limited, leave placeholders */ }})/* --------------------------------------------------- Discord members (nav + specs)@@ -293,7 +293,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {const fmt = n.toLocaleString('en-US')set('members', fmt)set('members-n', fmt)- } catch (e) { /* offline / blocked — the link keeps its plain label */ }+ } catch (e) { /* offline / blocked, the link keeps its plain label */ }})/* -------------------------------------------------------------- about timeline@@ -333,7 +333,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {const li = document.createElement('li')const title = x.name && x.name !== x.tag ? x.name : x.tagli.innerHTML = '<b></b><span class="when"></span><p></p>'- li.querySelector('b').textContent = title.startsWith(x.tag) ? title : x.tag + ' — ' + title+ li.querySelector('b').textContent = title.startsWith(x.tag) ? title : x.tag + ': ' + titleli.querySelector('.when').textContent = fmt(x.at)const p = li.querySelector('p')p.textContent = blurb(x.body) + ' '@@ -369,7 +369,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {}})()-/* The hero intro is armed in the inline <head> script, before the first paint — a deferred+/* The hero intro is armed in the inline <head> script, before the first paint. A deferredscript would arm it too late and the hero would flash. All this does is take the class offonce the last element has landed, so nothing stays mid-animation. */;(() => {