---
title: "Autosave the participant's reflection on their prior commitment (MED-937 / E3.1b)"
method: PUT
path: "/api/participant/sessions/{sessionId}/reflection/prior-commitment"
tags: ["Pre-Session Reflection"]
---

# Autosave the participant's reflection on their prior commitment (MED-937 / E3.1b)

`PUT /api/participant/sessions/{sessionId}/reflection/prior-commitment`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/participant/sessions/{sessionId}/reflection/prior-commitment`
- Auth: HTTP bearer

Upserts the "How do you think things went?" reflection for the
participant's prior-session commitment. The commitment_id is resolved
server-side from (cohort, group, session_number − 1, participant) —
the client never sends it. Empty text is a valid save (the AC
explicitly allows leaving the field blank).

Returns 422 with code `prior_commitment_not_available` when the gates
that would have shown the section don't pass (cohort flag off, no
prior session, or no commitment on the prior session).

## Path parameters

- `sessionId` string, uuid, required

## Request body

- object
  - `reflection_text` string, required

## Response `200`

Reflection saved; returns the prior_commitment block

- object
  - `success` boolean
  - `data` PriorCommitmentBlock: MED-937 / E3.1b — "Reflect on Prior Commitments" payload block. Present on the reflection payload only when the cohort has `commitment_tracking_enabled = true` AND the participant has a non-empty commitment from the immediately preceding session in the same group; otherwise the payload's `prior_commitment` is null and the section is omitted on the page.
    - `commitment_id` string, uuid: PK of the source session_participant_commitments row
    - `commitment_text` string: Prior session's commitment text (read-only on the pre-session page)
    - `reflection_text` string: Participant's saved reflection on the prior commitment (empty string when none saved yet)

## Other responses

- `400`: Bad request body
- `401`: Unauthorized
- `403`: Participant not enrolled in this session's cohort
- `404`: Session not found OR live_session_delivery flag off
- `410`: Reflection is locked — session has started
- `422`: prior_commitment_not_available — section gates don't pass

---

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