---
title: "Bulk upsert per-participant commitments (AC5)"
method: PUT
path: "/api/coach/sessions/{sessionId}/post-session/commitments"
tags: ["Coach Post-Session"]
---

# Bulk upsert per-participant commitments (AC5)

`PUT /api/coach/sessions/{sessionId}/post-session/commitments`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/coach/sessions/{sessionId}/post-session/commitments`
- Auth: HTTP bearer

Coach fill-in of a commitment for each listed participant. MED-1216:
the card now saves one row at a time (per-row Save), and a commitment
must be non-empty (whitespace-only is rejected, 422/400). The coach may
fill in a commitment when none exists or edit a coach-authored one, but
may NOT overwrite a participant-authored row — such a write is rejected
with 409 so the client refreshes and shows the participant's own entry
("saved by participant").

AI follow-up scheduling on saved entries → MED-893.

## Path parameters

- `sessionId` string, uuid, required

## Request body

- object
  - `commitments` object[]
    - `participant_user_id` string, uuid, required
    - `commitment_text` string, required

## Response `200`

Returns the post-upsert list of active commitments

- object
  - `success` boolean
  - `data` object
    - `commitments` PostSessionCommitment[]
      - `id` string, uuid
      - `session_id` string, uuid
      - `participant_user_id` string, uuid
      - `coach_user_id` string, uuid, nullable: NULL for participant-authored rows (MED-1216).
      - `authored_by_user_id` string, uuid: Actual author. Equals participant_user_id for participant-authored rows (coach cannot overwrite these), or the coach's id for coach fill-ins (MED-805/MED-1216).
      - `commitment_text` string
      - `created_at` string, date-time
      - `updated_at` string, date-time

## Other responses

- `401`: Unauthorized
- `404`: Session not found OR live_session_delivery flag off
- `409`: Commitment is participant-authored and cannot be overwritten by a coach (MED-1216 / AC4).
- `422`: Validation failed (includes empty commitment_text — MED-1216 / AC1).

---

[API](https://skmtc.dev/withmedley/apis/medley-api.md) - [All operations](https://skmtc.dev/withmedley/apis/medley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/withmedley/apis/medley-api/revisions/40aaac5ca6bd?raw)
