diff --git a/.env.production.example b/.env.production.example
index 5843492102..0801ad0183 100644
--- a/.env.production.example
+++ b/.env.production.example
@@ -81,6 +81,12 @@ API_TOKEN_HMAC_KEY="
+HealthLog is a health record you run yourself. It collects weight, blood pressure, pulse, glucose, sleep, mood, cycle, labs and medications from the devices and apps you already use, puts them on one timeline, and keeps them in a Postgres database on a NAS, homelab or small VPS of yours. It is a web app you can install on any phone or desktop, with a native iPhone and iPad app beside it.
+
+It is for people who track their health over years, often with a condition and several devices, and who would rather not hand that history to a vendor cloud. One `docker compose up` starts it, there is no subscription, and you can export everything.
+
+The [live demo](https://demo.healthlog.dev) is a working install with sample data. Sign in with `demo` / `demo123demo123`.
+
+
@@ -36,114 +42,101 @@
` when the feed answered but not with a
- success."
- type: string
+ dosesDue:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Today's scheduled doses of active, tracked medications whose resolved state is `due` or `overdue` (the dose
+ resolver's own answer, as the today list gives it), not counting a slot the person snoozed.
+ checkupsDue:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Check-up reminders due now: enabled, not snoozed, no booked visit, due today on a long cycle or past their
+ time on a short one, as the daily digest's rail counts them."
required:
- - status
- - current
+ - dosesDue
+ - checkupsDue
additionalProperties: false
- description: Whether a newer release exists. The three states are carried in `status`; which of the optional fields are
- present follows from it.
- ShareLinkCreated:
+ ReportScheduleStatus:
type: object
properties:
data:
type: object
properties:
- id:
- type: string
- label:
- type: string
- rangeStart:
- type: string
- rangeEnd:
- type:
- - string
- - "null"
- protected:
- type: boolean
- documentCount:
- type: number
- documentOnly:
- type: boolean
- needsReselection:
- type: boolean
- expiresAt:
- type: string
- createdAt:
- type: string
- revokedAt:
- type:
- - string
- - "null"
- lastAccessAt:
- type:
- - string
- - "null"
- accessCount:
- type: number
- active:
- type: boolean
- token:
- type: string
- description: Raw `hls_` token — returned ONCE and unrecoverable thereafter.
- passphrase:
- type: string
- description: Raw passphrase second factor — returned ONCE; stored only as an HMAC hash, unrecoverable.
- shareUrl:
- type: string
- description: Absolute `/c/` URL (no passphrase).
- qrUrl:
- type: string
- description: Absolute share URL with the passphrase in the URL FRAGMENT (`#k=`). Encode this as the QR
- payload; the fragment is never sent to the server.
+ schedule:
+ anyOf:
+ - $ref: "#/components/schemas/ReportSchedule"
+ - type: "null"
required:
- - id
- - label
- - rangeStart
- - rangeEnd
- - protected
- - documentCount
- - documentOnly
- - needsReselection
- - expiresAt
- - createdAt
- - revokedAt
- - lastAccessAt
- - accessCount
- - active
- - token
- - passphrase
- - shareUrl
- - qrUrl
+ - schedule
additionalProperties: false
error:
type: "null"
@@ -45210,69 +47642,76 @@ components:
- data
- error
additionalProperties: false
- ShareLinkList:
+ ReportSchedule:
+ type: object
+ properties:
+ cadence:
+ type: string
+ enum:
+ - MONTHLY
+ - QUARTERLY
+ - YEARLY
+ window:
+ type: string
+ enum:
+ - PERIOD
+ - LAST_90_DAYS
+ - LAST_365_DAYS
+ lastPeriod:
+ description: "The last period a run settled: `2026-10`, `2026-Q3` or `2025`. Null before the first run."
+ type:
+ - string
+ - "null"
+ lastOutcome:
+ anyOf:
+ - type: string
+ enum:
+ - stored
+ - alreadyFiled
+ - deletedByOwner
+ - quotaExceeded
+ - tooLarge
+ - noSelection
+ - failed
+ - type: "null"
+ description: "How the last run ended. `stored`: filed. `alreadyFiled`: the vault already held this period's report.
+ `deletedByOwner`: the owner deleted it, so it is not filed again. `quotaExceeded` / `tooLarge`: it did not
+ fit the vault; the next period tries again. `noSelection`: no saved report selection to render, retried once
+ there is one. `failed`: retried on the next run."
+ lastRunAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ duePeriod:
+ description: The closed period the next run files, on the record's clock; null when it is already settled.
+ type:
+ - string
+ - "null"
+ required:
+ - cadence
+ - window
+ - lastPeriod
+ - lastOutcome
+ - lastRunAt
+ - duePeriod
+ additionalProperties: false
+ description: "The scheduled doctor report. Each closed period is rendered with the owner's saved report selection and
+ filed once into the document vault as a `DOCTOR_REPORT` document with `sourceSystem: REPORT_SCHEDULE` and
+ `sourceId: :`. No notification is sent."
+ ReportScheduleStatusAfterPut:
type: object
properties:
data:
type: object
properties:
- shareLinks:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- label:
- type: string
- rangeStart:
- type: string
- rangeEnd:
- type:
- - string
- - "null"
- protected:
- type: boolean
- documentCount:
- type: number
- documentOnly:
- type: boolean
- needsReselection:
- type: boolean
- expiresAt:
- type: string
- createdAt:
- type: string
- revokedAt:
- type:
- - string
- - "null"
- lastAccessAt:
- type:
- - string
- - "null"
- accessCount:
- type: number
- active:
- type: boolean
- required:
- - id
- - label
- - rangeStart
- - rangeEnd
- - protected
- - documentCount
- - documentOnly
- - needsReselection
- - expiresAt
- - createdAt
- - revokedAt
- - lastAccessAt
- - accessCount
- - active
- additionalProperties: false
+ schedule:
+ anyOf:
+ - $ref: "#/components/schemas/ReportSchedule"
+ - type: "null"
required:
- - shareLinks
+ - schedule
additionalProperties: false
error:
type: "null"
@@ -45286,19 +47725,18 @@ components:
- data
- error
additionalProperties: false
- ShareLinkRevoked:
+ ReportScheduleStatusAfterDelete:
type: object
properties:
data:
type: object
properties:
- id:
- type: string
- revoked:
- type: boolean
+ schedule:
+ anyOf:
+ - $ref: "#/components/schemas/ReportSchedule"
+ - type: "null"
required:
- - id
- - revoked
+ - schedule
additionalProperties: false
error:
type: "null"
@@ -45312,18 +47750,11 @@ components:
- data
- error
additionalProperties: false
- ShareLinkUnlock:
+ MeasurementCategoriesEnvelope:
type: object
properties:
data:
- type: object
- properties:
- unlocked:
- type: boolean
- const: true
- required:
- - unlocked
- additionalProperties: false
+ $ref: "#/components/schemas/MeasurementCategoriesResponse"
error:
type: "null"
meta:
@@ -45336,10 +47767,783 @@ components:
- data
- error
additionalProperties: false
- ExportJsonBody:
+ MeasurementCategoriesResponse:
type: object
properties:
- data:
+ version:
+ type: number
+ const: 1
+ description: Additive schema marker; assignments never reshuffle.
+ categories:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ description: Category id (e.g. `vitals`).
+ labelKey:
+ type: string
+ description: i18n key for the category label (`categories.`).
+ order:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Stable display order.
+ required:
+ - id
+ - labelKey
+ - order
+ additionalProperties: false
+ description: The ordered category list for the picker.
+ assignments:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties:
+ type: string
+ description: MeasurementType → category id map.
+ required:
+ - version
+ - categories
+ - assignments
+ additionalProperties: false
+ description: "The measurement categorisation overlay: the ordered category list plus the MeasurementType → category
+ assignments. Derived server-side from the canonical map; cached `public, max-age=600`."
+ CapabilitiesEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/CapabilitiesResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ CapabilitiesResponse:
+ type: object
+ properties:
+ apiContractVersion:
+ type: string
+ description: Running build version — mirrors GET /api/version `version`.
+ derivedMetricIds:
+ type: array
+ items:
+ type: string
+ description: Closed derived-metric id set (GET /api/insights/derived).
+ vitalsBaselineTypes:
+ type: array
+ items:
+ type: string
+ description: MeasurementTypes the typical-range baseline engine supports.
+ layoutTileIds:
+ type: array
+ items:
+ type: string
+ description: Canonical insights layout tile-id set (English ids).
+ metricStatusIds:
+ type: array
+ items:
+ type: string
+ description: Closed metric-status / assessment id set.
+ ingest:
+ type: object
+ properties:
+ quantityTypes:
+ type: array
+ items:
+ type: object
+ properties:
+ type:
+ type: string
+ description: HealthLog MeasurementType.
+ hk:
+ type: string
+ description: HealthKit identifier.
+ unit:
+ type: string
+ description: Canonical DB unit.
+ required:
+ - type
+ - hk
+ - unit
+ additionalProperties: false
+ description: Accepted HealthKit quantity-sample mappings.
+ eventTypes:
+ type: array
+ items:
+ type: string
+ description: MeasurementTypes for device-flagged EVENT-class HealthKit samples.
+ computedScores:
+ type: array
+ items:
+ type: string
+ description: Server-owned nightly composite score types.
+ writeAllowlist:
+ type: array
+ items:
+ type: string
+ description: MeasurementSources a client may attribute on a write (others are server-owned).
+ required:
+ - quantityTypes
+ - eventTypes
+ - computedScores
+ - writeAllowlist
+ additionalProperties: false
+ description: Ingest vocabularies the batch / single-write paths accept.
+ fhir:
+ type: object
+ properties:
+ atcSystem:
+ type: string
+ description: WHO ATC CodeSystem URI.
+ snomedRoute:
+ type: string
+ description: SNOMED CT CodeSystem URI.
+ germanAtcDefaultLocales:
+ type: array
+ items:
+ type: string
+ description: App locales that default the additive BfArM ATC coding on.
+ restBaseUrl:
+ type: string
+ description: Base path of the read-only FHIR R4 REST face.
+ scopeMintable:
+ type: boolean
+ description: "Whether a narrow Bearer token for the FHIR face can be obtained. Always false: no mint path grants the
+ scope, so the face is reachable by the owner's cookie session or a wildcard device token only."
+ resourceTypes:
+ type: array
+ items:
+ type: string
+ description: FHIR resource types the REST face serves (read + search).
+ operations:
+ type: array
+ items:
+ type: string
+ description: Whole-record operations exposed (e.g. $everything).
+ searchParams:
+ type: array
+ items:
+ type: string
+ description: Search parameters honoured uniformly across the search routes.
+ required:
+ - atcSystem
+ - snomedRoute
+ - germanAtcDefaultLocales
+ - restBaseUrl
+ - scopeMintable
+ - resourceTypes
+ - operations
+ - searchParams
+ additionalProperties: false
+ description: FHIR coding constants + the read-only REST face descriptor (v1.11).
+ share:
+ type: object
+ properties:
+ supported:
+ type: boolean
+ description: Whether clinician share links are served.
+ maxDays:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Maximum lifetime of a share link, in days. No never-expiring share.
+ reportDownload:
+ type: array
+ items:
+ type: string
+ description: Machine formats a share link serves as a download under its token, behind the same unlock as the page.
+ selectionVersion:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Version of the leaf-selection grammar this build speaks.
+ groups:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ description: Group id.
+ leaves:
+ type: array
+ items:
+ type: string
+ description: Member leaf ids, in the order the panel renders them.
+ sensitive:
+ description: "Present and true only on the fenced tier: no single control may switch on more than one of its leaves."
+ type: boolean
+ required:
+ - id
+ - leaves
+ additionalProperties: false
+ description: Selection groups, in presentation order, each carrying its member leaf ids.
+ leaves:
+ type: array
+ items:
+ type: string
+ description: Every leaf id a report selection may carry. Membership is inclusion; absence is exclusion.
+ required:
+ - supported
+ - maxDays
+ - reportDownload
+ - selectionVersion
+ - groups
+ - leaves
+ additionalProperties: false
+ description: Clinician share-link surface descriptor.
+ retiredRoutes:
+ type: array
+ items:
+ type: object
+ properties:
+ path:
+ type: string
+ description: The path, as it was published.
+ removedIn:
+ type: string
+ description: Release the removal shipped in, without the `v`.
+ replacedBy:
+ description: Where the capability went, or null when it went nowhere.
+ type:
+ - string
+ - "null"
+ reason:
+ type: string
+ description: Why it was removed, in one sentence, in English.
+ methods:
+ type: array
+ items:
+ type: string
+ description: The verbs the route exported before it was removed. Every verb answers 410 regardless — the path was
+ retired, not a selection of methods on it.
+ required:
+ - path
+ - removedIn
+ - replacedBy
+ - reason
+ - methods
+ additionalProperties: false
+ description: Paths this server used to serve and no longer does. Each answers 410 Gone with `meta.errorCode` =
+ `route.retired`. Read on launch so a client can drop the surface that depended on one before it makes the
+ call, rather than learning from the failure.
+ required:
+ - apiContractVersion
+ - derivedMetricIds
+ - vitalsBaselineTypes
+ - layoutTileIds
+ - metricStatusIds
+ - ingest
+ - fhir
+ - share
+ - retiredRoutes
+ additionalProperties: false
+ description: Live id vocabularies + contract version. Every list is derived server-side from the canonical registry it
+ documents, so it cannot drift from the values the routes actually accept/emit.
+ VersionEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/VersionResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ VersionResponse:
+ type: object
+ properties:
+ version:
+ type: string
+ description: The running build's version. From the image build arg when present, falling back to package.json for a
+ local dev run.
+ buildSha:
+ description: Short Git SHA baked at image build time. Null for a local dev run, which is how a client tells a released
+ image from one.
+ type:
+ - string
+ - "null"
+ builtAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: ISO-8601 build timestamp. Null for a local dev run.
+ license:
+ type: string
+ repository:
+ type: string
+ format: uri
+ changelog:
+ type: string
+ format: uri
+ docs:
+ type: string
+ format: uri
+ offlineGeoEnabled:
+ type: boolean
+ description: A GeoLite2-City database is present and in use. When false, login-IP geolocation falls back to the online
+ provider named below — every login IP then leaves the host.
+ geoProviderHost:
+ type: string
+ description: Host of the online geolocation provider the fallback would use, so an operator surface names the real one
+ instead of assuming the default.
+ features:
+ type: array
+ items:
+ type: string
+ enum:
+ - medication.intake-recorded-push
+ - medication.already-taken
+ - medication.bulk-already-taken
+ - medication.undo-precondition
+ - sync.medications-last-updated
+ - medication.live-activity-tokens
+ - push.relay
+ - medication.dose-state
+ - measurement.reading-timezone
+ - apple-health.types-2026-11
+ - medication.snooze-setting
+ - apple-health.effort-scores
+ - medication.intake-sync-version
+ - medication.current-dose-open-slot
+ - cycle.pregnancy-state
+ - profile.emergency-card
+ - push.data-changed
+ - push.healthkit-catch-up
+ - push.security-alert-relay
+ - push.live-activity-relay
+ - push.live-activity-started
+ - day.dose-offset
+ - push.device-diagnostics
+ - medication.resolved-slots
+ - medication.intake-reopened
+ - push.relay-operator-decision
+ - measurement.stats-computed-at
+ description: "The server behaviours a client may rely on, by key; check for a key rather than compare versions. A key is
+ listed only once its behaviour has fully shipped, and is never renamed. `medication.intake-recorded-push`: A
+ take or skip recorded elsewhere sends MEDICATION_INTAKE_RECORDED to the owner's other iOS devices; since
+ v1.49.0 so does its undo (outcome reopened), and every one carries asOf. `medication.already-taken`: POST
+ /api/medications/{id}/intake and POST /api/ingest/medication carry data.alreadyTaken; a take of a taken slot
+ writes nothing. `medication.bulk-already-taken`: POST /api/medications/intake/bulk answers status
+ alreadyTaken per entry with intake, takenAt and takenVia. `medication.undo-precondition`: DELETE
+ /api/medications/{id}/intake/{eventId} honours expectedSyncVersion and expectedIdempotencyKey, 409
+ medications.intake.changedSinceSeen. `sync.medications-last-updated`: GET /api/sync/state carries
+ medications.lastUpdatedAt. `medication.live-activity-tokens`: POST /api/devices takes liveActivityTokens;
+ each Activity is ended by its own push once its dose is answered. `push.relay`: The server seals push
+ envelopes and can use the push relay; /api/auth/me push.relay and push.device carry the state, POST
+ /api/devices takes pushKey, relayConsent and relayBinding. `medication.dose-state`: Today rows carry the
+ resolved state, takenLate, dueAt, overdueSince and slotInstant; complianceDisplay.currentDose carries the
+ same state, takenLate, dueAt and overdueSince, with its slot as targetAt. `measurement.reading-timezone`:
+ POST /api/measurements/batch accepts an optional IANA timeZone per entry; the reading's own zone sets its
+ day for sleep, the day view, list day groups and daily charts. `apple-health.types-2026-11`: The batch
+ ingest accepts the Apple Health cycling distance, rowing distance and speed, and running speed, power,
+ ground contact time, vertical oscillation and stride length types. `medication.snooze-setting`: GET/PATCH
+ /api/auth/me/notification-prefs carry medication.snoozeMinutes (5–240, default 30); a snooze without
+ snoozedUntil and Telegram's Remind me later button defer by it. `apple-health.effort-scores`: The batch
+ ingest accepts HealthKit workoutEffortScore, estimatedWorkoutEffortScore and physicalEffort as
+ WORKOUT_EFFORT_SCORE, ESTIMATED_WORKOUT_EFFORT_SCORE and PHYSICAL_EFFORT. `medication.intake-sync-version`:
+ Today rows, the single take answers and every landed bulk entry carry the row's syncVersion, the value
+ expectedSyncVersion compares. `medication.current-dose-open-slot`: complianceDisplay.currentDose names the
+ earliest slot still due or overdue, so a dose whose time has passed stays current until it is recorded or
+ missed. `cycle.pregnancy-state`: CycleProfileDTO and the cycle calendar carry pregnancy (CyclePregnancyDTO):
+ PREGNANT or POSTPARTUM with its dates, the resolved week and predictionsPaused; PATCH
+ /api/auth/me/cycle-prefs takes pregnancy. While paused the forecast is empty and the verdict is
+ INSUFFICIENT_DATA. `profile.emergency-card`: GET /api/emergency-card returns the emergency card;
+ /api/emergency-card/link mints, reads and revokes its read-only hlm_ link, served at /e/{token} with only
+ the fields the owner ticked. `push.data-changed`: A device with a push key gets a sealed silent DATA_CHANGED
+ (d.domains, d.changedAt) when a server-side sync stores readings, and since v1.49.0 when doses or schedules
+ change (domains intakes, medications); per device at most once per five minutes and three times an hour,
+ within one silent budget shared with MEDICATION_INTAKE_SYNC, never for a change the device started itself.
+ `push.healthkit-catch-up`: A device with a push key whose app registered in the last three days gets a
+ sealed silent HEALTHKIT_CATCH_UP (d.requestedAt) when the account's Apple Health upload is six hours behind;
+ at most three a day, four hours apart. `push.security-alert-relay`: SECURITY_ALERT (new sign-in, passkey
+ added or removed, token revoked, refresh-token reuse, a device taken over by another account) reaches sealed
+ and relay-bound devices with ui.level time-sensitive and d.securityKind. `push.live-activity-relay`: POST
+ /api/devices takes liveActivityConsent (hl-la-consent-v1), liveActivityWithdraw (hl-la-withdraw-v1),
+ liveActivityStart (push-to-start token with hl-la-start-v1) and liveActivityTokens[].relayStart; the server
+ starts medication Live Activities over the relay and updates only those registered with relayStart, with the
+ closed content state, while push.relay.liveActivity lists start and update (operator switch
+ PUSH_RELAY_LIVE_ACTIVITY, off by default). `push.live-activity-started`: push.device.liveActivityStarted on
+ /api/auth/me and in the POST /api/devices answer names the dose ({ medicationId, slotInstant }) of the Live
+ Activity the server started on the calling device; null once that slot is answered, its medication paused or
+ ended, or nothing was started. `day.dose-offset`: GET /api/day/{date} symptom events and every GET
+ /api/symptoms/events occurrence carry doseOffset (intakeId, title, minutes) from one rule: the nearest dose
+ taken at or before it on the same local day of the record's zone, else the nearest after it (negative
+ minutes); absent without a timed dose that day or when medications are not readable.
+ `push.device-diagnostics`: GET /api/devices/me/push-diagnostics returns the X-Device-Id device's push state:
+ transport, relay and binding state, the silent budget (windowMinutes, limit, wakeLimit, usedInWindow,
+ wakesUsedInWindow, owedSyncs, nextFreeAt), the last delivery per kind, the last receipt and the masked APNs
+ token; 404 for a device that is not the caller's. `medication.resolved-slots`: GET
+ /api/medications/resolved-slots?from=&to= returns every medication's resolved slots with their state for a
+ window of at most 14 days (default two days back to eight ahead), from the same resolver as dose-history and
+ the today list. `medication.intake-reopened`: MEDICATION_INTAKE_RECORDED carries outcome \"reopened\" with
+ takenAt and takenVia null when a dose is undone elsewhere, plus asOf (server time) in d and in plaintext;
+ the today list answers with a HealthLog-As-Of header on 200 and 304. `push.relay-operator-decision`:
+ /api/auth/me carries push.relay.operatorDecision (undecided | on | off) and push.relay.canDecide; an admin
+ answers the one-time relay question in the web admin (POST /api/admin/push-relay/decision is cookie-only).
+ `measurement.stats-computed-at`: POST /api/measurements/batch accepts an optional computedAt (ISO 8601) on
+ stats: rows; a write older than the stored one answers skipped with reason stale, and without computedAt the
+ last write wins."
+ required:
+ - version
+ - buildSha
+ - builtAt
+ - license
+ - repository
+ - changelog
+ - docs
+ - offlineGeoEnabled
+ - geoProviderHost
+ - features
+ additionalProperties: false
+ description: The running build's identity plus the offline-geolocation state. Public — no authentication, no account data.
+ AssistantFlagsEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/AssistantFlagsResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ AssistantFlagsResponse:
+ type: object
+ properties:
+ assistant:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ description: Master switch for every AI feature.
+ coach:
+ type: boolean
+ description: The Coach.
+ briefing:
+ type: boolean
+ description: The daily briefing and model-written period narratives.
+ insightStatus:
+ type: boolean
+ description: "Status notes: per-metric notes, workout notes and reaction lines."
+ documentAi:
+ type: boolean
+ description: "Reading documents: the document vault's AI reads, lab report scans and medication extraction."
+ required:
+ - enabled
+ - coach
+ - briefing
+ - insightStatus
+ - documentAi
+ additionalProperties: false
+ description: "The operator's switches, master applied: when `enabled` is false every sub-switch is false in this
+ payload. A switch read that fails answers every switch false."
+ required:
+ - assistant
+ additionalProperties: false
+ description: "The operator's assistant switches, and nothing else. Deprecated: whether a capability is available also
+ depends on the record's modules, the provider, consent and who is asking, and `ai` on GET /api/auth/me is that
+ resolved answer."
+ UpdateCheckEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/UpdateCheckResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ UpdateCheckResponse:
+ type: object
+ properties:
+ status:
+ type: string
+ enum:
+ - up_to_date
+ - newer_available
+ - unknown
+ description: "`unknown` is a normal outcome, not an error — it means the release feed could not be reached or read."
+ current:
+ type: string
+ description: The version this instance is running.
+ latest_tag:
+ description: The newest published release tag. Absent when `unknown`.
+ type: string
+ html_url:
+ description: Release page to deep-link to. Only on `newer_available`.
+ anyOf:
+ - type: string
+ format: uri
+ - type: "null"
+ published_at:
+ description: When that release was published. Only on `newer_available`.
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ checked_at:
+ description: When the check ran. Absent when `unknown`.
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ reason:
+ description: "Only on `unknown`: `network_error`, or `github_status_` when the feed answered but not with a
+ success."
+ type: string
+ required:
+ - status
+ - current
+ additionalProperties: false
+ description: Whether a newer release exists. The three states are carried in `status`; which of the optional fields are
+ present follows from it.
+ ShareLinkCreated:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ id:
+ type: string
+ label:
+ type: string
+ rangeStart:
+ type: string
+ rangeEnd:
+ type:
+ - string
+ - "null"
+ protected:
+ type: boolean
+ documentCount:
+ type: number
+ documentOnly:
+ type: boolean
+ needsReselection:
+ type: boolean
+ expiresAt:
+ type: string
+ createdAt:
+ type: string
+ revokedAt:
+ type:
+ - string
+ - "null"
+ lastAccessAt:
+ type:
+ - string
+ - "null"
+ accessCount:
+ type: number
+ active:
+ type: boolean
+ token:
+ type: string
+ description: Raw `hls_` token — returned ONCE and unrecoverable thereafter.
+ passphrase:
+ type: string
+ description: Raw passphrase second factor — returned ONCE; stored only as an HMAC hash, unrecoverable.
+ shareUrl:
+ type: string
+ description: Absolute `/c/` URL (no passphrase).
+ qrUrl:
+ type: string
+ description: Absolute share URL with the passphrase in the URL FRAGMENT (`#k=`). Encode this as the QR
+ payload; the fragment is never sent to the server.
+ required:
+ - id
+ - label
+ - rangeStart
+ - rangeEnd
+ - protected
+ - documentCount
+ - documentOnly
+ - needsReselection
+ - expiresAt
+ - createdAt
+ - revokedAt
+ - lastAccessAt
+ - accessCount
+ - active
+ - token
+ - passphrase
+ - shareUrl
+ - qrUrl
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ShareLinkList:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ shareLinks:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ label:
+ type: string
+ rangeStart:
+ type: string
+ rangeEnd:
+ type:
+ - string
+ - "null"
+ protected:
+ type: boolean
+ documentCount:
+ type: number
+ documentOnly:
+ type: boolean
+ needsReselection:
+ type: boolean
+ expiresAt:
+ type: string
+ createdAt:
+ type: string
+ revokedAt:
+ type:
+ - string
+ - "null"
+ lastAccessAt:
+ type:
+ - string
+ - "null"
+ accessCount:
+ type: number
+ active:
+ type: boolean
+ required:
+ - id
+ - label
+ - rangeStart
+ - rangeEnd
+ - protected
+ - documentCount
+ - documentOnly
+ - needsReselection
+ - expiresAt
+ - createdAt
+ - revokedAt
+ - lastAccessAt
+ - accessCount
+ - active
+ additionalProperties: false
+ required:
+ - shareLinks
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ShareLinkRevoked:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ id:
+ type: string
+ revoked:
+ type: boolean
+ required:
+ - id
+ - revoked
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ShareLinkUnlock:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ unlocked:
+ type: boolean
+ const: true
+ required:
+ - unlocked
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ExportJsonBody:
+ type: object
+ properties:
+ data:
type: object
properties:
measurements:
@@ -45519,6 +48723,24 @@ components:
- low
- medium
- high
+ aiUsageMaxLevel:
+ type: string
+ enum:
+ - FRUGAL
+ - STANDARD
+ - FULL
+ aiUsageDefaultLevel:
+ type: string
+ enum:
+ - FRUGAL
+ - STANDARD
+ - FULL
+ aiSyncRegenGapHours:
+ anyOf:
+ - type: integer
+ minimum: 1
+ maximum: 48
+ - type: "null"
moduleAvailabilityJson:
anyOf:
- {}
@@ -45530,6 +48752,22 @@ components:
documentQuotaBytes:
type: string
pattern: ^\d+$
+ serverSetupCompletedAt:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
+ serverSetupStepsJson:
+ anyOf:
+ - {}
+ - type: "null"
+ pushRelayDecision:
+ anyOf:
+ - type: string
+ enum:
+ - on
+ - off
+ - type: "null"
required:
- id
- registrationEnabled
@@ -45674,6 +48912,10 @@ components:
type:
- string
- "null"
+ medicineRegistry:
+ type:
+ - string
+ - "null"
timeFormat:
type: string
dateFormat:
@@ -45692,6 +48934,7 @@ components:
activityGoalsJson: {}
nutrientTargetsJson: {}
reportSelectionJson: {}
+ reportScheduleJson: {}
globalExcludedInjectionSites:
type: array
items:
@@ -45726,6 +48969,7 @@ components:
- "null"
aiProviderChain: {}
aiNamedChains: {}
+ aiCoachBudgets: {}
aiResponseTimeoutSeconds:
anyOf:
- type: integer
@@ -45887,6 +49131,17 @@ components:
- FEV1
- FVC
- PEAK_EXPIRATORY_FLOW
+ - WORKOUT_EFFORT_SCORE
+ - ESTIMATED_WORKOUT_EFFORT_SCORE
+ - PHYSICAL_EFFORT
+ - CYCLING_DISTANCE
+ - ROWING_DISTANCE
+ - ROWING_SPEED
+ - RUNNING_SPEED
+ - RUNNING_POWER
+ - RUNNING_GROUND_CONTACT_TIME
+ - RUNNING_VERTICAL_OSCILLATION
+ - RUNNING_STRIDE_LENGTH
value:
type: number
valueMin:
@@ -45984,6 +49239,11 @@ components:
type:
- string
- "null"
+ timeZone:
+ anyOf:
+ - type: string
+ maxLength: 64
+ - type: "null"
ingestTokenId:
anyOf:
- type: string
@@ -45998,6 +49258,16 @@ components:
- type: string
minLength: 1
- type: "null"
+ appleHealthDeletedAt:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
+ statsComputedAt:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
createdAt:
type: string
minLength: 1
@@ -46129,6 +49399,10 @@ components:
- type: string
minLength: 1
- type: "null"
+ leafletUrl:
+ type:
+ - string
+ - "null"
lowStockNotifiedAt:
anyOf:
- type: string
@@ -46682,6 +49956,17 @@ components:
- FEV1
- FVC
- PEAK_EXPIRATORY_FLOW
+ - WORKOUT_EFFORT_SCORE
+ - ESTIMATED_WORKOUT_EFFORT_SCORE
+ - PHYSICAL_EFFORT
+ - CYCLING_DISTANCE
+ - ROWING_DISTANCE
+ - ROWING_SPEED
+ - RUNNING_SPEED
+ - RUNNING_POWER
+ - RUNNING_GROUND_CONTACT_TIME
+ - RUNNING_VERTICAL_OSCILLATION
+ - RUNNING_STRIDE_LENGTH
- type: "null"
biomarkerName:
anyOf:
@@ -46832,6 +50117,12 @@ components:
medicationId:
type: string
minLength: 1
+ ref:
+ type: string
+ minLength: 1
+ medicationRef:
+ type: string
+ minLength: 1
medication:
type: string
minLength: 1
@@ -46862,6 +50153,18 @@ components:
- REMINDER
- IMPORT
- APPLE_HEALTH
+ takenVia:
+ anyOf:
+ - type: string
+ enum:
+ - WEB
+ - APP
+ - INTEGRATION
+ - TELEGRAM
+ - APPLE_HEALTH
+ - IMPORT
+ - AUTO
+ - type: "null"
idempotencyKey:
type:
- string
@@ -46906,6 +50209,11 @@ components:
- type: string
minLength: 1
- type: "null"
+ appleHealthDeletedAt:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
required:
- medication
- scheduledFor
@@ -46998,6 +50306,11 @@ components:
- type: string
minLength: 1
- type: "null"
+ appleHealthDeletedAt:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
createdAt:
type: string
minLength: 1
@@ -47213,6 +50526,39 @@ components:
type: boolean
sensitiveCategoryEncryption:
type: boolean
+ reproductiveState:
+ anyOf:
+ - type: string
+ enum:
+ - PREGNANT
+ - POSTPARTUM
+ - type: "null"
+ pregnancyStartDate:
+ anyOf:
+ - type: string
+ pattern: ^\d{4}-\d{2}-\d{2}$
+ - type: "null"
+ pregnancyDueDate:
+ anyOf:
+ - type: string
+ pattern: ^\d{4}-\d{2}-\d{2}$
+ - type: "null"
+ deliveryDate:
+ anyOf:
+ - type: string
+ pattern: ^\d{4}-\d{2}-\d{2}$
+ - type: "null"
+ postpartumWeeks:
+ type: integer
+ minimum: 1
+ maximum: 78
+ pregnancyOwnerDecided:
+ type: boolean
+ pregnancyEncrypted:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
createdAt:
type: string
minLength: 1
@@ -47485,6 +50831,11 @@ components:
- type: string
minLength: 1
- type: "null"
+ appleHealthDeletedAt:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
createdAt:
type: string
minLength: 1
@@ -47529,6 +50880,20 @@ components:
- key
- createdAt
additionalProperties: false
+ symptomSources:
+ type: array
+ items:
+ type: object
+ properties:
+ key:
+ type: string
+ minLength: 1
+ source:
+ type: string
+ required:
+ - key
+ - source
+ additionalProperties: {}
required:
- date
- symptomKeys
@@ -47933,6 +51298,31 @@ components:
- source
- externalId
additionalProperties: {}
+ fhirImportedResources:
+ default: []
+ type: array
+ items:
+ type: object
+ properties:
+ resourceType:
+ type: string
+ minLength: 1
+ maxLength: 64
+ resourceKey:
+ type: string
+ pattern: ^[0-9a-f]{40}$
+ recordId:
+ type: string
+ minLength: 1
+ maxLength: 64
+ createdAt:
+ type: string
+ minLength: 1
+ required:
+ - resourceType
+ - resourceKey
+ - recordId
+ additionalProperties: {}
illnessEpisodes:
default: []
type: array
@@ -48181,6 +51571,11 @@ components:
- type: string
minLength: 1
- type: "null"
+ appleHealthDeletedAt:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
createdAt:
type: string
minLength: 1
@@ -49024,29 +52419,6 @@ components:
- durationSec
- source
additionalProperties: {}
- appleHealthTombstones:
- default: []
- type: array
- items:
- type: object
- properties:
- domain:
- type: string
- enum:
- - workout
- - ecg
- externalId:
- type: string
- minLength: 1
- maxLength: 120
- createdAt:
- type: string
- minLength: 1
- required:
- - domain
- - externalId
- - createdAt
- additionalProperties: {}
documents:
default: []
type: array
@@ -49154,6 +52526,7 @@ components:
- PAPERLESS
- PAPRA
- OTHER
+ - REPORT_SCHEDULE
- type: "null"
sourceId:
anyOf:
@@ -49280,6 +52653,7 @@ components:
- PAPERLESS
- PAPRA
- OTHER
+ - REPORT_SCHEDULE
sourceId:
type: string
minLength: 1
@@ -49878,6 +53252,17 @@ components:
- FEV1
- FVC
- PEAK_EXPIRATORY_FLOW
+ - WORKOUT_EFFORT_SCORE
+ - ESTIMATED_WORKOUT_EFFORT_SCORE
+ - PHYSICAL_EFFORT
+ - CYCLING_DISTANCE
+ - ROWING_DISTANCE
+ - ROWING_SPEED
+ - RUNNING_SPEED
+ - RUNNING_POWER
+ - RUNNING_GROUND_CONTACT_TIME
+ - RUNNING_VERTICAL_OSCILLATION
+ - RUNNING_STRIDE_LENGTH
dateKey:
type: string
pattern: ^\d{4}-\d{2}-\d{2}$
@@ -51088,6 +54473,17 @@ components:
- FEV1
- FVC
- PEAK_EXPIRATORY_FLOW
+ - WORKOUT_EFFORT_SCORE
+ - ESTIMATED_WORKOUT_EFFORT_SCORE
+ - PHYSICAL_EFFORT
+ - CYCLING_DISTANCE
+ - ROWING_DISTANCE
+ - ROWING_SPEED
+ - RUNNING_SPEED
+ - RUNNING_POWER
+ - RUNNING_GROUND_CONTACT_TIME
+ - RUNNING_VERTICAL_OSCILLATION
+ - RUNNING_STRIDE_LENGTH
- type: "null"
intervalDays:
anyOf:
@@ -51324,6 +54720,17 @@ components:
- FEV1
- FVC
- PEAK_EXPIRATORY_FLOW
+ - WORKOUT_EFFORT_SCORE
+ - ESTIMATED_WORKOUT_EFFORT_SCORE
+ - PHYSICAL_EFFORT
+ - CYCLING_DISTANCE
+ - ROWING_DISTANCE
+ - ROWING_SPEED
+ - RUNNING_SPEED
+ - RUNNING_POWER
+ - RUNNING_GROUND_CONTACT_TIME
+ - RUNNING_VERTICAL_OSCILLATION
+ - RUNNING_STRIDE_LENGTH
metricSlot:
type:
- string
@@ -51857,6 +55264,7 @@ components:
- biomarkers
- biomarkerMerges
- labResultImportKeys
+ - fhirImportedResources
- illnessEpisodes
- symptomDefinitions
- lifeEvents
@@ -51866,7 +55274,6 @@ components:
- allergies
- familyHistory
- workouts
- - appleHealthTombstones
- documents
- documentConditionLinks
- extractedFacts
@@ -51929,11 +55336,214 @@ components:
data:
type: object
properties:
- redirectTo:
+ redirectTo:
+ type: string
+ required:
+ - redirectTo
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ProfileClaimPreviewEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/ProfileClaimPreview"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ProfileClaimPreview:
+ type: object
+ properties:
+ displayName:
+ description: The profile's name, as its guardians set it.
+ type:
+ - string
+ - "null"
+ expiresAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ guardians:
+ type: array
+ items:
+ type: object
+ properties:
+ displayName:
+ description: "The guardian's display name; null when they set none. Never a login name or an id: the holder of the link
+ has proved nothing yet."
+ type:
+ - string
+ - "null"
+ proposal:
+ $ref: "#/components/schemas/ProfileClaimGuardianAccess"
+ required:
+ - displayName
+ - proposal
+ additionalProperties: false
+ description: Each guardian and the access they keep after the claim, as proposed. The new owner confirms or changes it
+ after signing in.
+ methods:
+ description: "v1.43 — how this link can be redeemed: `password` and/or `sso`. Absent on older servers."
+ type: array
+ items:
+ type: string
+ enum:
+ - password
+ - sso
+ ssoProviderName:
+ description: v1.43 — the identity provider's display name for the "Continue with …" button; null without one.
+ type:
+ - string
+ - "null"
+ required:
+ - displayName
+ - expiresAt
+ - guardians
+ additionalProperties: false
+ ProfileClaimGuardianAccess:
+ type: string
+ enum:
+ - end
+ - read
+ - manage
+ ProfileClaimEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ userId:
+ type: string
+ username:
+ type: string
+ required:
+ - userId
+ - username
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ LoginResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/AccessRefreshBundle"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ AccessRefreshBundle:
+ type: object
+ properties:
+ user:
+ type: object
+ properties:
+ id:
+ type: string
+ username:
type: string
required:
- - redirectTo
+ - id
+ - username
+ additionalProperties: false
+ token:
+ description: Access token (`hlk_<64hex>`); only present for native-policy callers. A browser caller gets the session
+ cookie instead.
+ type: string
+ tokenExpiresAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ refreshToken:
+ description: Refresh token (`hlr_<64hex>`); only present for native-policy callers.
+ type: string
+ refreshTokenExpiresAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ required:
+ - user
+ additionalProperties: false
+ description: Native-client token bundle returned by login + refresh. Web cookie-only callers see only `user`.
+ MfaRequiredResponse:
+ type: object
+ properties:
+ data:
+ type: "null"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ mfaRequired:
+ type: boolean
+ const: true
+ mfaTicket:
+ type: string
+ description: Opaque, single-use, ~5-minute ticket to present to /api/auth/mfa/verify.
+ methods:
+ type: array
+ items:
+ type: string
+ enum:
+ - totp
+ - recovery
+ - webauthn
+ description: Second factors the account can complete the challenge with. `webauthn` is completed via
+ /api/auth/mfa/webauthn/verify; the rest via /api/auth/mfa/verify.
+ required:
+ - mfaRequired
+ - mfaTicket
+ - methods
additionalProperties: false
+ required:
+ - data
+ - error
+ - meta
+ additionalProperties: false
+ description: Password accepted but a second factor is required. Not an error and not a session — no token is issued
+ until /api/auth/mfa/verify succeeds.
+ MfaVerifyResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/AccessRefreshBundle"
error:
type: "null"
meta:
@@ -51946,11 +55556,11 @@ components:
- data
- error
additionalProperties: false
- ProfileClaimPreviewEnvelope:
+ OidcNativeTokenResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/ProfileClaimPreview"
+ $ref: "#/components/schemas/AccessRefreshBundle"
error:
type: "null"
meta:
@@ -51963,75 +55573,394 @@ components:
- data
- error
additionalProperties: false
- ProfileClaimPreview:
+ NativeHandoffTokenResponse:
type: object
properties:
- displayName:
- description: The profile's name, as its guardians set it.
- type:
- - string
- - "null"
+ data:
+ $ref: "#/components/schemas/AccessRefreshBundle"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ StepUpOptionsEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/StepUpOptionsResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ StepUpOptionsResponse:
+ type: object
+ properties:
+ options:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ description: SimpleWebAuthn assertion options for the caller's passkeys.
+ challengeId:
+ type: string
+ required:
+ - options
+ - challengeId
+ additionalProperties: false
+ StepUpMintEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/StepUpMintResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ StepUpMintResponse:
+ type: object
+ properties:
+ elevation:
+ type: string
+ description: Opaque single-use elevation (`hle_<64hex>`). Present it in the `X-Step-Up` header on ONE
+ second-factor-management call. Returned exactly once; store it in memory only.
expiresAt:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- guardians:
+ expiresInSeconds:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ method:
+ type: string
+ enum:
+ - password
+ - totp
+ - webauthn
+ - passkey
+ description: The factor that was re-proved.
+ satisfiesFreshFactor:
+ type: boolean
+ description: Whether this elevation reaches the fresh-factor routes (MFA disable, recovery-code regeneration,
+ security-key removal). False for a password proof — mirroring the web, where a password login never marks a
+ session second-factor-verified.
+ required:
+ - elevation
+ - expiresAt
+ - expiresInSeconds
+ - method
+ - satisfiesFreshFactor
+ additionalProperties: false
+ ReproofEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/ReproofResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ReproofResponse:
+ type: object
+ properties:
+ method:
+ type: string
+ enum:
+ - password
+ - totp
+ - webauthn
+ - passkey
+ verifiedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
+ required:
+ - method
+ - verifiedAt
+ additionalProperties: false
+ ReproofStatusEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/ReproofStatus"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ReproofStatus:
+ type: object
+ properties:
+ recent:
+ type: boolean
+ const: true
+ required:
+ - recent
+ additionalProperties: false
+ TotpSetupEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/TotpSetupResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ TotpSetupResponse:
+ type: object
+ properties:
+ otpauthUri:
+ type: string
+ description: otpauth:// URI to render as a QR code (carries the secret).
+ totpSecret:
+ type: string
+ description: Base32 secret for manual entry. Pending until confirmed.
+ required:
+ - otpauthUri
+ - totpSecret
+ additionalProperties: false
+ TotpConfirmEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/MfaRecoveryCodesResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ MfaRecoveryCodesResponse:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ recoveryCodes:
type: array
items:
- type: object
- properties:
- displayName:
- description: "The guardian's display name; null when they set none. Never a login name or an id: the holder of the link
- has proved nothing yet."
- type:
- - string
- - "null"
- proposal:
- $ref: "#/components/schemas/ProfileClaimGuardianAccess"
- required:
- - displayName
- - proposal
- additionalProperties: false
- description: Each guardian and the access they keep after the claim, as proposed. The new owner confirms or changes it
- after signing in.
- methods:
- description: "v1.43 — how this link can be redeemed: `password` and/or `sso`. Absent on older servers."
+ type: string
+ description: Single-use recovery codes, shown once. Save them now.
+ recoveryCodesRemaining:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - recoveryCodes
+ - recoveryCodesRemaining
+ additionalProperties: false
+ MfaDisableEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/MfaToggleResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ MfaToggleResponse:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ required:
+ - enabled
+ additionalProperties: false
+ MfaRecoveryRegenEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/MfaRecoveryCodesResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ MfaStatusEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/MfaStatusResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ MfaStatusResponse:
+ type: object
+ properties:
+ totp:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ required:
+ - enabled
+ additionalProperties: false
+ recoveryCodesRemaining:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ webauthn:
+ type: array
+ items:
+ $ref: "#/components/schemas/WebauthnMfaCredentialInfo"
+ passkeyNudgeDismissed:
+ type: boolean
+ proofMethods:
type: array
items:
type: string
enum:
- password
- - sso
- ssoProviderName:
- description: v1.43 — the identity provider's display name for the "Continue with …" button; null without one.
- type:
- - string
- - "null"
+ - oidc
+ - totp
+ - webauthn
+ - passkey
+ description: The ways this account can confirm it is you, the same list a recent-proof refusal names in `meta.methods`.
+ `password` and `oidc` only on an account without a second factor; `oidc` is a browser round trip to the
+ identity provider (`GET /api/auth/oidc/reproof`) and is never offered to a token.
required:
- - displayName
- - expiresAt
- - guardians
+ - totp
+ - recoveryCodesRemaining
+ - webauthn
+ - passkeyNudgeDismissed
+ - proofMethods
+ additionalProperties: false
+ WebauthnMfaCredentialInfo:
+ type: object
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ createdAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ lastUsedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ required:
+ - id
+ - name
+ - createdAt
+ - lastUsedAt
+ additionalProperties: false
+ MfaWebauthnRegisterOptionsEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/WebauthnOptionsResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ WebauthnOptionsResponse:
+ type: object
+ properties:
+ options:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ description: SimpleWebAuthn options to pass to the browser ceremony.
+ challengeId:
+ type: string
+ description: Server-issued challenge id.
+ required:
+ - options
+ - challengeId
additionalProperties: false
- ProfileClaimGuardianAccess:
- type: string
- enum:
- - end
- - read
- - manage
- ProfileClaimEnvelope:
+ MfaWebauthnRegisterVerifyEnvelope:
type: object
properties:
data:
- type: object
- properties:
- userId:
- type: string
- username:
- type: string
- required:
- - userId
- - username
- additionalProperties: false
+ $ref: "#/components/schemas/WebauthnMfaCredentialInfo"
error:
type: "null"
meta:
@@ -52044,11 +55973,11 @@ components:
- data
- error
additionalProperties: false
- LoginResponse:
+ MfaWebauthnRenameEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/AccessRefreshBundle"
+ $ref: "#/components/schemas/WebauthnMfaCredentialInfo"
error:
type: "null"
meta:
@@ -52061,78 +55990,49 @@ components:
- data
- error
additionalProperties: false
- AccessRefreshBundle:
+ MfaWebauthnRemoveEnvelope:
type: object
properties:
- user:
+ data:
+ $ref: "#/components/schemas/AuthSuccessFlagResponse"
+ error:
+ type: "null"
+ meta:
type: object
properties:
- id:
- type: string
- username:
+ requestId:
type: string
- required:
- - id
- - username
additionalProperties: false
- token:
- description: Access token (`hlk_<64hex>`); only present for native-policy callers. A browser caller gets the session
- cookie instead.
- type: string
- tokenExpiresAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- refreshToken:
- description: Refresh token (`hlr_<64hex>`); only present for native-policy callers.
- type: string
- refreshTokenExpiresAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - user
+ - data
+ - error
additionalProperties: false
- description: Native-client token bundle returned by login + refresh. Web cookie-only callers see only `user`.
- MfaRequiredResponse:
+ AuthSuccessFlagResponse:
+ type: object
+ properties:
+ success:
+ type: boolean
+ required:
+ - success
+ additionalProperties: false
+ MfaWebauthnLoginOptionsEnvelope:
type: object
properties:
data:
- type: "null"
+ $ref: "#/components/schemas/WebauthnOptionsResponse"
error:
type: "null"
meta:
type: object
properties:
- mfaRequired:
- type: boolean
- const: true
- mfaTicket:
+ requestId:
type: string
- description: Opaque, single-use, ~5-minute ticket to present to /api/auth/mfa/verify.
- methods:
- type: array
- items:
- type: string
- enum:
- - totp
- - recovery
- - webauthn
- description: Second factors the account can complete the challenge with. `webauthn` is completed via
- /api/auth/mfa/webauthn/verify; the rest via /api/auth/mfa/verify.
- required:
- - mfaRequired
- - mfaTicket
- - methods
additionalProperties: false
required:
- data
- error
- - meta
additionalProperties: false
- description: Password accepted but a second factor is required. Not an error and not a session — no token is issued
- until /api/auth/mfa/verify succeeds.
- MfaVerifyResponse:
+ MfaWebauthnVerifyResponse:
type: object
properties:
data:
@@ -52149,7 +56049,7 @@ components:
- data
- error
additionalProperties: false
- OidcNativeTokenResponse:
+ PasskeyLoginVerifyResponse:
type: object
properties:
data:
@@ -52166,7 +56066,7 @@ components:
- data
- error
additionalProperties: false
- NativeHandoffTokenResponse:
+ RefreshResponse:
type: object
properties:
data:
@@ -52183,11 +56083,17 @@ components:
- data
- error
additionalProperties: false
- StepUpOptionsEnvelope:
+ RefreshRevokeResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/StepUpOptionsResponse"
+ type: object
+ properties:
+ revoked:
+ type: boolean
+ required:
+ - revoked
+ additionalProperties: false
error:
type: "null"
meta:
@@ -52200,26 +56106,11 @@ components:
- data
- error
additionalProperties: false
- StepUpOptionsResponse:
- type: object
- properties:
- options:
- type: object
- propertyNames:
- type: string
- additionalProperties: {}
- description: SimpleWebAuthn assertion options for the caller's passkeys.
- challengeId:
- type: string
- required:
- - options
- - challengeId
- additionalProperties: false
- StepUpMintEnvelope:
+ PasskeyListEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/StepUpMintResponse"
+ $ref: "#/components/schemas/PasskeyListResponse"
error:
type: "null"
meta:
@@ -52232,46 +56123,53 @@ components:
- data
- error
additionalProperties: false
- StepUpMintResponse:
+ PasskeyListResponse:
+ type: array
+ items:
+ $ref: "#/components/schemas/PasskeyInfo"
+ PasskeyInfo:
type: object
properties:
- elevation:
+ id:
type: string
- description: Opaque single-use elevation (`hle_<64hex>`). Present it in the `X-Step-Up` header on ONE
- second-factor-management call. Returned exactly once; store it in memory only.
- expiresAt:
+ description: Row id; the handle for DELETE.
+ name:
type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- expiresInSeconds:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- method:
+ description: User-supplied label, defaulting to “Passkey”.
+ credentialDeviceType:
type: string
- enum:
- - password
- - totp
- - webauthn
- - passkey
- description: The factor that was re-proved.
- satisfiesFreshFactor:
+ description: "Authenticator device type as reported at registration: `singleDevice` for a credential bound to one
+ authenticator, `multiDevice` for a syncable one."
+ credentialBackedUp:
type: boolean
- description: Whether this elevation reaches the fresh-factor routes (MFA disable, recovery-code regeneration,
- security-key removal). False for a password proof — mirroring the web, where a password login never marks a
- session second-factor-verified.
+ description: Whether the authenticator reported the credential as backed up (synced to the platform keychain) at
+ registration time. Not re-read afterwards.
+ createdAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: Registered at.
+ lastUsedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: When this passkey last completed a verified assertion; null when it has never been used to sign in. Stamped
+ on every successful login, so a client can render a real 'last used' rather than assuming never.
required:
- - elevation
- - expiresAt
- - expiresInSeconds
- - method
- - satisfiesFreshFactor
+ - id
+ - name
+ - credentialDeviceType
+ - credentialBackedUp
+ - createdAt
+ - lastUsedAt
additionalProperties: false
- ReproofEnvelope:
+ SessionListEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/ReproofResponse"
+ $ref: "#/components/schemas/SessionListResponse"
error:
type: "null"
meta:
@@ -52284,29 +56182,59 @@ components:
- data
- error
additionalProperties: false
- ReproofResponse:
+ SessionListResponse:
type: object
properties:
- method:
- type: string
- enum:
- - password
- - totp
- - webauthn
- - passkey
- verifiedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
+ sessions:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ device:
+ type: string
+ description: Coarse device label derived from the User-Agent.
+ ipMasked:
+ description: IP with the host portion masked — never the full address.
+ type:
+ - string
+ - "null"
+ location:
+ description: Resolved coarse location, when available.
+ type:
+ - string
+ - "null"
+ lastActiveAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ createdAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ isCurrent:
+ type: boolean
+ description: True for the session making this request.
+ required:
+ - id
+ - device
+ - ipMasked
+ - location
+ - lastActiveAt
+ - createdAt
+ - isCurrent
+ additionalProperties: false
required:
- - method
- - verifiedAt
+ - sessions
additionalProperties: false
- ReproofStatusEnvelope:
+ SignOutEverywhereEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/ReproofStatus"
+ $ref: "#/components/schemas/SignOutEverywhereResponse"
error:
type: "null"
meta:
@@ -52319,20 +56247,93 @@ components:
- data
- error
additionalProperties: false
- ReproofStatus:
+ SignOutEverywhereResponse:
type: object
properties:
- recent:
- type: boolean
- const: true
+ sessionsRevoked:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Number of OTHER sessions removed (the current one is kept).
+ accessTokensRevoked:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Tokens revoked: the access tokens of other device logins plus every programmatic token (connector,
+ measurement, document), never the caller's own."
+ connectorsRevoked:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Connected AI-assistant (MCP OAuth) connections revoked.
+ shareLinksRevoked:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Clinician share links revoked; 0 when `keepShareLinks=1` was sent.
+ pendingInvitesRevoked:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Record-sharing invitations this account offered that nobody had accepted yet, now withdrawn (`revokedBy:
+ GRANTOR`)."
+ grantsKept:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ description: The grant id, for DELETE /api/account/grants/{id}.
+ account:
+ type: object
+ properties:
+ id:
+ type: string
+ username:
+ type: string
+ displayName:
+ type:
+ - string
+ - "null"
+ required:
+ - id
+ - username
+ - displayName
+ additionalProperties: false
+ access:
+ type: string
+ enum:
+ - READ
+ - WRITE
+ - MANAGE
+ required:
+ - id
+ - account
+ - access
+ additionalProperties: false
+ description: Accepted grants this account gave that are still live. Signing out does not end them, because each is a
+ person the owner chose and ending one silently could cut off a carer; they are listed so a client can show
+ who can still read the record and offer to end each with DELETE /api/account/grants/{id}.
required:
- - recent
+ - sessionsRevoked
+ - accessTokensRevoked
+ - connectorsRevoked
+ - shareLinksRevoked
+ - pendingInvitesRevoked
+ - grantsKept
additionalProperties: false
- TotpSetupEnvelope:
+ SessionRevokeEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/TotpSetupResponse"
+ type: object
+ properties:
+ revoked:
+ type: boolean
+ required:
+ - revoked
+ additionalProperties: false
error:
type: "null"
meta:
@@ -52345,24 +56346,77 @@ components:
- data
- error
additionalProperties: false
- TotpSetupResponse:
+ TrustedDeviceListEnvelope:
type: object
properties:
- otpauthUri:
- type: string
- description: otpauth:// URI to render as a QR code (carries the secret).
- totpSecret:
- type: string
- description: Base32 secret for manual entry. Pending until confirmed.
+ data:
+ $ref: "#/components/schemas/TrustedDeviceListResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
required:
- - otpauthUri
- - totpSecret
+ - data
+ - error
additionalProperties: false
- TotpConfirmEnvelope:
+ TrustedDeviceListResponse:
+ type: object
+ properties:
+ devices:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ label:
+ description: Coarse, IP-free device label (e.g. 'Firefox on macOS').
+ type:
+ - string
+ - "null"
+ createdAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ lastUsedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ expiresAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ isCurrent:
+ type: boolean
+ description: True for the device making this request.
+ required:
+ - id
+ - label
+ - createdAt
+ - lastUsedAt
+ - expiresAt
+ - isCurrent
+ additionalProperties: false
+ required:
+ - devices
+ additionalProperties: false
+ TrustedDeviceRevokeAllEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/MfaRecoveryCodesResponse"
+ type: object
+ properties:
+ revoked:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - revoked
+ additionalProperties: false
error:
type: "null"
meta:
@@ -52375,29 +56429,86 @@ components:
- data
- error
additionalProperties: false
- MfaRecoveryCodesResponse:
+ TrustedDeviceRevokeEnvelope:
type: object
properties:
- enabled:
- type: boolean
- recoveryCodes:
+ data:
+ type: object
+ properties:
+ revoked:
+ type: boolean
+ required:
+ - revoked
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ SecurityActivityEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/SecurityActivityResponse"
+ error:
+ type: "null"
+ meta:
+ $ref: "#/components/schemas/ListCapMeta"
+ required:
+ - data
+ - error
+ - meta
+ additionalProperties: false
+ SecurityActivityResponse:
+ type: object
+ properties:
+ events:
type: array
items:
- type: string
- description: Single-use recovery codes, shown once. Save them now.
- recoveryCodesRemaining:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
+ type: object
+ properties:
+ action:
+ type: string
+ description: Audit action name, e.g. auth.login.password.
+ createdAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ location:
+ type:
+ - string
+ - "null"
+ ipMasked:
+ description: Host-masked IP.
+ type:
+ - string
+ - "null"
+ carrier:
+ type:
+ - string
+ - "null"
+ required:
+ - action
+ - createdAt
+ - location
+ - ipMasked
+ - carrier
+ additionalProperties: false
required:
- - recoveryCodes
- - recoveryCodesRemaining
+ - events
additionalProperties: false
- MfaDisableEnvelope:
+ LogoutEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/MfaToggleResponse"
+ $ref: "#/components/schemas/LogoutResponse"
error:
type: "null"
meta:
@@ -52410,19 +56521,22 @@ components:
- data
- error
additionalProperties: false
- MfaToggleResponse:
+ LogoutResponse:
type: object
properties:
- enabled:
+ loggedOut:
type: boolean
+ const: true
+ description: "Always true. The endpoint has no failure the caller acts on: it answers the same whether a cookie was
+ cleared, a token was revoked, or neither was there."
required:
- - enabled
+ - loggedOut
additionalProperties: false
- MfaRecoveryRegenEnvelope:
+ OidcStatusEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/MfaRecoveryCodesResponse"
+ $ref: "#/components/schemas/OidcStatusResponse"
error:
type: "null"
meta:
@@ -52435,11 +56549,42 @@ components:
- data
- error
additionalProperties: false
- MfaStatusEnvelope:
+ OidcStatusResponse:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ description: An OIDC provider is configured on this instance.
+ buttonLabel:
+ description: Operator-set label for the SSO button (`OIDC_BUTTON_LABEL`, defaulting to “Single Sign-On”). Null when no
+ provider is configured.
+ type:
+ - string
+ - "null"
+ only:
+ type: boolean
+ description: "`OIDC_ONLY=true` — password and passkey login are refused with 403 `oidc_only`. A client that offers those
+ controls anyway strands the user."
+ nativeReturnPath:
+ description: "The path of the native sign-in's opt-in https return, `/auth/native-return`, a fixed constant. Present
+ (non-null) only when SSO is configured and the instance is served over https (`NEXT_PUBLIC_APP_URL`). An app
+ build that carries an associated domain for this host may then start the native leg with `return=https` on
+ GET /api/auth/oidc/login and receive the callback on `https://` with the same
+ parameters the custom scheme carries. Null or absent: use the scheme. Servers before v1.48.0 omit the
+ field."
+ type:
+ - string
+ - "null"
+ required:
+ - enabled
+ - buttonLabel
+ - only
+ additionalProperties: false
+ RegistrationStatusEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/MfaStatusResponse"
+ $ref: "#/components/schemas/RegistrationStatusResponse"
error:
type: "null"
meta:
@@ -52452,71 +56597,23 @@ components:
- data
- error
additionalProperties: false
- MfaStatusResponse:
+ RegistrationStatusResponse:
type: object
properties:
- totp:
- type: object
- properties:
- enabled:
- type: boolean
- required:
- - enabled
- additionalProperties: false
- recoveryCodesRemaining:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- webauthn:
- type: array
- items:
- $ref: "#/components/schemas/WebauthnMfaCredentialInfo"
- passkeyNudgeDismissed:
+ registrationEnabled:
type: boolean
- proofMethods:
- type: array
- items:
- type: string
- enum:
- - password
- - oidc
- - totp
- - webauthn
- - passkey
- description: The ways this account can confirm it is you, the same list a recent-proof refusal names in `meta.methods`.
- `password` and `oidc` only on an account without a second factor; `oidc` is a browser round trip to the
- identity provider (`GET /api/auth/oidc/reproof`) and is never offered to a token.
- required:
- - totp
- - recoveryCodesRemaining
- - webauthn
- - passkeyNudgeDismissed
- - proofMethods
- additionalProperties: false
- WebauthnMfaCredentialInfo:
- type: object
- properties:
- id:
- type: string
- name:
- type: string
- createdAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- lastUsedAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
+ description: Whether open self-registration is on. An operator who turned it off can still admit a signup through an
+ invite token.
+ sessionCookieSecure:
+ type: boolean
+ description: Whether this server issues its session cookies with the `Secure` flag (`SESSION_COOKIE_SECURE`, else on in
+ production). A browser on a plain `http://` page cannot keep such a cookie; the web login page compares this
+ with its own scheme before any credential is sent.
required:
- - id
- - name
- - createdAt
- - lastUsedAt
+ - registrationEnabled
+ - sessionCookieSecure
additionalProperties: false
- MfaWebauthnRegisterOptionsEnvelope:
+ PasskeyLoginOptionsEnvelope:
type: object
properties:
data:
@@ -52533,27 +56630,11 @@ components:
- data
- error
additionalProperties: false
- WebauthnOptionsResponse:
- type: object
- properties:
- options:
- type: object
- propertyNames:
- type: string
- additionalProperties: {}
- description: SimpleWebAuthn options to pass to the browser ceremony.
- challengeId:
- type: string
- description: Server-issued challenge id.
- required:
- - options
- - challengeId
- additionalProperties: false
- MfaWebauthnRegisterVerifyEnvelope:
+ PasskeyRenameEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/WebauthnMfaCredentialInfo"
+ $ref: "#/components/schemas/PasskeyInfo"
error:
type: "null"
meta:
@@ -52566,11 +56647,11 @@ components:
- data
- error
additionalProperties: false
- MfaWebauthnRenameEnvelope:
+ PasskeyRemoveEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/WebauthnMfaCredentialInfo"
+ $ref: "#/components/schemas/AuthSuccessFlagResponse"
error:
type: "null"
meta:
@@ -52583,11 +56664,11 @@ components:
- data
- error
additionalProperties: false
- MfaWebauthnRemoveEnvelope:
+ ApiTokenListEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/AuthSuccessFlagResponse"
+ $ref: "#/components/schemas/ApiTokenListResponse"
error:
type: "null"
meta:
@@ -52600,19 +56681,65 @@ components:
- data
- error
additionalProperties: false
- AuthSuccessFlagResponse:
+ ApiTokenListResponse:
+ type: array
+ items:
+ $ref: "#/components/schemas/ApiTokenInfo"
+ ApiTokenInfo:
type: object
properties:
- success:
+ id:
+ type: string
+ description: Row id; the handle for DELETE.
+ name:
+ type: string
+ permissions:
+ type: array
+ items:
+ type: string
+ description: The token's scope list. `["*"]` is cookie-equivalent (what a native login mints); anything else is narrow
+ and reaches only the routes that name it. Admin endpoints are cookie-only and are reachable by no token at
+ any scope.
+ lastUsedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: Stamped fire-and-forget on use; null for an unused token.
+ expiresAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ createdAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ revoked:
+ type: boolean
+ description: Revoked tokens stay in the list rather than disappearing, so a client must filter on this rather than treat
+ presence as validity.
+ mirrorToAppleHealth:
type: boolean
+ description: "A measurement token's Apple Health setting: whether the HealthLog app writes the readings this token sent
+ into Apple Health. Changed with `PATCH /api/tokens/{id}`; false on every other token."
required:
- - success
+ - id
+ - name
+ - permissions
+ - lastUsedAt
+ - expiresAt
+ - createdAt
+ - revoked
+ - mirrorToAppleHealth
additionalProperties: false
- MfaWebauthnLoginOptionsEnvelope:
+ MeasurementTokenSummaryEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/WebauthnOptionsResponse"
+ $ref: "#/components/schemas/MeasurementTokenSummaryResponse"
error:
type: "null"
meta:
@@ -52625,11 +56752,23 @@ components:
- data
- error
additionalProperties: false
- MfaWebauthnVerifyResponse:
+ MeasurementTokenSummaryResponse:
+ type: object
+ properties:
+ unattributedReadings:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: "Live EXTERNAL readings that belong to no token: sent before readings were linked to their token, by an
+ account that held more than one. No token's Apple Health setting reaches them."
+ required:
+ - unattributedReadings
+ additionalProperties: false
+ CreateMeasurementTokenEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/AccessRefreshBundle"
+ $ref: "#/components/schemas/CreateMeasurementTokenResponse"
error:
type: "null"
meta:
@@ -52642,11 +56781,31 @@ components:
- data
- error
additionalProperties: false
- PasskeyLoginVerifyResponse:
+ CreateMeasurementTokenResponse:
+ type: object
+ properties:
+ token:
+ type: string
+ description: The raw `hlk_` Bearer, RETURNED EXACTLY ONCE. It is stored only as an HMAC-SHA256 hash, so there is no way
+ to retrieve it later; a client that does not capture it here has to mint a replacement. Treat it as a secret
+ in logs, crash reports and analytics.
+ name:
+ type: string
+ expiresAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ required:
+ - token
+ - name
+ - expiresAt
+ additionalProperties: false
+ description: The one response that carries a usable measurement-ingest Bearer value.
+ CreateWorkoutTokenEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/AccessRefreshBundle"
+ $ref: "#/components/schemas/CreateWorkoutTokenResponse"
error:
type: "null"
meta:
@@ -52659,11 +56818,30 @@ components:
- data
- error
additionalProperties: false
- RefreshResponse:
+ CreateWorkoutTokenResponse:
+ type: object
+ properties:
+ token:
+ type: string
+ description: The raw `hlk_` Bearer, RETURNED EXACTLY ONCE. It is stored only as an HMAC-SHA256 hash and cannot be
+ retrieved later. Treat it as a secret.
+ name:
+ type: string
+ expiresAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ required:
+ - token
+ - name
+ - expiresAt
+ additionalProperties: false
+ description: The one response that carries a usable workout-ingest Bearer value.
+ CreateDocumentTokenEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/AccessRefreshBundle"
+ $ref: "#/components/schemas/CreateDocumentTokenResponse"
error:
type: "null"
meta:
@@ -52676,7 +56854,26 @@ components:
- data
- error
additionalProperties: false
- RefreshRevokeResponse:
+ CreateDocumentTokenResponse:
+ type: object
+ properties:
+ token:
+ type: string
+ description: The raw `hlk_` Bearer, RETURNED EXACTLY ONCE. It is stored only as an HMAC-SHA256 hash and cannot be
+ retrieved later. Treat it as a secret.
+ name:
+ type: string
+ expiresAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ required:
+ - token
+ - name
+ - expiresAt
+ additionalProperties: false
+ description: The one response that carries a usable document-upload Bearer value.
+ ApiTokenRevokeEnvelope:
type: object
properties:
data:
@@ -52699,11 +56896,11 @@ components:
- data
- error
additionalProperties: false
- PasskeyListEnvelope:
+ UpdateMeasurementTokenEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/PasskeyListResponse"
+ $ref: "#/components/schemas/UpdateMeasurementTokenResponse"
error:
type: "null"
meta:
@@ -52716,53 +56913,22 @@ components:
- data
- error
additionalProperties: false
- PasskeyListResponse:
- type: array
- items:
- $ref: "#/components/schemas/PasskeyInfo"
- PasskeyInfo:
+ UpdateMeasurementTokenResponse:
type: object
properties:
id:
type: string
- description: Row id; the handle for DELETE.
- name:
- type: string
- description: User-supplied label, defaulting to “Passkey”.
- credentialDeviceType:
- type: string
- description: "Authenticator device type as reported at registration: `singleDevice` for a credential bound to one
- authenticator, `multiDevice` for a syncable one."
- credentialBackedUp:
+ mirrorToAppleHealth:
type: boolean
- description: Whether the authenticator reported the credential as backed up (synced to the platform keychain) at
- registration time. Not re-read afterwards.
- createdAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- description: Registered at.
- lastUsedAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- description: When this passkey last completed a verified assertion; null when it has never been used to sign in. Stamped
- on every successful login, so a client can render a real 'last used' rather than assuming never.
required:
- id
- - name
- - credentialDeviceType
- - credentialBackedUp
- - createdAt
- - lastUsedAt
+ - mirrorToAppleHealth
additionalProperties: false
- SessionListEnvelope:
+ RegisterEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/SessionListResponse"
+ $ref: "#/components/schemas/RegisteredUserResponse"
error:
type: "null"
meta:
@@ -52775,59 +56941,35 @@ components:
- data
- error
additionalProperties: false
- SessionListResponse:
+ RegisteredUserResponse:
type: object
properties:
- sessions:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- device:
- type: string
- description: Coarse device label derived from the User-Agent.
- ipMasked:
- description: IP with the host portion masked — never the full address.
- type:
- - string
- - "null"
- location:
- description: Resolved coarse location, when available.
- type:
- - string
- - "null"
- lastActiveAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- createdAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- isCurrent:
- type: boolean
- description: True for the session making this request.
- required:
- - id
- - device
- - ipMasked
- - location
- - lastActiveAt
- - createdAt
- - isCurrent
- additionalProperties: false
+ user:
+ type: object
+ properties:
+ id:
+ type: string
+ username:
+ type: string
+ email:
+ type:
+ - string
+ - "null"
+ required:
+ - id
+ - username
+ - email
+ additionalProperties: false
required:
- - sessions
+ - user
additionalProperties: false
- SignOutEverywhereEnvelope:
+ description: The account that was created. No credential rides this response — the session arrives as a cookie, and a
+ native client signs in afterwards through /api/auth/login.
+ PasswordChangeEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/SignOutEverywhereResponse"
+ $ref: "#/components/schemas/PasswordChangedResponse"
error:
type: "null"
meta:
@@ -52840,93 +56982,20 @@ components:
- data
- error
additionalProperties: false
- SignOutEverywhereResponse:
+ PasswordChangedResponse:
type: object
properties:
- sessionsRevoked:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Number of OTHER sessions removed (the current one is kept).
- accessTokensRevoked:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: "Tokens revoked: the access tokens of other device logins plus every programmatic token (connector,
- measurement, document), never the caller's own."
- connectorsRevoked:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Connected AI-assistant (MCP OAuth) connections revoked.
- shareLinksRevoked:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Clinician share links revoked; 0 when `keepShareLinks=1` was sent.
- pendingInvitesRevoked:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: "Record-sharing invitations this account offered that nobody had accepted yet, now withdrawn (`revokedBy:
- GRANTOR`)."
- grantsKept:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- description: The grant id, for DELETE /api/account/grants/{id}.
- account:
- type: object
- properties:
- id:
- type: string
- username:
- type: string
- displayName:
- type:
- - string
- - "null"
- required:
- - id
- - username
- - displayName
- additionalProperties: false
- access:
- type: string
- enum:
- - READ
- - WRITE
- - MANAGE
- required:
- - id
- - account
- - access
- additionalProperties: false
- description: Accepted grants this account gave that are still live. Signing out does not end them, because each is a
- person the owner chose and ending one silently could cut off a carer; they are listed so a client can show
- who can still read the record and offer to end each with DELETE /api/account/grants/{id}.
+ changed:
+ type: boolean
+ const: true
required:
- - sessionsRevoked
- - accessTokensRevoked
- - connectorsRevoked
- - shareLinksRevoked
- - pendingInvitesRevoked
- - grantsKept
+ - changed
additionalProperties: false
- SessionRevokeEnvelope:
+ AuthProfileUpdateEnvelope:
type: object
properties:
data:
- type: object
- properties:
- revoked:
- type: boolean
- required:
- - revoked
- additionalProperties: false
+ $ref: "#/components/schemas/AuthProfileUpdateResponse"
error:
type: "null"
meta:
@@ -52936,14 +57005,87 @@ components:
type: string
additionalProperties: false
required:
- - data
- - error
+ - data
+ - error
+ additionalProperties: false
+ AuthProfileUpdateResponse:
+ type: object
+ properties:
+ id:
+ type: string
+ username:
+ type: string
+ email:
+ type:
+ - string
+ - "null"
+ role:
+ type: string
+ heightCm:
+ type:
+ - number
+ - "null"
+ dateOfBirth:
+ type:
+ - string
+ - "null"
+ gender:
+ type:
+ - string
+ - "null"
+ timezone:
+ type:
+ - string
+ - "null"
+ fullName:
+ type:
+ - string
+ - "null"
+ insurerName:
+ type:
+ - string
+ - "null"
+ insurerIkNumber:
+ type:
+ - string
+ - "null"
+ hasInsuranceNumber:
+ type: boolean
+ description: Whether an insurance number is stored. The number itself is encrypted at rest and is never returned — only
+ its presence.
+ rejectedFields:
+ description: "Present only on a PARTIAL success: the fields that were skipped while the rest of the patch was written. A
+ 200 carrying this key means the save was incomplete — surface it, do not treat the response as a clean save.
+ `code` is the validator code for a field that failed validation, or `rate_limited` for an email-address
+ change that has spent the account's hourly budget; that one is not a bad value and the same address will be
+ accepted once the window rolls over."
+ type: array
+ items:
+ $ref: "#/components/schemas/ValidationIssue"
+ required:
+ - id
+ - username
+ - email
+ - role
+ - heightCm
+ - dateOfBirth
+ - gender
+ - timezone
+ - fullName
+ - insurerName
+ - insurerIkNumber
+ - hasInsuranceNumber
additionalProperties: false
- TrustedDeviceListEnvelope:
+ description: "The profile after the patch, as THIS path projects it. Deliberately named apart from
+ `ProfileUpdateResponse`: PATCH /api/user/profile runs the same handler and answers a different field set — this
+ one carries `id` and `role`, that one carries `displayName`, `locale`, `timeFormat`, `dateFormat` and
+ `moodReminderEnabled`. Neither is a superset of the other. Field-by-field either way: a bad field is dropped and
+ reported in `rejectedFields` rather than failing the whole request, unless EVERY supplied field was rejected."
+ PasskeyReauthOptionsEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/TrustedDeviceListResponse"
+ $ref: "#/components/schemas/PasskeyReauthOptionsResponse"
error:
type: "null"
meta:
@@ -52956,60 +57098,31 @@ components:
- data
- error
additionalProperties: false
- TrustedDeviceListResponse:
+ PasskeyReauthOptionsResponse:
type: object
properties:
- devices:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- label:
- description: Coarse, IP-free device label (e.g. 'Firefox on macOS').
- type:
- - string
- - "null"
- createdAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- lastUsedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- expiresAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- isCurrent:
- type: boolean
- description: True for the device making this request.
- required:
- - id
- - label
- - createdAt
- - lastUsedAt
- - expiresAt
- - isCurrent
- additionalProperties: false
+ options:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ description: SimpleWebAuthn assertion options for the re-proof ceremony.
+ challengeId:
+ type: string
+ reauth:
+ type: boolean
+ const: true
+ description: Marks this as the re-proof arm rather than the enrollment arm. Present only here.
required:
- - devices
+ - options
+ - challengeId
+ - reauth
additionalProperties: false
- TrustedDeviceRevokeAllEnvelope:
+ PasskeyRegisterOptionsEnvelope:
type: object
properties:
data:
- type: object
- properties:
- revoked:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- required:
- - revoked
- additionalProperties: false
+ $ref: "#/components/schemas/WebauthnOptionsResponse"
error:
type: "null"
meta:
@@ -53022,16 +57135,17 @@ components:
- data
- error
additionalProperties: false
- TrustedDeviceRevokeEnvelope:
+ PasskeyRegisterVerifyEnvelope:
type: object
properties:
data:
type: object
properties:
- revoked:
+ verified:
type: boolean
+ const: true
required:
- - revoked
+ - verified
additionalProperties: false
error:
type: "null"
@@ -53045,63 +57159,11 @@ components:
- data
- error
additionalProperties: false
- SecurityActivityEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/SecurityActivityResponse"
- error:
- type: "null"
- meta:
- $ref: "#/components/schemas/ListCapMeta"
- required:
- - data
- - error
- - meta
- additionalProperties: false
- SecurityActivityResponse:
- type: object
- properties:
- events:
- type: array
- items:
- type: object
- properties:
- action:
- type: string
- description: Audit action name, e.g. auth.login.password.
- createdAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- location:
- type:
- - string
- - "null"
- ipMasked:
- description: Host-masked IP.
- type:
- - string
- - "null"
- carrier:
- type:
- - string
- - "null"
- required:
- - action
- - createdAt
- - location
- - ipMasked
- - carrier
- additionalProperties: false
- required:
- - events
- additionalProperties: false
- LogoutEnvelope:
+ CodexDeviceStartEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/LogoutResponse"
+ $ref: "#/components/schemas/CodexDeviceStartResponse"
error:
type: "null"
meta:
@@ -53114,22 +57176,35 @@ components:
- data
- error
additionalProperties: false
- LogoutResponse:
+ CodexDeviceStartResponse:
type: object
properties:
- loggedOut:
- type: boolean
- const: true
- description: "Always true. The endpoint has no failure the caller acts on: it answers the same whether a cookie was
- cleared, a token was revoked, or neither was there."
+ userCode:
+ type: string
+ description: Short code the person types on the verification page.
+ verificationUrl:
+ type: string
+ format: uri
+ description: Where to type it — an OpenAI-hosted page, not a HealthLog one.
+ intervalSeconds:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "How often to call the poll endpoint. Honour it: the poll surface is limited to 60 calls per minute per
+ user."
required:
- - loggedOut
+ - userCode
+ - verificationUrl
+ - intervalSeconds
additionalProperties: false
- OidcStatusEnvelope:
+ description: The user-facing half of a device-code grant. The device-auth id that pairs with it is NOT here — it is
+ sealed into an encrypted, httpOnly, 15-minute cookie, so the poll can only be completed by the browser that
+ started the flow.
+ CodexDevicePollEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/OidcStatusResponse"
+ $ref: "#/components/schemas/CodexDevicePollResponse"
error:
type: "null"
meta:
@@ -53142,42 +57217,30 @@ components:
- data
- error
additionalProperties: false
- OidcStatusResponse:
+ CodexDevicePollResponse:
type: object
properties:
- enabled:
- type: boolean
- description: An OIDC provider is configured on this instance.
- buttonLabel:
- description: Operator-set label for the SSO button (`OIDC_BUTTON_LABEL`, defaulting to “Single Sign-On”). Null when no
- provider is configured.
- type:
- - string
- - "null"
- only:
- type: boolean
- description: "`OIDC_ONLY=true` — password and passkey login are refused with 403 `oidc_only`. A client that offers those
- controls anyway strands the user."
- nativeReturnPath:
- description: "The path of the native sign-in's opt-in https return, `/auth/native-return`, a fixed constant. Present
- (non-null) only when SSO is configured and the instance is served over https (`NEXT_PUBLIC_APP_URL`). An app
- build that carries an associated domain for this host may then start the native leg with `return=https` on
- GET /api/auth/oidc/login and receive the callback on `https://` with the same
- parameters the custom scheme carries. Null or absent: use the scheme. Servers before v1.48.0 omit the
- field."
- type:
- - string
- - "null"
+ status:
+ type: string
+ enum:
+ - pending
+ - connected
+ description: "`pending` while the person has not approved yet — keep polling. `connected` once the credentials are
+ stored; stop polling, the cookie is gone."
required:
- - enabled
- - buttonLabel
- - only
+ - status
additionalProperties: false
- RegistrationStatusEnvelope:
+ CodexDisconnectEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/RegistrationStatusResponse"
+ type: object
+ properties:
+ disconnected:
+ type: boolean
+ required:
+ - disconnected
+ additionalProperties: false
error:
type: "null"
meta:
@@ -53190,27 +57253,11 @@ components:
- data
- error
additionalProperties: false
- RegistrationStatusResponse:
- type: object
- properties:
- registrationEnabled:
- type: boolean
- description: Whether open self-registration is on. An operator who turned it off can still admit a signup through an
- invite token.
- sessionCookieSecure:
- type: boolean
- description: Whether this server issues its session cookies with the `Secure` flag (`SESSION_COOKIE_SECURE`, else on in
- production). A browser on a plain `http://` page cannot keep such a cookie; the web login page compares this
- with its own scheme before any credential is sent.
- required:
- - registrationEnabled
- - sessionCookieSecure
- additionalProperties: false
- PasskeyLoginOptionsEnvelope:
+ SyncStateEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/WebauthnOptionsResponse"
+ $ref: "#/components/schemas/SyncStateResponse"
error:
type: "null"
meta:
@@ -53223,28 +57270,155 @@ components:
- data
- error
additionalProperties: false
- PasskeyRenameEnvelope:
+ SyncStateResponse:
type: object
properties:
- data:
- $ref: "#/components/schemas/PasskeyInfo"
- error:
- type: "null"
- meta:
+ userId:
+ type: string
+ timezone:
+ type: string
+ lastSyncedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ serverNow:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ measurements:
type: object
properties:
- requestId:
- type: string
+ lastUpdatedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ liveCount:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ tombstonedCount:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - lastUpdatedAt
+ - liveCount
+ - tombstonedCount
+ additionalProperties: false
+ mood:
+ type: object
+ properties:
+ lastUpdatedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ liveCount:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ tombstonedCount:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - lastUpdatedAt
+ - liveCount
+ - tombstonedCount
+ additionalProperties: false
+ intakes:
+ type: object
+ properties:
+ lastUpdatedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ liveCount:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ tombstonedCount:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - lastUpdatedAt
+ - liveCount
+ - tombstonedCount
+ additionalProperties: false
+ medications:
+ type: object
+ properties:
+ lastUpdatedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: Newest write to any of the account's medication rows. A snooze, a pause and a schedule change move what is
+ due without touching an intake row; compare this together with `intakes` (on inequality) to know whether
+ the dose list is stale.
+ required:
+ - lastUpdatedAt
+ additionalProperties: false
+ description: Freshness of the medication rows the dose state derives from.
+ sync:
+ type: object
+ properties:
+ incrementalWindowDays:
+ type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ description: Days an incremental delta stays valid; tracks the native refresh-token lifetime. Beyond it a device
+ re-pairs with a full backfill. iOS derives its window from this rather than hardcoding 60.
+ tombstoneRetentionDays:
+ type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ description: Horizon past which tombstones may be pruned. A cursor older than this gets `cursorExpired` on
+ `/api/sync/changes`.
+ required:
+ - incrementalWindowDays
+ - tombstoneRetentionDays
+ additionalProperties: false
+ description: Sync-window metadata the client reads instead of hardcoding.
+ push:
+ type: object
+ properties:
+ receiptsRecorded:
+ type: boolean
+ description: Whether the envelope receipts of this request (`openedAlert`, `openedSilent`) were recorded.
+ required:
+ - receiptsRecorded
additionalProperties: false
+ description: v1.49 — envelope receipts.
required:
- - data
- - error
+ - userId
+ - timezone
+ - lastSyncedAt
+ - serverNow
+ - measurements
+ - mood
+ - intakes
+ - medications
+ - sync
+ - push
additionalProperties: false
- PasskeyRemoveEnvelope:
+ description: iOS SyncMode handshake. Reports the server-side `lastSyncedAt` checkpoint, which the batch ingest endpoints
+ set when a client push lands; the handshake does not move it, and writes only the envelope receipts it carries.
+ The cheap 'should I sync?' summary; the durable delta cursor lives on `/api/sync/changes`.
+ SyncChangesEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/AuthSuccessFlagResponse"
+ $ref: "#/components/schemas/SyncChangesResponse"
error:
type: "null"
meta:
@@ -53257,50 +57431,238 @@ components:
- data
- error
additionalProperties: false
- ApiTokenListEnvelope:
+ SyncChangesResponse:
type: object
properties:
- data:
- $ref: "#/components/schemas/ApiTokenListResponse"
- error:
- type: "null"
- meta:
+ serverNow:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ cursor:
+ description: Opaque cursor to echo into the next request.
+ type:
+ - string
+ - "null"
+ hasMore:
+ type: boolean
+ description: False once the client is caught up as of `serverNow`. Every row domain that ran dry on a page takes a
+ watermark two minutes before `serverNow` (on the last page of a walk, all of them), so the next pull reads
+ rows changed in that stretch again (a write still in flight may commit a row stamped there) and a domain
+ that stays quiet never ages its cursor past the tombstone horizon; upserts are idempotent.
+ cursorExpired:
+ type: boolean
+ description: True when the supplied cursor predates tombstone retention, or was issued before the account's data was
+ last restored from a backup or deleted — drop the cursor and do a clean initial sync.
+ changes:
type: object
properties:
- requestId:
- type: string
+ measurements:
+ type: object
+ properties:
+ upserts:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncMeasurementUpsert"
+ tombstones:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncMeasurementTombstone"
+ required:
+ - upserts
+ - tombstones
+ additionalProperties: false
+ mood:
+ type: object
+ properties:
+ upserts:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncMoodUpsert"
+ tombstones:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncMoodTombstone"
+ required:
+ - upserts
+ - tombstones
+ additionalProperties: false
+ intakes:
+ type: object
+ properties:
+ upserts:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncIntakeUpsert"
+ tombstones:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncIntakeTombstone"
+ required:
+ - upserts
+ - tombstones
+ additionalProperties: false
+ cycleDays:
+ type: object
+ properties:
+ upserts:
+ type: array
+ items:
+ $ref: "#/components/schemas/CycleDayLogDTO"
+ tombstones:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncCycleDayTombstone"
+ required:
+ - upserts
+ - tombstones
+ additionalProperties: false
+ description: Cycle day logs. Present on every page, empty arrays when the account has the cycle module off.
+ cycles:
+ type: object
+ properties:
+ upserts:
+ type: array
+ items:
+ $ref: "#/components/schemas/MenstrualCycleDTO"
+ tombstones:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncCycleTombstone"
+ required:
+ - upserts
+ - tombstones
+ additionalProperties: false
+ description: Menstrual cycles, observed and forward-predicted. Present on every page, empty arrays when the account has
+ the cycle module off.
+ measurementMirror:
+ type: object
+ properties:
+ upserts:
+ type: array
+ items:
+ $ref: "#/components/schemas/SyncMeasurementMirrorUpsert"
+ tombstones:
+ maxItems: 0
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ required:
+ - id
+ additionalProperties: false
+ description: "Always empty: a deleted reading is a measurement tombstone."
+ required:
+ - upserts
+ - tombstones
+ additionalProperties: false
+ description: Apple Health write-back changes for readings that are otherwise unchanged. Apply after `measurements`.
+ required:
+ - measurements
+ - mood
+ - intakes
+ - cycleDays
+ - cycles
+ - measurementMirror
additionalProperties: false
required:
- - data
- - error
+ - serverNow
+ - cursor
+ - hasMore
+ - cursorExpired
+ - changes
additionalProperties: false
- ApiTokenListResponse:
- type: array
- items:
- $ref: "#/components/schemas/ApiTokenInfo"
- ApiTokenInfo:
+ description: "Multi-domain delta page: measurements, mood, intakes, cycle day logs, cycles, and the Apple Health
+ write-back changes of otherwise unchanged readings. One opaque multi-domain keyset cursor; tombstones apply
+ before upserts within each domain. Tombstone identity: measurements key on externalId, every other domain on
+ server id. All six keys are present on every response, including the `cursorExpired` short-circuit — a domain
+ with nothing to report sends empty arrays rather than being omitted."
+ SyncMeasurementUpsert:
type: object
properties:
id:
type: string
- description: Row id; the handle for DELETE.
- name:
+ description: Stored row id, or a synthetic key (`day::`, `sleep-seg::`) on the collapsed list
+ modes.
+ type:
+ $ref: "#/components/schemas/MeasurementType"
+ value:
+ type: number
+ unit:
type: string
- permissions:
- type: array
- items:
- type: string
- description: The token's scope list. `["*"]` is cookie-equivalent (what a native login mints); anything else is narrow
- and reaches only the routes that name it. Admin endpoints are cookie-only and are reachable by no token at
- any scope.
- lastUsedAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- description: Stamped fire-and-forget on use; null for an unused token.
- expiresAt:
+ measuredAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ source:
+ $ref: "#/components/schemas/MeasurementSource"
+ notes:
+ type:
+ - string
+ - "null"
+ userId:
+ type: string
+ valueMin:
+ description: Bucket MINIMUM — set only on an hourly heart-rate `stats:` row.
+ type:
+ - number
+ - "null"
+ valueMax:
+ description: Bucket MAXIMUM — set only on an hourly heart-rate `stats:` row.
+ type:
+ - number
+ - "null"
+ externalId:
+ description: Cross-device dedup key (UUID string or `stats::`).
+ type:
+ - string
+ - "null"
+ externalSourceVersion:
+ type:
+ - string
+ - "null"
+ aggregationProvenance:
+ description: "Authority of an aggregate stored under a `stats:` identity: `HEALTHKIT_STATISTICS`,
+ `EXPORT_XML_SOURCE_MAX` or `LEGACY_UNKNOWN`. Null on an ordinary sample row. Decode unknown values
+ leniently."
+ type:
+ - string
+ - "null"
+ glucoseContext:
+ description: Set only on BLOOD_GLUCOSE rows, and null there too when the writer recorded no classification (a sensor
+ export, a device sync). Never invent one.
+ type:
+ - string
+ - "null"
+ sleepStage:
+ description: Set only on SLEEP_DURATION rows.
+ type:
+ - string
+ - "null"
+ rhythmClassification:
+ description: Device classification verdict; set only on EVENT rows.
+ type:
+ - string
+ - "null"
+ deviceType:
+ description: "`watch | band | ring | phone | scale | other | unknown`."
+ type:
+ - string
+ - "null"
+ timeZone:
+ description: IANA zone the reading was taken in, when its writer sent one; null means the profile zone. The reading's
+ local day is read in it.
+ type:
+ - string
+ - "null"
+ syncVersion:
+ type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ description: LWW reconciliation counter; echo to keep the mirror monotonic.
+ deletedAt:
+ description: Soft-delete tombstone; null on a live row.
anyOf:
- type: string
format: date-time
@@ -53310,285 +57672,412 @@ components:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- revoked:
- type: boolean
- description: Revoked tokens stay in the list rather than disappearing, so a client must filter on this rather than treat
- presence as validity.
- mirrorToAppleHealth:
+ updatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ appleHealthMirror:
type: boolean
- description: "A measurement token's Apple Health setting: whether the HealthLog app writes the readings this token sent
- into Apple Health. Changed with `PATCH /api/tokens/{id}`; false on every other token."
- required:
- - id
- - name
- - permissions
- - lastUsedAt
- - expiresAt
- - createdAt
- - revoked
- - mirrorToAppleHealth
- additionalProperties: false
- MeasurementTokenSummaryEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/MeasurementTokenSummaryResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- MeasurementTokenSummaryResponse:
- type: object
- properties:
- unattributedReadings:
+ description: Whether the HealthLog app writes this reading into Apple Health. Server-resolved; mirror exactly the rows
+ that say true.
+ dayKey:
+ type: string
+ sampleCount:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ mainAsleepMinutes:
+ description: The main night's own time asleep in minutes; null on a day of naps alone. On a sleep row `value` is the
+ day's total, the main night plus its naps.
+ anyOf:
+ - type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - type: "null"
+ napCount:
+ description: Naps on the same wake day.
type: integer
minimum: 0
maximum: 9007199254740991
- description: "Live EXTERNAL readings that belong to no token: sent before readings were linked to their token, by an
- account that held more than one. No token's Apple Health setting reaches them."
- required:
- - unattributedReadings
- additionalProperties: false
- CreateMeasurementTokenEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/CreateMeasurementTokenResponse"
- error:
- type: "null"
- meta:
+ napAsleepMinutes:
+ description: Time asleep across those naps, in minutes.
+ type: number
+ minimum: 0
+ sleepStages:
+ description: The main night's minutes per stage (`IN_BED`, `ASLEEP`, `AWAKE`, `CORE`, `DEEP`, `REM`), each the union of
+ that stage's spans; empty on a day of naps alone.
type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ propertyNames:
+ type: string
+ additionalProperties:
+ type: number
+ minimum: 0
+ inBedMinutes:
+ description: The main night's time in bed in minutes, or null when no in-bed span was recorded.
+ anyOf:
+ - type: number
+ minimum: 0
+ - type: "null"
+ awakeMinutes:
+ description: The main night's time awake in bed in minutes, or null when no awake span was recorded.
+ anyOf:
+ - type: number
+ minimum: 0
+ - type: "null"
+ awakenings:
+ description: Awake spans between the main night's first and last time asleep.
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
required:
- - data
- - error
+ - id
+ - type
+ - value
+ - unit
+ - measuredAt
+ - source
+ - externalId
+ - syncVersion
+ - updatedAt
+ - appleHealthMirror
additionalProperties: false
- CreateMeasurementTokenResponse:
+ MeasurementSource:
+ type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
+ description: Origin of the measurement. v1.4.23 added APPLE_HEALTH for the iOS HealthKit batch ingest path. v1.38.x
+ added EXTERNAL for rows pushed in under a narrow `measurements:write` Bearer — a scale, a watch bridge, a
+ home-automation rule — and workouts pushed in under a narrow `workouts:write` Bearer carry it too. No client may
+ name that value on a write; the server resolves it from the credential.
+ SyncMeasurementTombstone:
type: object
properties:
- token:
+ id:
type: string
- description: The raw `hlk_` Bearer, RETURNED EXACTLY ONCE. It is stored only as an HMAC-SHA256 hash, so there is no way
- to retrieve it later; a client that does not capture it here has to mint a replacement. Treat it as a secret
- in logs, crash reports and analytics.
- name:
+ externalId:
+ description: The identity key the client dedups on for measurements.
+ type:
+ - string
+ - "null"
+ syncVersion:
+ type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ deletedAt:
type: string
- expiresAt:
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ updatedAt:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - token
- - name
- - expiresAt
- additionalProperties: false
- description: The one response that carries a usable measurement-ingest Bearer value.
- CreateWorkoutTokenEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/CreateWorkoutTokenResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
- required:
- - data
- - error
+ - id
+ - externalId
+ - syncVersion
+ - deletedAt
+ - updatedAt
additionalProperties: false
- CreateWorkoutTokenResponse:
+ description: A soft-deleted measurement. Apply tombstones BEFORE upserts within a page to avoid resurrecting a row.
+ Since v1.42 only deletions a person makes appear here; the nightly fold that condenses raw samples into `stats:`
+ rows deletes them outright and lists nothing.
+ SyncMoodUpsert:
type: object
properties:
- token:
+ id:
type: string
- description: The raw `hlk_` Bearer, RETURNED EXACTLY ONCE. It is stored only as an HMAC-SHA256 hash and cannot be
- retrieved later. Treat it as a secret.
- name:
+ date:
type: string
- expiresAt:
+ description: YYYY-MM-DD anchored to the row's `tz`.
+ mood:
+ type: string
+ score:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: The legacy 1-5 axis. Unchanged.
+ a1:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Pleasantness, 0-10. Server-derived from `mood` on every write, so this is populated even for rows a client
+ posted without it. Consume the value; do not re-derive it.
+ a2:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: "Stress, 0-10, INVERSE-oriented: a higher value is more stress. NULL when nobody answered it."
+ a3:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Energy, 0-10, or null.
+ a4:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Connectedness, 0-10, or null.
+ a5:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Stability, 0-10, or null.
+ context:
+ anyOf:
+ - $ref: "#/components/schemas/MoodContextOutput"
+ - type: "null"
+ description: The day's context, or null when the entry carries none. Null and an object of nulls are different answers.
+ tags:
+ description: JSON array of tag keys, or null.
+ type:
+ - string
+ - "null"
+ note:
+ type:
+ - string
+ - "null"
+ moodLoggedAt:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- required:
- - token
- - name
- - expiresAt
- additionalProperties: false
- description: The one response that carries a usable workout-ingest Bearer value.
- CreateDocumentTokenEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/CreateDocumentTokenResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- CreateDocumentTokenResponse:
- type: object
- properties:
- token:
- type: string
- description: The raw `hlk_` Bearer, RETURNED EXACTLY ONCE. It is stored only as an HMAC-SHA256 hash and cannot be
- retrieved later. Treat it as a secret.
- name:
+ source:
type: string
- expiresAt:
+ syncVersion:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: LWW reconciliation counter; mood is last-writer-wins by it.
+ updatedAt:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - token
- - name
- - expiresAt
- additionalProperties: false
- description: The one response that carries a usable document-upload Bearer value.
- ApiTokenRevokeEnvelope:
- type: object
- properties:
- data:
- type: object
- properties:
- revoked:
- type: boolean
- required:
- - revoked
- additionalProperties: false
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
- required:
- - data
- - error
+ - id
+ - date
+ - mood
+ - score
+ - a1
+ - a2
+ - a3
+ - a4
+ - a5
+ - context
+ - tags
+ - note
+ - moodLoggedAt
+ - source
+ - syncVersion
+ - updatedAt
additionalProperties: false
- UpdateMeasurementTokenEnvelope:
+ SyncMoodTombstone:
type: object
properties:
- data:
- $ref: "#/components/schemas/UpdateMeasurementTokenResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ id:
+ type: string
+ description: Server id — the identity key the client dedups on for mood.
+ syncVersion:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ deletedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ updatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - data
- - error
+ - id
+ - syncVersion
+ - deletedAt
+ - updatedAt
additionalProperties: false
- UpdateMeasurementTokenResponse:
+ description: A soft-deleted mood entry, keyed on server `id`. Apply before upserts within the domain page.
+ SyncIntakeUpsert:
type: object
properties:
id:
type: string
- mirrorToAppleHealth:
+ medicationId:
+ type: string
+ scheduledFor:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ takenAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ skipped:
+ type: boolean
+ source:
+ type: string
+ autoRecorded:
type: boolean
+ description: v1.42.2 — the server recorded this dose because the medication has `autoMarkTaken` on. Counts as taken.
+ syncVersion:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Reconciliation counter. An intake is immutable; a correction is a tombstone + re-insert.
+ updatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- id
- - mirrorToAppleHealth
+ - medicationId
+ - scheduledFor
+ - takenAt
+ - skipped
+ - source
+ - autoRecorded
+ - syncVersion
+ - updatedAt
additionalProperties: false
- RegisterEnvelope:
+ SyncIntakeTombstone:
type: object
properties:
- data:
- $ref: "#/components/schemas/RegisteredUserResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ id:
+ type: string
+ description: Server id — the identity key the client dedups on for intakes.
+ syncVersion:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ deletedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ updatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ externalId:
+ description: "Since v1.49.0: the HealthKit dose-event UUID the dose recorded, null for a dose not from Apple Health.
+ Lets a client match a deleted dose to its Apple Health record without holding the server id. Informational:
+ `POST /api/medications/intake/bulk` already refuses the re-post of a dose the person deleted in HealthLog
+ (`skipped`, `deleted_in_healthlog`), and takes one the phone reported deleted in Apple Health."
+ type:
+ - string
+ - "null"
+ source:
+ type: string
+ description: "Since v1.49.0: the row's `source`, as on the upsert. A dose from Apple Health that landed on a pending
+ slot row keeps that row's source (`REMINDER`), so `externalId`, not `source`, says whether it came from
+ Apple Health."
required:
- - data
- - error
+ - id
+ - syncVersion
+ - deletedAt
+ - updatedAt
+ - externalId
+ - source
additionalProperties: false
- RegisteredUserResponse:
+ description: A soft-deleted medication intake, keyed on server `id`. Apply before upserts within the domain page.
+ SyncCycleDayTombstone:
type: object
properties:
- user:
- type: object
- properties:
- id:
- type: string
- username:
- type: string
- email:
- type:
- - string
- - "null"
- required:
- - id
- - username
- - email
- additionalProperties: false
+ id:
+ type: string
+ externalId:
+ description: The client's own key for the day log, when it set one.
+ type:
+ - string
+ - "null"
+ syncVersion:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ deletedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ updatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - user
+ - id
+ - externalId
+ - syncVersion
+ - deletedAt
+ - updatedAt
additionalProperties: false
- description: The account that was created. No credential rides this response — the session arrives as a cookie, and a
- native client signs in afterwards through /api/auth/login.
- PasswordChangeEnvelope:
+ description: A soft-deleted cycle day log, keyed on server `id`. Apply before upserts within the domain page.
+ SyncCycleTombstone:
type: object
properties:
- data:
- $ref: "#/components/schemas/PasswordChangedResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ id:
+ type: string
+ syncVersion:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ deletedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ updatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - data
- - error
+ - id
+ - syncVersion
+ - deletedAt
+ - updatedAt
additionalProperties: false
- PasswordChangedResponse:
+ description: A soft-deleted menstrual cycle, keyed on server `id`. Apply before upserts within the domain page.
+ SyncMeasurementMirrorUpsert:
type: object
properties:
- changed:
+ id:
+ type: string
+ description: The measurement's server id.
+ appleHealthMirror:
type: boolean
- const: true
+ description: The reading's write-back as it now stands. False means stop writing it; samples already in Apple Health stay.
required:
- - changed
+ - id
+ - appleHealthMirror
additionalProperties: false
- AuthProfileUpdateEnvelope:
+ description: A reading whose `appleHealthMirror` changed because the account switched the Apple Health setting of the
+ token that sent it. The reading itself did not change and is not re-sent in `measurements`.
+ GetBloodPressureTimeOfDayResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/AuthProfileUpdateResponse"
+ $ref: "#/components/schemas/BloodPressureTimeOfDay"
error:
type: "null"
meta:
@@ -53601,145 +58090,138 @@ components:
- data
- error
additionalProperties: false
- AuthProfileUpdateResponse:
+ BloodPressureTimeOfDay:
type: object
properties:
- id:
+ days:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: The window asked for, in local days.
+ from:
type: string
- username:
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: Window start (ISO-8601).
+ to:
type: string
- email:
- type:
- - string
- - "null"
- role:
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: "Window end: the last instant of today in the record's time zone."
+ timeZone:
type: string
- heightCm:
- type:
- - number
- - "null"
- dateOfBirth:
- type:
- - string
- - "null"
- gender:
- type:
- - string
- - "null"
- timezone:
- type:
- - string
- - "null"
- fullName:
- type:
- - string
- - "null"
- insurerName:
- type:
- - string
- - "null"
- insurerIkNumber:
- type:
- - string
- - "null"
- hasInsuranceNumber:
- type: boolean
- description: Whether an insurance number is stored. The number itself is encrypted at rest and is never returned — only
- its presence.
- rejectedFields:
- description: "Present only on a PARTIAL success: the fields that were skipped while the rest of the patch was written. A
- 200 carrying this key means the save was incomplete — surface it, do not treat the response as a clean save.
- `code` is the validator code for a field that failed validation, or `rate_limited` for an email-address
- change that has spent the account's hourly budget; that one is not a bad value and the same address will be
- accepted once the window rolls over."
+ description: IANA zone the hours were read in (the record's own).
+ minReadings:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Readings a part needs before its mean is given.
+ readingCount:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Paired readings in the window, across the three parts.
+ parts:
type: array
items:
- $ref: "#/components/schemas/ValidationIssue"
- required:
- - id
- - username
- - email
- - role
- - heightCm
- - dateOfBirth
- - gender
- - timezone
- - fullName
- - insurerName
- - insurerIkNumber
- - hasInsuranceNumber
- additionalProperties: false
- description: "The profile after the patch, as THIS path projects it. Deliberately named apart from
- `ProfileUpdateResponse`: PATCH /api/user/profile runs the same handler and answers a different field set — this
- one carries `id` and `role`, that one carries `displayName`, `locale`, `timeFormat`, `dateFormat` and
- `moodReminderEnabled`. Neither is a superset of the other. Field-by-field either way: a bad field is dropped and
- reported in `rejectedFields` rather than failing the whole request, unless EVERY supplied field was rejected."
- PasskeyReauthOptionsEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/PasskeyReauthOptionsResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ $ref: "#/components/schemas/BloodPressurePartOfDay"
+ description: "Always three entries: morning, midday, evening, in order."
+ morningEveningDifference:
+ anyOf:
+ - type: object
+ properties:
+ systolic:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ diastolic:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - systolic
+ - diastolic
+ additionalProperties: false
+ - type: "null"
+ description: Morning mean minus evening mean, from the two whole-mmHg means given above (so it equals their difference
+ exactly). Null unless both parts reach `minReadings`.
required:
- - data
- - error
+ - days
+ - from
+ - to
+ - timeZone
+ - minReadings
+ - readingCount
+ - parts
+ - morningEveningDifference
additionalProperties: false
- PasskeyReauthOptionsResponse:
+ BloodPressurePartOfDay:
type: object
properties:
- options:
- type: object
- propertyNames:
- type: string
- additionalProperties: {}
- description: SimpleWebAuthn assertion options for the re-proof ceremony.
- challengeId:
+ part:
type: string
- reauth:
- type: boolean
- const: true
- description: Marks this as the re-proof arm rather than the enrollment arm. Present only here.
- required:
- - options
- - challengeId
- - reauth
- additionalProperties: false
- PasskeyRegisterOptionsEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/WebauthnOptionsResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ enum:
+ - morning
+ - midday
+ - evening
+ description: The part of the day.
+ startHour:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: First local hour of the part (inclusive).
+ endHour:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Local hour the part ends at (exclusive). Smaller than `startHour` when the part runs past midnight
+ (evening: 18 to 4)."
+ readingCount:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Paired systolic/diastolic readings in this part.
+ systolic:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Mean systolic in whole mmHg; null while `readingCount` is below `minReadings`.
+ diastolic:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Mean diastolic in whole mmHg; null on the same floor.
+ pulseReadingCount:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Readings in this part that carried a pulse (same source, within five minutes).
+ pulse:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Mean pulse in whole bpm; null while `pulseReadingCount` is below `minReadings`.
required:
- - data
- - error
+ - part
+ - startHour
+ - endHour
+ - readingCount
+ - systolic
+ - diastolic
+ - pulseReadingCount
+ - pulse
additionalProperties: false
- PasskeyRegisterVerifyEnvelope:
+ GetMeasurementsSeriesBatchResponse:
type: object
properties:
data:
- type: object
- properties:
- verified:
- type: boolean
- const: true
- required:
- - verified
- additionalProperties: false
+ $ref: "#/components/schemas/MeasurementsSeriesBatchResponse"
error:
type: "null"
meta:
@@ -53752,52 +58234,62 @@ components:
- data
- error
additionalProperties: false
- CodexDeviceStartEnvelope:
+ MeasurementsSeriesBatchResponse:
type: object
properties:
- data:
- $ref: "#/components/schemas/CodexDeviceStartResponse"
- error:
- type: "null"
- meta:
+ series:
type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- CodexDeviceStartResponse:
- type: object
- properties:
- userCode:
- type: string
- description: Short code the person types on the verification page.
- verificationUrl:
- type: string
- format: uri
- description: Where to type it — an OpenAI-hosted page, not a HealthLog one.
- intervalSeconds:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: "How often to call the poll endpoint. Honour it: the poll surface is limited to 60 calls per minute per
- user."
- required:
- - userCode
- - verificationUrl
- - intervalSeconds
- additionalProperties: false
- description: The user-facing half of a device-code grant. The device-auth id that pairs with it is NOT here — it is
- sealed into an encrypted, httpOnly, 15-minute cookie, so the poll can only be completed by the browser that
- started the flow.
- CodexDevicePollEnvelope:
+ propertyNames:
+ $ref: "#/components/schemas/MeasurementType"
+ additionalProperties:
+ type: array
+ items:
+ type: object
+ properties:
+ type:
+ $ref: "#/components/schemas/MeasurementType"
+ value:
+ type: number
+ description: "The day's mean (spot metrics) or total (cumulative). A row of a coarser tier (a window longer than the
+ daily cap) carries the average day of its bucket, the same quantity: a spot metric's mean of its
+ daily means, a cumulative metric's total over the days of the bucket that hold a reading."
+ measuredAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: "Day-bucket start (ISO-8601): the user's local midnight. A window longer than the daily cap is served from
+ a coarser tier (a UTC day, week or month); its rows are stamped at noon UTC of the bucket's first
+ day, which falls inside the bucket's own week or month in every zone."
+ count:
+ description: Underlying raw-row count for the bucket.
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ minValue:
+ description: Per-day minimum (spot metrics only; absent for cumulative).
+ type:
+ - number
+ - "null"
+ maxValue:
+ description: Per-day maximum (spot metrics only; absent for cumulative).
+ type:
+ - number
+ - "null"
+ required:
+ - type
+ - value
+ - measuredAt
+ additionalProperties: false
+ description: Per-type daily series, keyed by MeasurementType. Only the requested types are present.
+ required:
+ - series
+ additionalProperties: false
+ description: Batched daily series — one rollup-backed series per requested type.
+ GetMeasurementsSeriesResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/CodexDevicePollResponse"
+ $ref: "#/components/schemas/MeasurementsSeriesResponse"
error:
type: "null"
meta:
@@ -53810,340 +58302,295 @@ components:
- data
- error
additionalProperties: false
- CodexDevicePollResponse:
+ MeasurementsSeriesResponse:
type: object
properties:
- status:
+ kind:
type: string
enum:
- - pending
- - connected
- description: "`pending` while the person has not approved yet — keep polling. `connected` once the credentials are
- stored; stop polling, the cookie is gone."
- required:
- - status
- additionalProperties: false
- CodexDisconnectEnvelope:
- type: object
- properties:
- data:
+ - weight
+ - bloodPressure
+ - pulse
+ - bodyFat
+ - glucose
+ - sleep
+ - steps
+ - totalBodyWater
+ - boneMass
+ - oxygenSaturation
+ - restingHeartRate
+ - heartRateVariability
+ - vo2Max
+ - ketones
+ - glucoseKetoneIndex
+ unit:
+ type: string
+ description: Resolved unit token for `value`. `glucose` follows the user's mg/dL|mmol/L preference; `sleep` is `h`
+ (per-night time-asleep in hours); `ketones` is `mmol/L`; `glucoseKetoneIndex` is `ratio`.
+ points:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ description: Measurement row id; `sleep:` for a sleep night; `day:` for a day bucket (`pulse`,
+ `glucose`, `heartRateVariability`, `oxygenSaturation` beyond 90 days); `hour:` for an hour
+ bucket (the same kinds within 90 days when the window holds more than 10 000 readings).
+ at:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: Point timestamp (ISO-8601).
+ value:
+ type: number
+ description: Primary value in the top-level `unit`.
+ secondary:
+ description: Diastolic value for `kind=bloodPressure` (paired within ±5 min); null for every other kind.
+ type:
+ - number
+ - "null"
+ sleepStages:
+ description: Per-stage hours for a `kind=sleep` night (CORE/DEEP/REM/…); null/absent for non-sleep kinds.
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties:
+ type: number
+ - type: "null"
+ valueMin:
+ description: "v1.19.2 (iOS #34 extension) — per-point MINIMUM for `kind=pulse`. On an aggregated hourly heart-rate
+ bucket `value` is the hour's average and this is the hour's low; null on a per-sample PULSE row and
+ absent for every other kind."
+ type:
+ - number
+ - "null"
+ valueMax:
+ description: "v1.19.2 (iOS #34 extension) — per-point MAXIMUM for `kind=pulse`. On an aggregated hourly heart-rate
+ bucket `value` is the hour's average and this is the hour's high; null on a per-sample PULSE row and
+ absent for every other kind."
+ type:
+ - number
+ - "null"
+ gki:
+ description: "#1367 — for `kind=glucoseKetoneIndex` only: the readings the index was computed from. `id` and `at` are
+ the ketone reading's. Absent for every other kind."
+ type: object
+ properties:
+ glucoseId:
+ type: string
+ description: The paired glucose reading's id.
+ glucoseAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: The paired glucose reading's timestamp.
+ glucoseMmol:
+ type: number
+ description: The paired glucose in mmol/L, one decimal.
+ ketonesMmol:
+ type: number
+ description: The ketone reading (beta-hydroxybutyrate), mmol/L.
+ required:
+ - glucoseId
+ - glucoseAt
+ - glucoseMmol
+ - ketonesMmol
+ additionalProperties: false
+ required:
+ - id
+ - at
+ - value
+ - secondary
+ additionalProperties: false
+ stats:
type: object
properties:
- disconnected:
- type: boolean
+ mean:
+ type: number
+ min:
+ type: number
+ max:
+ type: number
+ stdDev:
+ type: number
+ count:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
required:
- - disconnected
- additionalProperties: false
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- SyncStateEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/SyncStateResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
+ - mean
+ - min
+ - max
+ - stdDev
+ - count
additionalProperties: false
+ description: Summary over the returned points; all-zero when empty.
+ direction:
+ description: v1.43 — which way a change of this metric counts.
+ anyOf:
+ - $ref: "#/components/schemas/TrendVerdict"
+ - type: "null"
+ change:
+ description: v1.43 — first and last day value; null under two days.
+ anyOf:
+ - $ref: "#/components/schemas/SeriesChange"
+ - type: "null"
+ referenceLines:
+ description: v1.43 — lines to draw; empty when there is nothing to draw.
+ type: array
+ items:
+ $ref: "#/components/schemas/SeriesReferenceLine"
required:
- - data
- - error
+ - kind
+ - unit
+ - points
+ - stats
additionalProperties: false
- SyncStateResponse:
+ description: "iOS-friendly per-kind time series: one point per reading (or per reconstructed night for `sleep`), an
+ explicit `unit` token, and a summary `stats` block. Sample-dense kinds (`pulse`, `glucose`,
+ `heartRateVariability`, `oxygenSaturation`) are bucketed server-side: beyond 90 days per local day, and within
+ 90 days per local hour when the window holds more than 10 000 readings (a continuous glucose sensor, a watch or
+ ring recording every minute; a cuff, a fingerstick meter or a few readings a night stay raw). A bucket carries
+ the mean as `value` and otherwise has the shape of a reading of its kind; a `pulse` bucket also carries its
+ range as `valueMin` / `valueMax`, and a `glucose` bucket is converted to the user's unit like a raw reading.
+ `stats` is always computed over the underlying readings, never over the buckets. `glucoseKetoneIndex` (#1367) is
+ derived at read time, never stored: one point per ketone reading above zero that has a glucose reading at the
+ same instant or, failing that, the nearest one within 15 minutes either side; value = glucose (mmol/L, from
+ mg/dL by 18.0182) / ketones (mmol/L), one decimal. Draw it as given; do not recompute it."
+ TrendVerdict:
type: object
properties:
- userId:
- type: string
- timezone:
+ direction:
type: string
- lastSyncedAt:
+ enum:
+ - up-good
+ - up-bad
+ - neutral
+ - hold
+ description: "How a change counts: `up-good` a rise is progress, `up-bad` a fall is progress, `hold` staying is progress
+ and a move either way is no setback, `neutral` no judgement. `hold` covers a value inside its band, a blood
+ pressure, resting pulse or body fat below a profile-default band (a default's lower edge is no goal; below
+ the person's own target a rise stays `up-good`), and steps or oxygen saturation above their band (more is
+ never worse)."
+ targetPosition:
anyOf:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ enum:
+ - below
+ - inside
+ - above
- type: "null"
- serverNow:
+ description: Where the value sits against the band; null without one.
+ basis:
type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- measurements:
- type: object
- properties:
- lastUpdatedAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- liveCount:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- tombstonedCount:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - lastUpdatedAt
- - liveCount
- - tombstonedCount
- additionalProperties: false
- mood:
- type: object
- properties:
- lastUpdatedAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- liveCount:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- tombstonedCount:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - lastUpdatedAt
- - liveCount
- - tombstonedCount
- additionalProperties: false
- intakes:
- type: object
- properties:
- lastUpdatedAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- liveCount:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- tombstonedCount:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - lastUpdatedAt
- - liveCount
- - tombstonedCount
- additionalProperties: false
- sync:
- type: object
- properties:
- incrementalWindowDays:
- type: integer
- exclusiveMinimum: 0
- maximum: 9007199254740991
- description: Days an incremental delta stays valid; tracks the native refresh-token lifetime. Beyond it a device
- re-pairs with a full backfill. iOS derives its window from this rather than hardcoding 60.
- tombstoneRetentionDays:
- type: integer
- exclusiveMinimum: 0
- maximum: 9007199254740991
- description: Horizon past which tombstones may be pruned. A cursor older than this gets `cursorExpired` on
- `/api/sync/changes`.
- required:
- - incrementalWindowDays
- - tombstoneRetentionDays
- additionalProperties: false
- description: Sync-window metadata the client reads instead of hardcoding.
+ enum:
+ - personal_target
+ - profile_default
+ - metric_default
+ description: "What the verdict was judged against: the person's own target, a profile-derived default (e.g. the
+ age-based blood pressure target), or the metric's default direction."
required:
- - userId
- - timezone
- - lastSyncedAt
- - serverNow
- - measurements
- - mood
- - intakes
- - sync
+ - direction
+ - targetPosition
+ - basis
additionalProperties: false
- description: iOS SyncMode handshake. Reports the server-side `lastSyncedAt` checkpoint, which the batch ingest endpoints
- set when a client push lands; the handshake itself writes nothing. The cheap 'should I sync?' summary; the
- durable delta cursor lives on `/api/sync/changes`.
- SyncChangesEnvelope:
+ description: Which way a change of a metric counts as progress for this person. The generalisation of `tiles.weightTrend`.
+ SeriesChange:
type: object
properties:
- data:
- $ref: "#/components/schemas/SyncChangesResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ from:
+ type: number
+ to:
+ type: number
+ delta:
+ type: number
+ sentiment:
+ $ref: "#/components/schemas/TrendSentiment"
required:
- - data
- - error
+ - from
+ - to
+ - delta
+ - sentiment
additionalProperties: false
- SyncChangesResponse:
+ description: First and last day value in the window (by the metric's day statistic) and how the change counts. Null
+ under two days.
+ TrendSentiment:
+ type: string
+ enum:
+ - positive
+ - negative
+ - neutral
+ description: The verdict applied to one delivered change, with the noise floor applied. Colour the change from this.
+ SeriesReferenceLine:
type: object
properties:
- serverNow:
+ value:
+ type: number
+ description: In the unit of the response.
+ kind:
type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- cursor:
- description: Opaque cursor to echo into the next request.
- type:
- - string
- - "null"
- hasMore:
- type: boolean
- description: False once the client is caught up as of `serverNow`. Every row domain that ran dry on a page takes a
- watermark two minutes before `serverNow` (on the last page of a walk, all of them), so the next pull reads
- rows changed in that stretch again (a write still in flight may commit a row stamped there) and a domain
- that stays quiet never ages its cursor past the tombstone horizon; upserts are idempotent.
- cursorExpired:
- type: boolean
- description: True when the supplied cursor predates tombstone retention, or was issued before the account's data was
- last restored from a backup or deleted — drop the cursor and do a clean initial sync.
- changes:
- type: object
- properties:
- measurements:
- type: object
- properties:
- upserts:
- type: array
- items:
- $ref: "#/components/schemas/SyncMeasurementUpsert"
- tombstones:
- type: array
- items:
- $ref: "#/components/schemas/SyncMeasurementTombstone"
- required:
- - upserts
- - tombstones
- additionalProperties: false
- mood:
- type: object
- properties:
- upserts:
- type: array
- items:
- $ref: "#/components/schemas/SyncMoodUpsert"
- tombstones:
- type: array
- items:
- $ref: "#/components/schemas/SyncMoodTombstone"
- required:
- - upserts
- - tombstones
- additionalProperties: false
- intakes:
- type: object
- properties:
- upserts:
- type: array
- items:
- $ref: "#/components/schemas/SyncIntakeUpsert"
- tombstones:
- type: array
- items:
- $ref: "#/components/schemas/SyncIntakeTombstone"
- required:
- - upserts
- - tombstones
- additionalProperties: false
- cycleDays:
- type: object
- properties:
- upserts:
- type: array
- items:
- $ref: "#/components/schemas/CycleDayLogDTO"
- tombstones:
- type: array
- items:
- $ref: "#/components/schemas/SyncCycleDayTombstone"
- required:
- - upserts
- - tombstones
- additionalProperties: false
- description: Cycle day logs. Present on every page, empty arrays when the account has the cycle module off.
- cycles:
- type: object
- properties:
- upserts:
- type: array
- items:
- $ref: "#/components/schemas/MenstrualCycleDTO"
- tombstones:
- type: array
- items:
- $ref: "#/components/schemas/SyncCycleTombstone"
- required:
- - upserts
- - tombstones
- additionalProperties: false
- description: Menstrual cycles, observed and forward-predicted. Present on every page, empty arrays when the account has
- the cycle module off.
- measurementMirror:
- type: object
- properties:
- upserts:
- type: array
- items:
- $ref: "#/components/schemas/SyncMeasurementMirrorUpsert"
- tombstones:
- maxItems: 0
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- required:
- - id
- additionalProperties: false
- description: "Always empty: a deleted reading is a measurement tombstone."
- required:
- - upserts
- - tombstones
- additionalProperties: false
- description: Apple Health write-back changes for readings that are otherwise unchanged. Apply after `measurements`.
+ enum:
+ - lower
+ - upper
+ source:
+ type: string
+ enum:
+ - personal
+ - clinical
+ appliesTo:
+ type: string
+ enum:
+ - value
+ - secondary
+ description: "`secondary` is the diastolic value of a blood pressure."
+ labelKey:
+ type: string
+ label:
+ type: string
+ description: In the account language.
+ required:
+ - value
+ - kind
+ - source
+ - appliesTo
+ - labelKey
+ - label
+ additionalProperties: false
+ description: A horizontal line to draw on the chart. A personal line replaces the clinical one for the same edge. Empty
+ list when there is nothing to draw.
+ ListMeasurementsResponse:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ measurements:
+ type: array
+ items:
+ anyOf:
+ - $ref: "#/components/schemas/MeasurementResource"
+ - $ref: "#/components/schemas/AggregatedMeasurementBucket"
+ meta:
+ $ref: "#/components/schemas/ListMeasurementsMeta"
required:
- measurements
- - mood
- - intakes
- - cycleDays
- - cycles
- - measurementMirror
+ - meta
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
additionalProperties: false
required:
- - serverNow
- - cursor
- - hasMore
- - cursorExpired
- - changes
+ - data
+ - error
additionalProperties: false
- description: "Multi-domain delta page: measurements, mood, intakes, cycle day logs, cycles, and the Apple Health
- write-back changes of otherwise unchanged readings. One opaque multi-domain keyset cursor; tombstones apply
- before upserts within each domain. Tombstone identity: measurements key on externalId, every other domain on
- server id. All six keys are present on every response, including the `cursorExpired` short-circuit — a domain
- with nothing to report sends empty arrays rather than being omitted."
- SyncMeasurementUpsert:
+ MeasurementResource:
type: object
properties:
id:
@@ -54179,7 +58626,7 @@ components:
- number
- "null"
externalId:
- description: Cross-device dedup key (UUID string or `stats::`).
+ description: External-system dedup key; null for manual entries.
type:
- string
- "null"
@@ -54215,11 +58662,17 @@ components:
type:
- string
- "null"
+ timeZone:
+ description: IANA zone the reading was taken in, when its writer sent one; null means the profile zone. The reading's
+ local day is read in it.
+ type:
+ - string
+ - "null"
syncVersion:
+ description: Bumped on every server-side mutation; the last-writer-wins input for cross-device reconciliation.
type: integer
- exclusiveMinimum: 0
+ minimum: -9007199254740991
maximum: 9007199254740991
- description: LWW reconciliation counter; echo to keep the mirror monotonic.
deletedAt:
description: Soft-delete tombstone; null on a live row.
anyOf:
@@ -54236,9 +58689,10 @@ components:
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
appleHealthMirror:
+ description: "Whether the HealthLog app writes this reading into Apple Health. Resolved by the server on every stored
+ row: true for WITHINGS, IMPORT and MANUAL, for an EXTERNAL row whatever its account chose for the token that
+ sent it, false otherwise. Absent on the synthesised list rows."
type: boolean
- description: Whether the HealthLog app writes this reading into Apple Health. Server-resolved; mirror exactly the rows
- that say true.
dayKey:
type: string
sampleCount:
@@ -54295,50 +58749,197 @@ components:
- unit
- measuredAt
- source
- - externalId
- - syncVersion
- - updatedAt
- - appleHealthMirror
additionalProperties: false
- MeasurementSource:
- type: string
- enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
- description: Origin of the measurement. v1.4.23 added APPLE_HEALTH for the iOS HealthKit batch ingest path. v1.38.x
- added EXTERNAL for rows pushed in under a narrow `measurements:write` Bearer — a scale, a watch bridge, a
- home-automation rule — and workouts pushed in under a narrow `workouts:write` Bearer carry it too. No client may
- name that value on a write; the server resolves it from the credential.
- SyncMeasurementTombstone:
+ description: Server-shaped measurement row. GET endpoints return the whole stored row with the decrypted note on `notes`
+ and the `notesEncrypted` ciphertext stripped; the collapsed list modes synthesise rows carrying the display
+ fields plus `dayKey` / `sampleCount`.
+ AggregatedMeasurementBucket:
+ type: object
+ properties:
+ type:
+ $ref: "#/components/schemas/MeasurementType"
+ value:
+ type: number
+ description: The bucket's aggregated value.
+ measuredAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: Bucket start.
+ count:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ minValue:
+ description: The lowest reading in the bucket; absent on a summed (cumulative) type.
+ type:
+ - number
+ - "null"
+ maxValue:
+ description: The highest reading in the bucket; absent on a summed (cumulative) type.
+ type:
+ - number
+ - "null"
+ unit:
+ type: string
+ required:
+ - type
+ - value
+ - measuredAt
+ additionalProperties: false
+ description: Pre-folded bucket returned by the `aggregate=` list modes instead of a stored row.
+ ListMeasurementsMeta:
+ type: object
+ properties:
+ total:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ limit:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ offset:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ dayKey:
+ description: Echoed on the per-sample drill-down modes.
+ type: string
+ groupBy:
+ description: Set on the collapsed day-sum / per-night modes.
+ type: string
+ enum:
+ - day
+ - night
+ aggregate:
+ description: Set on the aggregate modes — the requested grain.
+ type: string
+ partOfDay:
+ description: Echoed when the series was narrowed with `partOfDay`.
+ type: string
+ enum:
+ - morning
+ - midday
+ - evening
+ droppedDuplicates:
+ description: Rows discarded by the cross-source canonical picker on the day-collapse mode.
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - total
+ - limit
+ - offset
+ additionalProperties: false
+ NamedSleepStageDuplicateResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/NamedSleepStageMeasurement"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ NamedSleepStageMeasurement:
type: object
properties:
id:
type: string
+ description: Stored row id, or a synthetic key (`day::`, `sleep-seg::`) on the collapsed list
+ modes.
+ type:
+ $ref: "#/components/schemas/MeasurementType"
+ value:
+ type: number
+ unit:
+ type: string
+ measuredAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ source:
+ $ref: "#/components/schemas/MeasurementSource"
+ notes:
+ type:
+ - string
+ - "null"
+ userId:
+ type: string
+ valueMin:
+ description: Bucket MINIMUM — set only on an hourly heart-rate `stats:` row.
+ type:
+ - number
+ - "null"
+ valueMax:
+ description: Bucket MAXIMUM — set only on an hourly heart-rate `stats:` row.
+ type:
+ - number
+ - "null"
externalId:
- description: The identity key the client dedups on for measurements.
+ description: External-system dedup key; null for manual entries.
+ type:
+ - string
+ - "null"
+ externalSourceVersion:
+ type:
+ - string
+ - "null"
+ aggregationProvenance:
+ description: "Authority of an aggregate stored under a `stats:` identity: `HEALTHKIT_STATISTICS`,
+ `EXPORT_XML_SOURCE_MAX` or `LEGACY_UNKNOWN`. Null on an ordinary sample row. Decode unknown values
+ leniently."
+ type:
+ - string
+ - "null"
+ glucoseContext:
+ description: Set only on BLOOD_GLUCOSE rows, and null there too when the writer recorded no classification (a sensor
+ export, a device sync). Never invent one.
+ type:
+ - string
+ - "null"
+ sleepStage:
+ description: Set only on SLEEP_DURATION rows.
+ type:
+ - string
+ - "null"
+ rhythmClassification:
+ description: Device classification verdict; set only on EVENT rows.
+ type:
+ - string
+ - "null"
+ deviceType:
+ description: "`watch | band | ring | phone | scale | other | unknown`."
+ type:
+ - string
+ - "null"
+ timeZone:
+ description: IANA zone the reading was taken in, when its writer sent one; null means the profile zone. The reading's
+ local day is read in it.
type:
- string
- "null"
syncVersion:
+ description: Bumped on every server-side mutation; the last-writer-wins input for cross-device reconciliation.
type: integer
- exclusiveMinimum: 0
+ minimum: -9007199254740991
maximum: 9007199254740991
deletedAt:
+ description: Soft-delete tombstone; null on a live row.
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ createdAt:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -54346,282 +58947,713 @@ components:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- required:
- - id
- - externalId
- - syncVersion
- - deletedAt
- - updatedAt
- additionalProperties: false
- description: A soft-deleted measurement. Apply tombstones BEFORE upserts within a page to avoid resurrecting a row.
- Since v1.42 only deletions a person makes appear here; the nightly fold that condenses raw samples into `stats:`
- rows deletes them outright and lists nothing.
- SyncMoodUpsert:
- type: object
- properties:
- id:
- type: string
- date:
- type: string
- description: YYYY-MM-DD anchored to the row's `tz`.
- mood:
+ appleHealthMirror:
+ description: "Whether the HealthLog app writes this reading into Apple Health. Resolved by the server on every stored
+ row: true for WITHINGS, IMPORT and MANUAL, for an EXTERNAL row whatever its account chose for the token that
+ sent it, false otherwise. Absent on the synthesised list rows."
+ type: boolean
+ dayKey:
type: string
- score:
+ sampleCount:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- description: The legacy 1-5 axis. Unchanged.
- a1:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- description: Pleasantness, 0-10. Server-derived from `mood` on every write, so this is populated even for rows a client
- posted without it. Consume the value; do not re-derive it.
- a2:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- description: "Stress, 0-10, INVERSE-oriented: a higher value is more stress. NULL when nobody answered it."
- a3:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- description: Energy, 0-10, or null.
- a4:
+ mainAsleepMinutes:
+ description: The main night's own time asleep in minutes; null on a day of naps alone. On a sleep row `value` is the
+ day's total, the main night plus its naps.
anyOf:
- type: integer
- minimum: -9007199254740991
+ minimum: 0
maximum: 9007199254740991
- type: "null"
- description: Connectedness, 0-10, or null.
- a5:
+ napCount:
+ description: Naps on the same wake day.
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ napAsleepMinutes:
+ description: Time asleep across those naps, in minutes.
+ type: number
+ minimum: 0
+ sleepStages:
+ description: The main night's minutes per stage (`IN_BED`, `ASLEEP`, `AWAKE`, `CORE`, `DEEP`, `REM`), each the union of
+ that stage's spans; empty on a day of naps alone.
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties:
+ type: number
+ minimum: 0
+ inBedMinutes:
+ description: The main night's time in bed in minutes, or null when no in-bed span was recorded.
anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
+ - type: number
+ minimum: 0
- type: "null"
- description: Stability, 0-10, or null.
- context:
+ awakeMinutes:
+ description: The main night's time awake in bed in minutes, or null when no awake span was recorded.
anyOf:
- - $ref: "#/components/schemas/MoodContextOutput"
+ - type: number
+ minimum: 0
- type: "null"
- description: The day's context, or null when the entry carries none. Null and an object of nulls are different answers.
- tags:
- description: JSON array of tag keys, or null.
- type:
- - string
- - "null"
- note:
- type:
- - string
- - "null"
- moodLoggedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- source:
+ awakenings:
+ description: Awake spans between the main night's first and last time asleep.
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ status:
type: string
- syncVersion:
+ enum:
+ - inserted
+ - updated
+ - duplicate
+ description: "`inserted` — a new row (HTTP 201). `duplicate` — the segment was already stored, by this route or the
+ batch route, and nothing changed (HTTP 200). `updated` — a stored segment with the same stage, source and
+ end was corrected in place, for example a later start (HTTP 200)."
+ required:
+ - id
+ - type
+ - value
+ - unit
+ - measuredAt
+ - source
+ - status
+ additionalProperties: false
+ description: The stored SLEEP_DURATION row for a named sleep-stage segment, with what the call did to it.
+ CreateMeasurementResponse:
+ type: object
+ properties:
+ data:
+ anyOf:
+ - $ref: "#/components/schemas/NamedSleepStageMeasurement"
+ - $ref: "#/components/schemas/MeasurementResource"
+ - type: array
+ items:
+ $ref: "#/components/schemas/MeasurementResource"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ GetMeasurementResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/MeasurementResource"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ UpdateMeasurementResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/MeasurementResource"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ DeleteMeasurementResponse:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ deleted:
+ type: boolean
+ const: true
+ required:
+ - deleted
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ BatchMeasurementsResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/AppleHealthBatchResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ AppleHealthBatchResponse:
+ type: object
+ properties:
+ processed:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ inserted:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ updated:
type: integer
minimum: 0
maximum: 9007199254740991
- description: LWW reconciliation counter; mood is last-writer-wins by it.
- updatedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ duplicates:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ failed:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ skipped:
+ type: array
+ items:
+ type: object
+ properties:
+ index:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ reason:
+ type: string
+ required:
+ - index
+ - reason
+ additionalProperties: false
+ entries:
+ type: array
+ items:
+ $ref: "#/components/schemas/AppleHealthBatchEntryResult"
required:
- - id
- - date
- - mood
- - score
- - a1
- - a2
- - a3
- - a4
- - a5
- - context
- - tags
- - note
- - moodLoggedAt
- - source
- - syncVersion
- - updatedAt
+ - processed
+ - inserted
+ - updated
+ - duplicates
+ - failed
+ - skipped
+ - entries
additionalProperties: false
- SyncMoodTombstone:
+ AppleHealthBatchEntryResult:
type: object
properties:
- id:
- type: string
- description: Server id — the identity key the client dedups on for mood.
- syncVersion:
+ index:
type: integer
minimum: 0
maximum: 9007199254740991
- deletedAt:
+ status:
type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- updatedAt:
+ enum:
+ - inserted
+ - updated
+ - duplicate
+ - skipped
+ - failed
+ description: "`inserted`/`duplicate` — the row landed (advance the cursor). `updated` — a `stats:` aggregate overwrote
+ an existing row. `skipped` — validation no-op; see `reason`. `failed` — retryable database failure that must
+ not advance the entry cursor; the response is marked `Cache-Control: no-store`."
+ reason:
+ description: "Why a row was `skipped` or a `duplicate`. On a `skipped`: `deleted_in_healthlog` (since v1.49.0), an
+ immutable sample whose `(type, source, externalId)` names a row the person deleted in HealthLog (web, app or
+ MCP); it stays deleted and nothing is written. Final: drop the entry. A sample the phone reported deleted
+ through `DELETE /api/measurements/by-external-ids` is the other case: posted again, it is back in Apple
+ Health, and the deleted row is written again in place (`updated`). A `stats:` aggregate is a day's total,
+ not a sample, and a re-post writes it again either way. `stale` (since v1.49.0, on a `skipped`): a `stats:`
+ entry whose `computedAt` is earlier than the one the stored row was written with; the newer total stays.
+ Final: drop the entry. `superseded_in_batch`: a later entry of the same batch carries the same `stats:` id.
+ `folded_window` (since v1.42): a raw sample of a dense or mean type whose local day lies before the fold
+ boundary and whose hour or day a live `stats:` row of the same source already covers. Nothing to retry;
+ treat it like any duplicate. `hour_bucket_misaligned`, `hour_bucket_unsupported_type`, `hour_bucket_too_old`
+ (since v1.43): an hourly `stats::T` row the server refused, see `externalId`; permanent
+ for the row as sent."
type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ convertedValue:
+ description: "Only on a `value_out_of_range` skip (since v1.39.1): the entry's value after conversion into the stored
+ unit, which is the number the band was checked against. A HealthKit fraction that should have been a percent
+ shows up here a hundred times off."
+ type: number
+ range:
+ description: "Only on a `value_out_of_range` skip (since v1.39.1): the plausibility band that refused the entry, in the
+ stored unit. Both edges are inclusive. A skip is permanent for the value as sent; resending it unchanged
+ skips it again."
+ type: object
+ properties:
+ min:
+ type: number
+ max:
+ type: number
+ unit:
+ type: string
+ required:
+ - min
+ - max
+ - unit
+ additionalProperties: false
required:
- - id
- - syncVersion
- - deletedAt
- - updatedAt
+ - index
+ - status
additionalProperties: false
- description: A soft-deleted mood entry, keyed on server `id`. Apply before upserts within the domain page.
- SyncIntakeUpsert:
+ MeasurementsDeleteByExternalIdsResponse:
type: object
properties:
- id:
- type: string
- medicationId:
- type: string
- scheduledFor:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- takenAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- skipped:
- type: boolean
- source:
- type: string
- autoRecorded:
- type: boolean
- description: v1.42.2 — the server recorded this dose because the medication has `autoMarkTaken` on. Counts as taken.
- syncVersion:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Reconciliation counter. An intake is immutable; a correction is a tombstone + re-insert.
- updatedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ data:
+ $ref: "#/components/schemas/MeasurementsDeleteByExternalIdsResult"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
required:
- - id
- - medicationId
- - scheduledFor
- - takenAt
- - skipped
- - source
- - autoRecorded
- - syncVersion
- - updatedAt
+ - data
+ - error
additionalProperties: false
- SyncIntakeTombstone:
+ MeasurementsDeleteByExternalIdsResult:
type: object
properties:
- id:
- type: string
- description: Server id — the identity key the client dedups on for intakes.
- syncVersion:
+ deletedCount:
type: integer
minimum: 0
maximum: 9007199254740991
- deletedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- updatedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - id
- - syncVersion
- - deletedAt
- - updatedAt
+ - deletedCount
additionalProperties: false
- description: A soft-deleted medication intake, keyed on server `id`. Apply before upserts within the domain page.
- SyncCycleDayTombstone:
+ MeasurementsBulkDeleteResponse:
type: object
properties:
- id:
- type: string
- externalId:
- description: The client's own key for the day log, when it set one.
- type:
- - string
- - "null"
- syncVersion:
+ data:
+ $ref: "#/components/schemas/MeasurementsBulkDeleteResult"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ MeasurementsBulkDeleteResult:
+ type: object
+ properties:
+ deleted:
type: integer
minimum: 0
maximum: 9007199254740991
- deletedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- updatedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - id
- - externalId
- - syncVersion
- - deletedAt
- - updatedAt
+ - deleted
additionalProperties: false
- description: A soft-deleted cycle day log, keyed on server `id`. Apply before upserts within the domain page.
- SyncCycleTombstone:
+ MeasurementsRestoreResponse:
type: object
properties:
- id:
- type: string
- syncVersion:
+ data:
+ $ref: "#/components/schemas/MeasurementsRestoreResult"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ MeasurementsRestoreResult:
+ type: object
+ properties:
+ restored:
type: integer
minimum: 0
maximum: 9007199254740991
- deletedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- updatedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - id
- - syncVersion
- - deletedAt
- - updatedAt
+ - restored
additionalProperties: false
- description: A soft-deleted menstrual cycle, keyed on server `id`. Apply before upserts within the domain page.
- SyncMeasurementMirrorUpsert:
+ SleepNightResponse:
type: object
properties:
- id:
- type: string
- description: The measurement's server id.
- appleHealthMirror:
- type: boolean
- description: The reading's write-back as it now stands. False means stop writing it; samples already in Apple Health stay.
+ data:
+ $ref: "#/components/schemas/SleepNightResource"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ SleepNightResource:
+ type: object
+ properties:
+ night:
+ type:
+ - string
+ - "null"
+ main:
+ anyOf:
+ - type: object
+ properties:
+ night:
+ type: string
+ description: Wake-day key (YYYY-MM-DD), in `timeZone` when set, else in the profile zone.
+ timeZone:
+ description: The zone the night is read in when its last stage row carries one other than the profile zone (a night
+ slept abroad); null otherwise. Render the night's clock times in it.
+ type:
+ - string
+ - "null"
+ source:
+ anyOf:
+ - $ref: "#/components/schemas/MeasurementSource"
+ - type: "null"
+ start:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ end:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ asleepMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ inBedMinutes:
+ anyOf:
+ - type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - type: "null"
+ awakeMinutes:
+ anyOf:
+ - type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - type: "null"
+ awakenings:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ reconstructed:
+ type: boolean
+ description: True when the source has no per-stage onset timestamps and the server synthesised a contiguous timeline in
+ a fixed physiological order (WHOOP). The client renders the hypnogram but labels it an approximate
+ layout and never recomputes. False for real-series sources (Apple Health / Withings / Fitbit).
+ stages:
+ type: object
+ propertyNames:
+ type: string
+ enum:
+ - IN_BED
+ - AWAKE
+ - ASLEEP
+ - REM
+ - CORE
+ - DEEP
+ additionalProperties:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Minutes per stage. Only the stages the night recorded are present; an absent stage is not zero minutes, it
+ was not measured.
+ segments:
+ type: array
+ items:
+ type: object
+ properties:
+ stage:
+ anyOf:
+ - type: string
+ enum:
+ - IN_BED
+ - AWAKE
+ - ASLEEP
+ - REM
+ - CORE
+ - DEEP
+ - type: "null"
+ start:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ end:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ minutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - stage
+ - start
+ - end
+ - minutes
+ additionalProperties: false
+ sourceDiscrepancy:
+ anyOf:
+ - type: object
+ properties:
+ deltaMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Spread (max − min) of the disagreeing per-writer asleep totals, in minutes.
+ sources:
+ type: array
+ items:
+ type: object
+ properties:
+ source:
+ type: string
+ description: MeasurementSource value of the writer bucket.
+ deviceType:
+ type:
+ - string
+ - "null"
+ asleepMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - source
+ - deviceType
+ - asleepMinutes
+ additionalProperties: false
+ required:
+ - deltaMinutes
+ - sources
+ additionalProperties: false
+ - type: "null"
+ description: Non-null when two writer buckets reported clearly different asleep totals for this session (> 45 min apart
+ and > 20% of the larger total). Observational only — the served totals stay the winning writer's;
+ clients may show a discreet 'sources disagree' hint listing each bucket's total.
+ required:
+ - night
+ - source
+ - start
+ - end
+ - asleepMinutes
+ - inBedMinutes
+ - awakeMinutes
+ - awakenings
+ - reconstructed
+ - stages
+ - segments
+ - sourceDiscrepancy
+ additionalProperties: false
+ - type: "null"
+ naps:
+ type: array
+ items:
+ type: object
+ properties:
+ night:
+ type: string
+ description: Wake-day key (YYYY-MM-DD), in `timeZone` when set, else in the profile zone.
+ timeZone:
+ description: The zone the night is read in when its last stage row carries one other than the profile zone (a night
+ slept abroad); null otherwise. Render the night's clock times in it.
+ type:
+ - string
+ - "null"
+ source:
+ anyOf:
+ - $ref: "#/components/schemas/MeasurementSource"
+ - type: "null"
+ start:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ end:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ asleepMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ inBedMinutes:
+ anyOf:
+ - type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - type: "null"
+ awakeMinutes:
+ anyOf:
+ - type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - type: "null"
+ awakenings:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ reconstructed:
+ type: boolean
+ description: True when the source has no per-stage onset timestamps and the server synthesised a contiguous timeline in
+ a fixed physiological order (WHOOP). The client renders the hypnogram but labels it an approximate
+ layout and never recomputes. False for real-series sources (Apple Health / Withings / Fitbit).
+ stages:
+ type: object
+ propertyNames:
+ type: string
+ enum:
+ - IN_BED
+ - AWAKE
+ - ASLEEP
+ - REM
+ - CORE
+ - DEEP
+ additionalProperties:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Minutes per stage. Only the stages the night recorded are present; an absent stage is not zero minutes, it
+ was not measured.
+ segments:
+ type: array
+ items:
+ type: object
+ properties:
+ stage:
+ anyOf:
+ - type: string
+ enum:
+ - IN_BED
+ - AWAKE
+ - ASLEEP
+ - REM
+ - CORE
+ - DEEP
+ - type: "null"
+ start:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ end:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ minutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - stage
+ - start
+ - end
+ - minutes
+ additionalProperties: false
+ sourceDiscrepancy:
+ anyOf:
+ - type: object
+ properties:
+ deltaMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Spread (max − min) of the disagreeing per-writer asleep totals, in minutes.
+ sources:
+ type: array
+ items:
+ type: object
+ properties:
+ source:
+ type: string
+ description: MeasurementSource value of the writer bucket.
+ deviceType:
+ type:
+ - string
+ - "null"
+ asleepMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - source
+ - deviceType
+ - asleepMinutes
+ additionalProperties: false
+ required:
+ - deltaMinutes
+ - sources
+ additionalProperties: false
+ - type: "null"
+ description: Non-null when two writer buckets reported clearly different asleep totals for this session (> 45 min apart
+ and > 20% of the larger total). Observational only — the served totals stay the winning writer's;
+ clients may show a discreet 'sources disagree' hint listing each bucket's total.
+ required:
+ - night
+ - source
+ - start
+ - end
+ - asleepMinutes
+ - inBedMinutes
+ - awakeMinutes
+ - awakenings
+ - reconstructed
+ - stages
+ - segments
+ - sourceDiscrepancy
+ additionalProperties: false
required:
- - id
- - appleHealthMirror
+ - night
+ - main
+ - naps
additionalProperties: false
- description: A reading whose `appleHealthMirror` changed because the account switched the Apple Health setting of the
- token that sent it. The reading itself did not change and is not re-sent in `measurements`.
- GetBloodPressureTimeOfDayResponse:
+ description: "One reconstructed sleep night: the main session's hypnogram segments + breakdown, plus same-wake-day naps
+ surfaced separately. A session is a nap when it holds under three hours asleep centred between 10:00 and 20:00
+ local time; the main session is the longest session that is not a nap. A day whose only sleep is naps has `main:
+ null` and its naps."
+ SleepRhythmResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/BloodPressureTimeOfDay"
+ $ref: "#/components/schemas/SleepRhythmResource"
error:
type: "null"
meta:
@@ -54634,494 +59666,158 @@ components:
- data
- error
additionalProperties: false
- BloodPressureTimeOfDay:
- type: object
- properties:
- days:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: The window asked for, in local days.
- from:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- description: Window start (ISO-8601).
- to:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- description: "Window end: the last instant of today in the record's time zone."
- timeZone:
- type: string
- description: IANA zone the hours were read in (the record's own).
- minReadings:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Readings a part needs before its mean is given.
- readingCount:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Paired readings in the window, across the three parts.
- parts:
- type: array
- items:
- $ref: "#/components/schemas/BloodPressurePartOfDay"
- description: "Always three entries: morning, midday, evening, in order."
- morningEveningDifference:
- anyOf:
- - type: object
- properties:
- systolic:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- diastolic:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- required:
- - systolic
- - diastolic
- additionalProperties: false
- - type: "null"
- description: Morning mean minus evening mean, from the two whole-mmHg means given above (so it equals their difference
- exactly). Null unless both parts reach `minReadings`.
- required:
- - days
- - from
- - to
- - timeZone
- - minReadings
- - readingCount
- - parts
- - morningEveningDifference
- additionalProperties: false
- BloodPressurePartOfDay:
- type: object
- properties:
- part:
- type: string
- enum:
- - morning
- - midday
- - evening
- description: The part of the day.
- startHour:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: First local hour of the part (inclusive).
- endHour:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: "Local hour the part ends at (exclusive). Smaller than `startHour` when the part runs past midnight
- (evening: 18 to 4)."
- readingCount:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Paired systolic/diastolic readings in this part.
- systolic:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- description: Mean systolic in whole mmHg; null while `readingCount` is below `minReadings`.
- diastolic:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- description: Mean diastolic in whole mmHg; null on the same floor.
- pulseReadingCount:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Readings in this part that carried a pulse (same source, within five minutes).
- pulse:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- description: Mean pulse in whole bpm; null while `pulseReadingCount` is below `minReadings`.
- required:
- - part
- - startHour
- - endHour
- - readingCount
- - systolic
- - diastolic
- - pulseReadingCount
- - pulse
- additionalProperties: false
- GetMeasurementsSeriesBatchResponse:
+ SleepRhythmResource:
type: object
properties:
- data:
- $ref: "#/components/schemas/MeasurementsSeriesBatchResponse"
- error:
- type: "null"
- meta:
+ sleepDebt:
type: object
properties:
- requestId:
+ state:
type: string
+ enum:
+ - partial
+ - ready
+ description: "`partial` until enough tracked nights exist (calm 'still learning'); `ready` once the rolling window can
+ assert a balance."
+ debtMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Outstanding sleep-debt balance over the window, in minutes, after caps. A night below need adds its
+ shortfall; a night above need pays the balance down (floored at 0).
+ needMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Age-based sleep need (minutes) used for the per-night deficit.
+ nightsCounted:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ windowNights:
+ type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ description: Rolling window length in nights.
+ nightsUntilReady:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Nights still needed before the debt is asserted (0 when ready).
+ source:
+ description: v1.25.0 — the active source the debt is resolved FROM, picked off the user's `sleepDebt` source ladder.
+ `COMPUTED` is HealthLog's own rolling-balance estimate (the only producer today); a provider value would
+ be a device-native debt. Clients explain the figure when it is `COMPUTED`.
+ $ref: "#/components/schemas/MeasurementSource"
+ required:
+ - state
+ - debtMinutes
+ - needMinutes
+ - nightsCounted
+ - windowNights
+ - nightsUntilReady
+ - source
additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- MeasurementsSeriesBatchResponse:
- type: object
- properties:
- series:
- type: object
- propertyNames:
- $ref: "#/components/schemas/MeasurementType"
- additionalProperties:
- type: array
- items:
- type: object
- properties:
- type:
- $ref: "#/components/schemas/MeasurementType"
- value:
- type: number
- description: "The day's mean (spot metrics) or total (cumulative). A row of a coarser tier (a window longer than the
- daily cap) carries the average day of its bucket, the same quantity: a spot metric's mean of its
- daily means, a cumulative metric's total over the days of the bucket that hold a reading."
- measuredAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- description: "Day-bucket start (ISO-8601): the user's local midnight. A window longer than the daily cap is served from
- a coarser tier (a UTC day, week or month); its rows are stamped at noon UTC of the bucket's first
- day, which falls inside the bucket's own week or month in every zone."
- count:
- description: Underlying raw-row count for the bucket.
- type: integer
- minimum: 0
- maximum: 9007199254740991
- minValue:
- description: Per-day minimum (spot metrics only; absent for cumulative).
- type:
- - number
- - "null"
- maxValue:
- description: Per-day maximum (spot metrics only; absent for cumulative).
- type:
- - number
- - "null"
- required:
- - type
- - value
- - measuredAt
- additionalProperties: false
- description: Per-type daily series, keyed by MeasurementType. Only the requested types are present.
- required:
- - series
- additionalProperties: false
- description: Batched daily series — one rollup-backed series per requested type.
- GetMeasurementsSeriesResponse:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/MeasurementsSeriesResponse"
- error:
- type: "null"
- meta:
+ chronotype:
type: object
properties:
- requestId:
+ state:
type: string
+ enum:
+ - learning
+ - ready
+ description: "`learning` until enough free-day nights exist (no band asserted); `ready` once the free-day sample is
+ large enough."
+ msfMinutes:
+ description: Mid-sleep on free days (minutes-of-day), null while learning.
+ type:
+ - number
+ - "null"
+ msfScMinutes:
+ description: Sleep-debt-corrected mid-sleep on free days (MSFsc, minutes-of-day), null while learning.
+ type:
+ - number
+ - "null"
+ band:
+ anyOf:
+ - type: string
+ enum:
+ - extreme_early
+ - early
+ - intermediate
+ - late
+ - extreme_late
+ - type: "null"
+ description: MCTQ chronotype band off MSFsc, null while learning.
+ socialJetlagMinutes:
+ description: Social jetlag = circular |MSF_work − MSF_free| in minutes, null when one side is missing.
+ type:
+ - number
+ - "null"
+ freeNightsCounted:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ workNightsCounted:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ freeNightsUntilReady:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Free-day nights still needed before a band is asserted.
+ required:
+ - state
+ - msfMinutes
+ - msfScMinutes
+ - band
+ - socialJetlagMinutes
+ - freeNightsCounted
+ - workNightsCounted
+ - freeNightsUntilReady
additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- MeasurementsSeriesResponse:
- type: object
- properties:
- kind:
- type: string
- enum:
- - weight
- - bloodPressure
- - pulse
- - bodyFat
- - glucose
- - sleep
- - steps
- - totalBodyWater
- - boneMass
- - oxygenSaturation
- - restingHeartRate
- - heartRateVariability
- - vo2Max
- - ketones
- - glucoseKetoneIndex
- unit:
- type: string
- description: Resolved unit token for `value`. `glucose` follows the user's mg/dL|mmol/L preference; `sleep` is `h`
- (per-night time-asleep in hours); `ketones` is `mmol/L`; `glucoseKetoneIndex` is `ratio`.
- points:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- description: Measurement row id; `sleep:` for a sleep night; `day:` for a day bucket (`pulse`,
- `glucose`, `heartRateVariability`, `oxygenSaturation` beyond 90 days); `hour:` for an hour
- bucket (the same kinds within 90 days when the window holds more than 10 000 readings).
- at:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- description: Point timestamp (ISO-8601).
- value:
- type: number
- description: Primary value in the top-level `unit`.
- secondary:
- description: Diastolic value for `kind=bloodPressure` (paired within ±5 min); null for every other kind.
- type:
- - number
- - "null"
- sleepStages:
- description: Per-stage hours for a `kind=sleep` night (CORE/DEEP/REM/…); null/absent for non-sleep kinds.
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties:
- type: number
- - type: "null"
- valueMin:
- description: "v1.19.2 (iOS #34 extension) — per-point MINIMUM for `kind=pulse`. On an aggregated hourly heart-rate
- bucket `value` is the hour's average and this is the hour's low; null on a per-sample PULSE row and
- absent for every other kind."
- type:
- - number
- - "null"
- valueMax:
- description: "v1.19.2 (iOS #34 extension) — per-point MAXIMUM for `kind=pulse`. On an aggregated hourly heart-rate
- bucket `value` is the hour's average and this is the hour's high; null on a per-sample PULSE row and
- absent for every other kind."
- type:
- - number
- - "null"
- gki:
- description: "#1367 — for `kind=glucoseKetoneIndex` only: the readings the index was computed from. `id` and `at` are
- the ketone reading's. Absent for every other kind."
- type: object
- properties:
- glucoseId:
- type: string
- description: The paired glucose reading's id.
- glucoseAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- description: The paired glucose reading's timestamp.
- glucoseMmol:
- type: number
- description: The paired glucose in mmol/L, one decimal.
- ketonesMmol:
- type: number
- description: The ketone reading (beta-hydroxybutyrate), mmol/L.
- required:
- - glucoseId
- - glucoseAt
- - glucoseMmol
- - ketonesMmol
- additionalProperties: false
- required:
- - id
- - at
- - value
- - secondary
- additionalProperties: false
- stats:
+ averagePerNight:
type: object
properties:
- mean:
- type: number
- min:
- type: number
- max:
- type: number
- stdDev:
- type: number
- count:
+ state:
+ type: string
+ enum:
+ - partial
+ - ready
+ averageMinutes:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ description: Mean asleep minutes per scorable night (0 while partial).
+ nightsCounted:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ nightsUntilReady:
type: integer
minimum: 0
maximum: 9007199254740991
+ description: Scorable nights still needed before the average is asserted.
required:
- - mean
- - min
- - max
- - stdDev
- - count
+ - state
+ - averageMinutes
+ - nightsCounted
+ - nightsUntilReady
additionalProperties: false
- description: Summary over the returned points; all-zero when empty.
- direction:
- description: v1.43 — which way a change of this metric counts.
- anyOf:
- - $ref: "#/components/schemas/TrendVerdict"
- - type: "null"
- change:
- description: v1.43 — first and last day value; null under two days.
- anyOf:
- - $ref: "#/components/schemas/SeriesChange"
- - type: "null"
- referenceLines:
- description: v1.43 — lines to draw; empty when there is nothing to draw.
- type: array
- items:
- $ref: "#/components/schemas/SeriesReferenceLine"
- required:
- - kind
- - unit
- - points
- - stats
- additionalProperties: false
- description: "iOS-friendly per-kind time series: one point per reading (or per reconstructed night for `sleep`), an
- explicit `unit` token, and a summary `stats` block. Sample-dense kinds (`pulse`, `glucose`,
- `heartRateVariability`, `oxygenSaturation`) are bucketed server-side: beyond 90 days per local day, and within
- 90 days per local hour when the window holds more than 10 000 readings (a continuous glucose sensor, a watch or
- ring recording every minute; a cuff, a fingerstick meter or a few readings a night stay raw). A bucket carries
- the mean as `value` and otherwise has the shape of a reading of its kind; a `pulse` bucket also carries its
- range as `valueMin` / `valueMax`, and a `glucose` bucket is converted to the user's unit like a raw reading.
- `stats` is always computed over the underlying readings, never over the buckets. `glucoseKetoneIndex` (#1367) is
- derived at read time, never stored: one point per ketone reading above zero that has a glucose reading at the
- same instant or, failing that, the nearest one within 15 minutes either side; value = glucose (mmol/L, from
- mg/dL by 18.0182) / ketones (mmol/L), one decimal. Draw it as given; do not recompute it."
- TrendVerdict:
- type: object
- properties:
- direction:
- type: string
- enum:
- - up-good
- - up-bad
- - neutral
- - hold
- description: "How a change counts: `up-good` a rise is progress, `up-bad` a fall is progress, `hold` staying is progress
- and a move either way is no setback, `neutral` no judgement. `hold` covers a value inside its band, a blood
- pressure, resting pulse or body fat below a profile-default band (a default's lower edge is no goal; below
- the person's own target a rise stays `up-good`), and steps or oxygen saturation above their band (more is
- never worse)."
- targetPosition:
- anyOf:
- - type: string
- enum:
- - below
- - inside
- - above
- - type: "null"
- description: Where the value sits against the band; null without one.
- basis:
- type: string
- enum:
- - personal_target
- - profile_default
- - metric_default
- description: "What the verdict was judged against: the person's own target, a profile-derived default (e.g. the
- age-based blood pressure target), or the metric's default direction."
- required:
- - direction
- - targetPosition
- - basis
- additionalProperties: false
- description: Which way a change of a metric counts as progress for this person. The generalisation of `tiles.weightTrend`.
- SeriesChange:
- type: object
- properties:
- from:
- type: number
- to:
- type: number
- delta:
- type: number
- sentiment:
- $ref: "#/components/schemas/TrendSentiment"
- required:
- - from
- - to
- - delta
- - sentiment
- additionalProperties: false
- description: First and last day value in the window (by the metric's day statistic) and how the change counts. Null
- under two days.
- TrendSentiment:
- type: string
- enum:
- - positive
- - negative
- - neutral
- description: The verdict applied to one delivered change, with the noise floor applied. Colour the change from this.
- SeriesReferenceLine:
- type: object
- properties:
- value:
- type: number
- description: In the unit of the response.
- kind:
- type: string
- enum:
- - lower
- - upper
- source:
- type: string
- enum:
- - personal
- - clinical
- appliesTo:
- type: string
- enum:
- - value
- - secondary
- description: "`secondary` is the diastolic value of a blood pressure."
- labelKey:
- type: string
- label:
- type: string
- description: In the account language.
required:
- - value
- - kind
- - source
- - appliesTo
- - labelKey
- - label
+ - sleepDebt
+ - chronotype
+ - averagePerNight
additionalProperties: false
- description: A horizontal line to draw on the chart. A personal line replaces the clinical one for the same edge. Empty
- list when there is nothing to draw.
- ListMeasurementsResponse:
+ description: "Server-authoritative sleep-rhythm read: the outstanding sleep-debt balance over the rolling window + MCTQ
+ chronotype (MSF/MSFsc band, social jetlag). Free vs work nights default to weekend = free in the user's timezone
+ (no work calendar). A view over existing per-stage SLEEP_DURATION rows — no schema, no new type."
+ ListWorkoutsResponse:
type: object
properties:
data:
- type: object
- properties:
- measurements:
- type: array
- items:
- anyOf:
- - $ref: "#/components/schemas/MeasurementResource"
- - $ref: "#/components/schemas/AggregatedMeasurementBucket"
- meta:
- $ref: "#/components/schemas/ListMeasurementsMeta"
- required:
- - measurements
- - meta
- additionalProperties: false
+ $ref: "#/components/schemas/WorkoutListResponse"
error:
type: "null"
meta:
@@ -55134,247 +59830,231 @@ components:
- data
- error
additionalProperties: false
- MeasurementResource:
+ WorkoutListResponse:
+ type: object
+ properties:
+ workouts:
+ type: array
+ items:
+ $ref: "#/components/schemas/WorkoutListEntry"
+ meta:
+ type: object
+ properties:
+ total:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ limit:
+ type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ offset:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ droppedDuplicates:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - total
+ - limit
+ - offset
+ - droppedDuplicates
+ additionalProperties: false
+ trainingLoad:
+ description: v1.44 — on the first page (`offset=0`) only, account-wide whatever the filter. Absent on later pages and
+ older servers.
+ $ref: "#/components/schemas/WorkoutTrainingLoad"
+ required:
+ - workouts
+ - meta
+ additionalProperties: false
+ WorkoutListEntry:
type: object
properties:
id:
type: string
- description: Stored row id, or a synthetic key (`day::`, `sleep-seg::`) on the collapsed list
- modes.
- type:
- $ref: "#/components/schemas/MeasurementType"
- value:
- type: number
- unit:
- type: string
- measuredAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- source:
- $ref: "#/components/schemas/MeasurementSource"
- notes:
- type:
- - string
- - "null"
- userId:
- type: string
- valueMin:
- description: Bucket MINIMUM — set only on an hourly heart-rate `stats:` row.
- type:
- - number
- - "null"
- valueMax:
- description: Bucket MAXIMUM — set only on an hourly heart-rate `stats:` row.
- type:
- - number
- - "null"
- externalId:
- description: External-system dedup key; null for manual entries.
- type:
- - string
- - "null"
- externalSourceVersion:
- type:
- - string
- - "null"
- aggregationProvenance:
- description: "Authority of an aggregate stored under a `stats:` identity: `HEALTHKIT_STATISTICS`,
- `EXPORT_XML_SOURCE_MAX` or `LEGACY_UNKNOWN`. Null on an ordinary sample row. Decode unknown values
- leniently."
- type:
- - string
- - "null"
- glucoseContext:
- description: Set only on BLOOD_GLUCOSE rows, and null there too when the writer recorded no classification (a sensor
- export, a device sync). Never invent one.
- type:
- - string
- - "null"
- sleepStage:
- description: Set only on SLEEP_DURATION rows.
- type:
- - string
- - "null"
- rhythmClassification:
- description: Device classification verdict; set only on EVENT rows.
- type:
- - string
- - "null"
- deviceType:
- description: "`watch | band | ring | phone | scale | other | unknown`."
+ sportType:
type:
- string
- "null"
- syncVersion:
- description: Bumped on every server-side mutation; the last-writer-wins input for cross-device reconciliation.
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- deletedAt:
- description: Soft-delete tombstone; null on a live row.
+ startedAt:
anyOf:
- type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- type: "null"
- createdAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- updatedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- appleHealthMirror:
- description: "Whether the HealthLog app writes this reading into Apple Health. Resolved by the server on every stored
- row: true for WITHINGS, IMPORT and MANUAL, for an EXTERNAL row whatever its account chose for the token that
- sent it, false otherwise. Absent on the synthesised list rows."
- type: boolean
- dayKey:
- type: string
- sampleCount:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- mainAsleepMinutes:
- description: The main night's own time asleep in minutes; null on a day of naps alone. On a sleep row `value` is the
- day's total, the main night plus its naps.
- anyOf:
- - type: integer
- minimum: 0
- maximum: 9007199254740991
- - type: "null"
- napCount:
- description: Naps on the same wake day.
- type: integer
- minimum: 0
- maximum: 9007199254740991
- napAsleepMinutes:
- description: Time asleep across those naps, in minutes.
- type: number
- minimum: 0
- sleepStages:
- description: The main night's minutes per stage (`IN_BED`, `ASLEEP`, `AWAKE`, `CORE`, `DEEP`, `REM`), each the union of
- that stage's spans; empty on a day of naps alone.
- type: object
- propertyNames:
- type: string
- additionalProperties:
- type: number
- minimum: 0
- inBedMinutes:
- description: The main night's time in bed in minutes, or null when no in-bed span was recorded.
+ endedAt:
anyOf:
- - type: number
- minimum: 0
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- type: "null"
- awakeMinutes:
- description: The main night's time awake in bed in minutes, or null when no awake span was recorded.
+ durationSec:
anyOf:
- - type: number
+ - type: integer
minimum: 0
+ maximum: 9007199254740991
- type: "null"
- awakenings:
- description: Awake spans between the main night's first and last time asleep.
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - id
- - type
- - value
- - unit
- - measuredAt
- - source
- additionalProperties: false
- description: Server-shaped measurement row. GET endpoints return the whole stored row with the decrypted note on `notes`
- and the `notesEncrypted` ciphertext stripped; the collapsed list modes synthesise rows carrying the display
- fields plus `dayKey` / `sampleCount`.
- AggregatedMeasurementBucket:
- type: object
- properties:
- type:
- $ref: "#/components/schemas/MeasurementType"
- value:
- type: number
- description: The bucket's aggregated value.
- measuredAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- description: Bucket start.
- count:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- minValue:
- description: The lowest reading in the bucket; absent on a summed (cumulative) type.
+ distanceM:
type:
- number
- "null"
- maxValue:
- description: The highest reading in the bucket; absent on a summed (cumulative) type.
+ activeEnergyKcal:
type:
- number
- "null"
- unit:
- type: string
- required:
- - type
- - value
- - measuredAt
- additionalProperties: false
- description: Pre-folded bucket returned by the `aggregate=` list modes instead of a stored row.
- ListMeasurementsMeta:
- type: object
- properties:
- total:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- limit:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- offset:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- dayKey:
- description: Echoed on the per-sample drill-down modes.
- type: string
- groupBy:
- description: Set on the collapsed day-sum / per-night modes.
- type: string
- enum:
- - day
- - night
- aggregate:
- description: Set on the aggregate modes — the requested grain.
- type: string
- partOfDay:
- description: Echoed when the series was narrowed with `partOfDay`.
- type: string
- enum:
- - morning
- - midday
- - evening
- droppedDuplicates:
- description: Rows discarded by the cross-source canonical picker on the day-collapse mode.
- type: integer
- minimum: 0
- maximum: 9007199254740991
+ avgHr:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ maxHr:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ source:
+ $ref: "#/components/schemas/MeasurementSource"
+ externalId:
+ type:
+ - string
+ - "null"
+ hasRoute:
+ type: boolean
+ hasHrSeries:
+ type: boolean
required:
- - total
- - limit
- - offset
+ - id
+ - sportType
+ - startedAt
+ - endedAt
+ - durationSec
+ - distanceM
+ - activeEnergyKcal
+ - avgHr
+ - maxHr
+ - source
+ - externalId
+ - hasRoute
+ - hasHrSeries
additionalProperties: false
- NamedSleepStageDuplicateResponse:
+ WorkoutTrainingLoad:
+ anyOf:
+ - type: object
+ properties:
+ status:
+ type: string
+ const: ok
+ asOf:
+ type: string
+ description: The last rated UTC day, at most yesterday; the figures are those of this day. The series runs on to
+ yesterday, so a later stretch without data shows as unrated days.
+ ctl:
+ type: number
+ description: "Fitness: 42-day exponentially weighted TRIMP."
+ atl:
+ type: number
+ description: "Fatigue: 7-day exponentially weighted TRIMP."
+ tsb:
+ type: number
+ description: "Form: fitness minus fatigue at `asOf`."
+ daysCovered:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ trainingDays:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ recentRatedDays:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Rated days of the trailing `recentDays` (42 up to yesterday, or fewer when covered less): a stored
+ impulse, or activity data without a workout."
+ recentDays:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ warmingUp:
+ type: boolean
+ description: "True below 42 covered days: both averages start at zero."
+ series:
+ type: array
+ items:
+ type: object
+ properties:
+ day:
+ type: string
+ ctl:
+ type: number
+ atl:
+ type: number
+ tsb:
+ type: number
+ rated:
+ type: boolean
+ description: "False for a day that could not be rated: no stored impulse and no activity data (steps, heart rate, active
+ energy), or a workout that was never scored. The averages held through it rather than counting it
+ as rest. A day with activity data and no workout is rest (impulse 0)."
+ required:
+ - day
+ - ctl
+ - atl
+ - tsb
+ - rated
+ additionalProperties: false
+ description: The trailing 90 days, oldest first; `tsb` is form going into the day.
+ required:
+ - status
+ - asOf
+ - ctl
+ - atl
+ - tsb
+ - daysCovered
+ - trainingDays
+ - recentRatedDays
+ - recentDays
+ - warmingUp
+ - series
+ additionalProperties: false
+ - type: object
+ properties:
+ status:
+ type: string
+ const: insufficient
+ reason:
+ type: string
+ enum:
+ - no_impulse_history
+ - too_little_history
+ daysCovered:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ trainingDays:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - status
+ - reason
+ - daysCovered
+ - trainingDays
+ additionalProperties: false
+ description: "v1.44 — the fitness-fatigue model over the stored daily heart-rate training impulse (Banister TRIMP; a day
+ with activity data but no training is 0, a day with no data or an unscored workout is not rated and the averages
+ hold through it). Needs 28 days and three training days. TRIMP units: comparable with the person's own past
+ only."
+ GetWorkoutResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/NamedSleepStageMeasurement"
+ $ref: "#/components/schemas/WorkoutDetailResponse"
error:
type: "null"
meta:
@@ -55387,228 +60067,474 @@ components:
- data
- error
additionalProperties: false
- NamedSleepStageMeasurement:
+ WorkoutDetailResponse:
type: object
properties:
id:
type: string
- description: Stored row id, or a synthetic key (`day::`, `sleep-seg::`) on the collapsed list
- modes.
- type:
- $ref: "#/components/schemas/MeasurementType"
- value:
- type: number
- unit:
+ sportType:
type: string
- measuredAt:
+ startedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ endedAt:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ dayKey:
+ type: string
+ durationSec:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ distanceM:
+ type:
+ - number
+ - "null"
+ activeEnergyKcal:
+ type:
+ - number
+ - "null"
+ avgHr:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ maxHr:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ minHr:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ storedAvgHr:
+ description: The row's own average heart rate (v1.42). `avgHr` may be filled in from a same-session twin by the
+ canonical picker; this is the stored value, which an edit of a hand-entered workout sends back so the twin's
+ value is not written onto it.
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ storedMaxHr:
+ description: The row's own maximum heart rate (v1.42), as `storedAvgHr` is to `avgHr`.
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ stepCount:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ elevationM:
+ type:
+ - number
+ - "null"
+ pauseDurationSec:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
source:
$ref: "#/components/schemas/MeasurementSource"
- notes:
+ externalId:
type:
- string
- "null"
- userId:
+ metadata:
+ anyOf:
+ - {}
+ - type: "null"
+ performance:
+ anyOf:
+ - $ref: "#/components/schemas/WorkoutPerformance"
+ - type: "null"
+ route:
+ anyOf:
+ - $ref: "#/components/schemas/WorkoutRouteGeometry"
+ - type: "null"
+ samples:
+ anyOf:
+ - $ref: "#/components/schemas/WorkoutHrSeries"
+ - type: "null"
+ hrSeries:
+ anyOf:
+ - $ref: "#/components/schemas/WorkoutHrCurve"
+ - type: "null"
+ zones:
+ anyOf:
+ - $ref: "#/components/schemas/WorkoutZones"
+ - type: "null"
+ splits:
+ anyOf:
+ - type: array
+ items:
+ $ref: "#/components/schemas/WorkoutSplit"
+ - type: "null"
+ sportContext:
+ anyOf:
+ - $ref: "#/components/schemas/WorkoutSportContext"
+ - type: "null"
+ aiInsight:
+ anyOf:
+ - $ref: "#/components/schemas/WorkoutActivityInsight"
+ - type: "null"
+ ai:
+ description: The `workoutInsights` AI capability. While it is unavailable `aiInsight` is null and the stored paragraph
+ is not even read.
+ $ref: "#/components/schemas/AiCapabilityState"
+ canonicalId:
type: string
- valueMin:
- description: Bucket MINIMUM — set only on an hourly heart-rate `stats:` row.
+ previousWorkoutId:
+ type:
+ - string
+ - "null"
+ required:
+ - id
+ - sportType
+ - startedAt
+ - endedAt
+ - dayKey
+ - durationSec
+ - distanceM
+ - activeEnergyKcal
+ - avgHr
+ - maxHr
+ - minHr
+ - stepCount
+ - elevationM
+ - pauseDurationSec
+ - source
+ - externalId
+ - metadata
+ - route
+ - samples
+ - hrSeries
+ - zones
+ - splits
+ - sportContext
+ - aiInsight
+ - ai
+ - canonicalId
+ - previousWorkoutId
+ additionalProperties: false
+ WorkoutPerformance:
+ type: object
+ properties:
+ aerobicTrainingEffect:
+ description: 0–5 score.
type:
- number
- "null"
- valueMax:
- description: Bucket MAXIMUM — set only on an hourly heart-rate `stats:` row.
+ anaerobicTrainingEffect:
+ description: 0–5 score.
type:
- number
- "null"
- externalId:
- description: External-system dedup key; null for manual entries.
+ trainingLoad:
type:
- - string
+ - number
- "null"
- externalSourceVersion:
+ recoveryTimeMin:
+ description: Minutes until the watch considers the person recovered.
type:
- - string
+ - number
- "null"
- aggregationProvenance:
- description: "Authority of an aggregate stored under a `stats:` identity: `HEALTHKIT_STATISTICS`,
- `EXPORT_XML_SOURCE_MAX` or `LEGACY_UNKNOWN`. Null on an ordinary sample row. Decode unknown values
- leniently."
+ sweatLossMl:
+ description: Estimated, millilitres.
type:
- - string
+ - number
- "null"
- glucoseContext:
- description: Set only on BLOOD_GLUCOSE rows, and null there too when the writer recorded no classification (a sensor
- export, a device sync). Never invent one.
+ avgPowerW:
type:
- - string
+ - number
- "null"
- sleepStage:
- description: Set only on SLEEP_DURATION rows.
+ avgVerticalOscillationMm:
type:
- - string
+ - number
- "null"
- rhythmClassification:
- description: Device classification verdict; set only on EVENT rows.
+ avgGroundContactTimeMs:
type:
- - string
+ - number
- "null"
- deviceType:
- description: "`watch | band | ring | phone | scale | other | unknown`."
+ avgGroundContactBalancePct:
+ description: The left foot's share of ground contact, percent.
type:
- - string
+ - number
- "null"
- syncVersion:
- description: Bumped on every server-side mutation; the last-writer-wins input for cross-device reconciliation.
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- deletedAt:
- description: Soft-delete tombstone; null on a live row.
+ required:
+ - aerobicTrainingEffect
+ - anaerobicTrainingEffect
+ - trainingLoad
+ - recoveryTimeMin
+ - sweatLossMl
+ - avgPowerW
+ - avgVerticalOscillationMm
+ - avgGroundContactTimeMs
+ - avgGroundContactBalancePct
+ additionalProperties: false
+ WorkoutRouteGeometry:
+ type: object
+ properties:
+ geometry: {}
+ sampleTimestamps:
anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: array
+ items:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: object
+ properties:
+ t:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ speedMs:
+ type: number
+ hr:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - t
+ additionalProperties: false
- type: "null"
- createdAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- updatedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- appleHealthMirror:
- description: "Whether the HealthLog app writes this reading into Apple Health. Resolved by the server on every stored
- row: true for WITHINGS, IMPORT and MANUAL, for an EXTERNAL row whatever its account chose for the token that
- sent it, false otherwise. Absent on the synthesised list rows."
- type: boolean
- dayKey:
- type: string
+ description: "One entry per geometry point, as the track was stored: a bare instant, or (from the workout batch and the
+ Apple Health export) an object with its instant and, where recorded, speed (m/s) and heart rate (bpm)."
+ required:
+ - geometry
+ - sampleTimestamps
+ additionalProperties: false
+ WorkoutHrSeries:
+ type: object
+ properties:
sampleCount:
type: integer
- minimum: -9007199254740991
+ minimum: 0
maximum: 9007199254740991
- mainAsleepMinutes:
- description: The main night's own time asleep in minutes; null on a day of naps alone. On a sleep row `value` is the
- day's total, the main night plus its naps.
+ samples: {}
+ required:
+ - sampleCount
+ - samples
+ additionalProperties: false
+ WorkoutHrCurve:
+ type: object
+ properties:
+ source:
+ type: string
+ enum:
+ - workout_series
+ - pulse_window
+ bucketSec:
+ type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ points:
+ type: array
+ items:
+ type: object
+ properties:
+ tSec:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ mean:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ min:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ max:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - tSec
+ - mean
+ - min
+ - max
+ additionalProperties: false
+ envelope:
+ type: boolean
+ required:
+ - source
+ - bucketSec
+ - points
+ - envelope
+ additionalProperties: false
+ WorkoutZones:
+ type: object
+ properties:
+ model:
+ type: string
+ enum:
+ - whoop
+ - tanaka
+ hrMax:
anyOf:
- type: integer
- minimum: 0
+ minimum: -9007199254740991
maximum: 9007199254740991
- type: "null"
- napCount:
- description: Naps on the same wake day.
+ zones:
+ type: array
+ items:
+ type: object
+ properties:
+ zone:
+ type: integer
+ minimum: 1
+ maximum: 5
+ lowBpm:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ highBpm:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ seconds:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ required:
+ - zone
+ - lowBpm
+ - highBpm
+ - seconds
+ additionalProperties: false
+ required:
+ - model
+ - hrMax
+ - zones
+ additionalProperties: false
+ WorkoutSplit:
+ type: object
+ properties:
+ km:
type: integer
- minimum: 0
+ exclusiveMinimum: 0
maximum: 9007199254740991
- napAsleepMinutes:
- description: Time asleep across those naps, in minutes.
- type: number
+ durationSec:
+ type: integer
minimum: 0
- sleepStages:
- description: The main night's minutes per stage (`IN_BED`, `ASLEEP`, `AWAKE`, `CORE`, `DEEP`, `REM`), each the union of
- that stage's spans; empty on a day of naps alone.
- type: object
- propertyNames:
- type: string
- additionalProperties:
- type: number
- minimum: 0
- inBedMinutes:
- description: The main night's time in bed in minutes, or null when no in-bed span was recorded.
- anyOf:
- - type: number
- minimum: 0
- - type: "null"
- awakeMinutes:
- description: The main night's time awake in bed in minutes, or null when no awake span was recorded.
- anyOf:
- - type: number
- minimum: 0
- - type: "null"
- awakenings:
- description: Awake spans between the main night's first and last time asleep.
+ maximum: 9007199254740991
+ paceSecPerKm:
type: integer
minimum: 0
maximum: 9007199254740991
- status:
- type: string
- enum:
- - inserted
- - updated
- - duplicate
- description: "`inserted` — a new row (HTTP 201). `duplicate` — the segment was already stored, by this route or the
- batch route, and nothing changed (HTTP 200). `updated` — a stored segment with the same stage, source and
- end was corrected in place, for example a later start (HTTP 200)."
required:
- - id
- - type
- - value
- - unit
- - measuredAt
- - source
- - status
+ - km
+ - durationSec
+ - paceSecPerKm
additionalProperties: false
- description: The stored SLEEP_DURATION row for a named sleep-stage segment, with what the call did to it.
- CreateMeasurementResponse:
+ WorkoutSportContext:
type: object
properties:
- data:
+ count:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ avgDurationSec:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ avgDistanceM:
+ type:
+ - number
+ - "null"
+ avgAvgHr:
anyOf:
- - $ref: "#/components/schemas/NamedSleepStageMeasurement"
- - $ref: "#/components/schemas/MeasurementResource"
- - type: array
- items:
- $ref: "#/components/schemas/MeasurementResource"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
required:
- - data
- - error
+ - count
+ - avgDurationSec
+ - avgDistanceM
+ - avgAvgHr
additionalProperties: false
- GetMeasurementResponse:
+ WorkoutActivityInsight:
type: object
properties:
- data:
- $ref: "#/components/schemas/MeasurementResource"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ paragraph:
+ type: string
+ generatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - data
- - error
+ - paragraph
+ - generatedAt
additionalProperties: false
- UpdateMeasurementResponse:
+ AiUnavailableReason:
+ type: string
+ enum:
+ - check_failed
+ - operator_disabled
+ - not_permitted_for_record
+ - module_disabled
+ - user_disabled
+ - usage_level
+ - no_provider
+ - consent_required
+ description: "Why an AI capability is unavailable, listed in precedence order; only the outermost reason that applies is
+ reported, because it names the layer that would have to change first. `check_failed` — an input could not be
+ read and the answer failed closed. `operator_disabled` — the operator's master switch, the capability's own
+ switch, or the operator's instance-wide availability of its module. `not_permitted_for_record` — AI work is not
+ admitted for this record (a delegate inside somebody else's record). `module_disabled` — an owning module is off
+ for this record, by its own switch or by the edge of the active grant. `user_disabled` — the record's own AI
+ opt-out: the Coach preference for the Coach, the `insights` module (AI analysis) for everything else.
+ `usage_level` — the record's AI usage level (`ai.usage.level`, v1.43) is below what the capability needs; today
+ only `supplementLabel` on `frugal`. `no_provider` — no configured provider can serve this capability's input.
+ `consent_required` — the provider chain needs an AI consent receipt and none is active. The list is closed; a
+ client that meets a value it does not know treats the capability as unavailable."
+ AiCapabilityState:
type: object
properties:
- data:
- $ref: "#/components/schemas/MeasurementResource"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ available:
+ type: boolean
+ reason:
+ anyOf:
+ - $ref: "#/components/schemas/AiUnavailableReason"
+ - type: "null"
+ description: "`null` exactly when `available` is true."
+ onDeviceAllowed:
+ type: boolean
+ description: "Whether an on-device model may do this work. False for `operator_disabled`, `not_permitted_for_record`,
+ `module_disabled`, `user_disabled`, `usage_level` and `check_failed`: the operator's and the person's
+ decisions hold on the device too. True otherwise, since a missing server provider or a missing consent for
+ server egress do not concern a model that runs on the device. Resolved here so the client never decides
+ which reasons apply off the server."
required:
- - data
- - error
+ - available
+ - reason
+ - onDeviceAllowed
additionalProperties: false
- DeleteMeasurementResponse:
+ description: "One AI capability, resolved for one record from every layer that can say no. Render from it; never
+ recompute it. Data never depends on it: measurements, scores, statistics and device records load whatever it
+ says."
+ DeleteWorkoutResponse:
type: object
properties:
data:
@@ -55632,11 +60558,11 @@ components:
- data
- error
additionalProperties: false
- BatchMeasurementsResponse:
+ BatchWorkoutsResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/AppleHealthBatchResponse"
+ $ref: "#/components/schemas/WorkoutBatchResponse"
error:
type: "null"
meta:
@@ -55649,29 +60575,26 @@ components:
- data
- error
additionalProperties: false
- AppleHealthBatchResponse:
+ WorkoutBatchResponse:
type: object
properties:
processed:
type: integer
minimum: 0
maximum: 9007199254740991
+ description: Entries in the request. Equals `inserted + duplicates + skipped.length`.
inserted:
type: integer
minimum: 0
maximum: 9007199254740991
- updated:
- type: integer
- minimum: 0
- maximum: 9007199254740991
+ description: Workout rows this request wrote.
duplicates:
type: integer
minimum: 0
maximum: 9007199254740991
- failed:
- type: integer
- minimum: 0
- maximum: 9007199254740991
+ description: Entries that wrote no workout row because the workout was already stored. The top-level counters count
+ workout rows, so an entry reported as `enriched` counts here as well even though its heart-rate series or
+ GPS track was attached.
skipped:
type: array
items:
@@ -55690,17 +60613,15 @@ components:
entries:
type: array
items:
- $ref: "#/components/schemas/AppleHealthBatchEntryResult"
+ $ref: "#/components/schemas/WorkoutBatchEntryResult"
required:
- processed
- inserted
- - updated
- duplicates
- - failed
- skipped
- entries
additionalProperties: false
- AppleHealthBatchEntryResult:
+ WorkoutBatchEntryResult:
type: object
properties:
index:
@@ -55711,51 +60632,35 @@ components:
type: string
enum:
- inserted
- - updated
- duplicate
+ - enriched
+ - updated
- skipped
- - failed
- description: "`inserted`/`duplicate` — the row landed (advance the cursor). `updated` — a `stats:` aggregate overwrote
- an existing row. `skipped` — validation no-op; see `reason`. `failed` — retryable database failure that must
- not advance the entry cursor; the response is marked `Cache-Control: no-store`."
+ description: "`inserted`: a new workout row. `duplicate`: the workout was already stored and nothing was written. From
+ v1.48.2 to v1.48.x also an `APPLE_HEALTH` workout whose externalId was deleted through `DELETE
+ /api/workouts/by-external-ids`; since v1.49.0 such a re-post is written again (`inserted`): only the phone
+ can delete an Apple Health workout, so one it posts again is back in Apple Health. `enriched`: the workout
+ was already stored and the heart-rate series or GPS track this entry carried (or both) was attached because
+ the stored workout had none; no workout row was inserted, and the entry also counts towards the top-level
+ `duplicates`. A track is attached only while the account keeps tracks (`storeWorkoutRoutes`), and when the
+ stored workout had no elevation, the climb derived from the attached track fills `elevationM`; no other
+ column of the workout row is written. `updated` (since v1.40.0): a workout entered by hand (`source:
+ MANUAL`, `externalId` starting `manual:`) was sent again with different values and the stored row now
+ carries them; no row was inserted, so it also counts towards `duplicates`. `skipped`: the server refused the
+ entry, see `reason`."
reason:
- description: "Why a row was `skipped` or a `duplicate`. `folded_window` (since v1.42): a raw sample of a dense or mean
- type whose local day lies before the fold boundary and whose hour or day a live `stats:` row of the same
- source already covers. Nothing to retry; treat it like any duplicate. `hour_bucket_misaligned`,
- `hour_bucket_unsupported_type`, `hour_bucket_too_old` (since v1.43): an hourly
- `stats::T` row the server refused, see `externalId`; permanent for the row as sent."
+ description: "Why a `skipped` entry was refused: `unstable_external_id` for an id that does not survive a client
+ restart, `invalid_samples` for a heart-rate series that failed validation."
type: string
- convertedValue:
- description: "Only on a `value_out_of_range` skip (since v1.39.1): the entry's value after conversion into the stored
- unit, which is the number the band was checked against. A HealthKit fraction that should have been a percent
- shows up here a hundred times off."
- type: number
- range:
- description: "Only on a `value_out_of_range` skip (since v1.39.1): the plausibility band that refused the entry, in the
- stored unit. Both edges are inclusive. A skip is permanent for the value as sent; resending it unchanged
- skips it again."
- type: object
- properties:
- min:
- type: number
- max:
- type: number
- unit:
- type: string
- required:
- - min
- - max
- - unit
- additionalProperties: false
required:
- index
- status
additionalProperties: false
- MeasurementsDeleteByExternalIdsResponse:
+ WorkoutsDeleteByExternalIdsResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/MeasurementsDeleteByExternalIdsResult"
+ $ref: "#/components/schemas/ExternalIdDeleteResult"
error:
type: "null"
meta:
@@ -55768,21 +60673,23 @@ components:
- data
- error
additionalProperties: false
- MeasurementsDeleteByExternalIdsResult:
+ ExternalIdDeleteResult:
type: object
properties:
deletedCount:
type: integer
minimum: 0
maximum: 9007199254740991
+ description: Rows this call deleted. An id that matched nothing, matched a row of another source or account, or was
+ already deleted is not counted.
required:
- deletedCount
additionalProperties: false
- MeasurementsBulkDeleteResponse:
+ EcgDeleteByExternalIdsResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/MeasurementsBulkDeleteResult"
+ $ref: "#/components/schemas/ExternalIdDeleteResult"
error:
type: "null"
meta:
@@ -55795,21 +60702,11 @@ components:
- data
- error
additionalProperties: false
- MeasurementsBulkDeleteResult:
- type: object
- properties:
- deleted:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - deleted
- additionalProperties: false
- MeasurementsRestoreResponse:
+ CycleDayLogsDeleteByExternalIdsResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/MeasurementsRestoreResult"
+ $ref: "#/components/schemas/ExternalIdDeleteResult"
error:
type: "null"
meta:
@@ -55822,21 +60719,11 @@ components:
- data
- error
additionalProperties: false
- MeasurementsRestoreResult:
- type: object
- properties:
- restored:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - restored
- additionalProperties: false
- SleepNightResponse:
+ MoodEntriesDeleteByExternalIdsResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/SleepNightResource"
+ $ref: "#/components/schemas/ExternalIdDeleteResult"
error:
type: "null"
meta:
@@ -55847,325 +60734,13 @@ components:
additionalProperties: false
required:
- data
- - error
- additionalProperties: false
- SleepNightResource:
- type: object
- properties:
- night:
- type:
- - string
- - "null"
- main:
- anyOf:
- - type: object
- properties:
- night:
- type: string
- description: Wake-day key (YYYY-MM-DD).
- source:
- anyOf:
- - $ref: "#/components/schemas/MeasurementSource"
- - type: "null"
- start:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- end:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- asleepMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- inBedMinutes:
- anyOf:
- - type: integer
- minimum: 0
- maximum: 9007199254740991
- - type: "null"
- awakeMinutes:
- anyOf:
- - type: integer
- minimum: 0
- maximum: 9007199254740991
- - type: "null"
- awakenings:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- reconstructed:
- type: boolean
- description: True when the source has no per-stage onset timestamps and the server synthesised a contiguous timeline in
- a fixed physiological order (WHOOP). The client renders the hypnogram but labels it an approximate
- layout and never recomputes. False for real-series sources (Apple Health / Withings / Fitbit).
- stages:
- type: object
- propertyNames:
- type: string
- enum:
- - IN_BED
- - AWAKE
- - ASLEEP
- - REM
- - CORE
- - DEEP
- additionalProperties:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Minutes per stage. Only the stages the night recorded are present; an absent stage is not zero minutes, it
- was not measured.
- segments:
- type: array
- items:
- type: object
- properties:
- stage:
- anyOf:
- - type: string
- enum:
- - IN_BED
- - AWAKE
- - ASLEEP
- - REM
- - CORE
- - DEEP
- - type: "null"
- start:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- end:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- minutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - stage
- - start
- - end
- - minutes
- additionalProperties: false
- sourceDiscrepancy:
- anyOf:
- - type: object
- properties:
- deltaMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Spread (max − min) of the disagreeing per-writer asleep totals, in minutes.
- sources:
- type: array
- items:
- type: object
- properties:
- source:
- type: string
- description: MeasurementSource value of the writer bucket.
- deviceType:
- type:
- - string
- - "null"
- asleepMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - source
- - deviceType
- - asleepMinutes
- additionalProperties: false
- required:
- - deltaMinutes
- - sources
- additionalProperties: false
- - type: "null"
- description: Non-null when two writer buckets reported clearly different asleep totals for this session (> 45 min apart
- and > 20% of the larger total). Observational only — the served totals stay the winning writer's;
- clients may show a discreet 'sources disagree' hint listing each bucket's total.
- required:
- - night
- - source
- - start
- - end
- - asleepMinutes
- - inBedMinutes
- - awakeMinutes
- - awakenings
- - reconstructed
- - stages
- - segments
- - sourceDiscrepancy
- additionalProperties: false
- - type: "null"
- naps:
- type: array
- items:
- type: object
- properties:
- night:
- type: string
- description: Wake-day key (YYYY-MM-DD).
- source:
- anyOf:
- - $ref: "#/components/schemas/MeasurementSource"
- - type: "null"
- start:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- end:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- asleepMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- inBedMinutes:
- anyOf:
- - type: integer
- minimum: 0
- maximum: 9007199254740991
- - type: "null"
- awakeMinutes:
- anyOf:
- - type: integer
- minimum: 0
- maximum: 9007199254740991
- - type: "null"
- awakenings:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- reconstructed:
- type: boolean
- description: True when the source has no per-stage onset timestamps and the server synthesised a contiguous timeline in
- a fixed physiological order (WHOOP). The client renders the hypnogram but labels it an approximate
- layout and never recomputes. False for real-series sources (Apple Health / Withings / Fitbit).
- stages:
- type: object
- propertyNames:
- type: string
- enum:
- - IN_BED
- - AWAKE
- - ASLEEP
- - REM
- - CORE
- - DEEP
- additionalProperties:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Minutes per stage. Only the stages the night recorded are present; an absent stage is not zero minutes, it
- was not measured.
- segments:
- type: array
- items:
- type: object
- properties:
- stage:
- anyOf:
- - type: string
- enum:
- - IN_BED
- - AWAKE
- - ASLEEP
- - REM
- - CORE
- - DEEP
- - type: "null"
- start:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- end:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- minutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - stage
- - start
- - end
- - minutes
- additionalProperties: false
- sourceDiscrepancy:
- anyOf:
- - type: object
- properties:
- deltaMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Spread (max − min) of the disagreeing per-writer asleep totals, in minutes.
- sources:
- type: array
- items:
- type: object
- properties:
- source:
- type: string
- description: MeasurementSource value of the writer bucket.
- deviceType:
- type:
- - string
- - "null"
- asleepMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - source
- - deviceType
- - asleepMinutes
- additionalProperties: false
- required:
- - deltaMinutes
- - sources
- additionalProperties: false
- - type: "null"
- description: Non-null when two writer buckets reported clearly different asleep totals for this session (> 45 min apart
- and > 20% of the larger total). Observational only — the served totals stay the winning writer's;
- clients may show a discreet 'sources disagree' hint listing each bucket's total.
- required:
- - night
- - source
- - start
- - end
- - asleepMinutes
- - inBedMinutes
- - awakeMinutes
- - awakenings
- - reconstructed
- - stages
- - segments
- - sourceDiscrepancy
- additionalProperties: false
- required:
- - night
- - main
- - naps
- additionalProperties: false
- description: "One reconstructed sleep night: the main session's hypnogram segments + breakdown, plus same-wake-day naps
- surfaced separately. A session is a nap when it holds under three hours asleep centred between 10:00 and 20:00
- local time; the main session is the longest session that is not a nap. A day whose only sleep is naps has `main:
- null` and its naps."
- SleepRhythmResponse:
+ - error
+ additionalProperties: false
+ SymptomEventsDeleteByExternalIdsResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/SleepRhythmResource"
+ $ref: "#/components/schemas/ExternalIdDeleteResult"
error:
type: "null"
meta:
@@ -56178,158 +60753,28 @@ components:
- data
- error
additionalProperties: false
- SleepRhythmResource:
+ MedicationIntakesDeleteByExternalIdsResponse:
type: object
properties:
- sleepDebt:
- type: object
- properties:
- state:
- type: string
- enum:
- - partial
- - ready
- description: "`partial` until enough tracked nights exist (calm 'still learning'); `ready` once the rolling window can
- assert a balance."
- debtMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Outstanding sleep-debt balance over the window, in minutes, after caps. A night below need adds its
- shortfall; a night above need pays the balance down (floored at 0).
- needMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Age-based sleep need (minutes) used for the per-night deficit.
- nightsCounted:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- windowNights:
- type: integer
- exclusiveMinimum: 0
- maximum: 9007199254740991
- description: Rolling window length in nights.
- nightsUntilReady:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Nights still needed before the debt is asserted (0 when ready).
- source:
- description: v1.25.0 — the active source the debt is resolved FROM, picked off the user's `sleepDebt` source ladder.
- `COMPUTED` is HealthLog's own rolling-balance estimate (the only producer today); a provider value would
- be a device-native debt. Clients explain the figure when it is `COMPUTED`.
- $ref: "#/components/schemas/MeasurementSource"
- required:
- - state
- - debtMinutes
- - needMinutes
- - nightsCounted
- - windowNights
- - nightsUntilReady
- - source
- additionalProperties: false
- chronotype:
- type: object
- properties:
- state:
- type: string
- enum:
- - learning
- - ready
- description: "`learning` until enough free-day nights exist (no band asserted); `ready` once the free-day sample is
- large enough."
- msfMinutes:
- description: Mid-sleep on free days (minutes-of-day), null while learning.
- type:
- - number
- - "null"
- msfScMinutes:
- description: Sleep-debt-corrected mid-sleep on free days (MSFsc, minutes-of-day), null while learning.
- type:
- - number
- - "null"
- band:
- anyOf:
- - type: string
- enum:
- - extreme_early
- - early
- - intermediate
- - late
- - extreme_late
- - type: "null"
- description: MCTQ chronotype band off MSFsc, null while learning.
- socialJetlagMinutes:
- description: Social jetlag = circular |MSF_work − MSF_free| in minutes, null when one side is missing.
- type:
- - number
- - "null"
- freeNightsCounted:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- workNightsCounted:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- freeNightsUntilReady:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Free-day nights still needed before a band is asserted.
- required:
- - state
- - msfMinutes
- - msfScMinutes
- - band
- - socialJetlagMinutes
- - freeNightsCounted
- - workNightsCounted
- - freeNightsUntilReady
- additionalProperties: false
- averagePerNight:
+ data:
+ $ref: "#/components/schemas/ExternalIdDeleteResult"
+ error:
+ type: "null"
+ meta:
type: object
properties:
- state:
+ requestId:
type: string
- enum:
- - partial
- - ready
- averageMinutes:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Mean asleep minutes per scorable night (0 while partial).
- nightsCounted:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- nightsUntilReady:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Scorable nights still needed before the average is asserted.
- required:
- - state
- - averageMinutes
- - nightsCounted
- - nightsUntilReady
additionalProperties: false
required:
- - sleepDebt
- - chronotype
- - averagePerNight
+ - data
+ - error
additionalProperties: false
- description: "Server-authoritative sleep-rhythm read: the outstanding sleep-debt balance over the rolling window + MCTQ
- chronotype (MSF/MSFsc band, social jetlag). Free vs work nights default to weekend = free in the user's timezone
- (no work calendar). A view over existing per-stage SLEEP_DURATION rows — no schema, no new type."
- ListWorkoutsResponse:
+ ActivityCalendarEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/WorkoutListResponse"
+ $ref: "#/components/schemas/ActivityCalendar"
error:
type: "null"
meta:
@@ -56342,680 +60787,1134 @@ components:
- data
- error
additionalProperties: false
- WorkoutListResponse:
+ ActivityCalendar:
type: object
properties:
- workouts:
+ period:
+ type: string
+ enum:
+ - week
+ - month
+ start:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ end:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ gridStart:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ description: First day drawn (the Monday on or before `start`).
+ gridEnd:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ description: Last day drawn (the Sunday on or after `end`).
+ today:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ timezone:
+ type: string
+ description: The IANA zone the days are cut in.
+ loadType:
+ anyOf:
+ - type: string
+ enum:
+ - DAY_STRAIN
+ - CARDIO_LOAD
+ - STRAIN_SCORE
+ - type: "null"
+ description: Which training-load score `load` carries; null when the account has none.
+ days:
type: array
items:
- $ref: "#/components/schemas/WorkoutListEntry"
- meta:
+ type: object
+ properties:
+ date:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ inPeriod:
+ type: boolean
+ future:
+ type: boolean
+ steps:
+ type:
+ - number
+ - "null"
+ activeMinutes:
+ description: The larger of the day's exercise minutes and workout minutes (never their sum).
+ type:
+ - number
+ - "null"
+ workoutCount:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ workoutsBySport:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ load:
+ type:
+ - number
+ - "null"
+ level:
+ type: object
+ properties:
+ steps:
+ type: string
+ enum:
+ - none
+ - unrated
+ - in_progress
+ - low
+ - below
+ - usual
+ - above
+ - high
+ description: "Where the day sits in the person's own spread over the 84 days before the period: `low` below their 10th
+ percentile, `below` below the 25th, `above` above the 75th, `high` above the 90th, `usual`
+ between. `none` = no value that day; `unrated` = fewer than 14 days of history to compare with;
+ `in_progress` = today, which has not ended and is never rated."
+ activeMinutes:
+ type: string
+ enum:
+ - none
+ - unrated
+ - in_progress
+ - low
+ - below
+ - usual
+ - above
+ - high
+ description: "Where the day sits in the person's own spread over the 84 days before the period: `low` below their 10th
+ percentile, `below` below the 25th, `above` above the 75th, `high` above the 90th, `usual`
+ between. `none` = no value that day; `unrated` = fewer than 14 days of history to compare with;
+ `in_progress` = today, which has not ended and is never rated."
+ load:
+ type: string
+ enum:
+ - none
+ - unrated
+ - in_progress
+ - low
+ - below
+ - usual
+ - above
+ - high
+ description: "Where the day sits in the person's own spread over the 84 days before the period: `low` below their 10th
+ percentile, `below` below the 25th, `above` above the 75th, `high` above the 90th, `usual`
+ between. `none` = no value that day; `unrated` = fewer than 14 days of history to compare with;
+ `in_progress` = today, which has not ended and is never rated."
+ required:
+ - steps
+ - activeMinutes
+ - load
+ additionalProperties: false
+ required:
+ - date
+ - inPeriod
+ - future
+ - steps
+ - activeMinutes
+ - workoutCount
+ - workoutsBySport
+ - load
+ - level
+ additionalProperties: false
+ weeks:
+ type: array
+ items:
+ type: object
+ properties:
+ start:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ end:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ steps:
+ type:
+ - number
+ - "null"
+ activeMinutes:
+ type:
+ - number
+ - "null"
+ workouts:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ goals:
+ type: array
+ items:
+ $ref: "#/components/schemas/ActivityGoalProgress"
+ description: The weekly goals for a week that has begun.
+ required:
+ - start
+ - end
+ - steps
+ - activeMinutes
+ - workouts
+ - goals
+ additionalProperties: false
+ baseline:
type: object
properties:
- total:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- limit:
- type: integer
- exclusiveMinimum: 0
- maximum: 9007199254740991
- offset:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- droppedDuplicates:
- type: integer
- minimum: 0
- maximum: 9007199254740991
+ steps:
+ $ref: "#/components/schemas/ActivityBaselineStats"
+ activeMinutes:
+ $ref: "#/components/schemas/ActivityBaselineStats"
+ load:
+ $ref: "#/components/schemas/ActivityBaselineStats"
required:
- - total
- - limit
- - offset
- - droppedDuplicates
+ - steps
+ - activeMinutes
+ - load
additionalProperties: false
- trainingLoad:
- description: v1.44 — on the first page (`offset=0`) only, account-wide whatever the filter. Absent on later pages and
- older servers.
- $ref: "#/components/schemas/WorkoutTrainingLoad"
- required:
- - workouts
- - meta
- additionalProperties: false
- WorkoutListEntry:
- type: object
- properties:
- id:
+ summary:
+ type: object
+ properties:
+ steps:
+ $ref: "#/components/schemas/ActivityPeriodComparison"
+ activeMinutes:
+ $ref: "#/components/schemas/ActivityPeriodComparison"
+ workouts:
+ $ref: "#/components/schemas/ActivityPeriodComparison"
+ load:
+ $ref: "#/components/schemas/ActivityPeriodComparison"
+ required:
+ - steps
+ - activeMinutes
+ - workouts
+ - load
+ additionalProperties: false
+ sports:
+ type: array
+ items:
+ type: object
+ properties:
+ sportType:
+ type: string
+ count:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - sportType
+ - count
+ additionalProperties: false
+ goals:
+ $ref: "#/components/schemas/ActivityGoals"
+ goalProgress:
+ type: array
+ items:
+ $ref: "#/components/schemas/ActivityGoalProgress"
+ available:
+ type: object
+ properties:
+ steps:
+ type: boolean
+ activeMinutes:
+ type: boolean
+ workouts:
+ type: boolean
+ load:
+ type: boolean
+ required:
+ - steps
+ - activeMinutes
+ - workouts
+ - load
+ additionalProperties: false
+ previous:
type: string
- sportType:
- type:
- - string
- - "null"
- startedAt:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- endedAt:
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ description: A day in the previous period.
+ next:
anyOf:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: "null"
- durationSec:
- anyOf:
- - type: integer
- minimum: 0
- maximum: 9007199254740991
- - type: "null"
- distanceM:
- type:
- - number
- - "null"
- activeEnergyKcal:
- type:
- - number
- - "null"
- avgHr:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- maxHr:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- type: "null"
- source:
- $ref: "#/components/schemas/MeasurementSource"
- externalId:
- type:
- - string
- - "null"
- hasRoute:
- type: boolean
- hasHrSeries:
+ description: A day in the next period, or null when that lies after today.
+ required:
+ - period
+ - start
+ - end
+ - gridStart
+ - gridEnd
+ - today
+ - timezone
+ - loadType
+ - days
+ - weeks
+ - baseline
+ - summary
+ - sports
+ - goals
+ - goalProgress
+ - available
+ - previous
+ - next
+ additionalProperties: false
+ ActivityGoalProgress:
+ type: object
+ properties:
+ key:
+ type: string
+ enum:
+ - workoutsPerWeek
+ - activeMinutesPerWeek
+ - stepsPerWeek
+ - stepsPerMonth
+ target:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ value:
+ type: number
+ met:
type: boolean
required:
- - id
- - sportType
- - startedAt
- - endedAt
- - durationSec
- - distanceM
- - activeEnergyKcal
- - avgHr
- - maxHr
- - source
- - externalId
- - hasRoute
- - hasHrSeries
+ - key
+ - target
+ - value
+ - met
additionalProperties: false
- WorkoutTrainingLoad:
+ ActivityBaselineStats:
anyOf:
- type: object
properties:
- status:
- type: string
- const: ok
- asOf:
- type: string
- description: The last rated UTC day, at most yesterday; the figures are those of this day. The series runs on to
- yesterday, so a later stretch without data shows as unrated days.
- ctl:
+ median:
type: number
- description: "Fitness: 42-day exponentially weighted TRIMP."
- atl:
+ p10:
type: number
- description: "Fatigue: 7-day exponentially weighted TRIMP."
- tsb:
+ p25:
type: number
- description: "Form: fitness minus fatigue at `asOf`."
- daysCovered:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- trainingDays:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- recentRatedDays:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: "Rated days of the trailing `recentDays` (42 up to yesterday, or fewer when covered less): a stored
- impulse, or activity data without a workout."
- recentDays:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- warmingUp:
- type: boolean
- description: "True below 42 covered days: both averages start at zero."
- series:
- type: array
- items:
- type: object
- properties:
- day:
- type: string
- ctl:
- type: number
- atl:
- type: number
- tsb:
- type: number
- rated:
- type: boolean
- description: "False for a day that could not be rated: no stored impulse and no activity data (steps, heart rate, active
- energy), or a workout that was never scored. The averages held through it rather than counting it
- as rest. A day with activity data and no workout is rest (impulse 0)."
- required:
- - day
- - ctl
- - atl
- - tsb
- - rated
- additionalProperties: false
- description: The trailing 90 days, oldest first; `tsb` is form going into the day.
- required:
- - status
- - asOf
- - ctl
- - atl
- - tsb
- - daysCovered
- - trainingDays
- - recentRatedDays
- - recentDays
- - warmingUp
- - series
- additionalProperties: false
- - type: object
- properties:
- status:
- type: string
- const: insufficient
- reason:
- type: string
- enum:
- - no_impulse_history
- - too_little_history
- daysCovered:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- trainingDays:
+ p75:
+ type: number
+ p90:
+ type: number
+ days:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
+ description: Days with a value the spread was computed from.
required:
- - status
- - reason
- - daysCovered
- - trainingDays
- additionalProperties: false
- description: "v1.44 — the fitness-fatigue model over the stored daily heart-rate training impulse (Banister TRIMP; a day
- with activity data but no training is 0, a day with no data or an unscored workout is not rated and the averages
- hold through it). Needs 28 days and three training days. TRIMP units: comparable with the person's own past
- only."
- GetWorkoutResponse:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/WorkoutDetailResponse"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
+ - median
+ - p10
+ - p25
+ - p75
+ - p90
+ - days
additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- WorkoutDetailResponse:
+ - type: "null"
+ ActivityPeriodComparison:
type: object
properties:
- id:
- type: string
- sportType:
- type: string
- startedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- endedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- dayKey:
- type: string
- durationSec:
+ value:
+ description: "The period so far: a total (steps, active minutes, workouts) or a mean (load)."
+ type:
+ - number
+ - "null"
+ daysWithData:
type: integer
- minimum: 0
+ minimum: -9007199254740991
maximum: 9007199254740991
- distanceM:
+ completedDays:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Days of the period that have ended (today excluded).
+ completedValue:
+ description: "`value` over the completed days only. This, not `value`, is what `usualToDate` is compared with, so a
+ running period is never judged on today's partial day."
type:
- number
- "null"
- activeEnergyKcal:
+ usual:
+ description: "The person's usual full period: the median of the twelve weeks (or, per day, of the six months) before it.
+ Null with fewer than three earlier periods of data."
type:
- number
- "null"
- avgHr:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- maxHr:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- minHr:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- storedAvgHr:
- description: The row's own average heart rate (v1.42). `avgHr` may be filled in from a same-session twin by the
- canonical picker; this is the stored value, which an edit of a hand-entered workout sends back so the twin's
- value is not written onto it.
+ usualToDate:
+ description: The usual figure for the completed days (today excluded); equals `usual` once the period is over, null
+ before the period's first day has ended.
+ type:
+ - number
+ - "null"
+ referencePeriods:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - value
+ - daysWithData
+ - completedDays
+ - completedValue
+ - usual
+ - usualToDate
+ - referencePeriods
+ additionalProperties: false
+ ActivityGoals:
+ type: object
+ properties:
+ workoutsPerWeek:
anyOf:
- type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- type: "null"
- storedMaxHr:
- description: The row's own maximum heart rate (v1.42), as `storedAvgHr` is to `avgHr`.
+ activeMinutesPerWeek:
anyOf:
- type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- type: "null"
- stepCount:
+ stepsPerWeek:
anyOf:
- type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- type: "null"
- elevationM:
- type:
- - number
- - "null"
- pauseDurationSec:
+ stepsPerMonth:
anyOf:
- type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- type: "null"
- source:
- $ref: "#/components/schemas/MeasurementSource"
- externalId:
- type:
- - string
- - "null"
- metadata:
- anyOf:
- - {}
- - type: "null"
- route:
- anyOf:
- - $ref: "#/components/schemas/WorkoutRouteGeometry"
- - type: "null"
- samples:
- anyOf:
- - $ref: "#/components/schemas/WorkoutHrSeries"
- - type: "null"
- hrSeries:
- anyOf:
- - $ref: "#/components/schemas/WorkoutHrCurve"
- - type: "null"
- zones:
- anyOf:
- - $ref: "#/components/schemas/WorkoutZones"
- - type: "null"
- splits:
- anyOf:
- - type: array
- items:
- $ref: "#/components/schemas/WorkoutSplit"
- - type: "null"
- sportContext:
- anyOf:
- - $ref: "#/components/schemas/WorkoutSportContext"
- - type: "null"
- aiInsight:
- anyOf:
- - $ref: "#/components/schemas/WorkoutActivityInsight"
- - type: "null"
- ai:
- description: The `workoutInsights` AI capability. While it is unavailable `aiInsight` is null and the stored paragraph
- is not even read.
- $ref: "#/components/schemas/AiCapabilityState"
- canonicalId:
- type: string
- previousWorkoutId:
- type:
- - string
- - "null"
required:
- - id
- - sportType
- - startedAt
- - endedAt
- - dayKey
- - durationSec
- - distanceM
- - activeEnergyKcal
- - avgHr
- - maxHr
- - minHr
- - stepCount
- - elevationM
- - pauseDurationSec
- - source
- - externalId
- - metadata
- - route
- - samples
- - hrSeries
- - zones
- - splits
- - sportContext
- - aiInsight
- - ai
- - canonicalId
- - previousWorkoutId
+ - workoutsPerWeek
+ - activeMinutesPerWeek
+ - stepsPerWeek
+ - stepsPerMonth
additionalProperties: false
- WorkoutRouteGeometry:
+ description: The person's own goals; `null` = not set. There is no default goal.
+ ActivityGoalsEnvelope:
type: object
properties:
- geometry: {}
- sampleTimestamps:
- anyOf:
- - type: array
- items:
- anyOf:
- - type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- - type: object
- properties:
- t:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- speedMs:
- type: number
- hr:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- required:
- - t
- additionalProperties: false
- - type: "null"
- description: "One entry per geometry point, as the track was stored: a bare instant, or (from the workout batch and the
- Apple Health export) an object with its instant and, where recorded, speed (m/s) and heart rate (bpm)."
+ data:
+ $ref: "#/components/schemas/ActivityGoals"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
required:
- - geometry
- - sampleTimestamps
+ - data
+ - error
additionalProperties: false
- WorkoutHrSeries:
+ ActivityGoalsPatchEnvelope:
type: object
properties:
- sampleCount:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- samples: {}
+ data:
+ $ref: "#/components/schemas/ActivityGoals"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
required:
- - sampleCount
- - samples
+ - data
+ - error
additionalProperties: false
- WorkoutHrCurve:
+ DayProvenanceEnvelope:
type: object
properties:
- source:
+ data:
+ $ref: "#/components/schemas/DayProvenance"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ DayProvenance:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - WEIGHT
+ - BLOOD_PRESSURE_SYS
+ - BLOOD_PRESSURE_DIA
+ - PULSE
+ - BODY_FAT
+ - SLEEP_DURATION
+ - ACTIVITY_STEPS
+ - BLOOD_GLUCOSE
+ - TOTAL_BODY_WATER
+ - BONE_MASS
+ - OXYGEN_SATURATION
+ - HEART_RATE_VARIABILITY
+ - RESTING_HEART_RATE
+ - ACTIVE_ENERGY_BURNED
+ - FLIGHTS_CLIMBED
+ - WALKING_RUNNING_DISTANCE
+ - VO2_MAX
+ - BODY_TEMPERATURE
+ - FAT_FREE_MASS
+ - FAT_MASS
+ - MUSCLE_MASS
+ - SKIN_TEMPERATURE
+ - PULSE_WAVE_VELOCITY
+ - VASCULAR_AGE
+ - VISCERAL_FAT
+ - AUDIO_EXPOSURE_ENV
+ - AUDIO_EXPOSURE_HEADPHONE
+ - TIME_IN_DAYLIGHT
+ - WALKING_STEADINESS
+ - AUDIO_EXPOSURE_EVENT
+ - RESPIRATORY_RATE
+ - BODY_MASS_INDEX
+ - LEAN_BODY_MASS
+ - WALKING_HEART_RATE_AVERAGE
+ - WALKING_ASYMMETRY
+ - WALKING_DOUBLE_SUPPORT
+ - WALKING_STEP_LENGTH
+ - WALKING_SPEED
+ - CARDIO_RECOVERY
+ - WRIST_TEMPERATURE
+ - FALL_COUNT
+ - SIX_MINUTE_WALK_DISTANCE
+ - STAIR_ASCENT_SPEED
+ - STAIR_DESCENT_SPEED
+ - BREATHING_DISTURBANCES
+ - IRREGULAR_RHYTHM_NOTIFICATION
+ - HIGH_HEART_RATE_EVENT
+ - LOW_HEART_RATE_EVENT
+ - WALKING_STEADINESS_EVENT
+ - BREATHING_DISTURBANCE_EVENT
+ - HYPERTENSION_EVENT
+ - RECOVERY_SCORE
+ - STRESS_SCORE
+ - STRAIN_SCORE
+ - HRV_RMSSD
+ - DAY_STRAIN
+ - WORKOUT_STRAIN
+ - SLEEP_PERFORMANCE
+ - SLEEP_EFFICIENCY
+ - SLEEP_CONSISTENCY
+ - SLEEP_NEED
+ - ENERGY_EXPENDITURE_KJ
+ - AVERAGE_HEART_RATE
+ - MAX_HEART_RATE
+ - SLEEP_DISTURBANCE_COUNT
+ - ANS_CHARGE
+ - CARDIO_LOAD
+ - SLEEP_SCORE
+ - BODY_TEMPERATURE_DEVIATION
+ - RESILIENCE
+ - PHQ9_SCORE
+ - GAD7_SCORE
+ - GRIP_STRENGTH
+ - PAIN_NRS
+ - WAIST_CIRCUMFERENCE
+ - WAIST_TO_HEIGHT
+ - WHO5_SCORE
+ - SCI_SCORE
+ - EXERCISE_MINUTES
+ - STAND_MINUTES
+ - STAND_HOURS
+ - MINDFUL_MINUTES
+ - STATE_OF_MIND_VALENCE
+ - AFIB_BURDEN
+ - INDOOR_CO2
+ - INDOOR_TEMPERATURE
+ - INDOOR_HUMIDITY
+ - BODY_BATTERY
+ - STRESS_LEVEL
+ - TRAINING_READINESS
+ - ACUTE_TRAINING_LOAD
+ - BASAL_ENERGY_BURNED
+ - BLOOD_KETONES
+ - LOW_CARDIO_FITNESS_EVENT
+ - MENOPAUSAL_STATE
+ - BLEEDING_AFTER_MENOPAUSE
+ - INSULIN_DELIVERY
+ - INHALER_USAGE
+ - FEV1
+ - FVC
+ - PEAK_EXPIRATORY_FLOW
+ - WORKOUT_EFFORT_SCORE
+ - ESTIMATED_WORKOUT_EFFORT_SCORE
+ - PHYSICAL_EFFORT
+ - CYCLING_DISTANCE
+ - ROWING_DISTANCE
+ - ROWING_SPEED
+ - RUNNING_SPEED
+ - RUNNING_POWER
+ - RUNNING_GROUND_CONTACT_TIME
+ - RUNNING_VERTICAL_OSCILLATION
+ - RUNNING_STRIDE_LENGTH
+ date:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ aggregation:
type: string
enum:
- - workout_series
- - pulse_window
- bucketSec:
- type: integer
- exclusiveMinimum: 0
- maximum: 9007199254740991
- points:
+ - sum
+ - mean
+ ranked:
+ type: boolean
+ metricKey:
+ type:
+ - string
+ - "null"
+ ladder:
+ type: array
+ items:
+ type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
+ picked:
+ anyOf:
+ - type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
+ - type: "null"
+ pickReason:
+ anyOf:
+ - type: string
+ enum:
+ - only_source
+ - highest_on_ladder
+ - name_tiebreak
+ - not_ranked
+ description: "`only_source`: one source that day. `highest_on_ladder`: it stands highest on the ladder among the day's
+ sources. `name_tiebreak`: none of them is on the ladder, the source name decided. `not_ranked`: this
+ metric has no ladder, every source counts."
+ - type: "null"
+ sources:
type: array
items:
type: object
properties:
- tSec:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- mean:
+ source:
+ type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
+ rank:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- min:
+ description: Position on the ladder, 0 = highest; 90 = not on the ladder.
+ readings:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
+ value:
+ description: "The day's value from this source: the day total for a cumulative metric (sleep counts asleep stages only),
+ the mean of the readings otherwise."
+ type:
+ - number
+ - "null"
+ min:
+ type:
+ - number
+ - "null"
max:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
+ type:
+ - number
+ - "null"
+ firstAt:
+ type: string
+ description: ISO instant of the first reading that day.
+ lastAt:
+ type: string
+ unit:
+ type:
+ - string
+ - "null"
+ devices:
+ type: array
+ items:
+ type: string
+ description: Device kinds the readings carry; `unknown` when untagged.
+ pass:
+ anyOf:
+ - type: string
+ enum:
+ - lower_on_ladder
+ - not_on_ladder
+ - name_tiebreak
+ - type: "null"
+ description: Why this source was not the one picked; null for the picked one.
required:
- - tSec
- - mean
+ - source
+ - rank
+ - readings
+ - value
- min
- max
+ - firstAt
+ - lastAt
+ - unit
+ - devices
+ - pass
additionalProperties: false
- envelope:
- type: boolean
required:
- - source
- - bucketSec
- - points
- - envelope
+ - type
+ - date
+ - aggregation
+ - ranked
+ - metricKey
+ - ladder
+ - picked
+ - pickReason
+ - sources
additionalProperties: false
- WorkoutZones:
+ SourceComparisonEnvelope:
type: object
properties:
- model:
+ data:
+ $ref: "#/components/schemas/SourceComparison"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ SourceComparison:
+ type: object
+ properties:
+ type:
type: string
enum:
- - whoop
- - tanaka
- hrMax:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- zones:
+ - WEIGHT
+ - BLOOD_PRESSURE_SYS
+ - BLOOD_PRESSURE_DIA
+ - PULSE
+ - BODY_FAT
+ - SLEEP_DURATION
+ - ACTIVITY_STEPS
+ - BLOOD_GLUCOSE
+ - TOTAL_BODY_WATER
+ - BONE_MASS
+ - OXYGEN_SATURATION
+ - HEART_RATE_VARIABILITY
+ - RESTING_HEART_RATE
+ - ACTIVE_ENERGY_BURNED
+ - FLIGHTS_CLIMBED
+ - WALKING_RUNNING_DISTANCE
+ - VO2_MAX
+ - BODY_TEMPERATURE
+ - FAT_FREE_MASS
+ - FAT_MASS
+ - MUSCLE_MASS
+ - SKIN_TEMPERATURE
+ - PULSE_WAVE_VELOCITY
+ - VASCULAR_AGE
+ - VISCERAL_FAT
+ - AUDIO_EXPOSURE_ENV
+ - AUDIO_EXPOSURE_HEADPHONE
+ - TIME_IN_DAYLIGHT
+ - WALKING_STEADINESS
+ - AUDIO_EXPOSURE_EVENT
+ - RESPIRATORY_RATE
+ - BODY_MASS_INDEX
+ - LEAN_BODY_MASS
+ - WALKING_HEART_RATE_AVERAGE
+ - WALKING_ASYMMETRY
+ - WALKING_DOUBLE_SUPPORT
+ - WALKING_STEP_LENGTH
+ - WALKING_SPEED
+ - CARDIO_RECOVERY
+ - WRIST_TEMPERATURE
+ - FALL_COUNT
+ - SIX_MINUTE_WALK_DISTANCE
+ - STAIR_ASCENT_SPEED
+ - STAIR_DESCENT_SPEED
+ - BREATHING_DISTURBANCES
+ - IRREGULAR_RHYTHM_NOTIFICATION
+ - HIGH_HEART_RATE_EVENT
+ - LOW_HEART_RATE_EVENT
+ - WALKING_STEADINESS_EVENT
+ - BREATHING_DISTURBANCE_EVENT
+ - HYPERTENSION_EVENT
+ - RECOVERY_SCORE
+ - STRESS_SCORE
+ - STRAIN_SCORE
+ - HRV_RMSSD
+ - DAY_STRAIN
+ - WORKOUT_STRAIN
+ - SLEEP_PERFORMANCE
+ - SLEEP_EFFICIENCY
+ - SLEEP_CONSISTENCY
+ - SLEEP_NEED
+ - ENERGY_EXPENDITURE_KJ
+ - AVERAGE_HEART_RATE
+ - MAX_HEART_RATE
+ - SLEEP_DISTURBANCE_COUNT
+ - ANS_CHARGE
+ - CARDIO_LOAD
+ - SLEEP_SCORE
+ - BODY_TEMPERATURE_DEVIATION
+ - RESILIENCE
+ - PHQ9_SCORE
+ - GAD7_SCORE
+ - GRIP_STRENGTH
+ - PAIN_NRS
+ - WAIST_CIRCUMFERENCE
+ - WAIST_TO_HEIGHT
+ - WHO5_SCORE
+ - SCI_SCORE
+ - EXERCISE_MINUTES
+ - STAND_MINUTES
+ - STAND_HOURS
+ - MINDFUL_MINUTES
+ - STATE_OF_MIND_VALENCE
+ - AFIB_BURDEN
+ - INDOOR_CO2
+ - INDOOR_TEMPERATURE
+ - INDOOR_HUMIDITY
+ - BODY_BATTERY
+ - STRESS_LEVEL
+ - TRAINING_READINESS
+ - ACUTE_TRAINING_LOAD
+ - BASAL_ENERGY_BURNED
+ - BLOOD_KETONES
+ - LOW_CARDIO_FITNESS_EVENT
+ - MENOPAUSAL_STATE
+ - BLEEDING_AFTER_MENOPAUSE
+ - INSULIN_DELIVERY
+ - INHALER_USAGE
+ - FEV1
+ - FVC
+ - PEAK_EXPIRATORY_FLOW
+ - WORKOUT_EFFORT_SCORE
+ - ESTIMATED_WORKOUT_EFFORT_SCORE
+ - PHYSICAL_EFFORT
+ - CYCLING_DISTANCE
+ - ROWING_DISTANCE
+ - ROWING_SPEED
+ - RUNNING_SPEED
+ - RUNNING_POWER
+ - RUNNING_GROUND_CONTACT_TIME
+ - RUNNING_VERTICAL_OSCILLATION
+ - RUNNING_STRIDE_LENGTH
+ from:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ to:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ aggregation:
+ type: string
+ enum:
+ - sum
+ - mean
+ ranked:
+ type: boolean
+ ladder:
+ type: array
+ items:
+ type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
+ unit:
+ type:
+ - string
+ - "null"
+ sources:
type: array
items:
type: object
properties:
- zone:
- type: integer
- minimum: 1
- maximum: 5
- lowBpm:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- highBpm:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- seconds:
+ source:
+ type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
+ days:
type: integer
- minimum: 0
+ minimum: -9007199254740991
maximum: 9007199254740991
required:
- - zone
- - lowBpm
- - highBpm
- - seconds
+ - source
+ - days
additionalProperties: false
- required:
- - model
- - hrMax
- - zones
- additionalProperties: false
- WorkoutSplit:
- type: object
- properties:
- km:
- type: integer
- exclusiveMinimum: 0
- maximum: 9007199254740991
- durationSec:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- paceSecPerKm:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- required:
- - km
- - durationSec
- - paceSecPerKm
- additionalProperties: false
- WorkoutSportContext:
- type: object
- properties:
- count:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- avgDurationSec:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- avgDistanceM:
- type:
- - number
- - "null"
- avgAvgHr:
+ a:
anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- required:
- - count
- - avgDurationSec
- - avgDistanceM
- - avgAvgHr
- additionalProperties: false
- WorkoutActivityInsight:
- type: object
- properties:
- paragraph:
- type: string
- generatedAt:
- type: string
- format: date-time
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- required:
- - paragraph
- - generatedAt
- additionalProperties: false
- AiUnavailableReason:
- type: string
- enum:
- - check_failed
- - operator_disabled
- - not_permitted_for_record
- - module_disabled
- - user_disabled
- - usage_level
- - no_provider
- - consent_required
- description: "Why an AI capability is unavailable, listed in precedence order; only the outermost reason that applies is
- reported, because it names the layer that would have to change first. `check_failed` — an input could not be
- read and the answer failed closed. `operator_disabled` — the operator's master switch, the capability's own
- switch, or the operator's instance-wide availability of its module. `not_permitted_for_record` — AI work is not
- admitted for this record (a delegate inside somebody else's record). `module_disabled` — an owning module is off
- for this record, by its own switch or by the edge of the active grant. `user_disabled` — the record's own AI
- opt-out: the Coach preference for the Coach, the `insights` module (AI analysis) for everything else.
- `usage_level` — the record's AI usage level (`ai.usage.level`, v1.43) is below what the capability needs; today
- only `supplementLabel` on `frugal`. `no_provider` — no configured provider can serve this capability's input.
- `consent_required` — the provider chain needs an AI consent receipt and none is active. The list is closed; a
- client that meets a value it does not know treats the capability as unavailable."
- AiCapabilityState:
- type: object
- properties:
- available:
- type: boolean
- reason:
+ - type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
+ - type: "null"
+ b:
anyOf:
- - $ref: "#/components/schemas/AiUnavailableReason"
+ - type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
- type: "null"
- description: "`null` exactly when `available` is true."
- onDeviceAllowed:
- type: boolean
- description: "Whether an on-device model may do this work. False for `operator_disabled`, `not_permitted_for_record`,
- `module_disabled`, `user_disabled`, `usage_level` and `check_failed`: the operator's and the person's
- decisions hold on the device too. True otherwise, since a missing server provider or a missing consent for
- server egress do not concern a model that runs on the device. Resolved here so the client never decides
- which reasons apply off the server."
- required:
- - available
- - reason
- - onDeviceAllowed
- additionalProperties: false
- description: "One AI capability, resolved for one record from every layer that can say no. Render from it; never
- recompute it. Data never depends on it: measurements, scores, statistics and device records load whatever it
- says."
- DeleteWorkoutResponse:
- type: object
- properties:
- data:
+ days:
+ type: array
+ items:
+ type: object
+ properties:
+ date:
+ type: string
+ format: date
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
+ a:
+ type:
+ - number
+ - "null"
+ b:
+ type:
+ - number
+ - "null"
+ picked:
+ anyOf:
+ - type: string
+ enum:
+ - MANUAL
+ - WITHINGS
+ - IMPORT
+ - APPLE_HEALTH
+ - COMPUTED
+ - WHOOP
+ - FITBIT
+ - NIGHTSCOUT
+ - POLAR
+ - OURA
+ - TELEGRAM
+ - MCP
+ - GOOGLE_HEALTH
+ - STRAVA
+ - EXTERNAL
+ - HEALTH_CONNECT
+ - GARMIN
+ - type: "null"
+ required:
+ - date
+ - a
+ - b
+ - picked
+ additionalProperties: false
+ summary:
type: object
properties:
- deleted:
- type: boolean
- const: true
+ daysA:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ daysB:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ daysBoth:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ meanA:
+ type:
+ - number
+ - "null"
+ meanB:
+ type:
+ - number
+ - "null"
+ meanDifference:
+ type:
+ - number
+ - "null"
+ meanAbsoluteDifference:
+ type:
+ - number
+ - "null"
+ pickedA:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ pickedB:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
required:
- - deleted
- additionalProperties: false
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
+ - daysA
+ - daysB
+ - daysBoth
+ - meanA
+ - meanB
+ - meanDifference
+ - meanAbsoluteDifference
+ - pickedA
+ - pickedB
additionalProperties: false
required:
- - data
- - error
+ - type
+ - from
+ - to
+ - aggregation
+ - ranked
+ - ladder
+ - unit
+ - sources
+ - a
+ - b
+ - days
+ - summary
additionalProperties: false
- BatchWorkoutsResponse:
+ DeviceRegisterResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/WorkoutBatchResponse"
+ type: object
+ properties:
+ id:
+ type: string
+ push:
+ $ref: "#/components/schemas/DevicePushState"
+ required:
+ - id
+ - push
+ additionalProperties: false
error:
type: "null"
meta:
@@ -57028,90 +61927,114 @@ components:
- data
- error
additionalProperties: false
- WorkoutBatchResponse:
+ DevicePushState:
type: object
properties:
- processed:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Entries in the request. Equals `inserted + duplicates + skipped.length`.
- inserted:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Workout rows this request wrote.
- duplicates:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Entries that wrote no workout row because the workout was already stored. The top-level counters count
- workout rows, so an entry reported as `enriched` counts here as well even though its heart-rate series or
- GPS track was attached.
- skipped:
- type: array
- items:
- type: object
- properties:
- index:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- reason:
- type: string
- required:
- - index
- - reason
- additionalProperties: false
- entries:
+ transport:
+ type: string
+ enum:
+ - relay
+ - direct
+ - none
+ description: "How pushes reach this device: this server's own APNs key, the relay, or not at all."
+ envelope:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: The envelope version sealed to this device, or null when it gets none.
+ consent:
+ type: boolean
+ description: The person turned the relay on for this device.
+ relayState:
+ type: string
+ enum:
+ - none
+ - bound
+ - rebind_needed
+ - conflict
+ description: "`rebind_needed`: send a fresh `relayBinding`. `conflict`: answer the relay's challenge push directly. A
+ `conflict` not settled by a fresh binding within 30 minutes (the challenge's lifetime) reads `rebind_needed`
+ (v1.49.0)."
+ intakeSync:
+ type: string
+ enum:
+ - ok
+ - degraded
+ description: "`degraded` when the relay is not healthy, the last dose confirmation to this device was dropped and no
+ alert opened since, or the newest alert the relay accepted was never opened although the device reported
+ receipts well after it. Only the last 24 hours count; silent and Live Activity pushes never do, since iOS
+ delivers them at its discretion (v1.49.0). The reason is in the device's push diagnostics."
+ senderKeys:
type: array
items:
- $ref: "#/components/schemas/WorkoutBatchEntryResult"
+ $ref: "#/components/schemas/PushSenderKey"
+ description: The same keys as `push.relay.senderKeys`.
+ relayInstanceId:
+ type:
+ - string
+ - "null"
+ liveActivityConsent:
+ type: boolean
+ description: "The relay holds the device's Live Activity consent: start and update over the relay. Withdrawn with the
+ relay consent."
+ liveActivityStarted:
+ anyOf:
+ - type: object
+ properties:
+ medicationId:
+ type: string
+ slotInstant:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ required:
+ - medicationId
+ - slotInstant
+ additionalProperties: false
+ - type: "null"
+ description: "The dose the Live Activity the server started on this device (over the relay) shows. The start push never
+ carries it, so the app reads it here, and in the `POST /api/devices` answer right after it registers the
+ started Activity's token (`relayStart: true`). Null until the relay accepted the start (a start still in
+ flight or one the relay refused shows null; a refused one is tried again later), when no server start is
+ running, or once that slot is taken, skipped or missed, its medication paused, ended or deleted, or the
+ Activity ended."
required:
- - processed
- - inserted
- - duplicates
- - skipped
- - entries
+ - transport
+ - envelope
+ - consent
+ - relayState
+ - intakeSync
+ - senderKeys
+ - relayInstanceId
+ - liveActivityConsent
+ - liveActivityStarted
additionalProperties: false
- WorkoutBatchEntryResult:
+ PushSenderKey:
type: object
properties:
- index:
- type: integer
- minimum: 0
- maximum: 9007199254740991
+ publicKey:
+ type: string
+ description: X25519 sender public key, 32 bytes, unpadded base64url.
status:
type: string
enum:
- - inserted
- - duplicate
- - enriched
- - updated
- - skipped
- description: "`inserted`: a new workout row. `duplicate`: the workout was already stored and nothing was written; since
- v1.48.2 also an `APPLE_HEALTH` workout whose externalId was deleted through `DELETE
- /api/workouts/by-external-ids`, which stays deleted. `enriched`: the workout was already stored and the
- heart-rate series or GPS track this entry carried (or both) was attached because the stored workout had
- none; no workout row was inserted, and the entry also counts towards the top-level `duplicates`. A track is
- attached only while the account keeps tracks (`storeWorkoutRoutes`), and when the stored workout had no
- elevation, the climb derived from the attached track fills `elevationM`; no other column of the workout row
- is written. `updated` (since v1.40.0): a workout entered by hand (`source: MANUAL`, `externalId` starting
- `manual:`) was sent again with different values and the stored row now carries them; no row was inserted, so
- it also counts towards `duplicates`. `skipped`: the server refused the entry, see `reason`."
- reason:
- description: "Why a `skipped` entry was refused: `unstable_external_id` for an id that does not survive a client
- restart, `invalid_samples` for a heart-rate series that failed validation."
- type: string
+ - next
+ - current
+ - previous
+ description: "`current` seals every envelope now. `next` is the incoming key: published at least 7 days before it seals
+ anything, then it becomes `current` and the old `current` becomes `previous`. `previous` sealed until its
+ retirement and stays published for 30 days after it. Pin every listed key and try each when opening."
required:
- - index
+ - publicKey
- status
additionalProperties: false
- WorkoutsDeleteByExternalIdsResponse:
+ DevicePushDiagnosticsEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/ExternalIdDeleteResult"
+ $ref: "#/components/schemas/DevicePushDiagnostics"
error:
type: "null"
meta:
@@ -57124,74 +62047,440 @@ components:
- data
- error
additionalProperties: false
- ExternalIdDeleteResult:
- type: object
- properties:
- deletedCount:
- type: integer
- minimum: 0
- maximum: 9007199254740991
- description: Rows this call deleted. An id that matched nothing, matched a row of another source or account, or was
- already deleted is not counted.
- required:
- - deletedCount
- additionalProperties: false
- EcgDeleteByExternalIdsResponse:
+ DevicePushDiagnostics:
type: object
properties:
- data:
- $ref: "#/components/schemas/ExternalIdDeleteResult"
- error:
- type: "null"
- meta:
+ deviceId:
+ type: string
+ transport:
+ type: string
+ enum:
+ - relay
+ - direct
+ - none
+ description: "The route the send takes, by the same rule as `push.device.transport`: this server's own APNs key
+ (`direct`), the relay, or none."
+ sealed:
+ type: boolean
+ description: Pushes to this device are sealed envelopes. False for a device without a push key, which gets plaintext
+ pushes over this server's own key, or none.
+ apnsToken:
+ anyOf:
+ - type: object
+ properties:
+ prefix:
+ type:
+ - string
+ - "null"
+ suffix:
+ type:
+ - string
+ - "null"
+ required:
+ - prefix
+ - suffix
+ additionalProperties: false
+ - type: "null"
+ description: "The APNs token masked: its first and last 8 hex characters only, the same mask as the admin diagnostic.
+ Null when the device registered no APNs token."
+ apnsEnvironment:
+ anyOf:
+ - type: string
+ enum:
+ - sandbox
+ - production
+ - type: "null"
+ relay:
type: object
properties:
- requestId:
+ state:
type: string
+ enum:
+ - ok
+ - degraded
+ - down
+ - off
+ since:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ reason:
+ description: As `push.relay.reason`, e.g. `bad_signature` once the relay refused this server's signature three times in
+ a row, or `relay_maintenance` from the relay's own status.
+ type:
+ - string
+ - "null"
+ required:
+ - state
+ - since
+ - reason
additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- CycleDayLogsDeleteByExternalIdsResponse:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/ExternalIdDeleteResult"
- error:
- type: "null"
- meta:
+ description: The instance's relay registration, as `push.relay.state` reads it.
+ binding:
type: object
properties:
- requestId:
+ state:
type: string
+ enum:
+ - none
+ - bound
+ - rebind_needed
+ - conflict
+ description: "As `push.device.relayState`: a `conflict` older than 30 minutes reads `rebind_needed`."
+ consent:
+ type: boolean
+ description: The person turned the relay on for this device.
+ boundAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: When the relay last confirmed the binding.
+ required:
+ - state
+ - consent
+ - boundAt
additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- MoodEntriesDeleteByExternalIdsResponse:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/ExternalIdDeleteResult"
- error:
- type: "null"
- meta:
+ description: This device's relay binding.
+ budget:
type: object
properties:
- requestId:
+ windowMinutes:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "The rolling window every limit counts: 60."
+ limit:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: "Silent pushes of every kind per window over the relay: 6. Null over this server's own APNs key, where no
+ overall cap applies."
+ wakeLimit:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "`DATA_CHANGED` and `HEALTHKIT_CATCH_UP` together per window: 4. Over the relay the last 2 of `limit` stay
+ free for the intake sync."
+ usedInWindow:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Silent pushes sent to this device in the window.
+ wakesUsedInWindow:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Of those, wakes.
+ owedSyncs:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Intake syncs held back by the budget and waiting, coalesced: 0 or 1, however many changes arrived. Held
+ back by this server's count, or refused by the relay for its own (`device_quota`); sent once the budget
+ frees up, never dropped."
+ owedSince:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: Since when the sync is owed.
+ nextFreeAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: "When the next intake sync fits the budget again (an owed one goes then): by this server's count, or later
+ when the relay named a later time with a refusal; null when one fits now."
+ required:
+ - windowMinutes
+ - limit
+ - wakeLimit
+ - usedInWindow
+ - wakesUsedInWindow
+ - owedSyncs
+ - owedSince
+ - nextFreeAt
+ additionalProperties: false
+ description: The device's silent budget, from the rule the send asks (`src/lib/push-relay/wakes.ts`).
+ medicationReminder:
+ type: object
+ properties:
+ delivery:
+ type: string
+ enum:
+ - server
+ - client
+ description: "Who reminds this device of a dose now, by the same decision the send reads: `server` when the server's
+ medication reminder goes to this device (over `transport`, the relay included), `client` while the app
+ reminds locally. The device's `medicationDelivery`, else the account switch; a device that reminds
+ locally counts as `server` once its local plan has run out (`localRunwayUntil`, else 3 days after its
+ last request)."
+ localUntil:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: "While `delivery` is `client`: when the server takes over unless the device reports a new runway or shows
+ up again. Null while `delivery` is `server`."
+ required:
+ - delivery
+ - localUntil
+ additionalProperties: false
+ description: The medication-reminder delivery resolved for this device. A follow-up for a dose still open goes to every
+ device over this server's own key, and over the relay only while `delivery` is `server`.
+ lastDelivery:
+ type: object
+ properties:
+ alert:
+ anyOf:
+ - type: object
+ properties:
+ at:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: When the push was handed on.
+ eventType:
+ type: string
+ description: The push type, e.g. `MEDICATION_REMINDER`, `DATA_CHANGED`.
+ outcome:
+ type: string
+ enum:
+ - pending
+ - accepted
+ - opened
+ - dropped
+ - failed
+ - sent
+ - skipped
+ description: "Over the relay: `pending` (waiting or retrying), `accepted` (the relay took it), `opened` (accepted and
+ covered by a receipt from this device), `dropped` or `failed`. Over this server's own APNs key:
+ `sent` for a silent push, `accepted`, `failed` or `skipped` for an alert."
+ reason:
+ description: The relay's or Apple's reason on a failure; for a `pending` push over the relay, the code it waits on
+ (`bad_signature`, `relay_unavailable`, `relay_paused`, a quota code); else null.
+ type:
+ - string
+ - "null"
+ required:
+ - at
+ - eventType
+ - outcome
+ - reason
+ additionalProperties: false
+ - type: "null"
+ silentSync:
+ anyOf:
+ - type: object
+ properties:
+ at:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: When the push was handed on.
+ eventType:
+ type: string
+ description: The push type, e.g. `MEDICATION_REMINDER`, `DATA_CHANGED`.
+ outcome:
+ type: string
+ enum:
+ - pending
+ - accepted
+ - opened
+ - dropped
+ - failed
+ - sent
+ - skipped
+ description: "Over the relay: `pending` (waiting or retrying), `accepted` (the relay took it), `opened` (accepted and
+ covered by a receipt from this device), `dropped` or `failed`. Over this server's own APNs key:
+ `sent` for a silent push, `accepted`, `failed` or `skipped` for an alert."
+ reason:
+ description: The relay's or Apple's reason on a failure; for a `pending` push over the relay, the code it waits on
+ (`bad_signature`, `relay_unavailable`, `relay_paused`, a quota code); else null.
+ type:
+ - string
+ - "null"
+ required:
+ - at
+ - eventType
+ - outcome
+ - reason
+ additionalProperties: false
+ - type: "null"
+ description: "`MEDICATION_INTAKE_SYNC`."
+ wake:
+ anyOf:
+ - type: object
+ properties:
+ at:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: When the push was handed on.
+ eventType:
+ type: string
+ description: The push type, e.g. `MEDICATION_REMINDER`, `DATA_CHANGED`.
+ outcome:
+ type: string
+ enum:
+ - pending
+ - accepted
+ - opened
+ - dropped
+ - failed
+ - sent
+ - skipped
+ description: "Over the relay: `pending` (waiting or retrying), `accepted` (the relay took it), `opened` (accepted and
+ covered by a receipt from this device), `dropped` or `failed`. Over this server's own APNs key:
+ `sent` for a silent push, `accepted`, `failed` or `skipped` for an alert."
+ reason:
+ description: The relay's or Apple's reason on a failure; for a `pending` push over the relay, the code it waits on
+ (`bad_signature`, `relay_unavailable`, `relay_paused`, a quota code); else null.
+ type:
+ - string
+ - "null"
+ required:
+ - at
+ - eventType
+ - outcome
+ - reason
+ additionalProperties: false
+ - type: "null"
+ description: "`DATA_CHANGED` or `HEALTHKIT_CATCH_UP`."
+ liveActivity:
+ anyOf:
+ - type: object
+ properties:
+ at:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: When the push was handed on.
+ eventType:
+ type: string
+ description: The push type, e.g. `MEDICATION_REMINDER`, `DATA_CHANGED`.
+ outcome:
+ type: string
+ enum:
+ - pending
+ - accepted
+ - opened
+ - dropped
+ - failed
+ - sent
+ - skipped
+ description: "Over the relay: `pending` (waiting or retrying), `accepted` (the relay took it), `opened` (accepted and
+ covered by a receipt from this device), `dropped` or `failed`. Over this server's own APNs key:
+ `sent` for a silent push, `accepted`, `failed` or `skipped` for an alert."
+ reason:
+ description: The relay's or Apple's reason on a failure; for a `pending` push over the relay, the code it waits on
+ (`bad_signature`, `relay_unavailable`, `relay_paused`, a quota code); else null.
+ type:
+ - string
+ - "null"
+ required:
+ - at
+ - eventType
+ - outcome
+ - reason
+ additionalProperties: false
+ - type: "null"
+ required:
+ - alert
+ - silentSync
+ - wake
+ - liveActivity
+ additionalProperties: false
+ description: The newest push of each kind to this device, from the ledger that knows the device. Over the relay, the
+ relay outbox. Over this server's own APNs key, the silent ledger for the sync and the wakes; the alert comes
+ from the account's delivery attempts only while this is the account's one APNs device, because that ledger
+ names no device, and is null otherwise. A Live Activity push over this server's own key leaves no per-device
+ record and stays null.
+ intakeSync:
+ type: object
+ properties:
+ state:
type: string
+ enum:
+ - ok
+ - degraded
+ description: The same value as `push.device.intakeSync`.
+ reason:
+ anyOf:
+ - type: string
+ enum:
+ - relay
+ - intake_recorded_dropped
+ - alert_unconfirmed
+ - type: "null"
+ description: "Why it reads `degraded`, null while `ok`: the relay is not healthy (`relay`); the last dose confirmation
+ to this device was dropped and no alert opened since (`intake_recorded_dropped`); the newest alert the
+ relay accepted in the last 24 hours was never opened although the device reported receipts well after it
+ (`alert_unconfirmed`). Silent and Live Activity pushes never count (v1.49.0)."
+ required:
+ - state
+ - reason
additionalProperties: false
+ description: Whether a dose recorded on another device reaches this one, from the last 24 hours of evidence only.
+ receipt:
+ anyOf:
+ - type: object
+ properties:
+ reportedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ openedAlert:
+ type:
+ - string
+ - "null"
+ openedSilent:
+ type:
+ - string
+ - "null"
+ required:
+ - reportedAt
+ - openedAlert
+ - openedSilent
+ additionalProperties: false
+ - type: "null"
+ description: "The last envelope receipt this device posted (`GET /api/sync/state` `openedAlert` / `openedSilent`): the
+ newest envelope ids it opened per class, kept forward only. Null before the first report."
+ serverTime:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
required:
- - data
- - error
+ - deviceId
+ - transport
+ - sealed
+ - apnsToken
+ - apnsEnvironment
+ - relay
+ - binding
+ - budget
+ - medicationReminder
+ - lastDelivery
+ - intakeSync
+ - receipt
+ - serverTime
additionalProperties: false
- SymptomEventsDeleteByExternalIdsResponse:
+ description: "One device's push state for its diagnostics screen. Only this device: nothing about the account's other
+ devices, no token in clear, no notification content."
+ DeviceRevokeEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/ExternalIdDeleteResult"
+ $ref: "#/components/schemas/DeviceRevokeResponse"
error:
type: "null"
meta:
@@ -57204,28 +62493,37 @@ components:
- data
- error
additionalProperties: false
- MedicationIntakesDeleteByExternalIdsResponse:
+ DeviceRevokeResponse:
type: object
properties:
- data:
- $ref: "#/components/schemas/ExternalIdDeleteResult"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
+ id:
+ type: string
+ revoked:
+ type: boolean
+ const: true
+ refreshTokensRevoked:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Refresh tokens the cascade revoked.
+ accessTokensRevoked:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Access tokens the cascade revoked.
required:
- - data
- - error
+ - id
+ - revoked
+ - refreshTokensRevoked
+ - accessTokensRevoked
additionalProperties: false
- ActivityCalendarEnvelope:
+ description: What the revocation cascade actually removed. The counts let a client say how many credentials were killed
+ rather than only that something happened.
+ AdminPushRelayStatusEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/ActivityCalendar"
+ $ref: "#/components/schemas/AdminPushRelayStatus"
error:
type: "null"
meta:
@@ -57238,445 +62536,306 @@ components:
- data
- error
additionalProperties: false
- ActivityCalendar:
+ AdminPushRelayStatus:
type: object
properties:
- period:
- type: string
- enum:
- - week
- - month
- start:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- end:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- gridStart:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- description: First day drawn (the Monday on or before `start`).
- gridEnd:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- description: Last day drawn (the Sunday on or after `end`).
- today:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- timezone:
- type: string
- description: The IANA zone the days are cut in.
- loadType:
+ allowed:
+ type: boolean
+ available:
+ type: boolean
+ unavailableReason:
anyOf:
- type: string
enum:
- - DAY_STRAIN
- - CARDIO_LOAD
- - STRAIN_SCORE
+ - mode_off
+ - invalid_url
+ - keys_unpinned
- type: "null"
- description: Which training-load score `load` carries; null when the account has none.
- days:
- type: array
- items:
- type: object
- properties:
- date:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- inPeriod:
- type: boolean
- future:
- type: boolean
- steps:
- type:
- - number
- - "null"
- activeMinutes:
- description: The larger of the day's exercise minutes and workout minutes (never their sum).
- type:
- - number
- - "null"
- workoutCount:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- workoutsBySport:
- type: object
- propertyNames:
+ relayHost:
+ type:
+ - string
+ - "null"
+ offered:
+ type: boolean
+ state:
+ type: string
+ enum:
+ - ok
+ - degraded
+ - down
+ - off
+ since:
+ type:
+ - string
+ - "null"
+ reason:
+ description: Why the state is not `ok`, e.g. `bad_signature` (the relay refused this server's signature three times in a
+ row), `relay_degraded`, `relay_maintenance` or `relay_misconfigured` (what the relay's status reports about
+ itself), `circuit_open`, or a registration refusal.
+ type:
+ - string
+ - "null"
+ instanceId:
+ type:
+ - string
+ - "null"
+ tier:
+ type:
+ - string
+ - "null"
+ notice:
+ anyOf:
+ - type: object
+ properties:
+ id:
type: string
- additionalProperties:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- load:
- type:
- - number
- - "null"
- level:
- type: object
- properties:
- steps:
- type: string
- enum:
- - none
- - unrated
- - in_progress
- - low
- - below
- - usual
- - above
- - high
- description: "Where the day sits in the person's own spread over the 84 days before the period: `low` below their 10th
- percentile, `below` below the 25th, `above` above the 75th, `high` above the 90th, `usual`
- between. `none` = no value that day; `unrated` = fewer than 14 days of history to compare with;
- `in_progress` = today, which has not ended and is never rated."
- activeMinutes:
- type: string
- enum:
- - none
- - unrated
- - in_progress
- - low
- - below
- - usual
- - above
- - high
- description: "Where the day sits in the person's own spread over the 84 days before the period: `low` below their 10th
- percentile, `below` below the 25th, `above` above the 75th, `high` above the 90th, `usual`
- between. `none` = no value that day; `unrated` = fewer than 14 days of history to compare with;
- `in_progress` = today, which has not ended and is never rated."
- load:
- type: string
- enum:
- - none
- - unrated
- - in_progress
- - low
- - below
- - usual
- - above
- - high
- description: "Where the day sits in the person's own spread over the 84 days before the period: `low` below their 10th
- percentile, `below` below the 25th, `above` above the 75th, `high` above the 90th, `usual`
- between. `none` = no value that day; `unrated` = fewer than 14 days of history to compare with;
- `in_progress` = today, which has not ended and is never rated."
- required:
- - steps
- - activeMinutes
- - load
- additionalProperties: false
- required:
- - date
- - inPeriod
- - future
- - steps
- - activeMinutes
- - workoutCount
- - workoutsBySport
- - load
- - level
- additionalProperties: false
- weeks:
- type: array
- items:
- type: object
- properties:
- start:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- end:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- steps:
- type:
- - number
- - "null"
- activeMinutes:
- type:
- - number
- - "null"
- workouts:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- goals:
- type: array
- items:
- $ref: "#/components/schemas/ActivityGoalProgress"
- description: The weekly goals for a week that has begun.
- required:
- - start
- - end
- - steps
- - activeMinutes
- - workouts
- - goals
- additionalProperties: false
- baseline:
- type: object
- properties:
- steps:
- $ref: "#/components/schemas/ActivityBaselineStats"
- activeMinutes:
- $ref: "#/components/schemas/ActivityBaselineStats"
- load:
- $ref: "#/components/schemas/ActivityBaselineStats"
- required:
- - steps
- - activeMinutes
- - load
- additionalProperties: false
- summary:
+ level:
+ type:
+ - string
+ - "null"
+ required:
+ - id
+ - level
+ additionalProperties: false
+ - type: "null"
+ lastSuccessAt:
+ type:
+ - string
+ - "null"
+ devices:
type: object
properties:
- steps:
- $ref: "#/components/schemas/ActivityPeriodComparison"
- activeMinutes:
- $ref: "#/components/schemas/ActivityPeriodComparison"
- workouts:
- $ref: "#/components/schemas/ActivityPeriodComparison"
- load:
- $ref: "#/components/schemas/ActivityPeriodComparison"
+ bound:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ consented:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
required:
- - steps
- - activeMinutes
- - workouts
- - load
+ - bound
+ - consented
additionalProperties: false
- sports:
- type: array
- items:
- type: object
- properties:
- sportType:
- type: string
- count:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- required:
- - sportType
- - count
- additionalProperties: false
- goals:
- $ref: "#/components/schemas/ActivityGoals"
- goalProgress:
- type: array
- items:
- $ref: "#/components/schemas/ActivityGoalProgress"
- available:
+ usage:
type: object
properties:
- steps:
- type: boolean
- activeMinutes:
- type: boolean
- workouts:
- type: boolean
- load:
- type: boolean
- required:
- - steps
- - activeMinutes
- - workouts
- - load
- additionalProperties: false
- previous:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- description: A day in the previous period.
- next:
- anyOf:
- - type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- - type: "null"
- description: A day in the next period, or null when that lies after today.
- required:
- - period
- - start
- - end
- - gridStart
- - gridEnd
- - today
- - timezone
- - loadType
- - days
- - weeks
- - baseline
- - summary
- - sports
- - goals
- - goalProgress
- - available
- - previous
- - next
- additionalProperties: false
- ActivityGoalProgress:
- type: object
- properties:
- key:
- type: string
- enum:
- - workoutsPerWeek
- - activeMinutesPerWeek
- - stepsPerWeek
- - stepsPerMonth
- target:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- value:
- type: number
- met:
- type: boolean
- required:
- - key
- - target
- - value
- - met
- additionalProperties: false
- ActivityBaselineStats:
- anyOf:
- - type: object
- properties:
- median:
- type: number
- p10:
- type: number
- p25:
- type: number
- p75:
- type: number
- p90:
- type: number
- days:
+ windowDays:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- description: Days with a value the spread was computed from.
+ accepted:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ pending:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ dropped:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ failed:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ lastFailure:
+ anyOf:
+ - type: object
+ properties:
+ reason:
+ type:
+ - string
+ - "null"
+ at:
+ type: string
+ required:
+ - reason
+ - at
+ additionalProperties: false
+ - type: "null"
required:
- - median
- - p10
- - p25
- - p75
- - p90
- - days
+ - windowDays
+ - accepted
+ - pending
+ - dropped
+ - failed
+ - lastFailure
additionalProperties: false
- - type: "null"
- ActivityPeriodComparison:
- type: object
- properties:
- value:
- description: "The period so far: a total (steps, active minutes, workouts) or a mean (load)."
- type:
- - number
- - "null"
- daysWithData:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- completedDays:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Days of the period that have ended (today excluded).
- completedValue:
- description: "`value` over the completed days only. This, not `value`, is what `usualToDate` is compared with, so a
- running period is never judged on today's partial day."
- type:
- - number
- - "null"
- usual:
- description: "The person's usual full period: the median of the twelve weeks (or, per day, of the six months) before it.
- Null with fewer than three earlier periods of data."
- type:
- - number
- - "null"
- usualToDate:
- description: The usual figure for the completed days (today excluded); equals `usual` once the period is over, null
- before the period's first day has ended.
- type:
- - number
- - "null"
- referencePeriods:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- required:
- - value
- - daysWithData
- - completedDays
- - completedValue
- - usual
- - usualToDate
- - referencePeriods
- additionalProperties: false
- ActivityGoals:
- type: object
- properties:
- workoutsPerWeek:
- anyOf:
- - type: integer
+ description: "What this instance handed the relay in the last `windowDays` days, from its own delivery ledger: counts
+ per outcome and the last failure. Aggregate only."
+ handoff:
+ type: object
+ properties:
+ windowHours:
+ type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- - type: "null"
- activeMinutesPerWeek:
- anyOf:
- - type: integer
+ count:
+ type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- - type: "null"
- stepsPerWeek:
- anyOf:
- - type: integer
+ description: "Pushes the relay answered `accepted` in the window: what the percentiles are computed over."
+ p50Ms:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: The median hand-off time in whole milliseconds; null when `count` is 0.
+ p95Ms:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: The 95th percentile of the hand-off time in whole milliseconds; null when `count` is 0.
+ retried:
+ type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- - type: "null"
- stepsPerMonth:
+ description: How many of the `count` pushes waited for at least one retry on this server, so their time includes its
+ backoff.
+ required:
+ - windowHours
+ - count
+ - p50Ms
+ - p95Ms
+ - retried
+ additionalProperties: false
+ description: "v1.49.0. The hand-off time as this server sees it, over the pushes the relay accepted in the last
+ `windowHours` hours: from queueing a push on this server until the relay answered `accepted`. The relay
+ answers `accepted` only once Apple accepted the push, so the time covers this server's hand-off, the network
+ and the relay's request to Apple. From this instance's own delivery ledger. Aggregate only: nothing per
+ person, device or kind of push."
+ relayCheck:
anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
+ - type: object
+ properties:
+ checkedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: When this server last asked `GET /v1/status`.
+ answeredAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: When the relay last answered it.
+ state:
+ anyOf:
+ - type: string
+ enum:
+ - ok
+ - degraded
+ - maintenance
+ - misconfigured
+ - type: "null"
+ description: The relay's own state in that answer.
+ devices:
+ anyOf:
+ - type: object
+ properties:
+ active:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ provisional:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ limit:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - active
+ - provisional
+ - limit
+ additionalProperties: false
+ - type: "null"
+ description: "This instance's bindings at the relay: active (soft-invalid included), provisional, and its device limit."
+ required:
+ - checkedAt
+ - answeredAt
+ - state
+ - devices
+ additionalProperties: false
- type: "null"
+ description: "v1.49.0. The hourly signed `GET /v1/status`: what the relay last reported about itself and this instance.
+ Null before the first check."
+ termsVersion:
+ type: string
+ termsConfirmationNeeded:
+ type: boolean
+ description: The relay is on, and the terms text the operator accepted is older than `termsVersion`. The relay keeps
+ running; turning it on again with both confirmations records the current text.
+ unbindsPending:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Device unbinds owed to the relay that it has not confirmed yet.
+ unreachableRegistrations:
+ type: array
+ items:
+ type: string
+ description: Relay hosts this server is still registered with but cannot reach under its current settings
+ (`PUSH_RELAY_MODE=off`, a changed `PUSH_RELAY_URL`); they keep its device bindings until it leaves them.
+ termsUrl:
+ type:
+ - string
+ - "null"
+ privacyUrl:
+ type:
+ - string
+ - "null"
+ docsUrl:
+ type: string
+ operatorDecision:
+ description: "As `push.relay.operatorDecision` of `/api/auth/me`: the relay question is open while it is `undecided`."
+ $ref: "#/components/schemas/PushRelayOperatorDecision"
required:
- - workoutsPerWeek
- - activeMinutesPerWeek
- - stepsPerWeek
- - stepsPerMonth
- additionalProperties: false
- description: The person's own goals; `null` = not set. There is no default goal.
- ActivityGoalsEnvelope:
- type: object
- properties:
- data:
- $ref: "#/components/schemas/ActivityGoals"
- error:
- type: "null"
- meta:
- type: object
- properties:
- requestId:
- type: string
- additionalProperties: false
- required:
- - data
- - error
- additionalProperties: false
- ActivityGoalsPatchEnvelope:
+ - allowed
+ - available
+ - unavailableReason
+ - relayHost
+ - offered
+ - state
+ - since
+ - reason
+ - instanceId
+ - tier
+ - notice
+ - lastSuccessAt
+ - devices
+ - usage
+ - handoff
+ - relayCheck
+ - termsVersion
+ - termsConfirmationNeeded
+ - unbindsPending
+ - unreachableRegistrations
+ - termsUrl
+ - privacyUrl
+ - docsUrl
+ - operatorDecision
+ additionalProperties: false
+ PushRelayOperatorDecision:
+ type: string
+ enum:
+ - undecided
+ - on
+ - off
+ AdminPushRelaySwitchEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/ActivityGoals"
+ $ref: "#/components/schemas/AdminPushRelayStatus"
error:
type: "null"
meta:
@@ -57689,11 +62848,11 @@ components:
- data
- error
additionalProperties: false
- DayProvenanceEnvelope:
+ AdminPushRelayDecisionEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/DayProvenance"
+ $ref: "#/components/schemas/AdminPushRelayStatus"
error:
type: "null"
meta:
@@ -57706,284 +62865,11 @@ components:
- data
- error
additionalProperties: false
- DayProvenance:
- type: object
- properties:
- type:
- type: string
- enum:
- - WEIGHT
- - BLOOD_PRESSURE_SYS
- - BLOOD_PRESSURE_DIA
- - PULSE
- - BODY_FAT
- - SLEEP_DURATION
- - ACTIVITY_STEPS
- - BLOOD_GLUCOSE
- - TOTAL_BODY_WATER
- - BONE_MASS
- - OXYGEN_SATURATION
- - HEART_RATE_VARIABILITY
- - RESTING_HEART_RATE
- - ACTIVE_ENERGY_BURNED
- - FLIGHTS_CLIMBED
- - WALKING_RUNNING_DISTANCE
- - VO2_MAX
- - BODY_TEMPERATURE
- - FAT_FREE_MASS
- - FAT_MASS
- - MUSCLE_MASS
- - SKIN_TEMPERATURE
- - PULSE_WAVE_VELOCITY
- - VASCULAR_AGE
- - VISCERAL_FAT
- - AUDIO_EXPOSURE_ENV
- - AUDIO_EXPOSURE_HEADPHONE
- - TIME_IN_DAYLIGHT
- - WALKING_STEADINESS
- - AUDIO_EXPOSURE_EVENT
- - RESPIRATORY_RATE
- - BODY_MASS_INDEX
- - LEAN_BODY_MASS
- - WALKING_HEART_RATE_AVERAGE
- - WALKING_ASYMMETRY
- - WALKING_DOUBLE_SUPPORT
- - WALKING_STEP_LENGTH
- - WALKING_SPEED
- - CARDIO_RECOVERY
- - WRIST_TEMPERATURE
- - FALL_COUNT
- - SIX_MINUTE_WALK_DISTANCE
- - STAIR_ASCENT_SPEED
- - STAIR_DESCENT_SPEED
- - BREATHING_DISTURBANCES
- - IRREGULAR_RHYTHM_NOTIFICATION
- - HIGH_HEART_RATE_EVENT
- - LOW_HEART_RATE_EVENT
- - WALKING_STEADINESS_EVENT
- - BREATHING_DISTURBANCE_EVENT
- - HYPERTENSION_EVENT
- - RECOVERY_SCORE
- - STRESS_SCORE
- - STRAIN_SCORE
- - HRV_RMSSD
- - DAY_STRAIN
- - WORKOUT_STRAIN
- - SLEEP_PERFORMANCE
- - SLEEP_EFFICIENCY
- - SLEEP_CONSISTENCY
- - SLEEP_NEED
- - ENERGY_EXPENDITURE_KJ
- - AVERAGE_HEART_RATE
- - MAX_HEART_RATE
- - SLEEP_DISTURBANCE_COUNT
- - ANS_CHARGE
- - CARDIO_LOAD
- - SLEEP_SCORE
- - BODY_TEMPERATURE_DEVIATION
- - RESILIENCE
- - PHQ9_SCORE
- - GAD7_SCORE
- - GRIP_STRENGTH
- - PAIN_NRS
- - WAIST_CIRCUMFERENCE
- - WAIST_TO_HEIGHT
- - WHO5_SCORE
- - SCI_SCORE
- - EXERCISE_MINUTES
- - STAND_MINUTES
- - STAND_HOURS
- - MINDFUL_MINUTES
- - STATE_OF_MIND_VALENCE
- - AFIB_BURDEN
- - INDOOR_CO2
- - INDOOR_TEMPERATURE
- - INDOOR_HUMIDITY
- - BODY_BATTERY
- - STRESS_LEVEL
- - TRAINING_READINESS
- - ACUTE_TRAINING_LOAD
- - BASAL_ENERGY_BURNED
- - BLOOD_KETONES
- - LOW_CARDIO_FITNESS_EVENT
- - MENOPAUSAL_STATE
- - BLEEDING_AFTER_MENOPAUSE
- - INSULIN_DELIVERY
- - INHALER_USAGE
- - FEV1
- - FVC
- - PEAK_EXPIRATORY_FLOW
- date:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- aggregation:
- type: string
- enum:
- - sum
- - mean
- ranked:
- type: boolean
- metricKey:
- type:
- - string
- - "null"
- ladder:
- type: array
- items:
- type: string
- enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
- picked:
- anyOf:
- - type: string
- enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
- - type: "null"
- pickReason:
- anyOf:
- - type: string
- enum:
- - only_source
- - highest_on_ladder
- - name_tiebreak
- - not_ranked
- description: "`only_source`: one source that day. `highest_on_ladder`: it stands highest on the ladder among the day's
- sources. `name_tiebreak`: none of them is on the ladder, the source name decided. `not_ranked`: this
- metric has no ladder, every source counts."
- - type: "null"
- sources:
- type: array
- items:
- type: object
- properties:
- source:
- type: string
- enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
- rank:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Position on the ladder, 0 = highest; 90 = not on the ladder.
- readings:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- value:
- description: "The day's value from this source: the day total for a cumulative metric (sleep counts asleep stages only),
- the mean of the readings otherwise."
- type:
- - number
- - "null"
- min:
- type:
- - number
- - "null"
- max:
- type:
- - number
- - "null"
- firstAt:
- type: string
- description: ISO instant of the first reading that day.
- lastAt:
- type: string
- unit:
- type:
- - string
- - "null"
- devices:
- type: array
- items:
- type: string
- description: Device kinds the readings carry; `unknown` when untagged.
- pass:
- anyOf:
- - type: string
- enum:
- - lower_on_ladder
- - not_on_ladder
- - name_tiebreak
- - type: "null"
- description: Why this source was not the one picked; null for the picked one.
- required:
- - source
- - rank
- - readings
- - value
- - min
- - max
- - firstAt
- - lastAt
- - unit
- - devices
- - pass
- additionalProperties: false
- required:
- - type
- - date
- - aggregation
- - ranked
- - metricKey
- - ladder
- - picked
- - pickReason
- - sources
- additionalProperties: false
- SourceComparisonEnvelope:
+ AdminPushRelayTestEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/SourceComparison"
+ $ref: "#/components/schemas/AdminPushRelayTest"
error:
type: "null"
meta:
@@ -57993,353 +62879,228 @@ components:
type: string
additionalProperties: false
required:
- - data
- - error
- additionalProperties: false
- SourceComparison:
- type: object
- properties:
- type:
- type: string
- enum:
- - WEIGHT
- - BLOOD_PRESSURE_SYS
- - BLOOD_PRESSURE_DIA
- - PULSE
- - BODY_FAT
- - SLEEP_DURATION
- - ACTIVITY_STEPS
- - BLOOD_GLUCOSE
- - TOTAL_BODY_WATER
- - BONE_MASS
- - OXYGEN_SATURATION
- - HEART_RATE_VARIABILITY
- - RESTING_HEART_RATE
- - ACTIVE_ENERGY_BURNED
- - FLIGHTS_CLIMBED
- - WALKING_RUNNING_DISTANCE
- - VO2_MAX
- - BODY_TEMPERATURE
- - FAT_FREE_MASS
- - FAT_MASS
- - MUSCLE_MASS
- - SKIN_TEMPERATURE
- - PULSE_WAVE_VELOCITY
- - VASCULAR_AGE
- - VISCERAL_FAT
- - AUDIO_EXPOSURE_ENV
- - AUDIO_EXPOSURE_HEADPHONE
- - TIME_IN_DAYLIGHT
- - WALKING_STEADINESS
- - AUDIO_EXPOSURE_EVENT
- - RESPIRATORY_RATE
- - BODY_MASS_INDEX
- - LEAN_BODY_MASS
- - WALKING_HEART_RATE_AVERAGE
- - WALKING_ASYMMETRY
- - WALKING_DOUBLE_SUPPORT
- - WALKING_STEP_LENGTH
- - WALKING_SPEED
- - CARDIO_RECOVERY
- - WRIST_TEMPERATURE
- - FALL_COUNT
- - SIX_MINUTE_WALK_DISTANCE
- - STAIR_ASCENT_SPEED
- - STAIR_DESCENT_SPEED
- - BREATHING_DISTURBANCES
- - IRREGULAR_RHYTHM_NOTIFICATION
- - HIGH_HEART_RATE_EVENT
- - LOW_HEART_RATE_EVENT
- - WALKING_STEADINESS_EVENT
- - BREATHING_DISTURBANCE_EVENT
- - HYPERTENSION_EVENT
- - RECOVERY_SCORE
- - STRESS_SCORE
- - STRAIN_SCORE
- - HRV_RMSSD
- - DAY_STRAIN
- - WORKOUT_STRAIN
- - SLEEP_PERFORMANCE
- - SLEEP_EFFICIENCY
- - SLEEP_CONSISTENCY
- - SLEEP_NEED
- - ENERGY_EXPENDITURE_KJ
- - AVERAGE_HEART_RATE
- - MAX_HEART_RATE
- - SLEEP_DISTURBANCE_COUNT
- - ANS_CHARGE
- - CARDIO_LOAD
- - SLEEP_SCORE
- - BODY_TEMPERATURE_DEVIATION
- - RESILIENCE
- - PHQ9_SCORE
- - GAD7_SCORE
- - GRIP_STRENGTH
- - PAIN_NRS
- - WAIST_CIRCUMFERENCE
- - WAIST_TO_HEIGHT
- - WHO5_SCORE
- - SCI_SCORE
- - EXERCISE_MINUTES
- - STAND_MINUTES
- - STAND_HOURS
- - MINDFUL_MINUTES
- - STATE_OF_MIND_VALENCE
- - AFIB_BURDEN
- - INDOOR_CO2
- - INDOOR_TEMPERATURE
- - INDOOR_HUMIDITY
- - BODY_BATTERY
- - STRESS_LEVEL
- - TRAINING_READINESS
- - ACUTE_TRAINING_LOAD
- - BASAL_ENERGY_BURNED
- - BLOOD_KETONES
- - LOW_CARDIO_FITNESS_EVENT
- - MENOPAUSAL_STATE
- - BLEEDING_AFTER_MENOPAUSE
- - INSULIN_DELIVERY
- - INHALER_USAGE
- - FEV1
- - FVC
- - PEAK_EXPIRATORY_FLOW
- from:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- to:
- type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- aggregation:
+ - data
+ - error
+ additionalProperties: false
+ AdminPushRelayTest:
+ type: object
+ properties:
+ outcome:
type: string
enum:
- - sum
- - mean
- ranked:
- type: boolean
- ladder:
- type: array
- items:
- type: string
- enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
- unit:
- type:
- - string
- - "null"
- sources:
+ - accepted
+ - failed
+ - waiting
+ - no_device
+ description: "`accepted` only when the relay accepted the push to every device; `failed` when one failed for good;
+ `waiting` when the rest waits for a retry. Per device in `results`."
+ results:
type: array
items:
type: object
properties:
- source:
+ deviceId:
type: string
- enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
- days:
+ model:
+ type:
+ - string
+ - "null"
+ relayStatus:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
+ description: The item status the relay signed; 0 when no signed answer arrived.
+ relayResult:
+ type: string
+ relayReason:
+ type:
+ - string
+ - "null"
+ delivery:
+ type: string
required:
- - source
- - days
+ - deviceId
+ - model
+ - relayStatus
+ - relayResult
+ - relayReason
+ - delivery
additionalProperties: false
- a:
- anyOf:
- - type: string
+ required:
+ - outcome
+ - results
+ additionalProperties: false
+ AdminPushRelayRotateEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ outcome:
+ type: string
enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
- - type: "null"
- b:
+ - rotated
+ - refused
+ - unreachable
+ - not_registered
+ required:
+ - outcome
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ AdminPushRelaySenderRotateEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ rotated:
+ type: boolean
+ const: true
+ required:
+ - rotated
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ AdminServerSetupStateEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/AdminServerSetupState"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ AdminServerSetupState:
+ type: object
+ properties:
+ offered:
+ type: boolean
+ description: False on a demo deploy, where the setup screens refuse and nothing points at them.
+ completedAt:
anyOf:
- type: string
- enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- type: "null"
- days:
+ description: When the setup was finished; null while it is offered. An instance that had accounts before 1.49 was
+ stamped by its migration.
+ steps:
type: array
items:
type: object
properties:
- date:
+ id:
type: string
- format: date
- pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
- a:
- type:
- - number
- - "null"
- b:
- type:
- - number
- - "null"
- picked:
- anyOf:
- - type: string
- enum:
- - MANUAL
- - WITHINGS
- - IMPORT
- - APPLE_HEALTH
- - COMPUTED
- - WHOOP
- - FITBIT
- - NIGHTSCOUT
- - POLAR
- - OURA
- - TELEGRAM
- - MCP
- - GOOGLE_HEALTH
- - STRAVA
- - EXTERNAL
- - HEALTH_CONNECT
- - GARMIN
- - type: "null"
+ enum:
+ - accounts
+ - notifications
+ - ai
+ - privacy
+ - health
+ status:
+ type: string
+ enum:
+ - pending
+ - done
+ - skipped
required:
- - date
- - a
- - b
- - picked
+ - id
+ - status
additionalProperties: false
- summary:
+ description: Every step, in order. A missing stored step reads pending.
+ noticePending:
+ type: boolean
+ description: "Whether the start-page notice shows for the calling admin: offered, not finished, not dismissed by this
+ admin."
+ facts:
type: object
properties:
- daysA:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- daysB:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- daysBoth:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- meanA:
- type:
- - number
- - "null"
- meanB:
- type:
- - number
- - "null"
- meanDifference:
- type:
- - number
- - "null"
- meanAbsoluteDifference:
- type:
- - number
- - "null"
- pickedA:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- pickedB:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
+ oidc:
+ type: object
+ properties:
+ configured:
+ type: boolean
+ only:
+ type: boolean
+ required:
+ - configured
+ - only
+ additionalProperties: false
+ smtp:
+ type: object
+ properties:
+ configured:
+ type: boolean
+ missing:
+ type: array
+ items:
+ type: string
+ description: Names of the required SMTP variables that are unset.
+ required:
+ - configured
+ - missing
+ additionalProperties: false
+ telegram:
+ type: object
+ properties:
+ webhookSecret:
+ type: boolean
+ required:
+ - webhookSecret
+ additionalProperties: false
required:
- - daysA
- - daysB
- - daysBoth
- - meanA
- - meanB
- - meanDifference
- - meanAbsoluteDifference
- - pickedA
- - pickedB
+ - oidc
+ - smtp
+ - telegram
additionalProperties: false
+ description: What the environment says, as booleans and variable names. Never a value.
required:
- - type
- - from
- - to
- - aggregation
- - ranked
- - ladder
- - unit
- - sources
- - a
- - b
- - days
- - summary
+ - offered
+ - completedAt
+ - steps
+ - noticePending
+ - facts
additionalProperties: false
- DeviceRegisterResponse:
+ AdminServerSetupNoticeEnvelope:
type: object
properties:
data:
type: object
properties:
- id:
- type: string
+ dismissed:
+ type: boolean
+ const: true
required:
- - id
+ - dismissed
additionalProperties: false
error:
type: "null"
@@ -58353,11 +63114,11 @@ components:
- data
- error
additionalProperties: false
- DeviceRevokeEnvelope:
+ AdminSetupHealthEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/DeviceRevokeResponse"
+ $ref: "#/components/schemas/AdminSetupHealth"
error:
type: "null"
meta:
@@ -58370,32 +63131,63 @@ components:
- data
- error
additionalProperties: false
- DeviceRevokeResponse:
+ AdminSetupHealth:
type: object
properties:
- id:
+ state:
type: string
- revoked:
- type: boolean
- const: true
- refreshTokensRevoked:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Refresh tokens the cascade revoked.
- accessTokensRevoked:
- type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- description: Access tokens the cascade revoked.
+ enum:
+ - ok
+ - attention
+ - failing
+ signals:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ enum:
+ - encryption_keys
+ - secure_cookie
+ - app_url
+ - database_dump
+ state:
+ type: string
+ enum:
+ - ok
+ - attention
+ - failing
+ reason:
+ type: string
+ description: A closed code per signal, rendered as `admin.setupHealth.reason..`.
+ params:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties:
+ type:
+ - string
+ - number
+ description: Values the sentence interpolates. Never a secret.
+ fixPath:
+ type:
+ - string
+ - "null"
+ docsUrl:
+ type: string
+ required:
+ - id
+ - state
+ - reason
+ - params
+ - fixPath
+ - docsUrl
+ additionalProperties: false
required:
- - id
- - revoked
- - refreshTokensRevoked
- - accessTokensRevoked
+ - state
+ - signals
additionalProperties: false
- description: What the revocation cascade actually removed. The counts let a client say how many credentials were killed
- rather than only that something happened.
MedicationIntakeAggregateEnvelope:
type: object
properties:
@@ -58438,6 +63230,43 @@ components:
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- type: "null"
+ syncVersion:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: The row's current version. Send it as `expectedSyncVersion` on `DELETE
+ /api/medications/{id}/intake/{eventId}` to undo this dose only if nothing changed it since; a changed row
+ answers 409 `medications.intake.changedSinceSeen`.
+ source:
+ type: string
+ enum:
+ - WEB
+ - API
+ - REMINDER
+ - IMPORT
+ - APPLE_HEALTH
+ description: "Which writer created the row. A take that converges onto a projected or reminder slot keeps `REMINDER`
+ here; read `takenVia` for where the take came from. Values: `WEB` the web app, `API` a Bearer client (the
+ iOS app, the ingest hook a pill box or home automation posts to), `REMINDER` a Telegram reminder button (or
+ the server's own projection while the slot is still open), `IMPORT` a file import, `APPLE_HEALTH` the Apple
+ Health medication sync. Read it with `takenAt` to warn before a second take of the same slot."
+ takenVia:
+ anyOf:
+ - type: string
+ enum:
+ - WEB
+ - APP
+ - INTEGRATION
+ - TELEGRAM
+ - APPLE_HEALTH
+ - IMPORT
+ - AUTO
+ - type: "null"
+ description: "How the take on this slot was recorded, whatever wrote the row: `WEB` the web app, `APP` a Bearer client
+ such as the iOS app, `INTEGRATION` the ingest hook (a pill box, home automation), `TELEGRAM` a Telegram
+ button, `APPLE_HEALTH` the Apple Health medication sync, `IMPORT` a file import, `AUTO` the server's
+ auto-take. Null while the slot is not taken, and on takes recorded before this field existed. Show it with
+ `takenAt` before offering a second take: \"already taken at 07:12 via an integration\"."
status:
type: string
enum:
@@ -58447,23 +63276,89 @@ components:
- pending
- snoozed
description: "Resolved in that precedence order. `missed` is TERMINAL — the nightly cron closed a never-acted slot — and
- is not a `pending` that can still be answered. `snoozed` is not a property of this event at all: it reflects
- the MEDICATION's deferral stamp still lying in the future, so every pending dose of that medication reads
- snoozed at once."
+ is not a `pending` that can still be answered. `snoozed` means the medication's running deferral holds THIS
+ slot: the slot whose reminder window was open when the snooze was set, or, set while none was open, the next
+ slot to open. It is the same rule the reminder worker applies, so another slot of the same medication stays
+ `pending` and is still reminded."
snoozedUntil:
anyOf:
- type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- type: "null"
- description: The medication's deferral stamp, repeated on each of its events. Null when the medication is not deferred.
+ description: When the snooze holding this slot ends. Null when no running snooze holds this slot, including other slots
+ of a snoozed medication.
+ state:
+ anyOf:
+ - type: string
+ enum:
+ - upcoming
+ - due
+ - overdue
+ - taken
+ - skipped
+ - missed
+ - type: "null"
+ description: The resolved state of this dose, computed once on the server from the same bands the dose history, the
+ adherence rate and the reminders use (the medication's stored dose windows included). `upcoming` before
+ `dueAt`; `due` from `dueAt`; `overdue` past the on-time window (see `overdueSince`) until `missedAfter`;
+ `missed` after that with nothing recorded (or closed by the auto-miss pass); `taken` (see `takenLate`);
+ `skipped`. Render from this instead of fixed thresholds. Null only for a row on no slot that records
+ nothing. Distinct from the older `status` field above.
+ takenLate:
+ type: boolean
+ description: "With `state: taken`: taken after the on-time window (it still counts, late). False otherwise."
+ slotInstant:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: The slot's scheduled time. Null for a take on no slot (ad hoc).
+ dueAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: When the dose window opens; the dose is `due` from here.
+ overdueSince:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: Since when the dose is overdue (the end of its on-time window). Null unless `state` is `overdue`.
+ missedAfter:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: The miss cutoff; past it an unanswered dose is `missed`. Schedule a client-side state change at `dueAt`,
+ `overdueSince` and `missedAfter` instead of polling.
+ lateTakeCounts:
+ type: boolean
+ description: "A take recorded for this dose now still counts for it (as `taken_late` after the on-time window): true
+ while `due`, `overdue` and `missed`. A client that shows `missed` with a take action says that a late take
+ still counts."
required:
- id
- medicationId
- scheduledAt
- takenAt
+ - syncVersion
+ - source
+ - takenVia
- status
- snoozedUntil
+ - state
+ - takenLate
+ - slotInstant
+ - dueAt
+ - overdueSince
+ - missedAfter
+ - lateTakeCounts
additionalProperties: false
description: One of today's dose slots, flattened for the dose sheet and the dashboard tile. A deliberately narrow
projection — not the full intake-event row.
@@ -58555,6 +63450,21 @@ components:
- REMINDER
- IMPORT
- APPLE_HEALTH
+ takenVia:
+ anyOf:
+ - type: string
+ enum:
+ - WEB
+ - APP
+ - INTEGRATION
+ - TELEGRAM
+ - APPLE_HEALTH
+ - IMPORT
+ - AUTO
+ - type: "null"
+ description: Where the take on this row came from, whatever wrote the row (`source` keeps the writer that created it,
+ `REMINDER` for a projected slot). Null until a take reaches the row, and on takes recorded before migration
+ 0515.
idempotencyKey:
type:
- string
@@ -58613,6 +63523,16 @@ components:
- type: "null"
description: Soft-delete tombstone. Non-null rows are excluded from every list/aggregate read; sync readers use it to
propagate deletions.
+ appleHealthDeletedAt:
+ description: "Since v1.49.0: who deleted a tombstone. Equal to `deletedAt` when the phone reported the dose deleted
+ through `DELETE /api/medications/intake/by-external-ids`; null, or different, when it was deleted in
+ HealthLog. A re-post of a dose deleted in HealthLog is refused (`skipped`, reason `deleted_in_healthlog`),
+ one the phone reported is written again. Null on every live row; do not show it."
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
required:
- id
- userId
@@ -58624,6 +63544,7 @@ components:
- autoRecorded
- attributionSource
- source
+ - takenVia
- idempotencyKey
- createdAt
- updatedAt
@@ -59454,11 +64375,20 @@ components:
- inserted
- updated
- duplicate
+ - alreadyTaken
- skipped
- description: "`inserted`/`updated`/`duplicate` — the row landed (advance the cursor). `skipped` — not stored; see
- `reason`."
+ description: "`inserted`/`updated`/`duplicate` — the row landed (advance the cursor); `duplicate` is an idempotent
+ replay of an entry already stored, nothing else. A dose the phone reported deleted through `DELETE
+ /api/medications/intake/by-external-ids` is the other case: posted again, it is back in Apple Health and
+ lands as a new dose (`inserted`). `alreadyTaken` — the slot already holds a take recorded by another writer
+ or another key, and this entry was a take or a skip: nothing was written, no stock consumed or refunded;
+ `intake` is the recorded row, `takenAt` and `takenVia` say when and how it was taken. Advance the cursor and
+ warn before a second dose. `skipped` — not stored; see `reason`. Since v1.49.0 that includes the re-post of
+ an Apple Health dose (`externalId`) the person deleted in HealthLog, `deleted_in_healthlog`: it stays
+ deleted, nothing was written and no stock was taken."
reason:
- description: "Why a `skipped` entry was not stored. Among others: `medication_not_found`, `unstable_external_id`,
+ description: "Why a `skipped` entry was not stored. Among others: `deleted_in_healthlog` (since v1.49.0) for the re-post
+ of a dose the person deleted in HealthLog, `medication_not_found`, `unstable_external_id`,
`force_slot_invalid`, `force_slot_occupied`, `injection_site_not_allowed`, and (v1.42.0)
`intake_not_tracked` for an entry against a medication kept as a record only (`trackIntake: false`), the
per-entry form of `medication.intake.notTracked`. A skip is final: resending the entry gives the same
@@ -59467,9 +64397,55 @@ components:
id:
description: The landed row id (absent on skips).
type: string
+ syncVersion:
+ description: The landed row's version after the batch settled (absent on skips). Send it as `expectedSyncVersion` to
+ undo the entry; a row changed since answers 409 `medications.intake.changedSinceSeen`. The `intake` row on
+ `alreadyTaken` carries the same value.
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ intake:
+ description: "On `alreadyTaken`: the recorded row the slot already holds."
+ $ref: "#/components/schemas/MedicationIntakeEvent"
+ takenAt:
+ description: "On `alreadyTaken`, and since v1.49.0 on a `force_slot_occupied` skip: when the take that holds the slot
+ was recorded (null when a skip holds it)."
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ takenVia:
+ description: "On `alreadyTaken`, and since v1.49.0 on a `force_slot_occupied` skip: where the slot's take came from
+ (null for takes before migration 0515, and when a skip holds the slot)."
+ anyOf:
+ - type: string
+ enum:
+ - WEB
+ - APP
+ - INTEGRATION
+ - TELEGRAM
+ - APPLE_HEALTH
+ - IMPORT
+ - AUTO
+ - type: "null"
+ slotInstant:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: "Since v1.49.0, on every entry. The canonical slot the entry's row is on, as `POST
+ /api/medications/{id}/intake` answers it: the slot a take or skip bound to (by its window, a named
+ `scheduledFor` or a `forceSlotInstant` pin), and on `alreadyTaken` the slot of the recorded take. Null for a
+ row on no slot (an ad-hoc take, an extra dose) and for an entry that stored nothing; a `force_slot_occupied`
+ skip names the slot it was refused. An entry answered by a row it did not write (`duplicate`) reads the slot
+ off that row. The device that sent the batch gets no silent `MEDICATION_INTAKE_SYNC` for it; this field is
+ its answer."
required:
- index
- status
+ - slotInstant
additionalProperties: false
ListMedicationsResponse:
type: object
@@ -59586,8 +64562,9 @@ components:
type: boolean
liveActivityEnabled:
type: boolean
- description: v1.7.0 iOS Live Activity opt-in for this medication's reminders. Default false. The iOS client owns the
- ActivityKit lifecycle; the server only stores + echoes the flag.
+ description: v1.7.0 iOS Live Activity opt-in for this medication's reminders. Default false. The iOS client plans its
+ own Activities by it; a server start over the push relay requires it, and a server-started Activity ends
+ once it is off.
criticalAlarmEnabled:
type: boolean
description: v1.7.0 iOS 26 AlarmKit critical-reminder opt-in. Default false. Critical alarms bypass the device mute
@@ -59613,6 +64590,13 @@ components:
type:
- string
- "null"
+ leafletUrl:
+ description: '#1430 — the official leaflet the person saved for this medication: an `https:` URL, any host. NULL = none
+ saved. Show it only as an external link (a new tab, `rel="noopener noreferrer"` on the web); never fetch or
+ embed it. Set or cleared through `leafletUrl` on the create and update bodies.'
+ type:
+ - string
+ - "null"
pausedAt:
anyOf:
- type: string
@@ -59825,6 +64809,8 @@ components:
description: v1.43 — whether a composition per unit is stored (`GET /api/medications/{id}` carries it as `ingredients`).
Absent on older servers.
type: boolean
+ leafletSearch:
+ $ref: "#/components/schemas/MedicationLeafletSearch"
required:
- id
- name
@@ -59841,6 +64827,7 @@ components:
- atcCode
- rxNormCode
- note
+ - leafletUrl
- pausedAt
- snoozedUntil
- remindersActive
@@ -59871,6 +64858,7 @@ components:
- stockUnitsRemaining
- stockDosesRemaining
- runwayDays
+ - leafletSearch
additionalProperties: false
description: List-row variant of the medication resource enriched with the joined `category`, the v1.32.25
`externalSource` provenance echo, `lastTakenAt`, `todayEventCount`, and the v1.16.10 aggregated stock fields
@@ -59941,6 +64929,61 @@ components:
description: v1.40 (#1024) — one course of a medication. Courses never overlap and every course except the latest has
ended, so the medication's `startsOn`/`endsOn`/`courseStatus`/`intakeActionable` are always those of the latest
course.
+ MedicationLeafletSearch:
+ anyOf:
+ - type: object
+ properties:
+ registry:
+ type: string
+ enum:
+ - PL
+ - DE
+ - ES
+ - FR
+ - GB
+ - BE
+ - NL
+ - US
+ - CA
+ - AU
+ - BR
+ - EU
+ authority:
+ type: string
+ description: Who runs the search the link opens, as a proper name ("DailyMed", "AEMPS CIMA"). Not translated.
+ url:
+ type: string
+ description: The registry's own search page, ready to open in a browser (a new tab, or an in-app browser). Always
+ `https:` on `host`. Built by the server from a static table; the server never requests it.
+ host:
+ type: string
+ description: The registry's host, for a label that names where the link goes.
+ prefill:
+ type: string
+ enum:
+ - nameAndStrength
+ - name
+ - none
+ description: "How much of the medication the link carries. `nameAndStrength` and `name`: the registry opens on its
+ results for `searchTerm`. `none`: the registry's search takes nothing from its address, so the page
+ opens empty and the client asks the person to search for `searchTerm` there."
+ searchTerm:
+ type: string
+ description: "What is searched for: the medication name, plus the strength when `prefill` is `nameAndStrength` and the
+ dose reads as one."
+ required:
+ - registry
+ - authority
+ - url
+ - host
+ - prefill
+ - searchTerm
+ additionalProperties: false
+ - type: "null"
+ description: "#1430 — the official registry search for this medication, built for the CALLER's `medicineRegistry` (the
+ person who will open it, not the record's owner). NULL when the caller chose `NONE`. Remind the person that the
+ leaflet comes from the national registry and that they should check it matches the medication's name, strength
+ and form."
CreateMedicationResponse:
type: object
properties:
@@ -60052,8 +65095,9 @@ components:
type: boolean
liveActivityEnabled:
type: boolean
- description: v1.7.0 iOS Live Activity opt-in for this medication's reminders. Default false. The iOS client owns the
- ActivityKit lifecycle; the server only stores + echoes the flag.
+ description: v1.7.0 iOS Live Activity opt-in for this medication's reminders. Default false. The iOS client plans its
+ own Activities by it; a server start over the push relay requires it, and a server-started Activity ends
+ once it is off.
criticalAlarmEnabled:
type: boolean
description: v1.7.0 iOS 26 AlarmKit critical-reminder opt-in. Default false. Critical alarms bypass the device mute
@@ -60079,6 +65123,13 @@ components:
type:
- string
- "null"
+ leafletUrl:
+ description: '#1430 — the official leaflet the person saved for this medication: an `https:` URL, any host. NULL = none
+ saved. Show it only as an external link (a new tab, `rel="noopener noreferrer"` on the web); never fetch or
+ embed it. Set or cleared through `leafletUrl` on the create and update bodies.'
+ type:
+ - string
+ - "null"
pausedAt:
anyOf:
- type: string
@@ -60277,6 +65328,8 @@ components:
type: array
items:
$ref: "#/components/schemas/RelatedLink"
+ leafletSearch:
+ $ref: "#/components/schemas/MedicationLeafletSearch"
required:
- id
- name
@@ -60292,6 +65345,7 @@ components:
- atcCode
- rxNormCode
- note
+ - leafletUrl
- pausedAt
- snoozedUntil
- remindersActive
@@ -60317,6 +65371,7 @@ components:
- stockUnitsRemaining
- stockDosesRemaining
- runwayDays
+ - leafletSearch
additionalProperties: false
description: Detail variant of the medication resource enriched with the joined `category`. The base medication fields
are inlined; see the `Medication` component for their semantics.
@@ -60738,9 +65793,50 @@ components:
type: string
minLength: 1
maxLength: 64
+ groupBy:
+ description: Grouping mode ("none" or "category"). Default "none".
+ type: string
+ enum:
+ - none
+ - category
+ groupsOpen:
+ description: Which groups open by default ("expanded", "flagged", "collapsed"). Default "expanded".
+ type: string
+ enum:
+ - expanded
+ - flagged
+ - collapsed
+ categoryOrder:
+ description: "The category order of the grouped list, first = top: built-in category values and `custom:` keys, at
+ most 64. A malformed key is a 422; a well-formed custom key the account does not have is dropped on write.
+ Categories not listed follow in the default order, OTHER last. Optional on PUT (preserve-when-absent);
+ always present on responses."
+ maxItems: 64
+ type: array
+ items:
+ anyOf:
+ - type: string
+ enum:
+ - BLOOD_PRESSURE
+ - VITAMIN
+ - SUPPLEMENT
+ - PAIN_RELIEF
+ - ALLERGY
+ - DIGESTIVE
+ - THYROID
+ - HORMONE
+ - SKIN
+ - SLEEP_AID
+ - DIABETES
+ - ANTIBIOTIC
+ - MENTAL_HEALTH
+ - OTHER
+ - type: string
+ pattern: ^custom:[0-9a-f-]{36}$
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -60843,7 +65939,7 @@ components:
type: object
properties:
data:
- $ref: "#/components/schemas/MedicationIntakeEvent"
+ $ref: "#/components/schemas/RecordedMedicationIntakeEvent"
error:
type: "null"
meta:
@@ -60856,11 +65952,180 @@ components:
- data
- error
additionalProperties: false
+ RecordedMedicationIntakeEvent:
+ type: object
+ properties:
+ id:
+ type: string
+ userId:
+ type: string
+ medicationId:
+ type: string
+ scheduledFor:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ takenAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ skipped:
+ type: boolean
+ autoMissed:
+ type: boolean
+ description: True when the nightly cron closed the slot as missed (no user action). Auto-missed rows count against
+ adherence but never consume inventory.
+ autoRecorded:
+ type: boolean
+ description: v1.42.2 — true when the server recorded this dose because the medication has `autoMarkTaken` on, not the
+ person. It counts as taken everywhere (adherence, history, Coach) and consumed inventory like a manual take.
+ Any take or skip the person records on the row clears it. Clients label such a dose "recorded
+ automatically".
+ attributionSource:
+ type: string
+ enum:
+ - AUTO
+ - USER_PIN
+ description: "How the row bound to its schedule slot: AUTO = the write path's nearest-slot resolution; USER_PIN = the
+ user explicitly pinned the slot (the dedup converge keeps the pinned row)."
+ source:
+ type: string
+ enum:
+ - WEB
+ - API
+ - REMINDER
+ - IMPORT
+ - APPLE_HEALTH
+ takenVia:
+ anyOf:
+ - type: string
+ enum:
+ - WEB
+ - APP
+ - INTEGRATION
+ - TELEGRAM
+ - APPLE_HEALTH
+ - IMPORT
+ - AUTO
+ - type: "null"
+ description: Where the take on this row came from, whatever wrote the row (`source` keeps the writer that created it,
+ `REMINDER` for a projected slot). Null until a take reaches the row, and on takes recorded before migration
+ 0515.
+ idempotencyKey:
+ type:
+ - string
+ - "null"
+ createdAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ updatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ injectionSite:
+ anyOf:
+ - type: string
+ enum:
+ - ABDOMEN_LEFT
+ - ABDOMEN_RIGHT
+ - ABDOMEN_UPPER_LEFT
+ - ABDOMEN_UPPER_RIGHT
+ - THIGH_LEFT
+ - THIGH_RIGHT
+ - UPPER_ARM_LEFT
+ - UPPER_ARM_RIGHT
+ - type: "null"
+ description: Recorded injection site for a site-tracked medication (GLP-1 rotation surface). NULL when the medication
+ does not track sites or none was recorded.
+ doseTaken:
+ description: Free-text dose actually taken when it differed from the scheduled dose (titration weeks, split doses). NULL
+ = the scheduled dose.
+ type:
+ - string
+ - "null"
+ inventoryConsumption:
+ anyOf:
+ - {}
+ - type: "null"
+ description: JSON ledger of the container decrements this intake caused (`[{itemId, units}]`), written by the
+ consumption hook. NULL when nothing was consumed (skipped / no tracked inventory).
+ externalId:
+ description: v1.28 — client-supplied stable id for externally-mirrored intakes (Apple Health sync); the dedup key for
+ re-synced rows. NULL for native rows.
+ type:
+ - string
+ - "null"
+ syncVersion:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Monotonic per-row version for incremental sync readers; bumps on every mutation.
+ deletedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: Soft-delete tombstone. Non-null rows are excluded from every list/aggregate read; sync readers use it to
+ propagate deletions.
+ appleHealthDeletedAt:
+ description: "Since v1.49.0: who deleted a tombstone. Equal to `deletedAt` when the phone reported the dose deleted
+ through `DELETE /api/medications/intake/by-external-ids`; null, or different, when it was deleted in
+ HealthLog. A re-post of a dose deleted in HealthLog is refused (`skipped`, reason `deleted_in_healthlog`),
+ one the phone reported is written again. Null on every live row; do not show it."
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ alreadyTaken:
+ type: boolean
+ description: "True when this POST reported a dose already recorded, or skipped one: the slot it binds to already holds a
+ take. Nothing was written and no stock was consumed; the body is the recorded row, so `takenAt` and
+ `takenVia` say when and how. False on a fresh dose (201) and on an idempotency replay (200)."
+ slotInstant:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: "Since v1.49.0. The canonical slot the dose is on: the slot the take or skip bound to (by its window, the
+ nearest open slot, a named `scheduledFor` or a `forceSlotInstant` pin), equal to `scheduledFor` then. Null
+ for a dose on no slot (an ad-hoc take or an extra dose, stored on its own instant). On `alreadyTaken` the
+ slot of the recorded take. The device that recorded the dose gets no silent `MEDICATION_INTAKE_SYNC` for it:
+ this field is its answer, and the sync goes to the account's other devices only."
+ required:
+ - id
+ - userId
+ - medicationId
+ - scheduledFor
+ - takenAt
+ - skipped
+ - autoMissed
+ - autoRecorded
+ - attributionSource
+ - source
+ - takenVia
+ - idempotencyKey
+ - createdAt
+ - updatedAt
+ - injectionSite
+ - doseTaken
+ - inventoryConsumption
+ - externalId
+ - syncVersion
+ - deletedAt
+ - alreadyTaken
+ - slotInstant
+ additionalProperties: false
CreateMedicationIntakeResponse:
type: object
properties:
data:
- $ref: "#/components/schemas/MedicationIntakeEvent"
+ $ref: "#/components/schemas/RecordedMedicationIntakeEvent"
error:
type: "null"
meta:
@@ -61687,10 +66952,58 @@ components:
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
- type: "null"
- description: Target instant of the open dose. Null when no dose is open.
+ description: "Target instant of the open dose: the earliest slot still due or overdue, before any upcoming one, so a
+ dose whose clock time has passed stays the current dose until it is recorded or missed. Null when no
+ dose is open."
+ state:
+ anyOf:
+ - type: string
+ enum:
+ - upcoming
+ - due
+ - overdue
+ - taken
+ - skipped
+ - missed
+ - type: "null"
+ description: The open dose's resolved state, the same vocabulary as the today list's `state`. Null when no dose is open.
+ `status` above is the same state in the older vocabulary.
+ takenLate:
+ type: boolean
+ description: "With `state: taken`: taken after the on-time window."
+ dueAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: When the open dose's window opens.
+ overdueSince:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: End of its on-time window; past it the dose is overdue.
+ missedAfter:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: Its miss cutoff; past it an unanswered dose is missed.
+ lateTakeCounts:
+ type: boolean
+ description: A take recorded for this dose now still counts for it (late after `overdueSince`).
required:
- status
- targetAt
+ - state
+ - takenLate
+ - dueAt
+ - overdueSince
+ - missedAfter
+ - lateTakeCounts
additionalProperties: false
description: v1.15.9 — the open dose's per-dose status + target, so the card highlights the actionable take-window green
and escalates an overdue dose without re-deriving the window math client-side.
@@ -62523,6 +67836,22 @@ components:
- missed
- upcoming
- ad_hoc
+ state:
+ anyOf:
+ - type: string
+ enum:
+ - upcoming
+ - due
+ - overdue
+ - taken
+ - skipped
+ - missed
+ - type: "null"
+ description: "The slot's resolved dose state, the same vocabulary as the today rows and `complianceDisplay.currentDose`:
+ an open slot (`status: upcoming`) reads `upcoming`, `due` or `overdue`. Null on an ad-hoc row."
+ takenLate:
+ type: boolean
+ description: True when the take came after the on-time window; `state` is then `taken`.
pinned:
description: Present and true when the row is served by a deliberate user pin ('zugeordnet').
type: boolean
@@ -62605,8 +67934,158 @@ components:
- at
- timeOfDay
- status
+ - state
+ - takenLate
- intake
additionalProperties: false
+ GetResolvedMedicationSlotsResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/ResolvedMedicationSlotsResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ ResolvedMedicationSlotsResponse:
+ type: object
+ properties:
+ from:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: The window start the slots were read over.
+ to:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: The window end the slots were read over.
+ medications:
+ type: array
+ items:
+ type: object
+ properties:
+ medicationId:
+ type: string
+ family:
+ type: string
+ enum:
+ - daily
+ - weekly
+ - one_shot
+ - none
+ description: Cadence family the window's slots were minted under.
+ slots:
+ type: array
+ items:
+ $ref: "#/components/schemas/ResolvedMedicationSlot"
+ description: Every scheduled dose of the medication with its slot time in the window, oldest first. Off-schedule takes
+ are not slots and are not listed; the dose history has them.
+ required:
+ - medicationId
+ - family
+ - slots
+ additionalProperties: false
+ required:
+ - from
+ - to
+ - medications
+ additionalProperties: false
+ description: Every active medication of the record that can be due (active, not as-needed, intake tracked), each with
+ its resolved slots over the window.
+ ResolvedMedicationSlot:
+ type: object
+ properties:
+ slotInstant:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: "The slot's scheduled time: the same instant as `at` in the dose history and `slotInstant` on the today
+ rows, and what a take of this dose answers as `slotInstant`."
+ state:
+ type: string
+ enum:
+ - upcoming
+ - due
+ - overdue
+ - taken
+ - skipped
+ - missed
+ description: "The resolved dose state, the vocabulary of the today rows and the dose history's `state`: `upcoming`
+ before `dueAt`, `due` from `dueAt`, `overdue` past `overdueSince`, `missed` past `missedAfter` with nothing
+ recorded (or closed by the auto-miss pass), `taken` (see `takenLate`), `skipped`."
+ takenLate:
+ type: boolean
+ description: "With `state: taken`: taken after the on-time window."
+ dueAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: When the dose window opens.
+ overdueSince:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: The end of the on-time window; past it an open dose is `overdue`. Always present here, unlike the today rows.
+ missedAfter:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ description: The miss cutoff; past it an unanswered dose is `missed`.
+ lateTakeCounts:
+ type: boolean
+ description: "A take recorded for this dose now still counts for it: true while `due`, `overdue` and `missed`."
+ takenAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: When the dose was taken; null unless `state` is `taken`.
+ takenVia:
+ anyOf:
+ - type: string
+ enum:
+ - WEB
+ - APP
+ - INTEGRATION
+ - TELEGRAM
+ - APPLE_HEALTH
+ - IMPORT
+ - AUTO
+ - type: "null"
+ description: How the take was recorded (as on the today rows); null while not taken and for takes recorded before the
+ field existed.
+ intakeId:
+ description: The intake row on the slot, when one exists (a projected pending row included); null for a slot no row
+ holds yet.
+ type:
+ - string
+ - "null"
+ pinned:
+ type: boolean
+ description: True when a deliberate user pin serves the slot.
+ required:
+ - slotInstant
+ - state
+ - takenLate
+ - dueAt
+ - overdueSince
+ - missedAfter
+ - lateTakeCounts
+ - takenAt
+ - takenVia
+ - intakeId
+ - pinned
+ additionalProperties: false
ListScheduleRevisionsResponse:
type: object
properties:
@@ -63398,6 +68877,53 @@ components:
- high
- type: "null"
description: "#1126 — the same for the OpenAI-compatible gateway entry."
+ localCoachBudget:
+ anyOf:
+ - type: object
+ properties:
+ snapshotChars:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ turnTokens:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ maxRounds:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ turnSeconds:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ additionalProperties: false
+ - type: "null"
+ description: "The Coach budget of the Local provider as a turn applies it (clamped to its bounds): snapshot characters,
+ tokens, rounds and seconds. A field left out runs on the built-in value; null when none is set."
+ compatCoachBudget:
+ anyOf:
+ - type: object
+ properties:
+ snapshotChars:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ turnTokens:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ maxRounds:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ turnSeconds:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ additionalProperties: false
+ - type: "null"
+ description: The same for the OpenAI-compatible gateway.
serverProviderHealth:
type: string
enum:
@@ -63445,6 +68971,8 @@ components:
- responseTimeoutSeconds
- localReasoningEffort
- compatReasoningEffort
+ - localCoachBudget
+ - compatCoachBudget
- serverProviderHealth
- serverProviderOffer
- serverProviderConsent
@@ -63600,9 +69128,9 @@ components:
- medium
- high
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque — only ever echo a server-returned value, never parse or
- synthesise it."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque — only ever echo a server-returned value, never parse or synthesise it."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -63749,9 +69277,9 @@ components:
- type: "null"
description: When the recipe last changed; null while it never has.
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque — only ever echo a server-returned value, never parse or
- synthesise it."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque — only ever echo a server-returned value, never parse or synthesise it."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -63804,9 +69332,9 @@ components:
modules:
$ref: "#/components/schemas/ModuleMap"
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque — only ever echo a server-returned value, never parse or
- synthesise it."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque — only ever echo a server-returned value, never parse or synthesise it."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -65447,11 +70975,19 @@ components:
description: Reorder lead time in days (0–60) the low-stock alert assumes. The alert fires this lead plus one
dose-interval before the supply runs out so a refill arrives before the last dose. Default 10; a
per-medication reorderLeadDays overrides it.
+ snoozeMinutes:
+ type: integer
+ minimum: 5
+ maximum: 240
+ description: "How long \"Remind me later\" defers a dose reminder, in minutes (5–240, default 30). One value for every
+ surface: the web card, Telegram and the app's notification action show it as \"Remind me later (30
+ min)\". A snooze written without `snoozedUntil` defers by this much."
required:
- clientManaged
- deliveryDefault
- lowStockRunwayDays
- reorderLeadDays
+ - snoozeMinutes
additionalProperties: false
mood:
type: object
@@ -65529,9 +71065,9 @@ components:
- detail
additionalProperties: false
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque — only ever echo a server-returned value, never parse or
- synthesise it."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque — only ever echo a server-returned value, never parse or synthesise it."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -68751,8 +74287,9 @@ components:
- order
additionalProperties: false
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -70678,6 +76215,72 @@ components:
- data
- error
additionalProperties: false
+ AdminMigrationStatusResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/AdminMigrationStatus"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ AdminMigrationStatus:
+ type: object
+ properties:
+ shipped:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Migrations in this image; null when the folder is absent.
+ applied:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ pending:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ pendingNames:
+ type: array
+ items:
+ type: string
+ description: The first 20 pending migrations, in apply order.
+ failedNames:
+ type: array
+ items:
+ type: string
+ description: Migrations that started and did not finish (first 20).
+ lastApplied:
+ anyOf:
+ - type: object
+ properties:
+ name:
+ type: string
+ at:
+ type: string
+ required:
+ - name
+ - at
+ additionalProperties: false
+ - type: "null"
+ required:
+ - shipped
+ - applied
+ - pending
+ - pendingNames
+ - failedNames
+ - lastApplied
+ additionalProperties: false
AdminMeasurementMaintenanceStatusResponse:
type: object
properties:
@@ -70993,6 +76596,32 @@ components:
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ relayState:
+ type: string
+ description: v1.49.0 — `none` | `bound` | `rebind_needed` | `conflict`, as `push.device.relayState` reads it (a
+ `conflict` older than 30 minutes reads `rebind_needed`).
+ relayBoundAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: v1.49.0 — when the relay last confirmed the binding.
+ liveActivityStartedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: v1.49.0 — when the relay accepted the server's last Live Activity start on the device; null while a start
+ is in flight or after one the relay refused.
+ envelopesReportedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: v1.49.0 — when the device last reported which sealed pushes it opened (`GET /api/sync/state`).
required:
- id
- platform
@@ -71001,6 +76630,10 @@ components:
- apnsTokenSuffix
- apnsEnvironment
- lastSeenAt
+ - relayState
+ - relayBoundAt
+ - liveActivityStartedAt
+ - envelopesReportedAt
additionalProperties: false
description: Per-device APNs registration snapshot. The APNs token is masked to its 8-char hex prefix + 8-char suffix so
an operator can correlate with iOS-side logs without disclosing the delivery target.
@@ -71615,10 +77248,13 @@ components:
- nextDueMedicationId
additionalProperties: false
description: "Today's medication block: active-medication count, today-window tally (scheduled / taken / skipped), every
- active medication's current display-due candidate, and legacy scalar fields projected from candidate zero.
- `overdue: true` marks an OPEN overdue slot (anchor passed, still inside its catch-up band); `availableFrom`
- is the canonical cadence- and dose-window-derived attribution-band start. `dueCandidates` is optional so
- older cached snapshots remain valid. Medication ids let consumers deep-link straight to the relevant card."
+ active medication's next dose, and legacy scalar fields projected from candidate zero. Since v1.49.0 each
+ candidate comes from the dose resolver, the same one behind the today rows and
+ `complianceDisplay.currentDose`: the medication's earliest open dose (`due` or `overdue`), else its earliest
+ `upcoming` one. `overdue: true` means the resolver's `overdue` state (past the on-time window, before the
+ miss cutoff); `availableFrom` is the resolver's `dueAt`, when the dose turns due. For the state of a dose,
+ read the today rows or `currentDose`. `dueCandidates` is optional so older cached snapshots remain valid.
+ Medication ids let consumers deep-link straight to the relevant card."
healthScore:
anyOf:
- type: object
@@ -72333,14 +77969,18 @@ components:
- "null"
compliance7:
type: number
- description: Percent, 0-100.
+ description: "Percent, 0-100. When `taken7 + missed7` is 0 there is no dose to score and this is not adherence: show an
+ empty state, not the number."
compliance30:
type: number
- description: Percent, 0-100.
+ description: "Percent, 0-100. When `expected30` is 0 there is no dose to score and this is not adherence: show an empty
+ state, not the number."
streak:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
+ description: Days in a row with every expected dose taken or skipped. Starts on a day with an answered dose, so it is 0
+ before the first one.
taken7:
type: integer
minimum: -9007199254740991
@@ -72353,6 +77993,11 @@ components:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
+ expected30:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Since v1.49.0: the doses the 30-day rate counts (taken plus missed)."
required:
- id
- name
@@ -72365,6 +78010,7 @@ components:
- taken7
- skipped7
- missed7
+ - expected30
additionalProperties: false
description: Cadence-aware compliance per active medication.
alerts:
@@ -75194,6 +80840,13 @@ components:
description: "v1.48.0 — the direction of `delta`: `flat` under 0.05 in the metric's own unit, `unknown` when `delta` is
null. The dashboard summary's metric card takes its `trend` from this same comparison over `30d` (its
`trendWindowDays` is then 30), so the arrow on the card and on the metric page agree."
+ unit:
+ type: string
+ description: "The unit every number of this answer is in, resolved for the account: BLOOD_GLUCOSE in its glucose unit
+ (`mg/dL` or `mmol/L`), the metric/imperial types (weight, length, distance, temperature, …) in its unit
+ system, everything else in the stored unit. `min`, `max`, `mean`, `sum` and `delta` are converted;
+ `deltaPct` is recomputed from the converted means. Render the values with this unit; never convert them
+ again."
required:
- range
- windowDays
@@ -75203,6 +80856,7 @@ components:
- delta
- deltaPct
- trend
+ - unit
additionalProperties: false
description: Single-metric period-over-period aggregate. Reads the current and previous comparable windows from the
rollup tier and composes a count-weighted-mean delta, one source per day. Step-like totals compare average daily
@@ -76036,25 +81690,24 @@ components:
properties:
id:
type: string
- description: "The recording row's id (cuid). Required and never null, so a client decoding it as a plain string keeps
- working: on a `duplicate` for a recording deleted through `DELETE /api/insights/ecg/by-external-ids` it is
- the id of the deletion record instead, which names no recording. Do not fetch or link it; treat it as
- opaque."
+ description: "The recording row's id (cuid): the written one, or on a `duplicate` the row that already holds the
+ recording."
status:
type: string
enum:
- inserted
- updated
- duplicate
- description: "What the write did. `inserted` — a new recording landed (HTTP 201). `updated` — this `externalRecordingId`
+ description: What the write did. `inserted` — a new recording landed (HTTP 201). `updated` — this `externalRecordingId`
was already stored and the row was overwritten in place (HTTP 200); a retry is safe and creates nothing.
`duplicate` — this exact recording is already stored under a DIFFERENT id, i.e. it arrived earlier through
the `export.zip` importer (HTTP 200); nothing was written and `id` names the row that already holds it. A
recording is the same recording when `(source, recordedAt, samplingFrequency)` match, which is enforced by a
- unique index rather than by convention. Since v1.48.2 `duplicate` is also the answer for an `APPLE_HEALTH`
- recording deleted through `DELETE /api/insights/ecg/by-external-ids`: it stays deleted, nothing is written,
- and `id` names the deletion record rather than a recording. All three statuses mean the client may advance
- its cursor."
+ unique index rather than by convention. From v1.48.2 to v1.48.x `duplicate` was also the answer for an
+ `APPLE_HEALTH` recording deleted through `DELETE /api/insights/ecg/by-external-ids`; since v1.49.0 such a
+ re-post is written again (`inserted`), because only the phone can delete a recording, and a recording it
+ reported deleted that comes back is back in Apple Health. All three statuses mean the client may advance its
+ cursor.
recordedAt:
type: string
format: date-time
@@ -78301,6 +83954,10 @@ components:
- skipped
description: "`inserted`/`duplicate` — the row landed (advance the cursor). `skipped` — see `reason`."
reason:
+ description: "Why an entry was `skipped`. `deleted_in_healthlog` (since v1.49.0) for an entry whose `(source,
+ externalId)` names an entry the person deleted in HealthLog; it stays deleted and nothing is written. An
+ entry the phone reported deleted through `DELETE /api/mood-entries/by-external-ids` is written back when it
+ is posted again (`inserted`): it is in Apple Health again."
type: string
id:
description: The upserted row id (absent on skips).
@@ -78760,9 +84417,9 @@ components:
items:
type: string
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque — only ever echo a server-returned value, never parse or
- synthesise it."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque — only ever echo a server-returned value, never parse or synthesise it."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -81024,6 +86681,379 @@ components:
- data
- error
additionalProperties: false
+ GadgetbridgeImportKickoffEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ jobId:
+ type: string
+ status:
+ type: string
+ idempotent:
+ type: boolean
+ required:
+ - jobId
+ - status
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ GadgetbridgeImportStatusEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ job:
+ anyOf:
+ - $ref: "#/components/schemas/RecordFileImportJob"
+ - type: "null"
+ required:
+ - job
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ RecordFileImportJob:
+ type: object
+ properties:
+ jobId:
+ type: string
+ status:
+ type: string
+ startedAt:
+ type: string
+ completedAt:
+ type:
+ - string
+ - "null"
+ uploadBytes:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ result:
+ anyOf:
+ - $ref: "#/components/schemas/RecordFileImportResult"
+ - type: "null"
+ failureReason:
+ description: "On `failed`, a reason led by a closed code and a colon: `not_gadgetbridge`, `unsafe_schema`,
+ `not_fhir_bundle`, `too_many_entries`, `too_large`, `time_budget`, `staging_missing`."
+ type:
+ - string
+ - "null"
+ required:
+ - jobId
+ - status
+ - startedAt
+ - completedAt
+ - uploadBytes
+ - result
+ - failureReason
+ additionalProperties: false
+ RecordFileImportResult:
+ type: object
+ properties:
+ kind:
+ type: string
+ enum:
+ - gadgetbridge
+ - fhir_bundle
+ imported:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ duplicates:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ skipped:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ failed:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ lines:
+ type: array
+ items:
+ type: object
+ properties:
+ key:
+ type: string
+ description: A measurement type (`ACTIVITY_STEPS`, `PULSE`, …) or a record family (`lab`, `condition`, `vaccination`,
+ `medication`, `visit`).
+ imported:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ duplicates:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - key
+ - imported
+ - duplicates
+ additionalProperties: false
+ description: What each kind of row became.
+ skips:
+ type: array
+ items:
+ type: object
+ properties:
+ key:
+ type: string
+ description: "A Gadgetbridge table name or a FHIR resource type: a schema name, never content."
+ reason:
+ type: string
+ description: "A closed reason code: `not_read`, `invalid_time`, `invalid_value`, `out_of_range`, `unsupported_type`,
+ `unsupported_category`, `unit_mismatch`, `not_final`, `no_date`, `future_date`, `no_label`,
+ `not_confirmed`, `not_completed`, `not_taken`, `not_a_visit`, or one of the lab mapping's reasons."
+ count:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - key
+ - reason
+ - count
+ additionalProperties: false
+ description: What the file held that was not imported, and why.
+ budgetExceeded:
+ type: boolean
+ description: The run stopped at its ten-minute budget. The job is `failed` with `time_budget`; uploading the same file
+ again continues, and what was written is found under its identities.
+ measuredSpan:
+ anyOf:
+ - type: object
+ properties:
+ from:
+ type: string
+ to:
+ type: string
+ required:
+ - from
+ - to
+ additionalProperties: false
+ - type: "null"
+ durationMs:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ required:
+ - kind
+ - imported
+ - duplicates
+ - skipped
+ - failed
+ - lines
+ - skips
+ - budgetExceeded
+ - measuredSpan
+ - durationMs
+ additionalProperties: false
+ FhirBundleImportKickoffEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ jobId:
+ type: string
+ status:
+ type: string
+ idempotent:
+ type: boolean
+ required:
+ - jobId
+ - status
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ FhirBundleImportStatusEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ job:
+ anyOf:
+ - $ref: "#/components/schemas/RecordFileImportJob"
+ - type: "null"
+ required:
+ - job
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ HealthConnectRemoteEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/HealthConnectRemoteState"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ HealthConnectRemoteState:
+ type: object
+ properties:
+ source:
+ anyOf:
+ - type: object
+ properties:
+ folderUrl:
+ type: string
+ fileName:
+ type: string
+ enabled:
+ type: boolean
+ lastAttemptAt:
+ type:
+ - string
+ - "null"
+ lastOutcome:
+ description: "The closed outcome of the last attempt: `imported`, `unchanged`, `busy`, `not_found`, `unauthorized`,
+ `redirected`, `upstream_error`, `too_large`, `timeout`, `network`, `private_origin_not_approved`,
+ `invalid_origin`, `no_worker`."
+ type:
+ - string
+ - "null"
+ nextAttemptAt:
+ type: string
+ consecutiveFailures:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ lastImportJobId:
+ type:
+ - string
+ - "null"
+ required:
+ - folderUrl
+ - fileName
+ - enabled
+ - lastAttemptAt
+ - lastOutcome
+ - nextAttemptAt
+ - consecutiveFailures
+ - lastImportJobId
+ additionalProperties: false
+ - type: "null"
+ required:
+ - source
+ additionalProperties: false
+ HealthConnectRemoteSavedEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/HealthConnectRemoteState"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ HealthConnectRemoteDeletedEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ deleted:
+ type: boolean
+ required:
+ - deleted
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ HealthConnectRemoteFetchEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ queued:
+ type: boolean
+ required:
+ - queued
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
MeasurementReminderListEnvelope:
type: object
properties:
@@ -85872,7 +91902,7 @@ components:
assessments:
type: array
items:
- $ref: "#/components/schemas/MentalHealthAssessment"
+ $ref: "#/components/schemas/MentalHealthAssessmentListRow"
trends:
description: v1.44 — one per PHQ-9 / GAD-7 / WHO-5 with at least one administration. Absent on older servers.
type: array
@@ -85881,7 +91911,7 @@ components:
required:
- assessments
additionalProperties: false
- MentalHealthAssessment:
+ MentalHealthAssessmentListRow:
type: object
properties:
id:
@@ -85924,6 +91954,15 @@ components:
type: string
createdAt:
type: string
+ source:
+ type: string
+ description: "Where the administration came from: `WEB`, `IOS` or `APPLE_HEALTH`, as on the detail read. Decode unknown
+ values leniently."
+ itemsUnavailable:
+ type: boolean
+ description: "The detail read's own verdict, without its answers: true when the detail read would answer `items: null`,
+ for a score-only `APPLE_HEALTH` row whose answers were never shared or a row whose answers no longer
+ decrypt. Lets a history say \"answers not shared\" without a detail read per row."
required:
- id
- instrument
@@ -85936,11 +91975,10 @@ components:
- crisisShownAt
- takenAt
- createdAt
+ - source
+ - itemsUnavailable
additionalProperties: false
- description: One completed screener administration. `severityBand` is a descriptive label for the screen (never a
- diagnosis). `item9Flagged` is true when the PHQ-9 self-harm item was answered > 0 — the client MUST show crisis
- resources when it is. Raw per-item answers are intentionally absent from list rows; the by-id detail read
- returns them decrypted.
+ description: "One row of the screener history: the administration plus `source` and `itemsUnavailable`. No item answer."
MentalHealthAssessmentTrend:
type: object
properties:
@@ -86067,6 +92105,66 @@ components:
- actionThreshold
- crisis
additionalProperties: false
+ MentalHealthAssessment:
+ type: object
+ properties:
+ id:
+ type: string
+ instrument:
+ type: string
+ enum:
+ - PHQ9
+ - GAD7
+ - WHO5
+ - SCI
+ locale:
+ type: string
+ wording:
+ anyOf:
+ - type: string
+ enum:
+ - validated
+ - unvalidated_translation
+ - original_en
+ - type: "null"
+ description: "Which text the answers were given in. `validated`: the published validated version for `locale` (the
+ original for English). `unvalidated_translation`: a translation written for HealthLog where no validated
+ version exists; clients show that the result is orientation only. `original_en`: the English original,
+ chosen by a reader of another language (`englishOriginal` on create). Null on administrations recorded
+ before v1.46."
+ version:
+ type: string
+ totalScore:
+ type: number
+ severityBand:
+ type: string
+ item9Flagged:
+ type: boolean
+ crisisShownAt:
+ type:
+ - string
+ - "null"
+ takenAt:
+ type: string
+ createdAt:
+ type: string
+ required:
+ - id
+ - instrument
+ - locale
+ - wording
+ - version
+ - totalScore
+ - severityBand
+ - item9Flagged
+ - crisisShownAt
+ - takenAt
+ - createdAt
+ additionalProperties: false
+ description: One completed screener administration. `severityBand` is a descriptive label for the screen (never a
+ diagnosis). `item9Flagged` is true when the PHQ-9 self-harm item was answered > 0 — the client MUST show crisis
+ resources when it is. Raw per-item answers are intentionally absent from list rows; the by-id detail read
+ returns them decrypted.
CrisisResourceSet:
type: object
properties:
@@ -86644,6 +92742,7 @@ components:
- PAPERLESS
- PAPRA
- OTHER
+ - REPORT_SCHEDULE
- type: "null"
sourceId:
type:
@@ -86698,13 +92797,14 @@ components:
index, and is null when the attempt succeeded or none ran. `hasThumbnail` is true when a preview thumbnail has
been rendered in the background (fetch it from `/api/documents/inbound/{id}/thumbnail`); false means no preview
yet or an unsupported type — show a placeholder. `sourceSystem` / `sourceId` say where an imported document came
- from and its id there (both null for a document added in HealthLog); treat an unknown `sourceSystem` as OTHER
- when decoding. `sourceUrl` is the document's page in the Paperless-ngx or Papra archive the owner has connected
- (http or https), built by the server from that connection; it is filled on the list (`GET
- /api/documents/inbound`) and on the detail read and edit (`GET` / `PATCH /api/documents/inbound/{id}`), only for
- the owner acting on their own record and only while the connection, the id and the operator's origin list allow
- it; it is null for a delegate or a guardian and in every other response. Open it in a browser; never send
- credentials to it. Treat an unknown `kind` value as OTHER when decoding.
+ from and its id there (both null for a document added in HealthLog); `REPORT_SCHEDULE` marks a doctor report the
+ server filed on the owner's schedule (no `sourceUrl`); treat an unknown `sourceSystem` as OTHER when decoding.
+ `sourceUrl` is the document's page in the Paperless-ngx or Papra archive the owner has connected (http or
+ https), built by the server from that connection; it is filled on the list (`GET /api/documents/inbound`) and on
+ the detail read and edit (`GET` / `PATCH /api/documents/inbound/{id}`), only for the owner acting on their own
+ record and only while the connection, the id and the operator's origin list allow it; it is null for a delegate
+ or a guardian and in every other response. Open it in a browser; never send credentials to it. Treat an unknown
+ `kind` value as OTHER when decoding.
DocumentConditionLink:
type: object
properties:
@@ -87228,6 +93328,7 @@ components:
- PAPERLESS
- PAPRA
- OTHER
+ - REPORT_SCHEDULE
- type: "null"
sourceId:
type:
@@ -87278,6 +93379,13 @@ components:
more facts than one review takes. Kept from the last extraction (the extract route, its background run, or
automatic lab staging) until the next one replaces the facts; false for a document never extracted. A review
shows it whenever it is opened, not only when the run ends."
+ aiFailures:
+ type: array
+ items:
+ $ref: "#/components/schemas/AiJobFailure"
+ description: v1.49 — why the latest background AI work on this document stopped, one entry per kind (`documentSummary`,
+ `documentIndex`, `documentRead`), newest first. Empty when nothing failed or the work succeeded since.
+ Absent on servers older than v1.49.
required:
- id
- kind
@@ -87311,6 +93419,7 @@ components:
- summaryGeneratedAt
- summaryState
- extractionIncomplete
+ - aiFailures
additionalProperties: false
description: 'A stored document plus its staged facts. `summary` is a short (3-4 sentence) plain-language description of
WHAT the document is, generated once and then served from storage; it is descriptive only, never a diagnosis.
@@ -87462,6 +93571,89 @@ components:
catalogue entry when this release still knows the dose's slug, for the reader's own bundle to name; null is the
signal to show `vaccineName`, the person's own wording. The same table the dose's own
`/api/vaccinations/{id}/links` writes from the other end.
+ AiJobFailure:
+ type: object
+ properties:
+ job:
+ type: string
+ enum:
+ - documentSummary
+ - documentIndex
+ - documentRead
+ - labScan
+ - supplementLabel
+ - statusText
+ - briefing
+ - periodNarrative
+ - workoutInsight
+ - reactionLine
+ - coachNudge
+ - coachMemory
+ description: "The kind of background AI work: `documentSummary`, `documentIndex` (making a document searchable),
+ `documentRead` (reading a document's values or filing suggestions), `labScan`, `supplementLabel`,
+ `statusText` (the notes on the cards), `briefing`, `periodNarrative`, `workoutInsight`, `reactionLine`,
+ `coachNudge`, `coachMemory`. Treat an unknown value as other background work."
+ code:
+ type: string
+ enum:
+ - no_provider
+ - chain_no_provider
+ - consent_required
+ - not_permitted
+ - check_failed
+ - credential_expired
+ - rate_limited
+ - provider_timeout
+ - provider_unreachable
+ - provider_empty
+ - provider_reasoning_only
+ - provider_paused
+ - provider_error
+ - budget_exhausted
+ - unreadable_file
+ description: "Why it stopped. `no_provider`: no provider is set up that could do this work. `chain_no_provider`: the
+ work is bound to a named chain and none of its entries is set up. `consent_required`: the provider needs a
+ consent receipt and none is active. `not_permitted`: the work may not run on this record. `check_failed`:
+ the server could not check whether it may run. `credential_expired`: the provider refused the key.
+ `rate_limited`: the provider said too many requests. `provider_timeout`: no answer in time.
+ `provider_unreachable`: the provider could not be reached. `provider_empty`: it answered with nothing.
+ `provider_reasoning_only`: the model reasoned and never answered. `provider_paused`: the provider failed so
+ often that background work waits before trying again. `provider_error`: another provider failure.
+ `budget_exhausted`: today's AI allowance is used up. `unreadable_file`: the file could not be prepared for
+ the provider. Treat an unknown value as `provider_error`."
+ documentId:
+ description: The document the work was for, or null.
+ type:
+ - string
+ - "null"
+ providerType:
+ description: The provider entry that failed (a chain provider type such as `local` or `anthropic`), when one was called.
+ type:
+ - string
+ - "null"
+ failCount:
+ type: integer
+ minimum: 1
+ maximum: 9007199254740991
+ description: Failures in a row since the last success.
+ firstFailedAt:
+ type: string
+ description: ISO 8601.
+ lastFailedAt:
+ type: string
+ description: ISO 8601.
+ required:
+ - job
+ - code
+ - documentId
+ - providerType
+ - failCount
+ - firstFailedAt
+ - lastFailedAt
+ additionalProperties: false
+ description: Why the latest background AI work of one kind stopped (v1.49). Recorded by the server from closed codes
+ only; no provider message or payload is stored. A later success removes it; it is no longer served thirty days
+ after its last failure.
InboundDocumentUpdateEnvelope:
type: object
properties:
@@ -87596,6 +93788,7 @@ components:
- PAPERLESS
- PAPRA
- OTHER
+ - REPORT_SCHEDULE
- type: "null"
description: The system an imported document came from, or null for one added in HealthLog.
deletedAt:
@@ -88293,6 +94486,119 @@ components:
- data
- error
additionalProperties: false
+ OnboardingChecklistExtrasEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/OnboardingChecklistExtras"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ OnboardingChecklistExtras:
+ type: object
+ properties:
+ emergencyCard:
+ type: object
+ properties:
+ applies:
+ type: boolean
+ description: "Whether the row means anything for this record: inside a managed profile only the guardian's rows
+ (emergency card, care feed, report schedule) apply."
+ done:
+ type: boolean
+ description: Whether it is already set up.
+ required:
+ - applies
+ - done
+ additionalProperties: false
+ careFeed:
+ type: object
+ properties:
+ applies:
+ type: boolean
+ description: "Whether the row means anything for this record: inside a managed profile only the guardian's rows
+ (emergency card, care feed, report schedule) apply."
+ done:
+ type: boolean
+ description: Whether it is already set up.
+ required:
+ - applies
+ - done
+ additionalProperties: false
+ sharing:
+ type: object
+ properties:
+ applies:
+ type: boolean
+ description: "Whether the row means anything for this record: inside a managed profile only the guardian's rows
+ (emergency card, care feed, report schedule) apply."
+ done:
+ type: boolean
+ description: Whether it is already set up.
+ required:
+ - applies
+ - done
+ additionalProperties: false
+ imports:
+ type: object
+ properties:
+ applies:
+ type: boolean
+ description: "Whether the row means anything for this record: inside a managed profile only the guardian's rows
+ (emergency card, care feed, report schedule) apply."
+ done:
+ type: boolean
+ description: Whether it is already set up.
+ required:
+ - applies
+ - done
+ additionalProperties: false
+ reportSchedule:
+ type: object
+ properties:
+ applies:
+ type: boolean
+ description: "Whether the row means anything for this record: inside a managed profile only the guardian's rows
+ (emergency card, care feed, report schedule) apply."
+ done:
+ type: boolean
+ description: Whether it is already set up.
+ required:
+ - applies
+ - done
+ additionalProperties: false
+ iosApp:
+ type: object
+ properties:
+ applies:
+ type: boolean
+ description: "Whether the row means anything for this record: inside a managed profile only the guardian's rows
+ (emergency card, care feed, report schedule) apply."
+ done:
+ type: boolean
+ description: Whether it is already set up.
+ required:
+ - applies
+ - done
+ additionalProperties: false
+ required:
+ - emergencyCard
+ - careFeed
+ - sharing
+ - imports
+ - reportSchedule
+ - iosApp
+ additionalProperties: false
+ description: 1.49 — presence behind the getting-started checklist's optional rows. Existence and counts only, never contents.
OnboardingStateEnvelope:
type: object
properties:
@@ -88338,14 +94644,17 @@ components:
anyOf:
- $ref: "#/components/schemas/OnboardingFirstResult"
- type: "null"
+ offers:
+ $ref: "#/components/schemas/OnboardingOffers"
required:
- steps
- needs
- completedAt
- firstResult
+ - offers
additionalProperties: false
description: The needs-based setup flow for one record. Always present on the account payload — a record that never
- entered the flow reads as empty answers with nine `pending` steps, so a client branches on the step statuses
+ entered the flow reads as empty answers and every step `pending`, so a client branches on the step statuses
rather than on the field's existence. On the account payload it describes the ACTIVE record, so a client under
an account switch reads the same record its counts and module map describe; under a scoped grant the answers
come back empty.
@@ -88362,6 +94671,8 @@ components:
- visit
- units
- confirm
+ - reminders
+ - ai
- first-result
- done
status:
@@ -88382,6 +94693,12 @@ components:
`units` carries one resolution the others do not: a record whose account already holds BOTH unit preferences
reads as `done` whether or not the question was ever put, which is what stops the flow re-asking a value the
account holds.
+
+
+ 1.49 adds two follow-ups after `confirm`: `reminders` (where reminders arrive; for a medication schedule or a
+ mood or cycle area) and `ai` (the Coach, yes or no; only while `offers.ai`). Neither holds the setup open for a
+ client that skips them: a follow-up that does not apply reads `skipped`, and a ledger confirmed before 1.49
+ reads both as `skipped`.
OnboardingNeeds:
type: object
properties:
@@ -88462,12 +94779,41 @@ components:
- metric
- imperial
- type: "null"
+ timezone:
+ description: 1.49 — the IANA time zone confirmed on the "Region & units" screen, as given. `timezone` on the account
+ payload is the value every surface reads.
+ type:
+ - string
+ - "null"
+ medicineRegistry:
+ anyOf:
+ - type: string
+ enum:
+ - PL
+ - DE
+ - ES
+ - FR
+ - GB
+ - BE
+ - NL
+ - US
+ - CA
+ - AU
+ - BR
+ - EU
+ - NONE
+ - type: "null"
+ description: 1.49 — the medicine registry chosen on the same screen (asked only when medication was chosen), as given.
+ `medicineRegistry` on the account payload is the value the medication read uses.
required:
- glucoseUnit
- unitPreference
+ - timezone
+ - medicineRegistry
additionalProperties: false
- description: "Q6 — the unit answers as given. NOT the source of truth for display: `glucoseUnit` and `unitPreference` on
- the account payload are, and the answers step writes them. This records what the flow was told."
+ description: "Q6 (\"Region & units\" since 1.49, id unchanged) — the answers as given. NOT the source of truth for
+ display: the account payload's columns are, and the answers step writes them. This records what the flow was
+ told."
required:
- recordTarget
- areas
@@ -88505,6 +94851,19 @@ components:
- completedAt
additionalProperties: false
description: The one task the flow offered at the end, and whether it produced its result.
+ OnboardingOffers:
+ type: object
+ properties:
+ ai:
+ type: boolean
+ description: "The server offers this record the Coach: available, waiting only for the person's consent, or waiting for
+ a provider the person may set up. Never while the operator or the person switched it off. The `ai` step
+ applies only while true."
+ required:
+ - ai
+ additionalProperties: false
+ description: 1.49 — the server facts the conditional follow-up steps depend on, resolved on the server so no client
+ recomputes them.
OnboardingCompleteEnvelope:
type: object
properties:
@@ -89014,6 +95373,144 @@ components:
additionalProperties: false
description: A user-set daily amount in the nutrient's canonical unit. `target` = an amount to reach, `limit` = an
amount to stay under.
+ EnergyBalanceEnvelope:
+ type: object
+ properties:
+ data:
+ type: object
+ properties:
+ windowDays:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ days:
+ type: array
+ items:
+ type: object
+ properties:
+ day:
+ type: string
+ format: date
+ intakeKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: The day's folded `energy` intake; null when nothing was logged (never 0).
+ restingKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: "Resting energy: the day's `BASAL_ENERGY_BURNED` sum, else the Mifflin-St Jeor estimate, else null."
+ restingEstimated:
+ type: boolean
+ description: True when `restingKcal` is the estimate, not a reading.
+ activeKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: The day's `ACTIVE_ENERGY_BURNED` sum, or null.
+ expenditureKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Resting plus active; null when either is missing.
+ balanceKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Intake minus expenditure; negative is a deficit. Null when either is missing.
+ trendKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description: Mean balance of the seven days ending here, once four of them hold one; null on the partial day.
+ partial:
+ type: boolean
+ description: "Today, still running: outside the trend and the window means."
+ required:
+ - day
+ - intakeKcal
+ - restingKcal
+ - restingEstimated
+ - activeKcal
+ - expenditureKcal
+ - balanceKcal
+ - trendKcal
+ - partial
+ additionalProperties: false
+ description: One entry per local day, oldest first.
+ summary:
+ type: object
+ properties:
+ daysWithBalance:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ meanIntakeKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ meanExpenditureKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ meanBalanceKcal:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ required:
+ - daysWithBalance
+ - meanIntakeKcal
+ - meanExpenditureKcal
+ - meanBalanceKcal
+ additionalProperties: false
+ estimateGaps:
+ type: array
+ items:
+ type: string
+ enum:
+ - weight
+ - height
+ - birthDate
+ - sex
+ description: What the resting estimate lacks; empty when it can be made. A day without a resting reading has no
+ expenditure while any is missing.
+ required:
+ - windowDays
+ - days
+ - summary
+ - estimateGaps
+ additionalProperties: false
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
NutrientWaterWriteEnvelope:
type: object
properties:
@@ -89282,6 +95779,15 @@ components:
type: boolean
description: This type has gone quiet while the source around it reads healthy — the dead-pipe signature (e.g. a single
revoked HealthKit permission). Only ever true when the verdict is `fresh`.
+ oldestSeenAt:
+ description: "Since v1.49.0: the oldest stored reading of this type from Apple Health, in the same scope as `lastSeenAt`
+ (live rows only; the oldest `takenAt`, or slot of a skipped dose, on `MEDICATION_DOSE`; the oldest start on
+ `WORKOUTS`). Below it the server holds nothing of the type from Apple Health, so a history walk that has met
+ only duplicates can jump here and go on below. Unlike `lastSeenAt` on a type the app writes back, it never
+ counts a reading entered here. Absent on a server before v1.49.0."
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
lastReceivedAt:
description: "When a live sync batch last brought a new or changed row of this type. Since v1.45 a batch that carried
the type with duplicates only (an unchanged `stats:` re-post or an hour posted again with its stored value
@@ -91420,10 +97926,10 @@ components:
type: array
items:
$ref: "#/components/schemas/IntegrationStatusEntry"
- description: "All nine providers, always, in the fixed order withings, whoop, google-health, polar, oura, strava,
- nightscout, dawarich, garmin. A provider the user has never touched still appears, with `connected: false`
- and the ledger state `unknown` — absence from this list never means anything, because nothing is ever absent
- from it."
+ description: "All ten providers, always, in the fixed order withings, whoop, google-health, polar, oura, strava,
+ nightscout, dawarich, garmin, health-connect-remote. A provider the user has never touched still appears,
+ with `connected: false` and the ledger state `unknown` — absence from this list never means anything,
+ because nothing is ever absent from it."
required:
- threshold
- fitbitRemovalNotice
@@ -91431,8 +97937,8 @@ components:
- integrations
additionalProperties: false
description: The one read behind the integrations settings surface. It carries every field the per-provider status
- routes carry, so a client has the choice of nine round-trips or this one; the per-provider routes remain for
- callers that want a single provider.
+ routes carry, so a client has the choice of one round-trip per provider or this one; the per-provider routes
+ remain for callers that want a single provider.
IntegrationStatusEntry:
type: object
properties:
@@ -91448,7 +97954,11 @@ components:
- nightscout
- dawarich
- garmin
- description: Which provider this entry describes.
+ - health-connect-remote
+ description: "Which provider this entry describes. `health-connect-remote` is the scheduled Health Connect export
+ fetched from a WebDAV or Nextcloud folder (`/api/import/health-connect-remote`): `configured` when a folder
+ is set up, `connected` when it is also switched on. A refused user name or app password reads as
+ `reauth_required`; the fix is a new password on that route, not an OAuth reconnect."
state:
type: string
enum:
@@ -92971,8 +99481,9 @@ components:
again. Additive.
type: boolean
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -93239,8 +99750,9 @@ components:
again. Additive.
type: boolean
updatedAt:
- description: "Optimistic-concurrency token: the stored row's `updatedAt` at read/write time. Echo it back as
- `baseUpdatedAt` on the next write. Opaque."
+ description: "Optimistic-concurrency token: this resource's own revision at read/write time, which moves only when this
+ resource changes, never on another write to the account. Echo it back as `baseUpdatedAt` on the next write.
+ Opaque."
type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
@@ -93529,6 +100041,29 @@ components:
- type: "null"
description: The account's chosen glucose display unit, as stored. `null` means the person never chose one (or the
stored value is neither unit), and the server then shows glucose in mg/dL.
+ medicineRegistry:
+ type: string
+ enum:
+ - PL
+ - DE
+ - ES
+ - FR
+ - GB
+ - BE
+ - NL
+ - US
+ - CA
+ - AU
+ - BR
+ - EU
+ - NONE
+ description: '#1430 — which official medicine registry the "Find leaflet" link opens: an ISO 3166 alpha-2 country code
+ (`PL`, `DE`, `ES`, `FR`, `GB`, `BE`, `NL`, `US`, `CA`, `AU`, `BR`, `EU`; `GB` is the United Kingdom, `EU`
+ the European Medicines Agency), or `NONE` for no leaflet search. Independent of the interface language.
+ Never null: an account that never chose one has it derived once from its language and time zone where the
+ two agree on one registry, otherwise `NONE`, and stored, so a later change of language does not move it. Set
+ it with `PATCH /api/auth/me/medicine-registry`. Clients show and edit it; the link itself comes ready-built
+ on the medication list and detail as `leafletSearch`.'
features:
type: object
properties:
@@ -93575,6 +100110,21 @@ components:
absent or `false` means this server does not have the feature; a client checks for `true` before it calls a
route or sends a request form the flag names. Absent on servers older than v1.42.0. A client that meets a
flag it does not know ignores it.
+ push:
+ type: object
+ properties:
+ relay:
+ $ref: "#/components/schemas/PushRelayCapability"
+ device:
+ anyOf:
+ - $ref: "#/components/schemas/DevicePushState"
+ - type: "null"
+ description: The calling device, named by `X-Device-Id`; null when the header names none of the caller's devices.
+ required:
+ - relay
+ - device
+ additionalProperties: false
+ description: v1.49 — the push relay and the calling device's push state. Clients gate on these fields, never on a version.
accountAccess:
$ref: "#/components/schemas/AccountAccess"
moduleAccess:
@@ -93609,7 +100159,9 @@ components:
- createdAt
- timezone
- glucoseUnit
+ - medicineRegistry
- features
+ - push
- accountAccess
- moduleAccess
- ai
@@ -93631,6 +100183,116 @@ components:
with the same masking; it replaces reading `GET /api/feature-flags`. `coachReasoning` (v1.41) is the Coach's
resolved thinking depth: the caller's own preference against the operator's reasoning controls and the record's
provider."
+ PushRelayCapability:
+ type: object
+ properties:
+ host:
+ description: "The relay host, lower case, without scheme or port: the `host` field of every statement the app signs
+ (`hl-bind-v1`, `hl-activity-v1`) and of the relay's response signatures."
+ type:
+ - string
+ - "null"
+ available:
+ type: boolean
+ description: This server can use a relay at all (`PUSH_RELAY_MODE` is not `off` and the relay's identity keys are pinned).
+ offered:
+ type: boolean
+ description: The operator turned the relay on. Show the opt-in card only when this is true and `push.device.consent` is
+ false; when it turns false, revoke the binding at the relay directly and return to local reminders.
+ state:
+ type: string
+ enum:
+ - ok
+ - degraded
+ - down
+ - off
+ description: The relay's health as this server sees it; `off` while not offered.
+ since:
+ description: When `state` last changed, ISO 8601.
+ type:
+ - string
+ - "null"
+ reason:
+ description: A short code for a non-`ok` state.
+ type:
+ - string
+ - "null"
+ instanceId:
+ description: "The instance id the relay issued: what `hl-bind-v1` and `hl-activity-v1` are signed for. Null until
+ registered."
+ type:
+ - string
+ - "null"
+ senderKeys:
+ type: array
+ items:
+ $ref: "#/components/schemas/PushSenderKey"
+ description: "The keys to pin for this account, at most three: `next` (announced at least 7 days before it seals
+ anything), `current`, and `previous` for 30 days after it retired. Pin all of them and try each. The server
+ enforces the notice: sealing switches only to a key that was published as `next` for 7 days, and a new
+ `next` is announced only after `previous` retired. The one exception is the operator's emergency rotation of
+ an exposed key, which replaces `current` at once and drops `next` and `previous`. Present whenever this
+ server seals envelopes, over the relay or over its own APNs key."
+ envelopeVersions:
+ type: array
+ items:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Envelope versions this server seals (`[1]`). Non-empty means the device must refuse unsealed content.
+ liveActivity:
+ type: array
+ items:
+ type: string
+ description: "Live Activity events the relay carries: `[\"end\"]`, and `[\"end\", \"start\", \"update\"]` while the
+ operator's switch (`PUSH_RELAY_LIVE_ACTIVITY=on`) is on; start and update reach only a device with
+ `push.device.liveActivityConsent`. Empty while the relay is not offered. Offer the second switch only when
+ it lists `start`."
+ liveActivityConsentTextVersion:
+ type: string
+ description: The text version of the Live Activity consent sentence; sent back as `liveActivityConsent.textVersion`.
+ termsUrl:
+ type:
+ - string
+ - "null"
+ privacyUrl:
+ type:
+ - string
+ - "null"
+ consentTextVersion:
+ type: string
+ description: The consent text version the card shows; sent back as `relayConsent.textVersion`.
+ operatorDecision:
+ description: "The operator's one answer, for the whole server, to \"Send push notifications through the HealthLog
+ relay?\". `on` once the registration at the relay succeeded; `off` when an admin said no or switched the
+ relay off, and also when there is nothing to decide (`available: false`, or the server has an APNs key of
+ its own, which the relay would never be used beside); `undecided` otherwise. Ask each person about the relay
+ only while it is `on`."
+ $ref: "#/components/schemas/PushRelayOperatorDecision"
+ canDecide:
+ type: boolean
+ description: "The caller is an admin of a server whose relay is available (never on a demo deploy). Informational for a
+ Bearer client: the answer is given on the web admin page (`/admin`), because the routes that give it (`POST
+ /api/admin/push-relay/decision`, `PUT /api/admin/push-relay`) are cookie-only like every admin route and
+ refuse a Bearer token."
+ required:
+ - host
+ - available
+ - offered
+ - state
+ - since
+ - reason
+ - instanceId
+ - senderKeys
+ - envelopeVersions
+ - liveActivity
+ - liveActivityConsentTextVersion
+ - termsUrl
+ - privacyUrl
+ - consentTextVersion
+ - operatorDecision
+ - canDecide
+ additionalProperties: false
AccountAccess:
type: object
properties:
@@ -94838,6 +101500,37 @@ components:
- data
- error
additionalProperties: false
+ ManagedProfileActivityEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/ManagedProfileActivity"
+ error:
+ type: "null"
+ meta:
+ $ref: "#/components/schemas/ListCapMeta"
+ required:
+ - data
+ - error
+ - meta
+ additionalProperties: false
+ ManagedProfileActivity:
+ type: object
+ properties:
+ entries:
+ type: array
+ items:
+ $ref: "#/components/schemas/RecordActivityEntry"
+ retentionDays:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "How far back this feed can see, in days: the instance's audit retention setting, the same number `GET
+ /api/account/activity` sends."
+ required:
+ - entries
+ - retentionDays
+ additionalProperties: false
ManagedProfileGuardianListEnvelope:
type: object
properties:
@@ -95227,6 +101920,7 @@ components:
- MEDICATION_LOW_STOCK
- MEASUREMENT_REMINDER
- MEDICATION_INTAKE_SYNC
+ - MEDICATION_INTAKE_RECORDED
- SECURITY_ALERT
- DAILY_BRIEFING
- SHARED_RECORD_INTAKE
@@ -95250,6 +101944,7 @@ components:
- MEDICATION_LOW_STOCK
- MEASUREMENT_REMINDER
- MEDICATION_INTAKE_SYNC
+ - MEDICATION_INTAKE_RECORDED
- SECURITY_ALERT
- DAILY_BRIEFING
- SHARED_RECORD_INTAKE
@@ -95322,6 +102017,7 @@ components:
- MEDICATION_LOW_STOCK
- MEASUREMENT_REMINDER
- MEDICATION_INTAKE_SYNC
+ - MEDICATION_INTAKE_RECORDED
- SECURITY_ALERT
- DAILY_BRIEFING
- SHARED_RECORD_INTAKE
@@ -95951,6 +102647,7 @@ components:
- coach
- insights
- documents
+ - aiSource
description: The closed set of configuration families a Guardian may read and write on a managed record. Identity,
credentials, delivery channels, Coach memories and provider connections are absent by construction — no
family accepts them, so every future field fails closed until one deliberately does.
@@ -95963,6 +102660,7 @@ components:
- $ref: "#/components/schemas/RecordCoachSettings"
- $ref: "#/components/schemas/RecordInsightsSettings"
- $ref: "#/components/schemas/RecordDocumentsSettings"
+ - $ref: "#/components/schemas/RecordAiSourceSettings"
description: The DTO for the family in the path. Which variant arrives is determined entirely by `{family}`, so branch
on `family` rather than probing the shape — OpenAPI cannot express the dependency between a path parameter
and a response variant.
@@ -96369,6 +103067,51 @@ components:
pipeline reads. Off by default. Turning it on records the record's document-reading consent (an `ai_extraction`
receipt) when none is active, and queues a bounded catch-up over documents already stored when the record's
`documentAi` capability is open.
+ RecordAiSourceSettings:
+ type: object
+ properties:
+ source:
+ type: string
+ enum:
+ - INSTANCE
+ - NONE
+ - GUARDIAN
+ chainId:
+ type:
+ - string
+ - "null"
+ servedByYou:
+ type: boolean
+ guardianChainUsable:
+ type: boolean
+ yourChains:
+ type: array
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ required:
+ - id
+ - name
+ additionalProperties: false
+ instanceKeyConfigured:
+ type: boolean
+ required:
+ - source
+ - chainId
+ - servedByYou
+ - guardianChainUsable
+ - yourChains
+ - instanceKeyConfigured
+ additionalProperties: false
+ description: "Which provider a managed profile's AI work uses: the operator's key (`INSTANCE`, the default), none
+ (`NONE`), or a chain of a guardian (`GUARDIAN`; `chainId` a named chain of that guardian, null for their default
+ chain). `servedByYou` says whether the reading guardian is the lender; `guardianChainUsable` whether the lender
+ still manages the profile and the chain still exists. `yourChains` lists the reading guardian's named chains to
+ pick from, ids and names only."
PatchRecordSettingsFamilyEnvelope:
type: object
properties:
@@ -97285,7 +104028,7 @@ components:
type: object
properties:
data:
- $ref: "#/components/schemas/MedicationIntakeEvent"
+ $ref: "#/components/schemas/RepeatedMedicationIntakeEvent"
error:
type: "null"
meta:
@@ -97298,11 +104041,168 @@ components:
- data
- error
additionalProperties: false
+ RepeatedMedicationIntakeEvent:
+ type: object
+ properties:
+ id:
+ type: string
+ userId:
+ type: string
+ medicationId:
+ type: string
+ scheduledFor:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ takenAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ skipped:
+ type: boolean
+ autoMissed:
+ type: boolean
+ description: True when the nightly cron closed the slot as missed (no user action). Auto-missed rows count against
+ adherence but never consume inventory.
+ autoRecorded:
+ type: boolean
+ description: v1.42.2 — true when the server recorded this dose because the medication has `autoMarkTaken` on, not the
+ person. It counts as taken everywhere (adherence, history, Coach) and consumed inventory like a manual take.
+ Any take or skip the person records on the row clears it. Clients label such a dose "recorded
+ automatically".
+ attributionSource:
+ type: string
+ enum:
+ - AUTO
+ - USER_PIN
+ description: "How the row bound to its schedule slot: AUTO = the write path's nearest-slot resolution; USER_PIN = the
+ user explicitly pinned the slot (the dedup converge keeps the pinned row)."
+ source:
+ type: string
+ enum:
+ - WEB
+ - API
+ - REMINDER
+ - IMPORT
+ - APPLE_HEALTH
+ takenVia:
+ anyOf:
+ - type: string
+ enum:
+ - WEB
+ - APP
+ - INTEGRATION
+ - TELEGRAM
+ - APPLE_HEALTH
+ - IMPORT
+ - AUTO
+ - type: "null"
+ description: Where the take on this row came from, whatever wrote the row (`source` keeps the writer that created it,
+ `REMINDER` for a projected slot). Null until a take reaches the row, and on takes recorded before migration
+ 0515.
+ idempotencyKey:
+ type:
+ - string
+ - "null"
+ createdAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ updatedAt:
+ type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ injectionSite:
+ anyOf:
+ - type: string
+ enum:
+ - ABDOMEN_LEFT
+ - ABDOMEN_RIGHT
+ - ABDOMEN_UPPER_LEFT
+ - ABDOMEN_UPPER_RIGHT
+ - THIGH_LEFT
+ - THIGH_RIGHT
+ - UPPER_ARM_LEFT
+ - UPPER_ARM_RIGHT
+ - type: "null"
+ description: Recorded injection site for a site-tracked medication (GLP-1 rotation surface). NULL when the medication
+ does not track sites or none was recorded.
+ doseTaken:
+ description: Free-text dose actually taken when it differed from the scheduled dose (titration weeks, split doses). NULL
+ = the scheduled dose.
+ type:
+ - string
+ - "null"
+ inventoryConsumption:
+ anyOf:
+ - {}
+ - type: "null"
+ description: JSON ledger of the container decrements this intake caused (`[{itemId, units}]`), written by the
+ consumption hook. NULL when nothing was consumed (skipped / no tracked inventory).
+ externalId:
+ description: v1.28 — client-supplied stable id for externally-mirrored intakes (Apple Health sync); the dedup key for
+ re-synced rows. NULL for native rows.
+ type:
+ - string
+ - "null"
+ syncVersion:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: Monotonic per-row version for incremental sync readers; bumps on every mutation.
+ deletedAt:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ description: Soft-delete tombstone. Non-null rows are excluded from every list/aggregate read; sync readers use it to
+ propagate deletions.
+ appleHealthDeletedAt:
+ description: "Since v1.49.0: who deleted a tombstone. Equal to `deletedAt` when the phone reported the dose deleted
+ through `DELETE /api/medications/intake/by-external-ids`; null, or different, when it was deleted in
+ HealthLog. A re-post of a dose deleted in HealthLog is refused (`skipped`, reason `deleted_in_healthlog`),
+ one the phone reported is written again. Null on every live row; do not show it."
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
+ - type: "null"
+ alreadyTaken:
+ type: boolean
+ description: "True when this POST reported a dose already recorded, or skipped one: the slot it binds to already holds a
+ take. Nothing was written and no stock was consumed; the body is the recorded row, so `takenAt` and
+ `takenVia` say when and how. False on a fresh dose (201) and on an idempotency replay (200)."
+ required:
+ - id
+ - userId
+ - medicationId
+ - scheduledFor
+ - takenAt
+ - skipped
+ - autoMissed
+ - autoRecorded
+ - attributionSource
+ - source
+ - takenVia
+ - idempotencyKey
+ - createdAt
+ - updatedAt
+ - injectionSite
+ - doseTaken
+ - inventoryConsumption
+ - externalId
+ - syncVersion
+ - deletedAt
+ - alreadyTaken
+ additionalProperties: false
ExternalMedicationIntakeCreatedEnvelope:
type: object
properties:
data:
- $ref: "#/components/schemas/MedicationIntakeEvent"
+ $ref: "#/components/schemas/RepeatedMedicationIntakeEvent"
error:
type: "null"
meta:
@@ -98227,6 +105127,31 @@ components:
type: string
updatedAt:
type: string
+ doseOffset:
+ description: "Since v1.49.0, on `GET /api/symptoms/events` only (feature key `day.dose-offset`). The same value `GET
+ /api/day/{date}` carries for this occurrence: its distance from the nearest dose taken at or before it on
+ the same local day of the record's zone, else the nearest one after it. Absent when that day holds no timed
+ dose, when the medications module is off, or when a delegate's grant does not cover medications. A distance
+ in time and nothing more; never a cause."
+ type: object
+ properties:
+ intakeId:
+ type: string
+ description: The anchoring intake event's id.
+ title:
+ type: string
+ description: The medication's name.
+ minutes:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Minutes from the dose to the symptom. Positive: after the dose; negative: before it, when the day holds no
+ earlier dose."
+ required:
+ - intakeId
+ - title
+ - minutes
+ additionalProperties: false
required:
- id
- definitionId
@@ -98351,12 +105276,31 @@ components:
description: "Why an entry was `skipped`: `unsupported_source` (source other than `APPLE_HEALTH`),
`unstable_external_id`, `unknown_code`, `value_out_of_range` (intensity not an integer 0-10),
`implausible_timestamp` (in the future beyond five minutes, before 1900, or ending before it started).
- Decode unknown reasons leniently."
+ `deleted_in_healthlog` (since v1.49.0) for a sample the person deleted in HealthLog, which stays deleted. A
+ sample the phone reported deleted through `DELETE /api/symptoms/events/by-external-ids` is written back when
+ it is posted again (`inserted`). Decode unknown reasons leniently."
type: string
required:
- index
- status
additionalProperties: false
+ GetSymptomEventEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/SymptomEvent"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
UpdateSymptomEventEnvelope:
type: object
properties:
@@ -98441,6 +105385,7 @@ components:
- medications
- illness
- symptoms
+ - seizures
- allergies
- labs
- visits
@@ -98573,6 +105518,7 @@ components:
- illnessResolved
- illnessDayLog
- symptom
+ - seizure
- allergyOnset
- labResult
- visit
@@ -98596,6 +105542,7 @@ components:
- medications
- illness
- symptoms
+ - seizures
- allergies
- labs
- visits
@@ -98713,6 +105660,7 @@ components:
- medications
- illness
- symptoms
+ - seizures
- allergies
- labs
- visits
@@ -98787,6 +105735,7 @@ components:
- medications
- illness
- symptoms
+ - seizures
- allergies
- labs
- visits
@@ -98958,6 +105907,7 @@ components:
- illnessResolved
- illnessDayLog
- symptom
+ - seizure
- allergyOnset
- labResult
- visit
@@ -98981,6 +105931,7 @@ components:
- medications
- illness
- symptoms
+ - seizures
- allergies
- labs
- visits
@@ -99026,6 +105977,28 @@ components:
type:
- string
- "null"
+ doseOffset:
+ description: "Symptoms only, and only on a day with a timed dose: the symptom's distance from the nearest dose taken at
+ or before it, else the nearest one after it. A distance in time and nothing more; never a cause."
+ type: object
+ properties:
+ intakeId:
+ type: string
+ description: The anchoring intake event's id.
+ title:
+ type: string
+ description: The medication's name.
+ minutes:
+ type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ description: "Minutes from the dose to the symptom. Positive: after the dose; negative: before it, when the day holds no
+ earlier dose."
+ required:
+ - intakeId
+ - title
+ - minutes
+ additionalProperties: false
required:
- at
- kind
@@ -99389,6 +106362,8 @@ components:
- seizureDay
- document
- cycle
+ - pregnancy
+ - postpartum
start:
type: string
description: A local calendar date, `YYYY-MM-DD`.
@@ -100038,6 +107013,33 @@ components:
- data
- error
additionalProperties: false
+ GetAiJobFailuresResponse:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/AiJobFailuresList"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ AiJobFailuresList:
+ type: object
+ properties:
+ failures:
+ type: array
+ items:
+ $ref: "#/components/schemas/AiJobFailure"
+ required:
+ - failures
+ additionalProperties: false
PutMedicationIngredientsResponse:
type: object
properties:
@@ -100072,6 +107074,45 @@ components:
- data
- error
additionalProperties: false
+ PatchMedicineRegistryEnvelope:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/MedicineRegistryResponse"
+ error:
+ type: "null"
+ meta:
+ type: object
+ properties:
+ requestId:
+ type: string
+ additionalProperties: false
+ required:
+ - data
+ - error
+ additionalProperties: false
+ MedicineRegistryResponse:
+ type: object
+ properties:
+ medicineRegistry:
+ type: string
+ enum:
+ - PL
+ - DE
+ - ES
+ - FR
+ - GB
+ - BE
+ - NL
+ - US
+ - CA
+ - AU
+ - BR
+ - EU
+ - NONE
+ required:
+ - medicineRegistry
+ additionalProperties: false
LifeCircumstancesEnvelope:
type: object
properties:
@@ -102548,8 +109589,9 @@ components:
type: boolean
liveActivityEnabled:
type: boolean
- description: v1.7.0 iOS Live Activity opt-in for this medication's reminders. Default false. The iOS client owns the
- ActivityKit lifecycle; the server only stores + echoes the flag.
+ description: v1.7.0 iOS Live Activity opt-in for this medication's reminders. Default false. The iOS client plans its
+ own Activities by it; a server start over the push relay requires it, and a server-started Activity ends
+ once it is off.
criticalAlarmEnabled:
type: boolean
description: v1.7.0 iOS 26 AlarmKit critical-reminder opt-in. Default false. Critical alarms bypass the device mute
@@ -102575,6 +109617,13 @@ components:
type:
- string
- "null"
+ leafletUrl:
+ description: '#1430 — the official leaflet the person saved for this medication: an `https:` URL, any host. NULL = none
+ saved. Show it only as an external link (a new tab, `rel="noopener noreferrer"` on the web); never fetch or
+ embed it. Set or cleared through `leafletUrl` on the create and update bodies.'
+ type:
+ - string
+ - "null"
pausedAt:
anyOf:
- type: string
@@ -102707,6 +109756,7 @@ components:
- atcCode
- rxNormCode
- note
+ - leafletUrl
- pausedAt
- snoozedUntil
- startsOn
diff --git a/docs/contributing/benchmarks.md b/docs/contributing/benchmarks.md
index 9ceb4b7a0b..8f8917d8a1 100644
--- a/docs/contributing/benchmarks.md
+++ b/docs/contributing/benchmarks.md
@@ -104,6 +104,36 @@ On the seeded account, idle, with the worker running and no requests (`results/v
Result on the same machine (`results/v1.45.0-boot.md`): the worker graph loads in stretches of at most 246 ms instead of one of 753 ms (the longest application stretch left is the query compiler's start, 336 ms, unchanged); the live heap after five idle minutes went from 162 to 172 MB to 142 to 153 MB; two parsed catalogs (1.6 MB) instead of 32 (14.1 MB), and no catalog chunk sources.
+## First-sync burst under the heap ceiling
+
+`scripts/bench/ingest-burst.ts` replays what a phone sends right after it signs in to a fresh account, against the production build under the heap of a 1 GB container (`--max-old-space-size=524`), and reads the server's heap through the inspector while it runs.
+
+The integration test `tests/integration/ingest-burst-memory.test.ts` holds the gated burst under its budget on every CI run. Its counterproof, the same burst with the gate opened wide, depends on the machine and runs only with `HEALTHLOG_BENCH=1`; run it after touching the ingest gate, to see the budget is still a real limit.
+
+```sh
+pnpm dlx tsx scripts/bench/ingest-burst.ts --out scripts/bench/results/} />",
+ filename: FILE,
+ },
+ // A counted exception, exactly as many as counted.
+ {
+ code: " ",
+ filename: `/repo/${MATRIX}`,
+ options: [{ allow: { [MATRIX]: 2 } }],
+ },
+ // The primitive itself, tests, and code outside the UI roots.
+ {
+ code: " ",
+ filename: "/repo/src/components/ui/switch-row.tsx",
+ },
+ {
+ code: " ",
+ filename: "/repo/src/components/settings/__tests__/x.test.tsx",
+ },
+ { code: " ", filename: "/repo/src/lib/x.tsx" },
+ ],
+ invalid: [
+ // The five shapes all come down to this.
+ {
+ code: ' ',
+ filename: FILE,
+ errors: [{ messageId: "bareSwitch" }],
+ },
+ {
+ code: '',
+ filename: FILE,
+ errors: [{ messageId: "bareSwitch" }],
+ },
+ // One more than the file's allowance: the extra one is reported.
+ {
+ code: " ",
+ filename: `/repo/${MATRIX}`,
+ options: [{ allow: { [MATRIX]: 2 } }],
+ errors: [{ messageId: "bareSwitch" }],
+ },
+ // One fewer: the allowance has to come down with it.
+ {
+ code: " ",
+ filename: `/repo/${MATRIX}`,
+ options: [{ allow: { [MATRIX]: 2 } }],
+ errors: [{ messageId: "staleAllow" }],
+ },
+ {
+ code: ' ',
+ filename: `/repo/${MATRIX}`,
+ options: [{ allow: { [MATRIX]: 1 } }],
+ errors: [{ messageId: "staleAllow" }],
+ },
+ ],
+});
diff --git a/eslint-plugins/healthlog/card-action-row.js b/eslint-plugins/healthlog/card-action-row.js
new file mode 100644
index 0000000000..bf36d2ff66
--- /dev/null
+++ b/eslint-plugins/healthlog/card-action-row.js
@@ -0,0 +1,274 @@
+/**
+ * @fileoverview ESLint rule — the action row of a card has one shape, and
+ * `SettingsCardActions` owns it (UI standards §12).
+ *
+ * The row was a primitive, its buttons were not: 177 buttons in 121 rows
+ * carried eight different class lists for the same job. Five new cards hung
+ * `w-full sm:w-auto` on theirs and so stretched across the phone while the
+ * other ninety-eight sat compact on the right; two dozen dropped
+ * `size="sm"` and stood 8 px taller on a desktop; three put the primary
+ * action on the left. The primitive now sets height and width on every
+ * button inside it, so a caller has nothing left to spell, and this rule
+ * refuses the spellings that used to diverge.
+ *
+ * Inside `` (dialog and popover content written inside
+ * the row is skipped, it renders in a portal):
+ *
+ * - `size`: a `Button` or `ConfirmButton` says `size="sm"`.
+ * - `sizing`: a button or link carries no width, height, self-alignment or
+ * auto-margin class. The row decides those.
+ * - `rowClass`: the row takes no `className` but `mt-auto` (a card in an
+ * equal-height grid pins its row to the bottom). A control that stands
+ * apart on the left goes in `leading`.
+ * - `startWithPrimary`: `align="start"` is for a row of links out of the
+ * card. A row with a primary or destructive action is right-aligned.
+ * - `saveIcon`: a save button carries its word and no disk glyph. The
+ * loading spinner still swaps in.
+ * - `notLast`: the row is the last thing in its parent. A status line or a
+ * result list goes above it.
+ *
+ * WHAT THIS RULE DOES NOT CATCH
+ *
+ * A wrapper component that renders a `Button` of another size in its own
+ * file (the row's CSS still sets its height and width), a class list built
+ * at runtime, a second primary action, and a row of buttons that never used
+ * `SettingsCardActions` at all.
+ */
+
+"use strict";
+
+const ROW = "SettingsCardActions";
+
+/** Content that renders in a portal, wherever it is written. */
+const PORTAL_RE =
+ /^(?:AlertDialogContent|DialogContent|PopoverContent|DropdownMenuContent|SheetContent|ConfirmDialog|ResponsiveSheet)$/;
+/** Siblings that may follow the row: they paint nothing in the card. */
+const OVERLAY_RE = /(?:Dialog|Sheet|Popover|Drawer|DialogContent)$/;
+
+const SIZED_TAG_RE = /(?:^button$|^a$|^Link$|Button$)/;
+const SIZING_RE =
+ /(?:^|\s)(?:[a-z0-9-]+:)*(?:w-|min-w-|max-w-|h-|min-h-|max-h-|size-|self-|basis-|grow(?:\s|$)|flex-1(?:\s|$)|m[lrx]-auto(?:\s|$))/;
+
+function tagName(opening) {
+ const name = opening.name;
+ if (name.type === "JSXIdentifier") return name.name;
+ if (name.type === "JSXMemberExpression") return name.property.name;
+ return "";
+}
+
+function attribute(opening, name) {
+ return opening.attributes.find(
+ (attr) => attr.type === "JSXAttribute" && attr.name.name === name,
+ );
+}
+
+/** Every string a class expression can resolve to, or null when unknown. */
+function classStrings(node) {
+ if (!node) return [];
+ if (node.type === "Literal") {
+ return typeof node.value === "string" ? [node.value] : [];
+ }
+ if (node.type === "JSXExpressionContainer") {
+ return classStrings(node.expression);
+ }
+ if (node.type === "TemplateLiteral") {
+ return node.quasis.map((quasi) => quasi.value.cooked ?? "");
+ }
+ if (node.type === "CallExpression") {
+ return node.arguments.flatMap((arg) => classStrings(arg) ?? []);
+ }
+ if (node.type === "ConditionalExpression") {
+ return [
+ ...(classStrings(node.consequent) ?? []),
+ ...(classStrings(node.alternate) ?? []),
+ ];
+ }
+ if (node.type === "LogicalExpression") {
+ return classStrings(node.right) ?? [];
+ }
+ return null;
+}
+
+/** Whether a `variant` attribute can resolve to a filled action. */
+function isFilledVariant(attr, tag) {
+ // ConfirmButton is outline unless it says otherwise.
+ if (!attr) return tag === "Button";
+ const value = attr.value;
+ if (!value) return false;
+ const strings = classStrings(value);
+ if (strings === null) return true;
+ return strings.some((s) => s === "default" || s === "destructive");
+}
+
+function isHiddenInput(node) {
+ if (node.type !== "JSXElement") return false;
+ const opening = node.openingElement;
+ if (tagName(opening) !== "input") return false;
+ const type = attribute(opening, "type");
+ return type?.value?.type === "Literal" && type.value.value === "file";
+}
+
+/** Tags of the JSX elements a child slot can render. */
+function renderedElements(node, out = []) {
+ if (!node) return out;
+ if (node.type === "JSXElement") {
+ out.push(node);
+ } else if (node.type === "JSXFragment") {
+ node.children.forEach((child) => renderedElements(child, out));
+ } else if (node.type === "JSXExpressionContainer") {
+ renderedElements(node.expression, out);
+ } else if (node.type === "LogicalExpression") {
+ renderedElements(node.right, out);
+ } else if (node.type === "ConditionalExpression") {
+ renderedElements(node.consequent, out);
+ renderedElements(node.alternate, out);
+ }
+ return out;
+}
+
+/** @type {import("eslint").Rule.RuleModule} */
+module.exports = {
+ meta: {
+ type: "problem",
+ docs: {
+ description:
+ "The action row of a card has one shape, owned by SettingsCardActions.",
+ },
+ schema: [],
+ messages: {
+ size: 'A button in a card\'s action row is size="sm" (UI standards §12). The row sets its height.',
+ sizing:
+ "`{{cls}}` on a button in a card's action row. SettingsCardActions owns height and width: every action is compact, at every viewport (UI standards §12).",
+ rowClass:
+ "SettingsCardActions takes no className but `mt-auto`. Its layout is the primitive's; a control that stands apart on the left goes in `leading`.",
+ startWithPrimary:
+ 'align="start" is for a row of links out of the card. A row with a primary or destructive action is right-aligned (UI standards §12).',
+ saveIcon:
+ "A save button carries its word and no disk glyph (UI standards §12).",
+ notLast:
+ "The action row is the last thing in the card. Status lines and results go above it (UI standards §12).",
+ },
+ },
+ create(context) {
+ /** Depth of `SettingsCardActions` rows the walk is inside. */
+ const rows = [];
+ /** Portal content inside a row: its buttons are not the row's. */
+ let portalDepth = 0;
+
+ function checkRow(node) {
+ const opening = node.openingElement;
+ const cls = attribute(opening, "className");
+ if (cls) {
+ const strings = classStrings(cls.value);
+ const only =
+ strings !== null && strings.join(" ").trim().split(/\s+/).join(" ");
+ if (only !== "mt-auto") {
+ context.report({ node: cls, messageId: "rowClass" });
+ }
+ }
+
+ // The slot the row fills in its parent: the row itself, or the
+ // `{cond &&
}` expression around it.
+ let slot = node;
+ let parent = node.parent;
+ while (
+ parent &&
+ (parent.type === "LogicalExpression" ||
+ parent.type === "ConditionalExpression" ||
+ parent.type === "JSXExpressionContainer")
+ ) {
+ slot = parent;
+ parent = parent.parent;
+ }
+ if (parent && parent.type === "JSXElement") {
+ const after = parent.children
+ .slice(parent.children.indexOf(slot) + 1)
+ .flatMap((child) =>
+ renderedElements(child).filter(
+ (el) =>
+ !OVERLAY_RE.test(tagName(el.openingElement)) &&
+ !isHiddenInput(el),
+ ),
+ );
+ if (after.length > 0) {
+ context.report({ node: node.openingElement, messageId: "notLast" });
+ }
+ }
+ }
+
+ return {
+ JSXElement(node) {
+ const tag = tagName(node.openingElement);
+ if (tag === ROW) {
+ checkRow(node);
+ const align = attribute(node.openingElement, "align");
+ rows.push({
+ start:
+ align?.value?.type === "Literal" && align.value.value === "start",
+ node,
+ });
+ return;
+ }
+ if (rows.length > 0 && PORTAL_RE.test(tag)) portalDepth++;
+ },
+ "JSXElement:exit"(node) {
+ const tag = tagName(node.openingElement);
+ if (tag === ROW) {
+ rows.pop();
+ return;
+ }
+ if (rows.length > 0 && PORTAL_RE.test(tag)) portalDepth--;
+ },
+ // A prop that holds JSX of its own is not one of the row's actions: a
+ // confirm dialog's `extra` renders in the dialog, and `leading` is the
+ // control that stands apart from them.
+ JSXAttribute(node) {
+ if (rows.length > 0 && node.value?.type === "JSXExpressionContainer") {
+ portalDepth++;
+ }
+ },
+ "JSXAttribute:exit"(node) {
+ if (rows.length > 0 && node.value?.type === "JSXExpressionContainer") {
+ portalDepth--;
+ }
+ },
+ JSXOpeningElement(node) {
+ if (rows.length === 0 || portalDepth > 0) return;
+ const tag = tagName(node);
+ if (tag === ROW) return;
+ const row = rows[rows.length - 1];
+
+ if (tag === "Save") {
+ context.report({ node, messageId: "saveIcon" });
+ return;
+ }
+
+ if (tag === "Button" || tag === "ConfirmButton") {
+ const size = attribute(node, "size");
+ const isSm =
+ size?.value?.type === "Literal" && size.value.value === "sm";
+ if (!isSm) context.report({ node: size ?? node, messageId: "size" });
+ if (row.start && isFilledVariant(attribute(node, "variant"), tag)) {
+ context.report({ node, messageId: "startWithPrimary" });
+ }
+ }
+
+ if (SIZED_TAG_RE.test(tag)) {
+ const cls = attribute(node, "className");
+ const strings = cls ? classStrings(cls.value) : [];
+ for (const value of strings ?? []) {
+ const hit = SIZING_RE.exec(value);
+ if (hit) {
+ context.report({
+ node: cls,
+ messageId: "sizing",
+ data: { cls: value.trim() },
+ });
+ break;
+ }
+ }
+ }
+ },
+ };
+ },
+};
diff --git a/eslint-plugins/healthlog/index.js b/eslint-plugins/healthlog/index.js
index 590d89d7e7..4c1f8caa8a 100644
--- a/eslint-plugins/healthlog/index.js
+++ b/eslint-plugins/healthlog/index.js
@@ -23,6 +23,10 @@
* primitive, not bg-card + border + rounded-xl.
* - `import-boundaries` — src/lib never imports components or app, and
* a "use client" file imports no server module.
+ * - `card-action-row` — the buttons of a card's action row take their
+ * height, width and place from SettingsCardActions.
+ * - `switch-row` — a switch with a name is a SwitchRow; the rest
+ * are counted per file, and the count only falls.
*/
"use strict";
@@ -39,6 +43,8 @@ const noPlanningTags = require("./no-planning-tags.js");
const noUnlocalisedDecimal = require("./no-unlocalised-decimal.js");
const noRawCardShell = require("./no-raw-card-shell.js");
const importBoundaries = require("./import-boundaries.js");
+const cardActionRow = require("./card-action-row.js");
+const switchRow = require("./switch-row.js");
module.exports = {
rules: {
@@ -59,5 +65,7 @@ module.exports = {
"no-unlocalised-decimal": noUnlocalisedDecimal,
"no-raw-card-shell": noRawCardShell,
"import-boundaries": importBoundaries,
+ "card-action-row": cardActionRow,
+ "switch-row": switchRow,
},
};
diff --git a/eslint-plugins/healthlog/switch-row.js b/eslint-plugins/healthlog/switch-row.js
new file mode 100644
index 0000000000..20bb442bbf
--- /dev/null
+++ b/eslint-plugins/healthlog/switch-row.js
@@ -0,0 +1,120 @@
+/**
+ * @fileoverview ESLint rule — a switch with a name is a `SwitchRow`
+ * (`src/components/ui/switch-row.tsx`).
+ *
+ * Five shapes put a name beside a switch: the switch under the title, the
+ * switch in a row of its own below the text on a phone, a name with a colon
+ * and a 14 px description, a `