---
title: "Create query export"
method: POST
path: "/api/v1/analytics/query/export"
tags: ["Query"]
---

# Create query export

`POST /api/v1/analytics/query/export`

Create a query export. This starts a query execution. The query will be executed asynchronously. You can check the status of the query using the `GET /api/analytics/query/export/{uuid}` endpoint.

## Request body

- object
  - `query` string, required — SQL query to execute
  - `settings` object, nullable
    - `delimiter` string — The delimiter character used for CSV or TXT exports
    - `escapeSpecialCharacters` boolean — Whether to escape special characters in TXT exports (e.g. quotes, newlines)
    - `disableQuotes` boolean — Whether to disable enclosing all values with double quotes in TXT exports. This is useful for handling special characters or values that contain the delimiter character. It's problematic if values contain double quotes themselves.
    - `exportFormat` 'csv' | 'xlsx' | 'json' | 'txt' | 'parquet' | 'pdf' — Export format for reports
    - `numberFormattingMode` 'locale' | 'raw' — Number formatting mode that should be applied when visualizing numbers (does not affect exports)
  - `parameters` object[], nullable
    - `name` string, required — Parameter name
    - `type` string, required — Parameter type
    - `defaultValue` string, required — Default value for parameter you want to store
    - `valueMap` object[] — Array of dropdown options with label and value properties. Values will be rendered in the query, labels are displayed in the dropdown.
      - `label` string, required — Display label shown in the dropdown
      - `value` string, required — Value used in the query

## Response `200`

Query execution response

- object
  - `data` object[], nullable, required — Details of the query execution
    - `id` string, uuid, required — Query execution ID
    - `status` string, required — Query execution status
    - `query` string, required — SQL query
    - `url` string, required — URL to download the result
    - `error` string, required — Error message
    - `exportFormat` string — Export format of the result
    - `createdAt` string, date-time, required — Creation time
    - `updatedAt` string, date-time, required — Last update time

## Other responses

- `400` — Error response with message
- `401` — Unable to authenticate the client
- `402` — Resource can not be accessed because you exceeded the credit limit.
- `403` — Unable to authorize the client
- `404` — Resource was not found or not enough access privileges
- `415` — Resource representation send in the request is not supported.
- `429` — Too many API calls made.

---

[API](https://skmtc.net/xentral/apis/xentral-api.md) · [All operations](https://skmtc.net/xentral/apis/xentral-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xentral/xentral-api/revisions/8a27ba392442/schema)
