← API overview
Save a structured workout
POST
/v1/workoutsrequires workouts.writeSave a workout to the athlete's library from explicit steps. It is persisted, tagged and indexed, so the search endpoint finds it straight away.
Targets are expressed per base, in percent of FTP by default. Send dry_run: true to resolve and score the structure without saving anything, which is worth doing once before committing a long or unusual session: the response is the same minus the identifiers.
Example
bash
curl -X POST "https://api.stride.is/v1/workouts" \
-H "Authorization: Bearer $STRIDE_TOKEN" \
-H "Content-Type: application/json" \
-d '{ }'Response 201
Created. The Location header points at the new resource.
basestringdescriptionstringdominant_zonestringduration_typestringidstringalways presentnamestringalways presentofficialbooleanalways presentowner_team_idstringowner_user_idstringsavedbooleanalways presentsegmentsobject[]cadence_highintegercadence_lowintegerdurationintegeralways presentduration_unitstringhigh_targetintegerindexintegeralways presentlow_targetintegeralways presentnamestringramp_endintegerramp_startintegerrepeatbooleanrepetitionsintegertarget_unitstringtextstringuntil_lap_pressboolean
slugstringsummarystringtagsstring[]total_distance_metersintegertotal_duration_secondsintegertraining_scoreintegertypestring
Errors
Every error is an RFC 9457 problem document. Branch on its code, which is stable; detail is prose and may be reworded.
400The request was malformed: an unparseable date, an unknown enum value, or a parameter combination that cannot be satisfied.401No access token was supplied, or it is not valid for this API.402The Stride account the token belongs to has no active subscription or trial.403The token does not hold the scope this endpoint requires, or may not act on the athlete or team named.404No such resource, or it is not visible to this token. The two are deliberately indistinguishable.405The path exists but does not serve this method. The Allow header lists the ones it does.422The request was understood but could not be carried out: most often an upload that produced no activity.429A rate limit was exceeded. Retry after the period in the Retry-After header.500Something failed on Stride's side. The failure is logged with a trace ID.