Skip to main content

/o/export/request

Endpoint

/o/export/request

Overview

Calls another API path, transforms the returned payload, and returns it as a downloadable export file.

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.
pathStringYesTarget API path to call (for example /o/analytics/dashboard).
methodStringNoOptional request method value passed into export pipeline.
dataJSON String (Object)NoRequest payload passed to the target path.
propStringNoDot path to extract a nested property from target response before export.
projectionJSON String (Object)NoInclude-only projection applied to returned objects.
columnNamesJSON String (Object)NoField rename map for output columns.
mapperJSON String (Object)NoValue transformation map for exported fields.
typeStringNoExport format (json, csv, xls, xlsx).
filenameStringNoDownload file name prefix.

Parameter Semantics

  • path is normalized to start with /.
  • If data parsing fails, an empty object is used.
  • If projection, columnNames, or mapper parsing fails, empty/default processing is used.
  • prop is applied after target response is received.

Response

Success Response

CSV export example (file content):

country,total_sessions,new_users
United States,121,11
Spain,87,6

JSON export example (file content):

[
{
"country": "United States",
"total_sessions": 121,
"new_users": 11
},
{
"country": "Spain",
"total_sessions": 87,
"new_users": 6
}
]

Response Fields

FieldTypeDescription
(download body)String or BinaryExported file content produced from internal request response.

Error Responses

Status Code: 400 Bad Request

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

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Direct export modepath is provided without mapping transformsCalls target API path and converts returned payload to requested format.Download stream/body (format depends on type)
Field-mapped export modeprojection, columnNames, or mapper is providedApplies field filtering/renaming/value transforms before export conversion.Download stream/body (format depends on type)
Property extraction modeprop is providedExtracts nested property from target response before export conversion.Download stream/body (format depends on type)

Impact on Other Data

  • Read-only for this endpoint flow. It does not write export task records.

Audit & System Logs

  • No /systemlogs action is emitted by this endpoint itself.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication validationReads caller identity for management-read access validation.
Depends on pathTarget request data sourceReads whatever the referenced target API path reads.

Examples

Example 1: Export dashboard countries using nested property extraction

/o/export/request?
api_key=YOUR_API_KEY&
path=/o/analytics/countries&
data={"app_id":"6991c75b024cb89cdc04efd2"}&
prop=30days&
type=csv&
filename=countries-30days

Example 2: Export with custom column names

/o/export/request?
api_key=YOUR_API_KEY&
path=/o/analytics/tops&
data={"app_id":"6991c75b024cb89cdc04efd2","period":"30days"}&
prop=platforms&
columnNames={"name":"Platform","value":"Sessions","percent":"Share"}&
type=xlsx&
filename=top-platforms

Operational Considerations

  • Result shape depends on the referenced path and prop.
  • Very large returned payloads can increase response memory and conversion time.

Limitations

  • Invalid path behavior is inherited from the target endpoint and may return empty export output.
  • This endpoint does not create asynchronous task records by itself.

Last Updated

2026-02-17