Events

Add a race or goal

Bounded, whoever is writing: no more than 800 days ahead or a day back (OUT_OF_HORIZON, 400), at most two events of one sport in any sixty days (DATE_OCCUPIED, 409), and at most 150 events on the calendar (SCHEDULE_FULL, 409 — waiting does not help; remove 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/events

Request

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

priority'A' | 'B' | 'C' required
distanceMnumber nullable
durationSinteger nullable
notesstring

Response

OK

idstring required

Opaque identifier.

Changes

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