---
title: "Say that a session is happening"
method: POST
path: "/commitments"
tags: ["Training"]
---

# Say that a session is happening

`POST /commitments`

## Request

- Base URL: `https://bodylab.lol/api/v1`
- URL: `https://bodylab.lol/api/v1/commitments`
- Auth: HTTP bearer

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.

## Headers

- `X-Client-Platform` string
- `X-Client-Version` string

## Request body

- object
  - `forDate` string, date, required: A day on the athlete's own calendar: YYYY-MM-DD, no time zone.
  - `sport` string, 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".
  - `durationS` integer, required
  - `intensity` 'easy' | 'mixed' | 'hard', required
  - `name` string: What to call it. Defaults to the sport's own name, which is all the card needs to draw it.

## Response `201`

OK

- object
  - `id` string, required: Opaque identifier.

## Other responses

- `400`: Error: OUT_OF_HORIZON.
- `401`: Error: UNAUTHORIZED.
- `409`: Error: DATE_OCCUPIED, SCHEDULE_FULL.
- `429`: Error: QUOTA_EXCEEDED.

---

[API](https://skmtc.dev/bodylab/apis/body-lab-api.md) · [All operations](https://skmtc.dev/bodylab/apis/body-lab-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bodylab/apis/body-lab-api/revisions/544c201eaf88?raw)
