Training

Say that a session is happening

One occurrence, one row: a weekly club ride is entered each week. There is no recurrence rule, on purpose — a stored schedule outlives its own truth, and when the club moves to Wednesdays the app would be confidently wrong for months. Adding one never replaces anything: unlike planning the engine's own session, a second commitment on the same day and sport is a second session, because two of the athlete's arrangements can share a day. Sending the same commitment twice stores one: the second call answers with the first one's id and writes nothing. Bounded, whoever is writing: no more than 180 days ahead or a day back (OUT_OF_HORIZON, 400), at most three on one day (DATE_OCCUPIED, 409), and at most 750 standing on the calendar (SCHEDULE_FULL, 409 — waiting does not help; withdraw one). A connected app is also held to a rolling per-app quota (QUOTA_EXCEEDED, 429, with retryAfterS); the athlete's own session is not.

post/commitments

Request

  • Base URL: https://bodylab.lol/api/v1
  • URL: https://bodylab.lol/api/v1/commitments
  • 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

forDatestring date required

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

sportstring 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".

durationSinteger required
intensity'easy' | 'mixed' | 'hard' required
namestring

What to call it. Defaults to the sport's own name, which is all the card needs to draw it.

Response

OK

idstring required

Opaque identifier.

Changes

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