Skip to main content

Prep and Products

A prescription says how much carbohydrate, sodium and fluid a session needs. These three routes turn it into products: how many servings of a gel or drink mix fit, what they cover, and what is left for water and the base mix. All three size against the athlete’s own prescription, the one POST /v1/nutrition/calculate gives that athlete for that session, and count servings the way the Saturday app’s Prep screen does. All three need the nutrition feature and count as calculation calls against your daily limits. A brick or triathlon is one call on each, never one call per leg.

Naming a product

Products come from Saturday’s curated catalog. Name one by text or by id:
product_query is matched against product names, brands and keywords; an exact name wins over a partial one. product_id wins when both are sent. A product that matches nothing is 404 product_not_found on fit and compare, and is left out of a prep answer.

Prep for a stored session

Create the session, calculate it, then send the products. Products with servings count first; each product without servings is sized to what the plan still needs after the products before it, in list order. A stored brick or triathlon preps leg by leg (below).
All amounts are for the whole session. Send no products (or an empty list) to get the prescription alone. Prep answers 404 prescription_not_found for a session that has no prescription yet and whose athlete has no Saturday subscription: calculate it first.

Product fit

Fit sizes one product against the athlete’s prescription for a session you describe, without storing anything. The session fields are the ones calculate takes: activity_type, duration_min, intensity_level, thermal_stress_level, meal_before_min and is_race, or for a brick or triathlon its legs (below). Any other field is refused with 400 unsupported_field.
max_servings is the most servings before a nutrient would overshoot the prescription by more than Prep’s allowance: a quarter of the product’s serving or a fixed margin for that nutrient, whichever is larger. Servings count in the steps Prep uses for the product, such as a quarter scoop, half a gel or a whole packet, so max_servings can be 3.75. remaining_gap shows a remainder smaller than a quarter serving as 0. limiting_factor names what stops the servings rising: verdict names the sodium source of the athlete’s base mix: their own choice in the Saturday app while they share their answers with you, otherwise salt. caffeine_mg is absent when Saturday has no caffeine figure for the product; that does not mean it has none. A body carrying carb_g, sodium_mg or fluid_ml is refused with 400 unsupported_field: the prescription is always Saturday’s.

Compare

Compare runs fit on two products against one session and names the product that covers more of each nutrient at its max_servings. overall is the higher average coverage; a tie goes to product_a.
The response carries prescription, product_a and product_b (each shaped like fit above) and:
A 404 names the product it could not find in param (product_a or product_b).

Bricks and triathlons

Prep, fit and compare take a brick or triathlon as one session and answer leg by leg, as the Saturday app’s Prep page for each leg does. Each leg’s prescription is its share of the session’s plan, the share calculate’s legs give it. A plan from ranges carries no legs.

Prep

On a stored brick or triathlon, send either list:
  • products: one list, sized against each leg’s share. A product’s servings count per leg.
  • legs: one entry per leg of the activity, in order, each with its own products.
Send products or legs, not both: the pair is refused with 400 invalid_value on products. legs on a single session, or with a count other than the activity’s legs, is refused with 400 invalid_value on legs: this activity has 2 legs; send one entry per leg, in order (got 1). When the activity’s plan is from ranges, which carry no legs, the per-leg lists are sized together as one list against the session. The answer carries legs, each leg shaped like a single session’s prep, and a top level that is the legs added up. For the brick on Nutrition Calculation, with the lists above:

Fit and compare

Send the brick or triathlon as calculate takes it: activity_type brick or triathlon, legs with each leg’s sport, minutes, effort and heat, and meal_before_min and is_race at the top level. duration_min is the legs’ total: leave it out or send that total.
The top-level prescription and fit (on compare, product_a, product_b and winner) size the product against the whole session. legs sizes it against each leg’s share:
Each leg’s fit carries every field of the top-level fit, shortened here. On compare, each leg carries product_a, product_b and its own winner.

Session errors

Fit and compare name the session field at fault in param: An unknown sport’s message points at POST /v1/infer/activity-type, which maps your own sport names to Saturday’s.

Plans from ranges

A plan uses the athlete’s exact numbers only when calculate would give them exact numbers: their profile answered, and every session input sent (intensity_level, thermal_stress_level, meal_before_min, is_race; on prep, set on the activity). When either is missing, calculate gives per-hour ranges, and prep, fit and compare plan from the middle of those ranges for the session. plan_basis then says so and names what is missing. A plan from ranges carries no legs. A fully onboarded athlete and a session missing meal_before_min and is_race:
An athlete whose profile is missing answers:
When plan_basis is present, show its message with the plan. Offer the athlete onboarding.url, or your own questions (Onboarding), only when it is there: a missing session input is yours to send. With everything in, plan_basis is absent and the plan uses the athlete’s exact numbers.

Who gets an answer

Product answers open on the athlete’s Saturday subscription, partner trial, or a seat license from their organization. For any other athlete, fit and compare answer 200 with "tier": "teaser": the product categories (categories), a subscribe link (cta) and request_id, in place of prescription and fit. Prep still returns the prescription and gear for them, with products empty. A key that receives a large share of the catalog within 24 hours is paced: a new product is refused with 429 catalog_paced and a Retry-After of the seconds until new products resume, while products already received keep working. See Rate Limiting.

Safety

Every answer carries the same safety block as a calculation. A prep answer whose products overshoot the prescription carries warnings; show each one with the plan. See Safety.