---
title: "Create Export"
method: POST
path: "/v2/exports"
tags: ["exports"]
---

# Create Export

`POST /v2/exports`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/exports`
- Auth: HTTP bearer

Request Export

Request an async export of data. The export will be processed in the background
and you will receive an email with a download link when it's ready.

If a pending/processing export with the same type and filters exists,
returns that instead of creating a duplicate.

## Request body

- ExportRequest: Request to create a new export.
  - `export_type` 'invoice' | 'partner' | 'payment' | 'analytics' | 'bank_transaction' | 'credit_memo' | 'customer_transaction' | 'invoice_pdf' | 'audit_log' | 'ask_stuut_table' | 'journal_entry' | 'ar_aging' | 'collections_readiness', required
  - `format` 'csv' | 'json', nullable: Journal entry file format; defaults to csv
  - `filters` object, nullable: Optional filter criteria for the export
  - `business_unit_id__in` string[], nullable: Filter export data to specific business units

## Response `200`

Successful Response

- CreateExportResponse: Response from creating or deduplicating an export.
  - `export` ExportResponse, required: Response containing export details.
    - `id` string, required
    - `export_type` 'invoice' | 'partner' | 'payment' | 'analytics' | 'bank_transaction' | 'credit_memo' | 'customer_transaction' | 'invoice_pdf' | 'audit_log' | 'ask_stuut_table' | 'journal_entry' | 'ar_aging' | 'collections_readiness', required
    - `status` 'pending' | 'processing' | 'completed' | 'failed', required
    - `filters` object, nullable, required
    - `format` 'csv' | 'json', nullable, required
    - `error_code` 'limit_exceeded' | 'timed_out' | 'generation_failed', required
    - `record_count` integer, nullable, required: Number of rows included in the export. Journal exports in both CSV and JSON skip events without accounting snapshots and can complete with those events omitted. The response does not include a skipped-event count.
    - `download_url` string, nullable, required
    - `created_at` string, date-time, required
    - `started_at` string, date-time, required
    - `completed_at` string, date-time, required
    - `requested_by` ExportUserRef, required: Reference to the user who requested the export.
      - `id` string, required
      - `name` string, required
      - `email` string, required
    - `report_config_id` string, nullable, required: The report config this export was sent for, when it is a report send.
  - `was_existing` boolean, required: True if an existing pending export was returned instead of creating new

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/stuut/apis/stuut-api.md) - [All operations](https://skmtc.dev/stuut/apis/stuut-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stuut/apis/stuut-api/revisions/3b5ab941f918?raw)
