---
title: "Preview CSV import"
method: POST
path: "/cohorts/{cohortId}/participants/import/preview"
tags: ["Participants"]
---

# Preview CSV import

`POST /cohorts/{cohortId}/participants/import/preview`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/cohorts/{cohortId}/participants/import/preview`
- Auth: HTTP bearer

Validate CSV data and return preview with duplicate detection

## Path parameters

- `cohortId` string, uuid, required

## Request body

- object
  - `mappings` CSVColumnMapping[], required
    - `csvColumn` string
    - `targetField` string, nullable
    - `isCustomField` boolean
    - `customFieldName` string, nullable
  - `csvData` array[], required
    - string[]

## Response `200`

Import preview generated

- object
  - `success` boolean
  - `data` object
    - `totalRows` integer
    - `validRows` integer
    - `errorRows` integer
    - `duplicateRows` integer
    - `rows` unknown[]
      - unknown

## Other responses

- `400`: Email column mapping required
- `401`: Unauthorized
- `404`: Cohort not found

---

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