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
2 changes: 1 addition & 1 deletion error-handling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Saturday uses one error format across all endpoints, modeled on Stripe's error s
| `request_id` | Yes, except on a `not_found_error` 404 | Identifier for this request. Include it in support tickets |
| `athlete_id` | No | On `athlete_exists`: the athlete that holds the `external_id` you sent |

A value of the wrong JSON type is refused with code `invalid_value` and the field in `param`, on the athlete, activity, calculate, batch, gear and integration routes: `"duration_min": "90"` answers "duration_min must be a whole number (got a string)." A nested field carries its path, such as `settings.sweat_level`. A body that is not JSON answers `invalid_json`.
A value of the wrong JSON type is refused with code `invalid_value` and the field in `param`, on the athlete, activity, calculate, batch and gear routes: `"duration_min": "90"` answers "duration_min must be a whole number (got a string)." A nested field carries its path, such as `settings.sweat_level`. A body that is not JSON answers `invalid_json`.

### A field the request does not take

Expand Down
32 changes: 2 additions & 30 deletions guides/activities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -197,37 +197,9 @@ GET /v1/athletes/{athlete_id}/activities?limit=50&cursor=1737043200%7C3f6c2b1e-8

Activities come back newest first, paginated by cursor. `limit` defaults to 50 and is clamped to 1-200; pass `pagination.next_cursor` back as `cursor` for the next page, URL-encoded and unchanged. There are no date-range or type filters; filter on your side, or track activities by `external_id`.

## Syncing activities from intervals.icu
## Workouts from other platforms

When an athlete connected intervals.icu to your platform, send us your intervals.icu OAuth access token for them and we store their intervals.icu activities as activities of your athlete.

```bash
POST /v1/integrations/{provider}/sync
```

`provider` is `intervals_icu`.

```json
{
"athlete_id": "3f6c2b1e-8d4a-4e7b-9c2f-1a5d7e9b0c43",
"access_token": "the athlete's intervals.icu access token",
"sync_types": ["activities"],
"date_range": { "start": "2026-11-01", "end": "2026-11-19" }
}
```

| Field | Required | Description |
|-------|----------|-------------|
| `athlete_id` | Yes | Your athlete the activities are stored under |
| `access_token` | Yes | The intervals.icu OAuth access token your app holds for that athlete |
| `sync_types` | Yes | `["activities"]` |
| `date_range` | No | `start` and `end`, both `YYYY-MM-DD`. Without it, the last 7 days |

The answer is `result` and `request_id`. `result` holds `status` (`completed`, `partial` when some activities could not be stored, `failed` when none could or intervals.icu refused the token, with `errors` saying why), `activities_found`, `activities_synced`, `activities_skipped` (activities whose type names no sport the API supports, such as yoga) and `prescription_tier` (`full` or `teaser`, the athlete's tier). A synced activity's id is `icu_` followed by its intervals.icu id, so syncing the same days again updates those activities and adds no copies.

Each sync calls intervals.icu with your token, so it counts against your intervals.icu app's limit: for an OAuth app, 100 calls a day per user.

The route takes no Strava or TrainingPeaks token. `strava` answers `400` with code `invalid_provider`. For TrainingPeaks workouts, send them with [activity import](/guides/batch-operations#activity-import) once the athlete agrees to share them with Saturday; `training_peaks` on this route answers `400` `invalid_provider` and names that route.
To bring in an athlete's workouts from intervals.icu, TrainingPeaks or another platform, read them with your app's own access and send them with [activity import](/guides/batch-operations#activity-import). Saturday does not take a platform's access token from you.

## Submitting feedback

Expand Down
2 changes: 1 addition & 1 deletion guides/athletes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Removes the athlete from your roster together with everything stored under them:
POST /v1/athletes/{id}/delete
```

The erasure path. It revokes at the provider every connection you supplied for the athlete through `POST /v1/integrations/{provider}/sync`, then deletes the athlete and everything stored under them, including the activities synced through those connections and the athlete's link to a Saturday account.
The erasure path. It deletes the athlete and everything stored under them, including the athlete's link to a Saturday account.

A linked athlete's own Saturday account is not changed. What they connected or entered there, including their own provider connections and workouts, stays until they remove it in the Saturday app or delete their account.

Expand Down