From 7dcd7b44d99913d2bec9e93d7ed00b013cfe4095 Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Sun, 22 Nov 2026 06:36:00 -0700 Subject: [PATCH 1/4] Satiety and fitness take 1, 3, 5, 7 or 9; Max Carbs steps of 10 Co-Authored-By: Claude Opus 5.5 Ci-From: linux Ci-Session: 5f9c7d25-5b60-4c43-beda-a4c0c63709d4 --- engine-constants-allowlist.txt | 1 + guides/athletes.mdx | 12 ++++++------ guides/nutrition-calculation.mdx | 2 +- guides/safety.mdx | 5 +++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/engine-constants-allowlist.txt b/engine-constants-allowlist.txt index 6d3e37e..ee3d67f 100644 --- a/engine-constants-allowlist.txt +++ b/engine-constants-allowlist.txt @@ -19,6 +19,7 @@ rate-adjacent guides/safety.mdx 1500 mL/hr response field: max_safe_fluid_ml_per rate-adjacent guides/safety.mdx 3000 mg/hr response field: max_safe_sodium_mg_per_hr, same block, same reasoning nutrient-ceiling guides/safety.mdx 50 request bound: carb_upper_limit_override below 50 is refused with 400 out_of_range, so a caller must respect it nutrient-ceiling guides/safety.mdx 150 request bound: carb_upper_limit_override above 150 is refused with 400 out_of_range, so a caller must respect it +nutrient-ceiling guides/safety.mdx 10 request bound: a carb_upper_limit_override off its steps of 10 is refused with 400 out_of_range, so a caller must respect it rate-adjacent guides/safety.mdx 150 g/hr the same request bound, with its unit nutrient-ceiling guides/safety.mdx 1500 response field: the fluid advisory threshold again, on the line that states the warning it triggers rate-adjacent guides/athletes.mdx 150 g/hr request bound: carb_upper_limit_override is set BY the caller and rejected with a 400 outside its range, so a partner who does not know the range cannot debug the rejection diff --git a/guides/athletes.mdx b/guides/athletes.mdx index 98bfa7f..bdf7d7c 100644 --- a/guides/athletes.mdx +++ b/guides/athletes.mdx @@ -95,7 +95,7 @@ Saturday sets `id`, `partner_id`, `created_at`, `updated_at`, `profile_complete` ### Settings: the fueling profile -`settings` holds the fields the engine reads. The 1-9 scales are odd-point selectors, not continuous sliders: send 1, 3, 5, 7, or 9. +`settings` holds the fields the engine reads. The 1-9 scales are odd-point selectors, not continuous sliders: send 1, 3, 5, 7, or 9. `satiety_level` and `fitness_level` take only those five levels, the ones the Saturday app stores, and `carb_upper_limit_override` takes 50 to 150 g/hr in steps of 10, as the app's Max Carbs slider does, so your athletes get the same answers as members of the app. | Field | Type | Values | Safety-core | |-------|------|--------|-------------| @@ -103,13 +103,13 @@ Saturday sets `id`, `partner_id`, `created_at`, `updated_at`, `profile_complete` | `saltiness` | integer | 1 (not salty) to 9 (very salty), default 5 | Yes | | `carb_experience` | string | `range_0_30`, `range_40_60`, `range_gt_70` | Yes | | `usual_carb_consumption` | string | `range_lt_60`, `range_60_80`, `range_80_100`, `range_gt_100` | Yes | -| `satiety_level` | integer | 1 (mostly whole food) to 9 (high-octane fuel), default 5 | No | -| `fitness_level` | integer | 1 (beginner) to 9 (elite), default 5 | No | -| `carb_upper_limit_override` | integer | 50 to 150 g/hr, default 150 | No | +| `satiety_level` | integer | 1, 3, 5, 7 or 9: 1 mostly whole food to 9 high-octane fuel, default 5 | No | +| `fitness_level` | integer | 1, 3, 5, 7 or 9: 1 complete novice to 9 elite, default 5 | No | +| `carb_upper_limit_override` | integer | 50 to 150 g/hr in steps of 10, default 150 | No | `carb_experience` is the most carbohydrate per hour the athlete has ever fueled with; `usual_carb_consumption` is what they typically take. Both are stored as range tokens rather than numbers, because a range is what an athlete can answer without guessing. -On create, on update and on `PATCH /v1/athletes/{id}/settings`, a scale outside 1 to 9, a token outside its list, or a `sex` outside the three values is refused with a `400` of code `invalid_value`, naming the field in `param` and the accepted values in the message. Nothing in that request is saved. +On create, on update and on `PATCH /v1/athletes/{id}/settings`, a scale outside 1 to 9, a `satiety_level` or `fitness_level` other than 1, 3, 5, 7 or 9, a token outside its list, or a `sex` outside the three values is refused with a `400` of code `invalid_value`, naming the field in `param` and the accepted values in the message. Nothing in that request is saved. ### Fueling concerns @@ -189,7 +189,7 @@ The settings object is written as a unit. Send the athlete's complete settings o The same replacement rule applies if you send a `settings` object through `PATCH /v1/athletes/{id}`. -On create, on update and on calculate, Saturday rejects `carb_upper_limit_override` outside 50-150 g/hr and `weight_kg` outside 20-250 with a `400` of code `out_of_range` rather than clamping, so a bad value in your data surfaces at the boundary instead of distorting a prescription. Batch create reports the same code per item. +On create, on update and on calculate, Saturday rejects a `carb_upper_limit_override` that is not 50 to 150 g/hr in steps of 10 and `weight_kg` outside 20-250 with a `400` of code `out_of_range` rather than clamping, so a bad value in your data surfaces at the boundary instead of distorting a prescription. Batch create reports the same code per item. Saturday is for athletes 14 and up. On create and on update, a `year_of_birth` that makes the athlete younger than 14 (the current year minus the birth year) is refused with a `400` of code `under_minimum_age` and param `year_of_birth`, and nothing in that request is saved. The message names the minimum age: diff --git a/guides/nutrition-calculation.mdx b/guides/nutrition-calculation.mdx index 1e34292..c6b81c1 100644 --- a/guides/nutrition-calculation.mdx +++ b/guides/nutrition-calculation.mdx @@ -119,7 +119,7 @@ The two lists name inputs only and come with a partner API key on every tier, te An `athlete_id` your account does not hold is refused with `404` and code `athlete_not_found`; leave `athlete_id` out for a range estimate. -Profile fields, at the top level of the request, stand in for a stored athlete or override one stored answer for that call: `sex` (`male`, `female` or `intersex`), `age` (years), `athlete_weight_kg` (20 to 250), `sweat_level`, `saltiness`, `satiety_level` and `fitness_level` (1, 3, 5, 7 or 9), `carb_experience` and `usual_carb_consumption` (the values in [Settings: the fueling profile](/guides/athletes#settings-the-fueling-profile)), `carb_upper_limit_override` (50 to 150 g/hr), and `concerns`, one object of the eight flags `performance`, `gut_distress`, `heat_tolerance`, `muscle_cramps`, `faintness`, `hunger`, `thirst` and `drinking_resistance`. +Profile fields, at the top level of the request, stand in for a stored athlete or override one stored answer for that call: `sex` (`male`, `female` or `intersex`), `age` (years), `athlete_weight_kg` (20 to 250), `sweat_level`, `saltiness`, `satiety_level` and `fitness_level` (1, 3, 5, 7 or 9), `carb_experience` and `usual_carb_consumption` (the values in [Settings: the fueling profile](/guides/athletes#settings-the-fueling-profile)), `carb_upper_limit_override` (50 to 150 g/hr in steps of 10), and `concerns`, one object of the eight flags `performance`, `gut_distress`, `heat_tolerance`, `muscle_cramps`, `faintness`, `hunger`, `thirst` and `drinking_resistance`. The request may carry only the fields on this page. Any other field, at any depth, is refused with `400` and code `unsupported_field`, `param` naming it, and the message naming the field it was probably meant to be: `meal_before_mins` answers `Did you mean "meal_before_min"?`. A field spelled the way the athlete or activity request spells it gets that request's spelling: `weight_kg` (send `athlete_weight_kg`), `year_of_birth` (send `age`), `is_race_event` (send `is_race`), `type` (send `activity_type`), `duration` (send `duration_min`) and `settings` (send the profile fields at the top level, or an `athlete_id`). See [Error Handling](/error-handling#a-field-the-request-does-not-take). diff --git a/guides/safety.mdx b/guides/safety.mdx index 0283228..06c925b 100644 --- a/guides/safety.mdx +++ b/guides/safety.mdx @@ -98,8 +98,9 @@ Send values inside these ranges. When the API refuses a value, the error names t | `meal_before_min` | Minutes since the last carb-rich meal; over 180 is a fasted start | | `athlete_weight_kg` | 20 to 250 | | `age` | 1 to 120 | -| `sweat_level`, `saltiness`, `satiety_level`, `fitness_level` | 1 to 9 | -| `carb_upper_limit_override` | 50 to 150 g/hr, a ceiling the athlete sets on their carbohydrate | +| `sweat_level`, `saltiness` | 1 to 9 | +| `satiety_level`, `fitness_level` | 1, 3, 5, 7 or 9 | +| `carb_upper_limit_override` | 50 to 150 g/hr in steps of 10, a ceiling the athlete sets on their carbohydrate | ### Reading the answer From 293148b8303316014128f4322a1c32be5b8fb9db Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Sun, 22 Nov 2026 08:55:20 -0700 Subject: [PATCH 2/4] Sweat level takes 1, 3, 5, 7 or 9 and saltiness 1, 5 or 9 Co-Authored-By: Claude Opus 5.5 Ci-From: linux Ci-Session: 5f9c7d25-5b60-4c43-beda-a4c0c63709d4 --- guides/athletes.mdx | 8 ++++---- guides/nutrition-calculation.mdx | 2 +- guides/safety.mdx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/guides/athletes.mdx b/guides/athletes.mdx index bdf7d7c..9311c42 100644 --- a/guides/athletes.mdx +++ b/guides/athletes.mdx @@ -95,12 +95,12 @@ Saturday sets `id`, `partner_id`, `created_at`, `updated_at`, `profile_complete` ### Settings: the fueling profile -`settings` holds the fields the engine reads. The 1-9 scales are odd-point selectors, not continuous sliders: send 1, 3, 5, 7, or 9. `satiety_level` and `fitness_level` take only those five levels, the ones the Saturday app stores, and `carb_upper_limit_override` takes 50 to 150 g/hr in steps of 10, as the app's Max Carbs slider does, so your athletes get the same answers as members of the app. +`settings` holds the fields the engine reads. The 1-9 scales take only the levels the Saturday app stores: `sweat_level`, `satiety_level` and `fitness_level` take 1, 3, 5, 7 or 9, and `saltiness` takes 1, 5 or 9. `carb_upper_limit_override` takes 50 to 150 g/hr in steps of 10, as the app's Max Carbs slider does, so your athletes get the same answers as members of the app. | Field | Type | Values | Safety-core | |-------|------|--------|-------------| -| `sweat_level` | integer | 1 (light) to 9 (heavy), default 5 | Yes | -| `saltiness` | integer | 1 (not salty) to 9 (very salty), default 5 | Yes | +| `sweat_level` | integer | 1, 3, 5, 7 or 9: 1 light to 9 heavy, default 5 | Yes | +| `saltiness` | integer | 1, 5 or 9: 1 not very salty, 5 somewhat salty, 9 very salty, default 5 | Yes | | `carb_experience` | string | `range_0_30`, `range_40_60`, `range_gt_70` | Yes | | `usual_carb_consumption` | string | `range_lt_60`, `range_60_80`, `range_80_100`, `range_gt_100` | Yes | | `satiety_level` | integer | 1, 3, 5, 7 or 9: 1 mostly whole food to 9 high-octane fuel, default 5 | No | @@ -109,7 +109,7 @@ Saturday sets `id`, `partner_id`, `created_at`, `updated_at`, `profile_complete` `carb_experience` is the most carbohydrate per hour the athlete has ever fueled with; `usual_carb_consumption` is what they typically take. Both are stored as range tokens rather than numbers, because a range is what an athlete can answer without guessing. -On create, on update and on `PATCH /v1/athletes/{id}/settings`, a scale outside 1 to 9, a `satiety_level` or `fitness_level` other than 1, 3, 5, 7 or 9, a token outside its list, or a `sex` outside the three values is refused with a `400` of code `invalid_value`, naming the field in `param` and the accepted values in the message. Nothing in that request is saved. +On create, on update and on `PATCH /v1/athletes/{id}/settings`, a `sweat_level`, `satiety_level` or `fitness_level` other than 1, 3, 5, 7 or 9, a `saltiness` other than 1, 5 or 9, a token outside its list, or a `sex` outside the three values is refused with a `400` of code `invalid_value`, naming the field in `param` and the accepted values in the message. Nothing in that request is saved. ### Fueling concerns diff --git a/guides/nutrition-calculation.mdx b/guides/nutrition-calculation.mdx index c6b81c1..8132404 100644 --- a/guides/nutrition-calculation.mdx +++ b/guides/nutrition-calculation.mdx @@ -119,7 +119,7 @@ The two lists name inputs only and come with a partner API key on every tier, te An `athlete_id` your account does not hold is refused with `404` and code `athlete_not_found`; leave `athlete_id` out for a range estimate. -Profile fields, at the top level of the request, stand in for a stored athlete or override one stored answer for that call: `sex` (`male`, `female` or `intersex`), `age` (years), `athlete_weight_kg` (20 to 250), `sweat_level`, `saltiness`, `satiety_level` and `fitness_level` (1, 3, 5, 7 or 9), `carb_experience` and `usual_carb_consumption` (the values in [Settings: the fueling profile](/guides/athletes#settings-the-fueling-profile)), `carb_upper_limit_override` (50 to 150 g/hr in steps of 10), and `concerns`, one object of the eight flags `performance`, `gut_distress`, `heat_tolerance`, `muscle_cramps`, `faintness`, `hunger`, `thirst` and `drinking_resistance`. +Profile fields, at the top level of the request, stand in for a stored athlete or override one stored answer for that call: `sex` (`male`, `female` or `intersex`), `age` (years), `athlete_weight_kg` (20 to 250), `sweat_level`, `satiety_level` and `fitness_level` (1, 3, 5, 7 or 9), `saltiness` (1, 5 or 9), `carb_experience` and `usual_carb_consumption` (the values in [Settings: the fueling profile](/guides/athletes#settings-the-fueling-profile)), `carb_upper_limit_override` (50 to 150 g/hr in steps of 10), and `concerns`, one object of the eight flags `performance`, `gut_distress`, `heat_tolerance`, `muscle_cramps`, `faintness`, `hunger`, `thirst` and `drinking_resistance`. The request may carry only the fields on this page. Any other field, at any depth, is refused with `400` and code `unsupported_field`, `param` naming it, and the message naming the field it was probably meant to be: `meal_before_mins` answers `Did you mean "meal_before_min"?`. A field spelled the way the athlete or activity request spells it gets that request's spelling: `weight_kg` (send `athlete_weight_kg`), `year_of_birth` (send `age`), `is_race_event` (send `is_race`), `type` (send `activity_type`), `duration` (send `duration_min`) and `settings` (send the profile fields at the top level, or an `athlete_id`). See [Error Handling](/error-handling#a-field-the-request-does-not-take). diff --git a/guides/safety.mdx b/guides/safety.mdx index 06c925b..5cb41ea 100644 --- a/guides/safety.mdx +++ b/guides/safety.mdx @@ -98,8 +98,8 @@ Send values inside these ranges. When the API refuses a value, the error names t | `meal_before_min` | Minutes since the last carb-rich meal; over 180 is a fasted start | | `athlete_weight_kg` | 20 to 250 | | `age` | 1 to 120 | -| `sweat_level`, `saltiness` | 1 to 9 | -| `satiety_level`, `fitness_level` | 1, 3, 5, 7 or 9 | +| `sweat_level`, `satiety_level`, `fitness_level` | 1, 3, 5, 7 or 9 | +| `saltiness` | 1, 5 or 9 | | `carb_upper_limit_override` | 50 to 150 g/hr in steps of 10, a ceiling the athlete sets on their carbohydrate | ### Reading the answer From 5e2e8d4de22f0885c0f2744ccbba2f7e8e04bb1e Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Sun, 22 Nov 2026 12:51:53 -0700 Subject: [PATCH 3/4] Settings schema: name values and step Co-Authored-By: Claude Opus 5.5 Ci-From: linux Ci-Session: 0fe43437-6218-4995-9bbb-14b061a1d1c2 --- guides/athletes.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/athletes.mdx b/guides/athletes.mdx index 8131b2a..cc09d74 100644 --- a/guides/athletes.mdx +++ b/guides/athletes.mdx @@ -254,6 +254,6 @@ Fetch the global settings schema to build dynamic forms: GET /v1/settings/schema ``` -Returns each field's type, valid range or option list, description, and default, so a settings UI does not have to hardcode Saturday's requirements. This is a global schema, identical for every athlete; fetch one athlete's current values with `GET /v1/athletes/{id}/settings`. The schema lists the editable fields; a stored settings object can also carry `concerns_answered`, which sending any concern field sets, so keep it when you write a settings object back. +Returns each field's type, valid range or option list, description, and default, so a settings UI does not have to hardcode Saturday's requirements. `values` lists the only numbers a scale takes (`[1, 3, 5, 7, 9]`, or `[1, 5, 9]` for `saltiness`), and `step` is the spacing of `carb_upper_limit_override` (10). This is a global schema, identical for every athlete; fetch one athlete's current values with `GET /v1/athletes/{id}/settings`. The schema lists the editable fields; a stored settings object can also carry `concerns_answered`, which sending any concern field sets, so keep it when you write a settings object back. For collecting the profile from scratch rather than editing it, `GET /v1/onboarding/questions` returns the same fields as athlete-facing questions with copy, ordering, and answer values. See [Athlete Onboarding](/guides/onboarding). From 1271d3f992bebb5d729c606d51340dbaf86df00b Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Sun, 22 Nov 2026 13:37:32 -0700 Subject: [PATCH 4/4] Error catalog: what retryable means, and per-item batch codes Co-Authored-By: Claude Opus 5.5 Ci-From: linux Ci-Session: 0fe43437-6218-4995-9bbb-14b061a1d1c2 --- error-handling.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/error-handling.mdx b/error-handling.mdx index a75efa5..4c1f944 100644 --- a/error-handling.mdx +++ b/error-handling.mdx @@ -166,4 +166,4 @@ Every response carries an `X-Request-ID` header, and every error body repeats it ### Error catalog -`GET /v1/errors` (no auth) lists the error codes, leaving out features in STEALTH. +`GET /v1/errors` (no auth) lists the error codes, leaving out features in STEALTH. Each entry's `retryable` says whether you may retry the same call automatically after `Retry-After`: it is `false` for the daily ceilings, which clear only at midnight UTC. A code that appears only on one item of a batch, such as `missing_identifier`, is listed with the status a single request would get.