Training

Send a prescribed session to a connected service as a structured workout

The workout goes to the athlete's account there and onto that day in its calendar; compatible devices pick it up on their next sync. Which devices show it is decided by the sport, not by Body Lab. Sending the same session again replaces what was sent before. Also records the plan, and keeps the service's own id for it so the completed activity is matched exactly.

post/planned-workouts/push

Request

  • Base URL: https://bodylab.lol/api/v1
  • URL: https://bodylab.lol/api/v1/planned-workouts/push
  • Auth: HTTP bearer

Headers

X-Client-Platformstring

The native client's platform, e.g. ios. Server-side and non-native callers omit it.

X-Client-Versionstring

The native client's own semver version. With X-Client-Platform, a version below that platform's minimum is refused with CLIENT_UPGRADE_REQUIRED (426).

Request body

namestring required
modalitystring required

Sport, from the engine's vocabulary (packages/engine/src/sports.ts), e.g. road_biking, running, hiking, strength_training. Known values: road_biking, running, hiking, strength_training, other. Treat unknown values as "other".

forDatestring date required

A day on the athlete's own calendar: YYYY-MM-DD, no time zone.

providerstring required

Response

OK

idstring required

The prescription this push recorded.

providerstring required
providerWorkoutIdstring required

What the service calls the workout. Kept so the activity that comes back is matched to this plan exactly.

scheduledOnstring date nullable required

A day on the athlete's own calendar: YYYY-MM-DD, no time zone.

replacedEarlierPushboolean required

An earlier push of this session for this day was superseded.

Changes

No recorded changes to this operation across all 1 revision of this API.