Skip to main content
POST
/
v1
/
collections
/
{collection_identifier}
/
export
Export Collection
curl --request POST \
  --url https://api.mixpeek.com/v1/collections/{collection_identifier}/export \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "format": "parquet",
  "include_vectors": false,
  "select_fields": [
    "document_id",
    "metadata.title",
    "metadata.category"
  ],
  "filters": {
    "AND": [
      {
        "field": "name",
        "operator": "eq",
        "value": "John"
      },
      {
        "field": "age",
        "operator": "gte",
        "value": 30
      }
    ],
    "OR": [
      {
        "field": "status",
        "operator": "eq",
        "value": "active"
      },
      {
        "field": "role",
        "operator": "eq",
        "value": "admin"
      }
    ],
    "NOT": [
      {
        "field": "department",
        "operator": "eq",
        "value": "HR"
      },
      {
        "field": "location",
        "operator": "eq",
        "value": "remote"
      }
    ],
    "case_sensitive": true
  },
  "sample_size": 500000
}
'
import requests

url = "https://api.mixpeek.com/v1/collections/{collection_identifier}/export"

payload = {
"format": "parquet",
"include_vectors": False,
"select_fields": ["document_id", "metadata.title", "metadata.category"],
"filters": {
"AND": [
{
"field": "name",
"operator": "eq",
"value": "John"
},
{
"field": "age",
"operator": "gte",
"value": 30
}
],
"OR": [
{
"field": "status",
"operator": "eq",
"value": "active"
},
{
"field": "role",
"operator": "eq",
"value": "admin"
}
],
"NOT": [
{
"field": "department",
"operator": "eq",
"value": "HR"
},
{
"field": "location",
"operator": "eq",
"value": "remote"
}
],
"case_sensitive": True
},
"sample_size": 500000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
format: 'parquet',
include_vectors: false,
select_fields: ['document_id', 'metadata.title', 'metadata.category'],
filters: {
AND: [
{field: 'name', operator: 'eq', value: 'John'},
{field: 'age', operator: 'gte', value: 30}
],
OR: [
{field: 'status', operator: 'eq', value: 'active'},
{field: 'role', operator: 'eq', value: 'admin'}
],
NOT: [
{field: 'department', operator: 'eq', value: 'HR'},
{field: 'location', operator: 'eq', value: 'remote'}
],
case_sensitive: true
},
sample_size: 500000
})
};

fetch('https://api.mixpeek.com/v1/collections/{collection_identifier}/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/collections/{collection_identifier}/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'format' => 'parquet',
'include_vectors' => false,
'select_fields' => [
'document_id',
'metadata.title',
'metadata.category'
],
'filters' => [
'AND' => [
[
'field' => 'name',
'operator' => 'eq',
'value' => 'John'
],
[
'field' => 'age',
'operator' => 'gte',
'value' => 30
]
],
'OR' => [
[
'field' => 'status',
'operator' => 'eq',
'value' => 'active'
],
[
'field' => 'role',
'operator' => 'eq',
'value' => 'admin'
]
],
'NOT' => [
[
'field' => 'department',
'operator' => 'eq',
'value' => 'HR'
],
[
'field' => 'location',
'operator' => 'eq',
'value' => 'remote'
]
],
'case_sensitive' => true
],
'sample_size' => 500000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.mixpeek.com/v1/collections/{collection_identifier}/export"

payload := strings.NewReader("{\n \"format\": \"parquet\",\n \"include_vectors\": false,\n \"select_fields\": [\n \"document_id\",\n \"metadata.title\",\n \"metadata.category\"\n ],\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"John\"\n },\n {\n \"field\": \"age\",\n \"operator\": \"gte\",\n \"value\": 30\n }\n ],\n \"OR\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"active\"\n },\n {\n \"field\": \"role\",\n \"operator\": \"eq\",\n \"value\": \"admin\"\n }\n ],\n \"NOT\": [\n {\n \"field\": \"department\",\n \"operator\": \"eq\",\n \"value\": \"HR\"\n },\n {\n \"field\": \"location\",\n \"operator\": \"eq\",\n \"value\": \"remote\"\n }\n ],\n \"case_sensitive\": true\n },\n \"sample_size\": 500000\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.mixpeek.com/v1/collections/{collection_identifier}/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"format\": \"parquet\",\n \"include_vectors\": false,\n \"select_fields\": [\n \"document_id\",\n \"metadata.title\",\n \"metadata.category\"\n ],\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"John\"\n },\n {\n \"field\": \"age\",\n \"operator\": \"gte\",\n \"value\": 30\n }\n ],\n \"OR\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"active\"\n },\n {\n \"field\": \"role\",\n \"operator\": \"eq\",\n \"value\": \"admin\"\n }\n ],\n \"NOT\": [\n {\n \"field\": \"department\",\n \"operator\": \"eq\",\n \"value\": \"HR\"\n },\n {\n \"field\": \"location\",\n \"operator\": \"eq\",\n \"value\": \"remote\"\n }\n ],\n \"case_sensitive\": true\n },\n \"sample_size\": 500000\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.mixpeek.com/v1/collections/{collection_identifier}/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"format\": \"parquet\",\n \"include_vectors\": false,\n \"select_fields\": [\n \"document_id\",\n \"metadata.title\",\n \"metadata.category\"\n ],\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"John\"\n },\n {\n \"field\": \"age\",\n \"operator\": \"gte\",\n \"value\": 30\n }\n ],\n \"OR\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"active\"\n },\n {\n \"field\": \"role\",\n \"operator\": \"eq\",\n \"value\": \"admin\"\n }\n ],\n \"NOT\": [\n {\n \"field\": \"department\",\n \"operator\": \"eq\",\n \"value\": \"HR\"\n },\n {\n \"field\": \"location\",\n \"operator\": \"eq\",\n \"value\": \"remote\"\n }\n ],\n \"case_sensitive\": true\n },\n \"sample_size\": 500000\n}"

response = http.request(request)
puts response.read_body
{
  "download_url": "<string>",
  "s3_path": "<string>",
  "document_count": 1,
  "file_size_bytes": 1,
  "exported_at": "2023-11-07T05:31:56Z",
  "vectors_download_url": "<string>",
  "vectors_s3_path": "<string>"
}
{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}
{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}
{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}
{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

collection_identifier
string
required

The ID or name of the collection to export

Body

application/json

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
enum<string>
default:parquet

Export format: json (line-delimited), csv, or parquet (default).

Available options:
json,
csv,
parquet
include_vectors
boolean
default:false

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[] | null

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').

Example:
[
"document_id",
"metadata.title",
"metadata.category"
]
filters
LogicalOperator · object | null

Filter conditions to export only matching documents. Uses LogicalOperator format (AND/OR/NOT) same as document listing.

sample_size
integer | null

Maximum number of documents to export. If not provided, exports all documents. Useful for testing exports or creating sample datasets.

Required range: 1 <= x <= 1000000

Response

Successful Response

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
enum<string>
required

The format of the exported file.

Available options:
json,
csv,
parquet
document_count
integer
required

Number of documents included in the export.

Required range: x >= 0
file_size_bytes
integer
required

Size of the exported file in bytes.

Required range: x >= 0
exported_at
string<date-time>
required

Timestamp when the export was completed.

vectors_download_url
string | null

Presigned URL for downloading the vectors file (if include_vectors=True). Vectors are exported separately due to their large size.

vectors_s3_path
string | null

Full S3 path for the vectors file (if include_vectors=True).