1Export Query Data

1Export Query Data

Overview

This API executes an SQL or MDX query against a Semantic Model and returns the results in the required format (JSON, CSV, or zipped).

Method: POST

Request URL: {kyvos-url}/v2/exports/query-data


Authorization

API Key: sessionid

This method authenticates requests using a session ID which acts like an API key.


BasicAuth: HTTP Authorization Scheme

This method authenticates requests using a username and password sent in the HTTP Authorization header.


Headers

Header Name

Type

Description

Possible Values

Header Name

Type

Description

Possible Values

Content-Type (Required)

String

Specifies media type of request body.

application/x-www-form-urlencoded

Accept

String

Specifies media type of response body.

application/json, application/octet-stream

sessionid

String

The session ID is the token received from the login API.

Note: Session ID is required for token-based authentication.

–


Request Body

Parameter Name

Type

Description

Possible Values

Parameter Name

Type

Description

Possible Values

queryType (Required)

String

Type of query to execute.

"SQL", "MDX", "DAX", "MDXTABULAR", "WORKSHEET", "QNA_SHEET"

query (Required)

String

The SQL or MDX query string to be executed.

–

outputFormat (Required)

String

Format in which the data should be exported.

Note: Required when Accept header is "application/octet-stream".

When Accept is "application/json", this is automatically set to "json" and zipped is forced to "false".

"csv", "json"

folderName

String

Name of the folder where Semantic Model is present, If the Semantic Model is present in the root directory, specify [Root].

Note: If folderName is not provided, the Semantic Model will be treated as a root-level entity by default.

–

smodelName

String

Name of the Semantic Model to execute the query against.

–

zipped

String

Whether the response should be zipped.

Note: Only applicable when Accept is "application/octet-stream".

Ignored (forced to "false") when Accept is "application/json".

"true"/"false"<br>Default: "true"

outputFileName

String

Custom file name for the exported data. If not provided, a default name is generated.

Note: The file extension (.json, .csv, or .zip) is appended automatically based on outputFormat and zipped.

–

keepMeasureFormatting

String

Whether to preserve measure formatting in the exported data.

"true"/"false"

tabularViewType

String

The tabular view type for the query results.

"HIERARCHICAL", "FLAT"<br>Default: "HIERARCHICAL"

columnHeaderSeparator

String

Custom separator for column header values. Used to separate hierarchical column names in the exported output..

Default: "_"

maxRows

String

Maximum number of rows to include in the response. Must be a valid integer. If not provided, no row limit is applied.

–

maxColumns

String

Maximum number of columns to include in the response. Must be a valid integer. If not provided, no column limit is applied.

–

requestID

String

Custom request ID for logging and tracing. If provided, it overrides the auto-generated request ID in the logger context. Also used for sending cancel requests on timeout.

–

lineSeparator

String

Line separator character(s) used while exporting data to a file.

Default: "\\r\\n"

fieldSeparator

String

Delimiter character used for separating fields in CSV output.

Default: "," (comma).

enclosedBy

String

Character used for enclosing field values in CSV output.

Default: "\\"" (double quotes).

includeHeader

String

Whether to include header information in the exported file.

"true"/"false"<br>Default: "true"


Responses

200 OK

The query is executed successfully, and the results are returned in the requested format.

Error Responses

Status Code

Description

Status Code

Description

401

Authorization information is missing or invalid.

404

No matching record found.

412

Precondition failed. Parameter missing.

500

Internal Server Error.

Copyright Kyvos, Inc. 2026. All rights reserved.