From 8bfb6d28a1543d4af8623493cb713301598520a3 Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Sun, 22 Nov 2026 07:35:55 -0700 Subject: [PATCH 1/3] Satiety and fitness take 1, 3, 5, 7 or 9; Max Carbs steps of 10 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + saturday/client.py | 3 ++- saturday/types.py | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae71316..fbe30f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Breaking changes: - Every timestamp a partner key receives is Unix seconds, matching the API: webhooks and deliveries, `WebhookEvent["created_at"]` and the two typed sharing events, `PartnerAccount["created_at"]`, `ApiKeyInfo` and `CreatedApiKey` times, `TrialMetadata["trial_ends_at"]`, the fueling profile's `updated_at` and `IntegrationStatusDetail["last_sync_at"]` were milliseconds. `AthleteDataExport["exported_at"]` is an `int` of Unix seconds (it was an RFC 3339 string), and every time in the export's records is Unix seconds. Coach types keep Unix milliseconds. - `activities.prep` sends only the lists you pass: `products=`, `legs=`, or an empty `products` list when you pass neither. - `ImportActivityRequest` takes `type` alone as required (`duration_min` is required for a single sport only), with `legs` and `meal_before_min`. +- `satiety_level` and `fitness_level` take 1, 3, 5, 7 or 9, the levels the Saturday app stores, on `nutrition.calculate` and on an athlete's settings; the API refuses any other value with a `ValidationError` of code `invalid_value`. `carb_upper_limit_override` takes 50 to 150 g/hr in steps of 10 (code `out_of_range` otherwise). `SettingsFieldSchema` gains `values` and `step`. Added: diff --git a/saturday/client.py b/saturday/client.py index 21c95f0..8f7965f 100644 --- a/saturday/client.py +++ b/saturday/client.py @@ -242,7 +242,8 @@ def calculate(self, **request: Any) -> NutritionCalculateResponse: Required: ``activity_type``, and ``duration_min`` for a single sport. Send ``athlete_id`` to use a stored athlete, and every session input (``intensity_level``, ``thermal_stress_level``, ``meal_before_min``: over 180 plans a fasted start, ``is_race``) - for exact numbers. + for exact numbers. ``satiety_level`` and ``fitness_level`` take 1, 3, 5, 7 or 9, and + ``carb_upper_limit_override`` 50 to 150 g/hr in steps of 10. A brick or triathlon is one call: ``activity_type="brick"`` (or ``"triathlon"``) with ``legs``, 2 to 10 dicts of ``activity_type``, ``duration_min``, ``intensity_level`` and diff --git a/saturday/types.py b/saturday/types.py index 3bbbe26..5406126 100644 --- a/saturday/types.py +++ b/saturday/types.py @@ -268,10 +268,14 @@ class Activity(_ActivityRequired, total=False): class AthleteSettings(TypedDict, total=False): sweat_level: int saltiness: int + # A write takes 1, 3, 5, 7 or 9 and refuses any other value with 400 invalid_value. satiety_level: int + # A write takes 1, 3, 5, 7 or 9 and refuses any other value with 400 invalid_value. fitness_level: int carb_experience: str usual_carb_consumption: str + # A write takes 50 to 150 g/hr in steps of 10, or 0 to clear it; any other value is refused + # with 400 out_of_range. carb_upper_limit_override: int muscle_cramps: bool gut_distress: bool @@ -1082,6 +1086,11 @@ class SettingsFieldSchema(_SettingsFieldRequired, total=False): min: float max: float options: List[str] + # The only values an integer setting takes, when it takes fewer than every whole number from + # min to max (satiety_level and fitness_level: 1, 3, 5, 7, 9). + values: List[int] + # The spacing of the values an integer setting takes from min to max (carb_upper_limit_override: 10). + step: int class SettingsSchemaResponse(TypedDict): From 805b92a66fc6408a7d8aa9119fe9b8a4de977608 Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Sun, 22 Nov 2026 08:55:20 -0700 Subject: [PATCH 2/3] Sweat level takes 1, 3, 5, 7 or 9 and saltiness 1, 5 or 9 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 +- saturday/client.py | 3 ++- saturday/types.py | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbe30f3..ba8b5d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ Breaking changes: - Every timestamp a partner key receives is Unix seconds, matching the API: webhooks and deliveries, `WebhookEvent["created_at"]` and the two typed sharing events, `PartnerAccount["created_at"]`, `ApiKeyInfo` and `CreatedApiKey` times, `TrialMetadata["trial_ends_at"]`, the fueling profile's `updated_at` and `IntegrationStatusDetail["last_sync_at"]` were milliseconds. `AthleteDataExport["exported_at"]` is an `int` of Unix seconds (it was an RFC 3339 string), and every time in the export's records is Unix seconds. Coach types keep Unix milliseconds. - `activities.prep` sends only the lists you pass: `products=`, `legs=`, or an empty `products` list when you pass neither. - `ImportActivityRequest` takes `type` alone as required (`duration_min` is required for a single sport only), with `legs` and `meal_before_min`. -- `satiety_level` and `fitness_level` take 1, 3, 5, 7 or 9, the levels the Saturday app stores, on `nutrition.calculate` and on an athlete's settings; the API refuses any other value with a `ValidationError` of code `invalid_value`. `carb_upper_limit_override` takes 50 to 150 g/hr in steps of 10 (code `out_of_range` otherwise). `SettingsFieldSchema` gains `values` and `step`. +- `sweat_level`, `satiety_level` and `fitness_level` take 1, 3, 5, 7 or 9 and `saltiness` 1, 5 or 9, the levels the Saturday app stores, on `nutrition.calculate` and on an athlete's settings; the API refuses any other value with a `ValidationError` of code `invalid_value`. `carb_upper_limit_override` takes 50 to 150 g/hr in steps of 10 (code `out_of_range` otherwise). `SettingsFieldSchema` gains `values` and `step`. Added: diff --git a/saturday/client.py b/saturday/client.py index 8f7965f..351dd89 100644 --- a/saturday/client.py +++ b/saturday/client.py @@ -242,7 +242,8 @@ def calculate(self, **request: Any) -> NutritionCalculateResponse: Required: ``activity_type``, and ``duration_min`` for a single sport. Send ``athlete_id`` to use a stored athlete, and every session input (``intensity_level``, ``thermal_stress_level``, ``meal_before_min``: over 180 plans a fasted start, ``is_race``) - for exact numbers. ``satiety_level`` and ``fitness_level`` take 1, 3, 5, 7 or 9, and + for exact numbers. ``sweat_level``, ``satiety_level`` and ``fitness_level`` take 1, 3, 5, + 7 or 9, ``saltiness`` 1, 5 or 9, and ``carb_upper_limit_override`` 50 to 150 g/hr in steps of 10. A brick or triathlon is one call: ``activity_type="brick"`` (or ``"triathlon"``) with diff --git a/saturday/types.py b/saturday/types.py index 5406126..a2ac0fe 100644 --- a/saturday/types.py +++ b/saturday/types.py @@ -266,7 +266,9 @@ class Activity(_ActivityRequired, total=False): class AthleteSettings(TypedDict, total=False): + # A write takes 1, 3, 5, 7 or 9 and refuses any other value with 400 invalid_value. sweat_level: int + # A write takes 1, 5 or 9 and refuses any other value with 400 invalid_value. saltiness: int # A write takes 1, 3, 5, 7 or 9 and refuses any other value with 400 invalid_value. satiety_level: int @@ -1087,7 +1089,7 @@ class SettingsFieldSchema(_SettingsFieldRequired, total=False): max: float options: List[str] # The only values an integer setting takes, when it takes fewer than every whole number from - # min to max (satiety_level and fitness_level: 1, 3, 5, 7, 9). + # min to max (sweat_level, satiety_level and fitness_level: 1, 3, 5, 7, 9; saltiness: 1, 5, 9). values: List[int] # The spacing of the values an integer setting takes from min to max (carb_upper_limit_override: 10). step: int From 516153cfae1408dcc48b9e71409e8ff446da9ca3 Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Sun, 22 Nov 2026 12:53:32 -0700 Subject: [PATCH 3/3] CHANGELOG: the narrower values under Unreleased, since 0.8.0 is published Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab6c17e..e5f4c40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +Breaking changes: + +- `sweat_level`, `satiety_level` and `fitness_level` take 1, 3, 5, 7 or 9 and `saltiness` 1, 5 or 9, the levels the Saturday app stores, on `nutrition.calculate` and on an athlete's settings; the API refuses any other value with a `ValidationError` of code `invalid_value`. `carb_upper_limit_override` takes 50 to 150 g/hr in steps of 10 (code `out_of_range` otherwise). `SettingsFieldSchema` gains `values` and `step`. + Added: - `athletes.create_onboarding_link(athlete_id, locale=None)` (`POST /v1/athletes/{athlete_id}/onboarding-link`) returns `OnboardingLink`: a fresh link to the hosted onboarding page (`url`), valid until `expires_at` (Unix seconds, 90 days on). Call it from your refresh address, where an athlete who opens an expired link is sent with `athlete_id` and `locale` in the query, and redirect them to `url`. Production refuses it with `PermissionDeniedError` (`hosted_onboarding_unavailable`) until the page opens there. A 5xx on it is retried. @@ -28,7 +32,6 @@ Breaking changes: - Every timestamp a partner key receives is Unix seconds, matching the API: webhooks and deliveries, `WebhookEvent["created_at"]` and the two typed sharing events, `PartnerAccount["created_at"]`, `ApiKeyInfo` and `CreatedApiKey` times, `TrialMetadata["trial_ends_at"]`, the fueling profile's `updated_at` and `IntegrationStatusDetail["last_sync_at"]` were milliseconds. `AthleteDataExport["exported_at"]` is an `int` of Unix seconds (it was an RFC 3339 string), and every time in the export's records is Unix seconds. Coach types keep Unix milliseconds. - `activities.prep` sends only the lists you pass: `products=`, `legs=`, or an empty `products` list when you pass neither. - `ImportActivityRequest` takes `type` alone as required (`duration_min` is required for a single sport only), with `legs` and `meal_before_min`. -- `sweat_level`, `satiety_level` and `fitness_level` take 1, 3, 5, 7 or 9 and `saltiness` 1, 5 or 9, the levels the Saturday app stores, on `nutrition.calculate` and on an athlete's settings; the API refuses any other value with a `ValidationError` of code `invalid_value`. `carb_upper_limit_override` takes 50 to 150 g/hr in steps of 10 (code `out_of_range` otherwise). `SettingsFieldSchema` gains `values` and `step`. Added: