From 96bd6551e547a0772db1adc14aa3d5d3ebac6483 Mon Sep 17 00:00:00 2001 From: Alex Harrison Date: Tue, 24 Nov 2026 05:20:03 -0700 Subject: [PATCH] Docs prose pass; coach API guide: closed keys, training-setting step, error codes Co-Authored-By: Claude Opus 5.5 Ci-From: linux Ci-Session: 5f62b94d-ff1e-4285-9831-d56f646efbb9 --- access.mdx | 26 ++++++++++++------------ authentication.mdx | 13 ++++++------ guides/coach-api.mdx | 41 ++++++++++++++++++++++++++++---------- guides/coach-connector.mdx | 2 +- guides/freemium-model.mdx | 30 +++++++++------------------- introduction.mdx | 22 +++----------------- llms.txt | 2 +- quickstart.mdx | 10 +++++----- 8 files changed, 70 insertions(+), 76 deletions(-) diff --git a/access.mdx b/access.mdx index b1e0d93..34e3bef 100644 --- a/access.mdx +++ b/access.mdx @@ -1,44 +1,44 @@ --- title: 'Getting Access' -description: 'Which lane fits you: a key with your Saturday plan, the coach portal, or a partnership' +description: 'A key with your Saturday plan, the coach portal, or a partnership' sidebarTitle: 'Getting Access' icon: 'door-open' --- # Getting Access -There are four ways to build with Saturday. One question routes you: where do your athletes live? +There are four ways to build with Saturday. Which one fits depends on where your athletes' records are. -| Lane | Who | Athletes live in… | Auth | Money | +| Way in | Who | Athletes' records are in | Auth | Money | |------|-----|-------------------|------|-------| | Consumer app | An athlete | the Saturday app | app account | app subscription | -| **Coach portal** | A coach managing real Saturday-app athletes | **the Saturday app** | portal login + `cp_` API keys | any paid coach plan, `cp_` keys included | -| **Your own API key** | Dev-athletes, AI-assisted coaching businesses, team-scale builders | **your system** | an `sk_` key you make at saturday.fit/api | comes with any paid Saturday plan | -| **Platform partner** | A platform embedding Saturday for its whole user base | **the partner's system** | `sk_` key via agreement | rev share + athlete subscribe loop | +| **Coach portal** | A coach whose athletes use the Saturday app | **the Saturday app** | portal login (coach API keys are closed for now) | any paid coach plan | +| **Your own API key** | Developers, coaching businesses and teams building their own tools | **your system** | an `sk_` key you make at saturday.fit/api | comes with any paid Saturday plan | +| **Platform partner** | A platform embedding Saturday for its whole user base | **the partner's system** | `sk_` key via agreement | revenue share; athletes subscribe for exact numbers | ## Your own API key (comes with your Saturday plan) -You are building a product, tooling, or a coaching stack, and athletes live in **your** database. +You're building a product, a tool or your coaching setup, and you keep your athletes' records. - **Get it:** sign in at [saturday.fit/api](https://saturday.fit/api) with your Saturday account and make your key. It comes with any paid Saturday plan, member or coach: a subscription from the App Store, Google Play or the web, Lifetime, or a paid coach plan. The free trial alone does not include one. The key is shown once and emailed to your sign-in address once it is verified. - **Lost it?** Make a new one at saturday.fit/api. The old one stops working at once, and your athletes stay. - **Athletes:** a key covers 10 athletes. To cover more, write to [api@saturday.fit](mailto:api@saturday.fit) about what you're building and we'll raise it. -- **Trial economics:** each athlete you create gets the standard [full-precision trial](/guides/freemium-model#full-precision-trial) (15 calls day one, then 5/day, up to 42 in all) automatically. A key starts that trial for 10 athletes over its life, so deleting an athlete frees no trial; when we raise your athletes, the trials rise with them. An athlete whose Saturday account has used its own free trial gets ranges until they subscribe. -- **Limits:** 2 requests/second and 200 calls/day per account. Outgrowing them is when we want to hear from you: [api@saturday.fit](mailto:api@saturday.fit). +- **Trial:** each athlete you add gets the standard [full-precision trial](/guides/freemium-model#full-precision-trial) (15 calls day one, then 5/day, up to 42 in all) automatically. A key starts that trial for 10 athletes over its life, so deleting an athlete frees no trial; when we raise your athletes, the trials rise with them. An athlete whose Saturday account has used its own free trial gets ranges until they subscribe. +- **Limits:** 2 requests/second and 200 calls/day per account. Write to [api@saturday.fit](mailto:api@saturday.fit) when you need more. - **If your plan ends:** the key answers `403 plan_inactive` until the plan is active again, then works with your athletes as they were. ## Coach portal (your athletes use the Saturday app) -If you coach real Saturday-app athletes, the [coach portal](https://coach.saturday.fit) is your lane: roster, alerts, coverage. Every paid coach plan includes `cp_` API keys for scripts against your roster. See the [Coach API guide](/guides/coach-api). Your paid coach plan also lets you make your own API key at saturday.fit/api for athletes who live in your system. +If you coach athletes who use the Saturday app, work in the [coach portal](https://coach.saturday.fit): your roster and alerts, and paying for your athletes' Saturday plans. Coach API keys (`cp_`) are closed for now; the [Coach API guide](/guides/coach-api) has the details. A paid coach plan also comes with your own API key at saturday.fit/api, for athletes whose records you keep. ## Platform partnership -You run a training platform and want Saturday embedded for your entire user base: partner-namespaced athletes, revenue share, [bundle and team offers](/guides/freemium-model#how-discounts-stack), webhooks at platform scale. That one starts as a conversation: [api@saturday.fit](mailto:api@saturday.fit). +You run a training platform and want Saturday inside it for all your users: partner-namespaced athletes, revenue share, [bundle and team offers](/guides/freemium-model#how-discounts-stack) and webhooks. Write to [api@saturday.fit](mailto:api@saturday.fit). - A big team wanting both app athletes *and* custom tooling beyond roster scripts is partner-shaped. Start the conversation rather than stretching your own key. + A large team with athletes in the Saturday app and tooling of its own fits a partnership. Write to [api@saturday.fit](mailto:api@saturday.fit). ## Discovery for agents -`GET https://api.saturday.fit/v1/` (no auth) self-describes the API: its endpoints at their current stage, how a key comes, and the trial shape. Site context: [saturday.fit/llms.txt](https://saturday.fit/llms.txt). +`GET https://api.saturday.fit/v1/` (no auth) lists the endpoints at their current stage, how to get a key, and how the trial works. Site context: [saturday.fit/llms.txt](https://saturday.fit/llms.txt). diff --git a/authentication.mdx b/authentication.mdx index e6e47e3..931db8b 100644 --- a/authentication.mdx +++ b/authentication.mdx @@ -22,20 +22,20 @@ All server-to-server requests pass the key in the `Authorization` header as a Be ### Key types -The prefix encodes both the principal and the environment, so a misrouted key fails closed instead of touching the wrong data. +The prefix encodes both the principal and the environment, so a key sent to the wrong environment is refused. | Prefix | Environment | Purpose | |--------|-------------|---------| | `sk_test_` | Sandbox | Partner key for development and testing | | `sk_live_` | Production | Partner key against real athlete data | | `cp_test_` | Sandbox | Coach key for a coach's roster surface (`/v1/coach/*`) | -| `cp_live_` | Production | Coach key in production. Requires the Business tier or higher | +| `cp_live_` | Production | Coach key in production. Requires Pro Coach or higher | Coach API keys aren't available right now. Write to api@saturday.fit to ask about access. Until then the portal mints no coach key, and a request with a `cp_` key is refused with `403 coach_keys_closed`. -Coach keys (`cp_*`) are minted in the [coach portal](https://coach.saturday.fit) under **[API Keys](https://coach.saturday.fit/admin/api-keys)**, not via `api@saturday.fit`. They authenticate the coach to the [Coach API](/guides/coach-api) and are confined to that coach's roster and configuration. A coach whose subscription lapses below Pro Coach loses `cp_` key access on the next request. +Coach keys (`cp_*`) come from the [coach portal](https://coach.saturday.fit)'s **[API Keys](https://coach.saturday.fit/admin/api-keys)** page. They authenticate the coach to the [Coach API](/guides/coach-api) and are confined to that coach's roster and configuration. A coach whose subscription lapses below Pro Coach loses `cp_` key access on the next request. Coach keys use a separate scope vocabulary, chosen at mint time in the portal: `roster:read`, `roster:write`, `reports:read`, `org:read`, `org:write`, `org:admin`, `webhooks:manage`, `billing:read`. That is a different model from the partner-key scopes below, and the two do not mix. The portal offers each coach only the scopes their role and plan can mint. @@ -45,14 +45,14 @@ curl -H "Authorization: Bearer $SATURDAY_API_KEY" \ ``` - Never expose live keys in client-side code. API keys belong in server-to-server requests only. If you suspect a key has been compromised, revoke it immediately. + Keep live keys out of client-side code: API keys belong in server-to-server requests. If a key may have leaked, revoke it. ### Getting your keys Your own key comes with any paid Saturday plan: sign in at [saturday.fit/api](https://saturday.fit/api) to make it. It is shown once and emailed to your sign-in address once it is verified. If you lose it, make a new one there; the old one stops working at once. -Platform partners are issued keys as part of the agreement: contact [api@saturday.fit](mailto:api@saturday.fit) with your platform name and use case. See [Getting Access](/access) for which lane applies to you. +Platform partners get keys with their agreement: write to [api@saturday.fit](mailto:api@saturday.fit) with your platform name and what you're building. [Getting Access](/access) compares the ways in. ### Using your key @@ -76,7 +76,7 @@ const response = await fetch("https://api.saturday.fit/v1/athletes", { ### Key management -**Creating additional keys.** One key per service or deployment stage keeps a compromise contained and makes rotation a non-event. +**Creating additional keys.** With one key per service or deployment stage, a leaked key reaches less, and you can rotate one without touching the others. ```bash curl -X POST https://api.saturday.fit/v1/partner/api-keys \ @@ -160,6 +160,7 @@ Authentication and authorization failures share the standard [error envelope](/e | `insufficient_scope` | `authorization_error` | 403 | The key's scopes don't permit this method | | `coach_keys_closed` | `authorization_error` | 403 | A valid `cp_` key while coach API keys are closed | | `coach_tier_required` | `authorization_error` | 403 | A `cp_` key whose coach is below Pro Coach | +| `coach_training_proof_required` | `authorization_error` | 403 | A coach's AI assistant on a coach endpoint before the coach has completed the [training-setting step](/guides/coach-api#the-training-setting-step) for that assistant's account | | `service_unavailable` | `api_error` | 503 | Key verification is temporarily unavailable. Retry rather than rotating a working key | A key used against the wrong environment fails closed as `invalid_api_key`, and the message names the environment the key was issued for. Each environment keeps separate key records, and a record whose environment is not the host's is refused even if it is present. diff --git a/guides/coach-api.mdx b/guides/coach-api.mdx index 1847bba..83163ea 100644 --- a/guides/coach-api.mdx +++ b/guides/coach-api.mdx @@ -9,10 +9,14 @@ icon: 'users' The Coach API exposes a coach's Saturday surface over a coach-scoped REST API, and over an [MCP connector](/guides/coach-connector): the per-athlete fueling rollup, AI reports, the roster's needs-attention markers, the notification and alerting settings, and a read-only view of the coach's billing. -It is built for a coach who wants to automate fueling monitoring: read who needs attention, pull a report, and configure alert rules and digests across a whole roster programmatically. +With it, a coach's scripts or AI assistant read who needs attention, pull reports, and set alert rules and digests for the whole roster. + + + **Closed for now.** Coach API keys aren't available right now: the portal mints no coach key, and a request with a `cp_` key is refused with `403 coach_keys_closed`. Keys you hold stay listed in the portal, and you can revoke them there. A coach's AI assistant reaches the coach surface only after the coach completes the [training-setting step](#the-training-setting-step). Write to api@saturday.fit to ask about access. + - **Tier requirements.** Coach endpoints require the Pro Coach tier or above (Pro Coach, Head Coach, Business, Enterprise), and the tier is checked on every request. Two further gates sit above that line: minting a coach API key in the portal requires the Business or Enterprise tier, and webhook *delivery* requires Business or Enterprise. A Pro Coach or Head Coach therefore reaches the whole surface through the OAuth connector, and reaches it through an API key only if someone on a Business or Enterprise plan minted one. + **Tier requirements.** Coach endpoints require Pro Coach or higher (Pro Coach, Head Coach, Business, Enterprise), and the tier is checked on every request. Webhook *delivery* requires Business or Enterprise. @@ -28,11 +32,7 @@ Two ways to authenticate as a coach. Both resolve to the same coach identity and | **Coach API key** | `cp_live_…` / `cp_test_…` (Bearer) | Scripts, automations, server-to-server | | **OAuth2 (coach scopes)** | OAuth2 access token (Bearer) | The Saturday connector for AI assistants / user-delegated apps | - - Coach API keys aren't available right now. Write to api@saturday.fit to ask about access. Until then the portal mints no coach key, and a request with a `cp_` key is refused with `403 coach_keys_closed`. Keys you hold stay listed in the portal, and you can revoke them there. - - -Coach API keys are minted in the [coach portal](https://coach.saturday.fit) under **[Admin → API Keys](https://coach.saturday.fit/admin/api-keys)**. Pass the key as a Bearer token: +Coach API keys come from the [coach portal](https://coach.saturday.fit)'s **[Admin → API Keys](https://coach.saturday.fit/admin/api-keys)** page. Pass the key as a Bearer token: ```bash curl -H "Authorization: Bearer cp_live_..." https://api.saturday.fit/v1/coach/roster @@ -40,6 +40,27 @@ curl -H "Authorization: Bearer cp_live_..." https://api.saturday.fit/v1/coach/ro OAuth2 coaches use the [connector OAuth flow](/guides/oauth2) with coach scopes (`coach:roster`, `coach:reports`, `coach:alerts`, `coach:webhooks`). Because a coach is also an athlete, the same OAuth token acts as an athlete-self token on `/v1/athletes/*`. +## The training-setting step + +Before a coach's AI assistant (Claude or ChatGPT, through the [connector](/guides/coach-connector) or any OAuth token with coach scopes) works with athletes' Saturday data, the coach does two things for the assistant account they connect: + +1. Signs a short statement, typing their full name: model training is off in that account and will stay off while it is connected to Saturday; the account is theirs and they use their athletes' Saturday data there only to coach them; and if model training is ever turned on there, they will disconnect it from Saturday first. +2. Shows a screenshot that model training is off in that account. + +Both stand for 90 days, and then we ask again. Until both stand, the coach surface answers that assistant with `403 coach_training_proof_required` and the coach tools stay off. The message says what is needed; where the step is open (the sandbox today), it ends with a link to the step. The token keeps working for the coach's own athlete data on `/v1/athletes/*`. When we can't read the coach's standing, the answer is `503 service_unavailable`: retry. + +## Errors + +The coach surface answers with the standard [error envelope](/error-handling). These codes are its own: + +| Code | Status | When | +|------|--------|------| +| `coach_keys_closed` | 403 | A valid `cp_` key while coach API keys are closed. The message: "Coach API keys aren't available right now. Write to api@saturday.fit to ask about access." | +| `coach_training_proof_required` | 403 | A coach's AI assistant before the coach has completed the [training-setting step](#the-training-setting-step) for that assistant's account | +| `coach_tier_required` | 403 | A `cp_` key whose coach is below Pro Coach | + +A resource outside the coach's roster, or a credential without the capability a route needs, answers `404` (below). + ## Scopes and capabilities A coach token or key carries scopes, and each scope confers one or more of five capabilities. A route is reachable only when the credential confers the capability it requires; otherwise it returns the uniform `404`. @@ -111,7 +132,7 @@ The markers come from Saturday's single shared concern definition, so they match ### Roster digest (flagged-only) -`GET /v1/coach/roster/digest` returns the same data for athletes who crossed a concern bar this window, most-flagged first. Athletes who did not cross a bar are omitted, which is what makes this the useful call on a large roster. +`GET /v1/coach/roster/digest` returns the same data for athletes who crossed a concern bar this window, most-flagged first. Athletes who did not cross a bar are omitted. ```json { @@ -200,7 +221,7 @@ A workout recorded on a Garmin device that reached Saturday through another serv Sessions from some connected services stay on Saturday and are never returned by the Coach API, so no response carries them or anything built from them. A workout recorded by Garmin or COROS alone is withheld; when the same workout also reached Saturday from another service, it comes back with only that other service's details. When an athlete has connected such a service, the fueling rollup, AI report and AI plan responses, and that athlete's roster row, carry a `withheld` object (`kind`: `connected_app_sessions`, plus a `message` to show). Treat the sessions you do get as incomplete: a short list does not mean the athlete trained less. -The adherence fractions are uncapped, so a value above `1.0` is genuine over-consumption rather than an error. Every missing value stays `null`, never `0`, and an absent `symptoms` key is not a zero. +The adherence fractions are uncapped: a value above `1.0` means the athlete had more than prescribed. Every missing value stays `null`, never `0`, and an absent `symptoms` key is not a zero. ### AI report @@ -251,7 +272,7 @@ Served from cache unless a newer session has landed or `refresh=true`. ## Configuration -Most of the Coach API is a configuration surface. It writes the same alert-rule and report-settings model the portal reads: channels, triggers, per-trigger thresholds, the overall/group/athlete scope hierarchy, cadence, quiet hours, the hourly cap, two-trigger combinators, and AI-report defaults. The portal UI and the API are two views of one config model. +Most of the Coach API is a configuration surface. It writes the same alert-rule and report-settings model the portal reads: channels, triggers, per-trigger thresholds, the overall/group/athlete scope hierarchy, cadence, quiet hours, the hourly cap, two-trigger combinators, and AI-report defaults. **Scope precedence.** Config applies at one of three scopes: `overall` (the whole roster), `group` (a coach group), or `athlete` (one athlete). When resolving what an athlete sees, the most specific scope wins (athlete over group over overall). `scope_id` is required for `group` and `athlete`, and omitted for `overall`. diff --git a/guides/coach-connector.mdx b/guides/coach-connector.mdx index 1208c7a..73098c2 100644 --- a/guides/coach-connector.mdx +++ b/guides/coach-connector.mdx @@ -10,7 +10,7 @@ icon: 'plug' Saturday publishes a remote MCP connector for [Claude](https://claude.ai). There is one connector and one URL; which tools appear depends on who signs in. - An **athlete** (any active Saturday subscriber) gets self-tools over the signed-in account's data. -- A **coach** (Pro Coach tier or above) additionally gets roster and config tools. +- A **coach** (Pro Coach tier or above) additionally gets roster and config tools, once they have completed the [training-setting step](/guides/coach-api#the-training-setting-step) for that Claude account. A coach is also an athlete, so a coach sees both tool sets. An athlete-only subscriber never sees the coach tools. diff --git a/guides/freemium-model.mdx b/guides/freemium-model.mdx index ef6ed13..f760991 100644 --- a/guides/freemium-model.mdx +++ b/guides/freemium-model.mdx @@ -7,11 +7,7 @@ icon: 'gift' # Freemium Model -Saturday's API is free for partners to integrate. The monetization happens at the athlete level: athletes subscribe to Saturday for full-precision nutrition data. - -``` -Partner integrates (free) -> Athletes see teasers (free) -> Athletes subscribe for precision -``` +Platform partners integrate at no charge, and a key you make at saturday.fit/api comes with your paid Saturday plan. Athletes without a Saturday subscription get ranges; athletes who subscribe get exact numbers. ## Teaser vs. full comparison @@ -25,7 +21,7 @@ Partner integrates (free) -> Athletes see teasers (free) -> Athletes subscribe f | **Confidence score** | Shown | Shown | - **Safety is never gated.** Both teaser and full responses include complete safety metadata. Safety information is always free. + **Safety is never gated.** Teaser and full responses both carry the full safety metadata. ## Detecting response type @@ -74,7 +70,7 @@ if (data.tier === "teaser") { ## Full-precision trial -An athlete-scoped calculation with real profile or optional activity inputs starts a **14-day trial of full-tier responses: 15 calls on the first UTC day (exploration allowance), then 5 calls per athlete per UTC day, and at most 42 in all**. Zero-data calls do not start the trial. Complete inputs are still required for exact numbers. During the trial, full responses carry trial metadata so you can build countdown UX: +An athlete-scoped calculation with real profile or optional activity inputs starts a **14-day trial of full-tier responses: 15 calls on the first UTC day, then 5 calls per athlete per UTC day, and at most 42 in all**. Zero-data calls do not start the trial. Complete inputs are still required for exact numbers. During the trial, full responses carry trial metadata, so you can show how much of the trial is left: ```json { @@ -94,7 +90,7 @@ Over the daily cap, responses degrade to teaser ranges (never an error) and incl Three more bounds keep the trial to real athletes. None is an error: the answer comes back in teaser ranges with a flag and a `trial_note` you can show the athlete as it stands. -- **New trials per day.** A key starts at most 50 new trials per UTC day (5 for a key that comes with a Saturday plan). An athlete past that gets ranges with `trial_start_deferred: true`, and their trial starts on a later day. Athletes already in their trial are not affected. Rolling out to a large roster? Email api@saturday.fit and we raise it for your key. +- **New trials per day.** A key starts at most 50 new trials per UTC day (5 for a key that comes with a Saturday plan). An athlete past that gets ranges with `trial_start_deferred: true`, and their trial starts on a later day. Athletes already in their trial are not affected. Rolling out to a large roster? Email api@saturday.fit and we'll raise it for your key. - **Profiles per trial athlete.** One trial athlete's exact numbers cover up to 3 distinct profiles over the trial: their first, plus two changes. Small day-to-day weight changes do not count as changes. A fourth profile gets ranges with `trial_profile_limit_reached: true`; the earlier profiles stay exact. Subscribed athletes have no such bound. - **Exact answers per trial.** One athlete's trial gives at most 42 exact answers in all, however the days fall. The next answer comes back in ranges with `trial_answers_used_up: true`, and its `trial_note` says a Saturday subscription gives exact numbers. @@ -109,7 +105,7 @@ When an athlete wants full precision: 3. The athlete lands on Saturday's checkout page (partner-branded), pays via Stripe, and is sent back toward your app 4. Saturday writes the link and fires the `subscription.created` webhook, and the athlete's next API call returns full precision -Saturday manages the subscription and the payment. Two important details: +Saturday manages the subscription and the payment. Two details: - **The unlock requires athlete-scoped requests.** Only CTAs minted from requests that included an `athlete_id` carry the `pst`; identity-less CTAs are attribution-only and cannot auto-unlock anyone. - **Subscribed Saturday users are never double-charged.** If the athlete has an active Saturday subscription, checkout links their account to your athlete instead of charging, and `subscription.created` fires with `source: "existing_subscription_linked"`. @@ -120,7 +116,7 @@ Saturday manages the subscription and the payment. Two important details: ### Return-to-app handoff -Give Saturday a `return_url` (https or deep link) at partner onboarding and the post-payment success page shows a "Back to your app" button, so athletes land back in your product with full precision flowing. +Give Saturday a `return_url` (https or deep link) at partner onboarding and the post-payment success page shows a "Back to your app" button, so athletes return to your product. ### Automatic linking by email @@ -147,7 +143,7 @@ When an athlete qualifies for more than one discount source (a partner offer **a 20% partner + 15% org → 1 − (0.80 × 0.85) = 32% → capped to 30% ``` -Checkout collapses the stack into a single combined discount, and Saturday's subscribe landing page displays the stacked percent plus which sources contributed, so athletes see the number they will pay rather than a per-source figure. +Checkout collapses the stack into a single combined discount, and Saturday's subscribe landing page displays the stacked percent plus which sources contributed, so athletes see the price they will pay. ## Testing the loop (test environment) @@ -175,20 +171,12 @@ You can also run a real test checkout with Stripe's `4242 4242 4242 4242` card f ## Attribution Teaser data must carry the "Powered by Saturday" mark, linked, near the numbers. Full data carries a -lighter mark wherever Saturday data appears. That linked mark is how the loop closes: athletes seeing -teasers find their way to full precision through it. +lighter mark wherever Saturday data appears. Athletes who see ranges reach Saturday's subscribe page +through that link. Full placement rules, marks, sizing, and the per-surface matrix live on the [Brand & Attribution](/guides/attribution) page. -## Partner value exchange - -- **Partners get**: Free nutrition intelligence for their platform -- **Saturday gets**: Distribution to athletes who may subscribe -- **Athletes get**: Personalized nutrition whether they subscribe or not - -More partners means more athletes seeing Saturday, and more subscribers. - The trial starts once real profile or optional activity inputs are present. Zero-data calculations never start or burn it. Collect the [fueling profile](/guides/onboarding) and provide the per-activity inputs so trial calculations can return exact numbers. diff --git a/introduction.mdx b/introduction.mdx index b5cb7be..fec78ac 100644 --- a/introduction.mdx +++ b/introduction.mdx @@ -10,8 +10,6 @@ Saturday calculates personalized fuel, hydration, and electrolyte prescriptions ## What the API returns -Training platforms build the workout. Saturday fuels it. - | Output | Field | Units | |--------|-------|-------| | Carbohydrate target | `carb_g_per_hr` | grams per hour | @@ -24,25 +22,11 @@ Safety metadata is present on every response at every tier, including free ones. Every time a partner key receives is a whole number of Unix seconds: on athletes, activities and stored prescriptions, webhooks and their deliveries, each event's `created_at`, API keys, your partner account, `trial_ends_at`, the fueling profile's `updated_at`, the export's `exported_at` and every time in its records, over REST, webhooks and MCP alike. The webhook signature header's `t` is Unix seconds too ([Webhooks](/guides/webhooks#verifying-webhook-signatures-hmac-sha256)). Usage dates are `YYYY-MM-DD` in UTC, and `GET /v1/health` gives its `timestamp` as an RFC 3339 string. The [Coach API](/guides/coach-api) answers in Unix milliseconds. -Product matching against Saturday's curated endurance-nutrition catalog and conversations with Saturday's assistant are gated. [Feature Gates](/guides/feature-gates) covers the launch stages and how to request access. - -## The problem - -Fueling for endurance athletes is safety-critical. Hyponatremia, dangerously low blood sodium from overdrinking, kills athletes. Bad fueling causes GI distress, bonking, and DNFs. Getting those edge cases right is the hard part. - -Saturday's API lets a platform offer that without building it. Your platform handles the training. Saturday handles the fueling. - -## Who builds on it - -- Training platforms, the Athletica.ai / Intervals.icu / TriDot / AI Endurance / Final Surge category -- Wearable companies putting nutrition into watch faces and workout summaries -- Race organizers issuing fueling plans to event participants -- Coaching platforms adding nutrition tools alongside training tools -- AI agents consuming Saturday over MCP or direct HTTP +Product matching against Saturday's endurance-nutrition catalog and conversations with Saturday's assistant are gated. [Feature Gates](/guides/feature-gates) covers the launch stages and how to request access. ## What it costs -Platform partners integrate at no charge and earn attribution. Athletes who want exact numbers subscribe to Saturday directly, so the partner carries no nutrition billing. Builders whose athletes live in the builder's database get a key with any paid Saturday plan, member or coach. [Getting Access](/access) routes you to the right lane. +Platform partners integrate at no charge and earn attribution. Athletes who want exact numbers subscribe to Saturday directly, so the partner carries no nutrition billing. If you keep your athletes' records in your own system, your key comes with any paid Saturday plan, member or coach. [Getting Access](/access) compares the ways in. Athletes without a subscription get teaser responses: ranges in place of exact numbers, safety metadata intact. [Freemium Model](/guides/freemium-model) shows both response shapes. @@ -54,7 +38,7 @@ Athletes without a subscription get teaser responses: ranges in place of exact n | [Athletes](/guides/athletes) | Athlete profiles scoped to your organization | | [Activities](/guides/activities) | Creating activities and attaching prescriptions | | [Webhooks](/guides/webhooks) | Event notifications for your integration | -| [Safety](/guides/safety) | Saturday's safety model, and why it is load-bearing | +| [Safety](/guides/safety) | The safety metadata and what you must show | ## Getting started diff --git a/llms.txt b/llms.txt index f053d1f..530d32f 100644 --- a/llms.txt +++ b/llms.txt @@ -12,7 +12,7 @@ Authenticated API requests use a Bearer token in the Authorization header. Partn Authorization: Bearer $SATURDAY_API_KEY ``` -Coaches use a separate surface with separate credentials: a `cp_live_` / `cp_test_` coach API key, or an OAuth2 token carrying coach scopes. +Coaches use a separate surface with separate credentials: a `cp_live_` / `cp_test_` coach API key, or an OAuth2 token carrying coach scopes. Coach API keys are closed for now, and a coach's AI assistant reaches the coach surface only after the coach completes the training-setting step: https://docs.saturday.fit/guides/coach-api ## Core Endpoints diff --git a/quickstart.mdx b/quickstart.mdx index 990e5ba..5b05cd4 100644 --- a/quickstart.mdx +++ b/quickstart.mdx @@ -8,7 +8,7 @@ sidebarTitle: 'Quickstart' ## 1. Get your API key -**Your own key:** a key comes with any paid Saturday plan, member or coach. Sign in at [saturday.fit/api](https://saturday.fit/api) and make it; it is shown once and emailed to you. It covers 10 athletes; to cover more, write to [api@saturday.fit](mailto:api@saturday.fit) about what you're building. Not sure which lane is yours? See [Getting Access](/access). +**Your own key:** a key comes with any paid Saturday plan, member or coach. Sign in at [saturday.fit/api](https://saturday.fit/api) and make it; it is shown once and emailed to you. It covers 10 athletes; to cover more, write to [api@saturday.fit](mailto:api@saturday.fit) about what you're building. Not sure which way in fits you? See [Getting Access](/access). **Platform partners:** keys come with your agreement. Contact [api@saturday.fit](mailto:api@saturday.fit). @@ -134,14 +134,14 @@ curl -X POST https://api.saturday.fit/v1/nutrition/calculate \ | `carb_g_per_hr`, `sodium_mg_per_hr`, `fluid_ml_per_hr` | Per-hour targets, whole numbers, as the Saturday app shows them | | `total_*` | Totals for the whole session | | `precision.profile_complete` | When `precision` is present, `true`: these are exact numbers. `false`: the response carries ranges instead (step 5) | -| `tier`, `tier_source` | `full` with `trial`: the athlete's 14-day trial gives exact numbers. It started with this call: 15 calls on the first day, then 5 a day, up to 42 in all | +| `tier`, `tier_source` | `full` with `trial`: the athlete's trial gives exact numbers for up to 14 days. It started with this call: 15 calls on the first day, then 5 a day, up to 42 in all | | `safety` | Shown on every response. Show each warning to the athlete. `not_instructions` marks the numbers as guidance, not commands | | `attribution` | Show it wherever you show the numbers | -That is a first prescription. To store the session and size the athlete's gels and drink mix against it, continue with [Activities](/guides/activities) and [Prep and Products](/guides/prep-and-products). +To store the session and size the athlete's gels and drink mix against it, continue with [Activities](/guides/activities) and [Prep and Products](/guides/prep-and-products). - Safety data is never gated. Every response carries full safety metadata regardless of subscription status, because overdrinking can cause hyponatremia, a potentially fatal condition. + Every response carries the full safety metadata, whatever the athlete's subscription: overdrinking can cause hyponatremia, which can be fatal. ## 5. Ranges and what they ask for @@ -192,7 +192,7 @@ An athlete whose profile is missing answers gets ranges and a list of what to as `missing_fields` arrives most impactful first. `missing_profile_fields` names the athlete's answers to collect: ask those questions in your app, or, in the sandbox, send the athlete to `precision.onboarding.url` when the response carries one. A session input your request left out (`meal_before_min`, say) is listed in `missing_fields` too and in `missing_session_inputs`: it is yours to send. Check `precision.profile_complete` when the response carries `precision`, and the range fields when it does not, not `tier`, to tell exact numbers from ranges. `trial_ends_at`, like every time the API gives you, is in Unix seconds. -After the trial, an athlete without a Saturday subscription gets `"tier": "teaser"`: ranges and a `subscription_cta` with their subscribe link. See [Freemium Model](/guides/freemium-model) for how the tiers are decided and how the subscribe loop pays you. +After the trial, an athlete without a Saturday subscription gets `"tier": "teaser"`: ranges and a `subscription_cta` with their subscribe link. See [Freemium Model](/guides/freemium-model) for how the tiers are decided. ## 6. Use an SDK