---
title: "Export a resource to a file"
method: POST
path: "/exports"
tags: ["data-transfer"]
---

# Export a resource to a file

`POST /exports`

## Request

- Base URL: `https://api.pscrpt.com/v1`
- URL: `https://api.pscrpt.com/v1/exports`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://api.pscrpt.com/oauth/authorize`
    - Token URL: `https://api.pscrpt.com/oauth/token`

Starts an async job that writes every record of a resource matching `filters` to one file. See [Bulk exports](/docs/bulk-exports).

## Headers

- `Idempotency-Key` string
- `Postscript-Version` string, date

## Request body

- ExportRequest
  - `filters` object: The resource's list filters as an object, such as `{"type": {"in": ["order.completed"]}}`; a bare value means `eq`. Events exports need `occurred_at` with `gte` and `lt`, any number of days apart.
  - `format` 'jsonl' | 'csv'
  - `resource` string, required: The resource the rows belong to, such as `profiles`.

## Response `202`

Export accepted.

- ExportEnvelope
  - `data` Export, required
    - `completed_at` string, date-time, required
    - `created_at` string, date-time, required
    - `format` 'jsonl' | 'csv', required
    - `id` string, required
    - `job_id` string, required
    - `object` 'export', required
    - `resource` string, required: The resource the rows belong to, such as `profiles`.
    - `status` 'queued' | 'running' | 'succeeded' | 'partially_succeeded' | 'failed' | 'cancelled', required
  - `meta` Meta, required
    - `as_of` string, date-time
    - `livemode` boolean, required
    - `page` PageMeta
      - `limit` integer, required
      - `next_cursor` string, nullable, required: Pass as `page[after]`. Null on the last page.
    - `request_id` string, required
    - `resolved_from` string: The merged-away profile ID the request addressed; `data` holds the survivor.
    - `revision` string, date, required

## Other responses

- `400`: Malformed input, an unknown parameter, an unsupported filter, sort, or expand, or a mistyped ID.
- `401`: Missing or invalid API key.
- `403`: The key lacks the required scope.
- `409`: State conflict: an identifier collision (`identity_conflict`), an idempotency key reused with a different body, or a duplicate request still in flight (`Retry-After` present).
- `422`: Semantically invalid, e.g. an impossible lifecycle transition.
- `429`: Rate limit exceeded.
- `500`: Internal error.
- `502`: Upstream provider failure.
- `503`: Temporarily unavailable.

## Changes

- **2026-10-28** `3aede004c7f6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pscrpt/apis/postscript-native-api-beta/changes/exports/post.md)

---

[API](https://skmtc.dev/pscrpt/apis/postscript-native-api-beta.md) - [All operations](https://skmtc.dev/pscrpt/apis/postscript-native-api-beta/llms.txt) - [OpenAPI document](https://skmtc.dev/pscrpt/apis/postscript-native-api-beta/revisions/882458ee1f36?raw)
