Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions access.mdx
Original file line number Diff line number Diff line change
@@ -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).

<Note>
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).
</Note>

## 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).
13 changes: 7 additions & 6 deletions authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

<Warning>
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`.
</Warning>

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.

Expand All @@ -45,14 +45,14 @@ curl -H "Authorization: Bearer $SATURDAY_API_KEY" \
```

<Warning>
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.
</Warning>

### 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

Expand All @@ -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 \
Expand Down Expand Up @@ -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.
41 changes: 31 additions & 10 deletions guides/coach-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<Warning>
**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.
</Warning>

<Note>
**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.
</Note>

<Note>
Expand All @@ -28,18 +32,35 @@ 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 |

<Warning>
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.
</Warning>

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
```

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`.
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.

<Info>
**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`.
Expand Down
2 changes: 1 addition & 1 deletion guides/coach-connector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading