Skip to main content

/o/export/data

Endpoint

/o/export/data

Overview

Converts a provided payload into an export file without querying a collection.

Authentication

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Requires authenticated dashboard user access.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API authentication key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
dataJSON String (Array/Object) or Array/ObjectYesData payload to convert and export.
rawBooleanNoWhen truthy, skips JSON parsing of string data.
typeStringNoExport format (json, csv, xls, xlsx).
filenameStringNoDownload file name prefix.

Parameter Semantics

  • If data is a string and raw is not set, it must be valid JSON.
  • Object payloads are converted to array form before export conversion.

Response

Success Response

CSV export example (file content):

event,count,sum
Purchase,19,233.74
Subscription,8,159.92

JSON export example (file content):

[
{
"event": "Purchase",
"count": 19,
"sum": 233.74
},
{
"event": "Subscription",
"count": 8,
"sum": 159.92
}
]

Response Fields

FieldTypeDescription
(download body)String or BinaryExported file content created from provided data.

Error Responses

Status Code: 400 Bad Request

{
"result": "Missing parameter \"data\""
}

Status Code: 400 Bad Request

{
"result": "Incorrect parameter \"data\""
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Parsed-data modedata is a string and raw is not setParses JSON payload, normalizes to exportable array/object form, converts to requested output format.Download stream/body (format depends on type)
Raw-data moderaw is setSkips JSON parsing and exports provided data value directly.Download stream/body (format depends on type)

Impact on Other Data

  • No collection writes. This endpoint only formats and returns output.

Audit & System Logs

  • No /systemlogs action is emitted by this endpoint.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication validationReads caller identity for management-read access validation.

Examples

Example 1: Export provided array as CSV

/o/export/data?
api_key=YOUR_API_KEY&
data=[{"event":"Purchase","count":19,"sum":233.74},{"event":"Subscription","count":8,"sum":159.92}]&
type=csv&
filename=event-summary

Example 2: Export provided payload as JSON

/o/export/data?
api_key=YOUR_API_KEY&
data={"rows":[{"country":"US","users":124},{"country":"ES","users":48}]}&
type=json&
filename=country-users

Operational Considerations

  • Large payloads increase conversion memory/time.
  • For very large exports, prefer asynchronous request-query export.

Last Updated

2026-02-17