---
title: "Upload (or replace) a session content file (MED-784 AC2, AC6, AC7, AC11)"
method: POST
path: "/cohorts/{cohortId}/sessions/{sessionId}/content/{slot}"
tags: ["Session Content"]
---

# Upload (or replace) a session content file (MED-784 AC2, AC6, AC7, AC11)

`POST /cohorts/{cohortId}/sessions/{sessionId}/content/{slot}`

## Request

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

Multipart upload (field name `file`) for one of the two slots. If an
active row exists for the same (session, slot) pair, it is soft-deleted
atomically with the new row's insert (AC6 replace flow), preserving
AC7's one-file-per-slot invariant. The conversion job is queued
asynchronously; clients should poll the GET endpoint to observe
processing_state transitioning pending → processing → ready/failed (AC11).

## Path parameters

- `cohortId` string, uuid, required
- `sessionId` string, uuid, required
- `slot` SessionContentSlot, required (unresolved $ref)

## Request body `multipart/form-data`

- object
  - `file` string, binary: Source file (PDF, DOCX, PPTX, etc. — see resourceUpload allowlist). Max 50 MB.

## Response `201`

File accepted; conversion queued.

- object
  - `success` boolean
  - `data` object
    - `file` SessionContentFile (unresolved $ref)

## Other responses

- `400`: Missing file or invalid slot value.
- `401`: Unauthorized
- `404`: Session not found
- `500`: Storage or queue failure (CM should retry).

---

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