---
title: "Export Collection"
method: POST
path: "/v1/collections/{collection_identifier}/export"
tags: ["Collections"]
---

# Export Collection

`POST /v1/collections/{collection_identifier}/export`

Export collection documents to JSON, CSV, or Parquet format.

    **Export Formats:**
    - **JSON**: Line-delimited JSON (JSONL) format. Good for streaming.
    - **CSV**: Comma-separated values. Best for spreadsheets.
    - **PARQUET**: Columnar format (default). Best for data pipelines.

    **Vector Export:**
    Vectors are large and exported separately. When `include_vectors=True`,
    a separate file is created for vectors with document_id mapping.

    **Field Selection:**
    Use `select_fields` to export only specific fields, reducing file size.

    **Filtering:**
    Apply filters to export a subset of documents.

    **Response:**
    Returns presigned download URLs valid for 1 hour.

    **Limits:**
    - Large exports may take time. Consider using `sample_size` for testing.
    - Vector exports significantly increase processing time.

## Path parameters

- `collection_identifier` string, required — The ID or name of the collection to export

## Request body

- CollectionExportRequest — Request model for exporting collection data. **Export Formats:** - **JSON**: Line-delimited JSON (JSONL) format, one document per line. Good for streaming and large files. - **CSV**: Comma-separated values. Best for tabular data analysis in spreadsheets. - **PARQUET**: Columnar format optimized for analytics. Best for large datasets and data pipelines. **Vector Export:** Vectors are stored separately from document metadata due to their large size. When `include_vectors=True`, vectors are exported to a separate file with the naming convention: `{collection_name}_vectors.{format}` **Field Selection:** Use `select_fields` to export only specific fields, reducing file size for large collections. Supports dot notation for nested fields (e.g., "metadata.title"). **Filtering:** Apply filters to export a subset of documents. Uses the same LogicalOperator format as the documents list endpoint.
  - `format` 'json' | 'csv' | 'parquet' — Supported export formats for collection data.
  - `include_vectors` boolean — Whether to include vectors in the export. Vectors are exported to a separate file due to their large size. This significantly increases export time and file size.
  - `select_fields` string[], nullable — Specific fields to include in the export. If not provided, all fields are exported. Supports dot notation for nested fields (e.g., 'metadata.title', 'metadata.author').
  - `filters` LogicalOperatorInput — Represents a logical operation (AND, OR, NOT) on filter conditions. Allows nesting with a defined depth limit. Also supports shorthand syntax where field names can be passed directly as key-value pairs for equality filtering (e.g., {"metadata.title": "value"}).
    - `AND` union[], nullable — Logical AND operation - all conditions must be true
      - union
        - LogicalOperatorInput — recursive
        - FilterCondition — Represents a single filter condition. Attributes: field: The field to filter on operator: The comparison operator value: The value to compare against
          - `field` string, required — Field name to filter on
          - `operator` 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'nin' | 'contains' | 'starts_with' | 'ends_with' | 'regex' | 'exists' | 'is_null' | 'text' | 'phrase' | 'geo_radius' | 'geo_bounding_box' | 'geo_polygon' — Supported filter operators across database implementations.
          - `value` union, required — Value to compare against
            - DynamicValue — A value that should be dynamically resolved from the query request.
              - …
            - unknown
    - `OR` union[], nullable — Logical OR operation - at least one condition must be true
      - union
        - LogicalOperatorInput — recursive
        - FilterCondition — Represents a single filter condition. Attributes: field: The field to filter on operator: The comparison operator value: The value to compare against
          - `field` string, required — Field name to filter on
          - `operator` 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'nin' | 'contains' | 'starts_with' | 'ends_with' | 'regex' | 'exists' | 'is_null' | 'text' | 'phrase' | 'geo_radius' | 'geo_bounding_box' | 'geo_polygon' — Supported filter operators across database implementations.
          - `value` union, required — Value to compare against
            - DynamicValue — A value that should be dynamically resolved from the query request.
              - …
            - unknown
    - `NOT` union[], nullable — Logical NOT operation - all conditions must be false
      - union
        - LogicalOperatorInput — recursive
        - FilterCondition — Represents a single filter condition. Attributes: field: The field to filter on operator: The comparison operator value: The value to compare against
          - `field` string, required — Field name to filter on
          - `operator` 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'nin' | 'contains' | 'starts_with' | 'ends_with' | 'regex' | 'exists' | 'is_null' | 'text' | 'phrase' | 'geo_radius' | 'geo_bounding_box' | 'geo_polygon' — Supported filter operators across database implementations.
          - `value` union, required — Value to compare against
            - DynamicValue — A value that should be dynamically resolved from the query request.
              - …
            - unknown
    - `case_sensitive` boolean, nullable — Whether to perform case-sensitive matching
  - `sample_size` integer, nullable — Maximum number of documents to export. If not provided, exports all documents. Useful for testing exports or creating sample datasets.

## Response `200`

Successful Response

- CollectionExportResponse — Response model for collection export. Contains the presigned URL for downloading the exported file. The URL is valid for a limited time (typically 1 hour).
  - `download_url` string, required — Presigned URL for downloading the exported file. Valid for 1 hour.
  - `s3_path` string, required — Full S3 path where the export is stored (for internal reference).
  - `format` 'json' | 'csv' | 'parquet', required — Supported export formats for collection data.
  - `document_count` integer, required — Number of documents included in the export.
  - `file_size_bytes` integer, required — Size of the exported file in bytes.
  - `exported_at` string, date-time, required — Timestamp when the export was completed.
  - `vectors_download_url` string, nullable — Presigned URL for downloading the vectors file (if include_vectors=True). Vectors are exported separately due to their large size.
  - `vectors_s3_path` string, nullable — Full S3 path for the vectors file (if include_vectors=True).

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/mixpeek/apis/mixpeek-api.md) · [All operations](https://skmtc.net/mixpeek/apis/mixpeek-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mixpeek/mixpeek-api/versions/220a3b263fda/schema)
