---
title: "Upsert the peer leader's own commitment (AC3, IV3)"
method: PUT
path: "/api/participant/sessions/{sessionId}/post-session/commitments"
tags: ["Peer Leader Post-Session"]
---

# Upsert the peer leader's own commitment (AC3, IV3)

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

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/participant/sessions/{sessionId}/post-session/commitments`
- Auth: none declared

MED-1133 (E4.5a) — PRIVACY: a peer leader may only record their OWN
commitment. The card now sends just the leader's row; any row whose
participant_user_id is not the leader is dropped at the data layer (AC2)
and logged for audit. The leader's row is stored as a self-authored
commitment (coach_user_id NULL) — the same single
`(session_id, participant_user_id)` row E3.4 uses, so it cannot duplicate
E3.4 data (IV3). MED-1216 / AC1: `commitment_text` must be non-empty
(whitespace-only rejected, 400) — no blank saves. The response contains
only the leader's own commitment (0 or 1 row).

## Path parameters

- `sessionId` string, uuid, required

## Request body

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

## Response `200`

Commitments persisted (returns the active list)

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Caller is not the peer leader for this session
- `500`: Server error

---

[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)
