From 8202c2e034595013c9a1402379c54b00ddfd8d7f Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Tue, 24 Nov 2026 09:00:51 -0700 Subject: [PATCH 1/2] Guide: sessions in a member's Saturday Co-Authored-By: Claude Opus 5.5 Ci-From: linux Ci-Session: 83bc3e32-50b1-42bc-9ad3-b7a0c6753b4d --- docs.json | 1 + guides/activities.mdx | 3 +- guides/member-sessions.mdx | 75 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 guides/member-sessions.mdx diff --git a/docs.json b/docs.json index 7b78302..ccd7bba 100644 --- a/docs.json +++ b/docs.json @@ -85,6 +85,7 @@ "guides/nutrition-calculation", "guides/athletes", "guides/activities", + "guides/member-sessions", "guides/prep-and-products", "guides/freemium-model", "guides/onboarding", diff --git a/guides/activities.mdx b/guides/activities.mdx index cc3565a..4a2cefa 100644 --- a/guides/activities.mdx +++ b/guides/activities.mdx @@ -83,8 +83,9 @@ console.log(`Activity ID: ${activity.id}`); | `is_race_event` | boolean | No | Whether this is a race. The calculate request spells it `is_race`; here that name is refused. Exact numbers need it | | `meal_before_min` | integer | No | Minutes since the athlete's last carb-rich meal at the start. More than 180 plans a fasted start. Exact numbers need it | | `external_id` | string | No | Your platform's activity ID | +| `start` | string | No | When the session is planned: ISO 8601 with a UTC offset (`2026-12-02T07:00:00-07:00`), or without one for the athlete's clock in Saturday. Within a year of today. Needed to [add the session to a member's Saturday](/guides/member-sessions) | -Create takes these fields. It also accepts `name` and `scheduled_at` and ignores them: there is no stored display name or scheduled start time, so keep those on your side and join on `external_id`. Any other field is refused with `400` and code `unsupported_field`, `param` naming it and the message naming the field to send: `activity_type` (send `type`), `is_race` (send `is_race_event`), `duration` (send `duration_min`), or the closest field for a misspelling. See [Error Handling](/error-handling#a-field-the-request-does-not-take). +Create takes these fields. It also accepts `name` and `scheduled_at` and ignores them: there is no stored display name, and the planned start goes in `start`. Keep the name on your side and join on `external_id`. Any other field is refused with `400` and code `unsupported_field`, `param` naming it and the message naming the field to send: `activity_type` (send `type`), `is_race` (send `is_race_event`), `duration` (send `duration_min`), or the closest field for a misspelling. See [Error Handling](/error-handling#a-field-the-request-does-not-take). `external_id` is worth sending. Saturday's hosted onboarding finish screen uses it to deep-link the athlete back into the matching activity in your app. diff --git a/guides/member-sessions.mdx b/guides/member-sessions.mdx new file mode 100644 index 0000000..6f060fb --- /dev/null +++ b/guides/member-sessions.mdx @@ -0,0 +1,75 @@ +--- +title: 'Sessions in a member\'s Saturday' +description: 'The sessions you plan for an athlete, added to their own Saturday app' +sidebarTitle: 'Member sessions' +icon: 'calendar-plus' +--- + +# Sessions in a member's Saturday + +When an athlete on your platform is linked to their Saturday account, the sessions you plan for them can appear in their Saturday app with a fuel plan for each, and follow your changes. Nothing extra to call: the [activity routes](/guides/activities) you use today do it. + +This needs two things: + +1. **Saturday's go-ahead for your platform.** Ask at api@saturday.fit. Until then the routes below behave exactly as before and their answers carry no `member_session`. +2. **The member's yes.** When a member confirms the link to your platform (the confirmation page Saturday emails, or your checkout on saturday.fit), the page says "{your name} will add the sessions it plans for you to Saturday." Confirming is their yes. A member linked before that sentence was shown gives it by confirming again. + +## Adding a session + +Create the activity as usual, with a `start` and your own `external_id`: + +```json +POST /v1/athletes/{athlete_id}/activities +{ + "type": "run", + "duration_min": 60, + "intensity_level": 5, + "start": "2026-12-02T07:00:00-07:00", + "external_id": "your-session-4411" +} +``` + +The answer carries what happened in the member's Saturday: + +```json +{ + "id": "…", + "type": "run", + "start": "2026-12-02T07:00:00-07:00", + "member_session": { "state": "added" } +} +``` + +The member's session is matched on `external_id`. Sending the same session again, or retrying a request, updates the one session the member has. + +## Changing and moving a session + +`PATCH` the activity. The member's session takes your change, and `member_session` reads `updated`. A field the member changed in Saturday stays as they set it, and `kept_fields` lists it: + +```json +{ "member_session": { "state": "updated", "kept_fields": ["duration_min"] } } +``` + +To move a session, send a new `start`. A session the member moved stays where they put it. + +## Removing a session + +`DELETE` the activity. The session leaves the member's Saturday unless the member used it (changed it, planned fuel or bottles for it, reported on it, rated it, wrote a note or marked it done), or another of your activities for this athlete holds the same `external_id`. A session the member used stays theirs. + +## When a session is not added + +`member_session.state` is `not_added`, and `code` says why: + +| `code` | What it means | What to do | +|---|---|---| +| `not_linked` | The athlete is not linked to a Saturday account | Nothing; sessions start once they link | +| `no_member_yes` | The member linked before agreeing that you add their sessions | They agree when they confirm the link again | +| `member_turned_off` | The member turned your sessions off in Saturday | Nothing; sessions already added stay with them | +| `start_required` | The activity has no `start` | Send `start` | +| `start_needs_offset` | Saturday holds no time zone for the member | Send `start` with a UTC offset | +| `legs_not_added` | Bricks and triathlons stay on your record only | Nothing | +| `member_deleted` | The member deleted this session in Saturday | Nothing; it stays deleted | +| `not_partner_session` | The member's Saturday holds a session there that you did not add | Nothing; it is left as it is | +| `try_again` | Saturday could not write the session | `PATCH` the activity with the same values | + +The activity itself is stored on your record in every case, and its prescription works as before. From ad0c5f884e8d2d92cac446df290aecdf83433c4a Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Tue, 24 Nov 2026 10:29:57 -0700 Subject: [PATCH 2/2] Member sessions: the member's yes can come from the app's switch fuel-backend #2467: turning a partner's sessions on in the Saturday app (Preferences, Partner Sharing) is the member's yes, as confirming the link is. Co-Authored-By: Claude Opus 5.5 Ci-From: linux Ci-Session: b63e831f-4078-433a-a6a6-48393bedfa12 --- guides/member-sessions.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/member-sessions.mdx b/guides/member-sessions.mdx index 6f060fb..7350cd9 100644 --- a/guides/member-sessions.mdx +++ b/guides/member-sessions.mdx @@ -12,7 +12,7 @@ When an athlete on your platform is linked to their Saturday account, the sessio This needs two things: 1. **Saturday's go-ahead for your platform.** Ask at api@saturday.fit. Until then the routes below behave exactly as before and their answers carry no `member_session`. -2. **The member's yes.** When a member confirms the link to your platform (the confirmation page Saturday emails, or your checkout on saturday.fit), the page says "{your name} will add the sessions it plans for you to Saturday." Confirming is their yes. A member linked before that sentence was shown gives it by confirming again. +2. **The member's yes.** When a member confirms the link to your platform (the confirmation page Saturday emails, or your checkout on saturday.fit), the page says "{your name} will add the sessions it plans for you to Saturday." Confirming is their yes. A member linked before that sentence was shown gives it by turning your sessions on in the Saturday app (Preferences, Partner Sharing), or by confirming again. The same switch turns your sessions off. ## Adding a session @@ -63,7 +63,7 @@ To move a session, send a new `start`. A session the member moved stays where th | `code` | What it means | What to do | |---|---|---| | `not_linked` | The athlete is not linked to a Saturday account | Nothing; sessions start once they link | -| `no_member_yes` | The member linked before agreeing that you add their sessions | They agree when they confirm the link again | +| `no_member_yes` | The member linked before agreeing that you add their sessions | They agree by turning your sessions on in the Saturday app, or when they confirm the link again | | `member_turned_off` | The member turned your sessions off in Saturday | Nothing; sessions already added stay with them | | `start_required` | The activity has no `start` | Send `start` | | `start_needs_offset` | Saturday holds no time zone for the member | Send `start` with a UTC offset |