---
title: "Pre-populate the target editor with another session's authored content (MED-982 / E1.3g)"
method: POST
path: "/cohorts/{cohortId}/sessions/{sessionId}/agenda/duplicate-from"
tags: ["Session Agenda Authoring"]
---

# Pre-populate the target editor with another session's authored content (MED-982 / E1.3g)

`POST /cohorts/{cohortId}/sessions/{sessionId}/agenda/duplicate-from`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/cohorts/{cohortId}/sessions/{sessionId}/agenda/duplicate-from`
- Auth: none declared

Copies the source session's authored content (description, agenda
sections + leader prompts + visuals, participant pre-session work
+ reflection prompts) into the response for the target editor's
draft state. The agenda fields are NOT persisted to the target
until the editor's normal Save (AC-S1); only the slide deck is
persisted server-side at this point (AC-CB2 — S3 copy → new
session_content_files row for the target, replacing any existing
target slide_deck row atomically).

The response applies the TARGET cohort's commitment-tracking gate
(AC-CB6): per-section commitment toggles and the pre-session work
commitment_review_enabled flag are forced to false when the target
cohort has tracking off, so the editor never inherits a stranded
value it cannot surface.

The source can live in a different cohort. Both source and target
must resolve to a (cohort, modality='group_coaching', session_number)
triple — sessions without a session_number or whose cohort lacks an
active group_coaching modality return 404.

## Path parameters

- `cohortId` string, uuid, required
- `sessionId` string, uuid, required

## Request body

- object
  - `source_session_id` string, uuid, required: A session id from the source cohort (any group's row at the source session_number — the service resolves to the canonical scope).

## Response `200`

Reconciled content payload + (if copied) new slide_deck_file metadata. The editor loads `sections` / `description` / `participant_pre_session_work` into draft state and refreshes its content-files list to pick up the new deck.

- object
  - `success` boolean
  - `data` object
    - `description` string, nullable
    - `sections` SessionAgendaSection[]
      - `id` string, uuid: Present on existing rows being kept on save; absent on new ones.
      - `section_name` string, nullable
      - `duration_minutes` integer, nullable: MED-1224 — section duration in whole minutes. Minimum valid value is 1; 0 and negatives are rejected. Nullable so an in-progress section with no duration yet can still be saved (AC-MC3).
      - `sort_order` integer, required: 1-based position in the agenda list.
      - `participant_prompt` string, nullable: MED-980 (E1.3e / AC-PP). Rich-text instructions shown to participants in-session, stored as sanitized HTML. Optional. Rendering to participants is E3.3a.
      - `show_commitment_field` boolean: MED-980 (E1.3e / AC-SCF). When true, the in-session participant view (E3.3a) surfaces the commitment-entry field in this section. UI gates the toggle on the cohort's commitment_tracking_enabled; the column persists regardless.
      - `show_last_session_commitment` boolean: MED-980 (E1.3e / AC-SLC). When true, the in-session participant view (E3.3a) displays the participant's prior-session commitment in this section. UI gates the toggle on the cohort's commitment_tracking_enabled.
      - `visuals` SessionAgendaVisual[], required
        - `slide_page` integer, required: 1-based page number in the uploaded slide deck PDF.
        - `sort_order` integer, required: 1-based display order within the section.
      - `leader_prompts` SessionAgendaLeaderPrompt[], required
        - `id` string, uuid: Present on existing rows being kept on save; absent on new ones.
        - `intro_text` string, nullable: Short single-line context above the discussion prompt.
        - `discussion_prompt` string, nullable: Rich-text HTML serialization (bold, italic, underline, bullet list).
        - `sort_order` integer, required: 1-based position in the section's prompt list (creation order).
    - `participant_pre_session_work` SessionAgendaPreSessionWork: MED-981 (E1.3f). Participant Pre-Session Work panel — configures what participants complete before the session. Pre-session page rendering is E3.1c (NOT this story).
      - `commitment_review_enabled` boolean, required: AC-CR1/CR3. When TRUE, the pre-session page (E3.1c) will surface the participant's prior-session commitment review. UI gates the toggle on cohort_commitment_tracking_enabled — hidden when off.
      - `reading_tasks` string, nullable, required: AC-RT1/RT2. Reading / Tasks rich-text (bold, italic, underline, bullet list). Sanitized server-side on write.
      - `reflection_prompts` SessionAgendaReflectionPrompt[], required
        - `id` string, uuid: Present on existing rows being kept on save; absent on new ones.
        - `prompt_text` string, nullable: Plain text — NOT rich text per the spec.
        - `sort_order` integer, required
    - `cohort_commitment_tracking_enabled` boolean
    - `slide_deck_file` object, nullable
      - `id` string, uuid
      - `slot` 'slide_deck'
      - `original_filename` string
      - `mime_type` string
      - `source_s3_key` string
      - `converted_pdf_s3_key` string, nullable
      - `processing_state` 'pending' | 'processing' | 'ready' | 'failed'

## Other responses

- `401`: Unauthorized
- `404`: Target or source session not found / not eligible.
- `422`: Source has no authored content to copy.

---

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