---
title: "Request an export"
method: POST
path: "/v1/exports"
tags: ["exports"]
---

# Request an export

`POST /v1/exports`

## Request

- Base URL: `https://api.octaneai.com`
- URL: `https://api.octaneai.com/v1/exports`
- Auth: HTTP bearer

## Request body

- ExportCreate
  - `quiz_id` string, nullable: Only this quiz (profiles and responses)
  - `from` string, date, nullable: First day, inclusive, UTC
  - `to` string, date, nullable: Last day, inclusive, UTC
  - `tz` string, nullable: quiz_analytics only: the timezone the days are counted in
  - `search` ProfileSearch: Who to find: the list filters of GET /v1/profiles except q, plus person facts and an answer filter, an OR of AND groups. Send the same body with every page: a cursor belongs to the search that answered it and is refused with any other body.
    - `quiz_id` string, nullable: Only people who took this quiz
    - `from` string, date, nullable: Last seen on or after this UTC day
    - `to` string, date, nullable: Last seen on or before this UTC day
    - `has_order` boolean, nullable: Placed an order we linked to a quiz session
    - `has_email` boolean, nullable: Has an email
    - `has_phone` boolean, nullable: Has a phone
    - `has_marketing_consent` boolean, nullable: Ticked the marketing-consent checkbox beside their newest email or phone answer
    - `is_returning` boolean, nullable: Took a quiz again after we first knew them, on any device
    - `match` 'any_session' | 'latest_completed_per_quiz': any_session: any time they took the quiz counts; latest_completed_per_quiz: only their latest completed take of each quiz
    - `groups` ProfileSearchGroup[], nullable: OR of AND groups: up to 4 groups of 8 terms
      - `all` union[], required: Every slot must hold: a term, or {any: [terms]}; at most 8 terms in the group, counting the terms inside any
        - union
          - ProfileSearchTerm
            - `quiz_id` string, required: The quiz the term reads
            - `kind` 'choice' | 'number' | 'date' | 'text' | 'email' | 'phone' | 'points' | 'formula' | 'winner' | 'session', required: choice | number | date | text | email | phone: a question of the quiz (page_key + component_key); points: a dimension (dimension_id); formula: a formula component (page_key + component_key); winner: the top dimension (dimension ids in option_ids); session: how the shopper's session ended (value completed | abandoned, page_key the page they left on)
            - `op` 'in' | 'not_in' | 'eq' | 'lt' | 'gt' | 'between' | 'before' | 'after' | 'contains' | 'equals' | 'matches' | 'answered' | 'not_answered', required: choice: in | not_in; number, points, formula: eq | lt | gt | between; date: eq | before | after | between; text: contains | equals | matches | answered | not_answered; email, phone: answered | not_answered; winner: in; session: equals. not_in means answered the question and picked none of these; not_answered means took the quiz and left the question unanswered.
            - `page_key` string, nullable: The question's page (choice, number, date, text, email, phone, formula) or the page left on (session)
            - `component_key` string, nullable: The question or formula
            - `dimension_id` string, nullable: points: the dimension
            - `option_ids` string[], nullable: Option ids (exact)
            - `option_labels` string[], nullable: Option labels, matched trim- and case-insensitively against every version of the quiz
            - `min` union: between: the low bound (a number, or a YYYY-MM-DD day)
              - …
            - `max` union: between: the high bound
              - …
            - `value` union: eq, lt, gt, before, after, contains, equals: the operand; matches: a case-insensitive regular expression of at most 64 characters with a run of three plain letters or digits, no lookarounds or backreferences; session: completed | abandoned
              - …
          - ProfileSearchAny
            - `any` ProfileSearchTerm[], required: At least one of these terms must hold; plain terms only
              - …
  - `dataset` 'profiles' | 'responses' | 'quiz_analytics', required: profiles or responses need profiles:read; quiz_analytics needs analytics:read
  - `format` 'csv' | 'json': csv: one row per line behind a UTF-8 byte-order mark; json: one object {dataset, filters, generated_at, items} whose items are the rows as the API returns them

## Response `202`

The export is queued. Poll urls.self until status is completed, then follow download_url.

- ExportSummary
  - `id` string, required: The export
  - `dataset` 'profiles' | 'responses' | 'quiz_analytics' | 'audit_events', required: What the file holds
  - `format` 'csv' | 'json', required: The file's format
  - `source` 'api' | 'dashboard', required: Where the export was requested
  - `status` 'pending' | 'running' | 'completed' | 'failed' | 'expired', required: pending | running | completed | failed | expired
  - `filters` ExportFilters, required
    - `quiz_id` string, nullable: Only this quiz (profiles and responses)
    - `from` string, date, nullable: First day, inclusive, UTC
    - `to` string, date, nullable: Last day, inclusive, UTC
    - `tz` string, nullable: quiz_analytics only: the timezone the days are counted in
    - `search` ProfileSearch: Who to find: the list filters of GET /v1/profiles except q, plus person facts and an answer filter, an OR of AND groups. Send the same body with every page: a cursor belongs to the search that answered it and is refused with any other body.
      - `quiz_id` string, nullable: Only people who took this quiz
      - `from` string, date, nullable: Last seen on or after this UTC day
      - `to` string, date, nullable: Last seen on or before this UTC day
      - `has_order` boolean, nullable: Placed an order we linked to a quiz session
      - `has_email` boolean, nullable: Has an email
      - `has_phone` boolean, nullable: Has a phone
      - `has_marketing_consent` boolean, nullable: Ticked the marketing-consent checkbox beside their newest email or phone answer
      - `is_returning` boolean, nullable: Took a quiz again after we first knew them, on any device
      - `match` 'any_session' | 'latest_completed_per_quiz': any_session: any time they took the quiz counts; latest_completed_per_quiz: only their latest completed take of each quiz
      - `groups` ProfileSearchGroup[], nullable: OR of AND groups: up to 4 groups of 8 terms
        - `all` union[], required: Every slot must hold: a term, or {any: [terms]}; at most 8 terms in the group, counting the terms inside any
          - union
            - ProfileSearchTerm
              - …
            - ProfileSearchAny
              - …
  - `row_count` integer, nullable, required: Rows in the file; null until completed
  - `bytes` integer, nullable, required: The file's size in bytes; null until completed
  - `error` string, nullable, required: Why the build failed; null otherwise
  - `requested_at` string, date-time, required: When the export was requested
  - `started_at` string, date-time, nullable, required: When the build started; null before
  - `completed_at` string, date-time, nullable, required: When the file was ready; null before
  - `expires_at` string, date-time, required: When the export and its file are deleted
  - `download_url` string, nullable: Set on GET /v1/exports/{export_id} while completed; valid 15 minutes
  - `download_url_expires_at` string, date-time, nullable: When download_url stops working; null with it
  - `urls` object, required: self: this export on the API; fetch it for a fresh download link

## Other responses

- `401`: The key is missing, malformed, revoked or expired.
- `403`: The store's plan has no API access, or the key lacks the scope.
- `404`: Not found
- `409`: An export of this dataset is still being built; wait for it to finish.
- `422`: A request parameter is invalid.
- `429`: The key's or the store's bucket is full; Retry-After says when to try again.
- `503`: Request limits cannot be checked right now; retry shortly.
- `504`: The request timed out.

---

[API](https://skmtc.dev/octaneai/apis/octane-ai-merchant-api.md) - [All operations](https://skmtc.dev/octaneai/apis/octane-ai-merchant-api/llms.txt) - [OpenAPI document](https://skmtc.dev/octaneai/apis/octane-ai-merchant-api/revisions/dc2d1aa2b7c6?raw)
