---
title: "Create a new export request"
method: POST
path: "/api/exports"
tags: ["Exports"]
---

# Create a new export request

`POST /api/exports`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/exports`
- Auth: HTTP bearer

Queue a data export for async processing. User will receive email when ready.

## Request body

- CreateExportRequest
  - `entity_type` 'participants' | 'coaches' | 'partners' | 'cohorts' | 'groups' | 'sessions' | 'resources' | 'users' | 'survey_responses' | 'attendance', required: Type of data to export
  - `context_type` 'global' | 'cohort' | 'partner': Scope of the export
  - `context_id` string, uuid: ID of cohort or partner if scoped
  - `filter_context` object: Current filter/search state to apply to export
  - `selected_columns` string[]: Column keys to include in export
  - `include_all_columns` boolean: If true, include all available columns
  - `match_current_view` boolean: If true, match currently visible table columns
  - `format` 'csv' | 'xlsx'
  - `populate_dnm_groupings` boolean: If true, calculate and populate DNM groupings in the export

## Response `201`

Export request created and queued

- object
  - `success` boolean
  - `data` object
    - `id` string, uuid
    - `status` string
  - `message` string

## Other responses

- `400`: Validation error or rate limit exceeded
- `401`: Unauthorized

---

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