---
title: "Export Analytics data in CSV file"
method: GET
path: "/analytics/csv"
tags: ["analytics"]
---

# Export Analytics data in CSV file

`GET /analytics/csv`

## Request

- Base URL: `https://pro.api.serversmtp.com/api/v2`
- URL: `https://pro.api.serversmtp.com/api/v2/analytics/csv`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `consumerKey` and API key in header `consumerSecret`

Export Analytics data in CSV file

## Query parameters

- `from` string, date, required: Start date
- `to` string, date, required: End date
- `status[]` AnalyticMailStatus[]: Filter by Status
- `filter_by` AnalyticFilterByOption[]: Filter by
- `filter` string: Query to search
- `smart_search` boolean, nullable: Smart search
- `orderby` 'subject' | 'sender' | 'recipient' | 'send_time': Field to sort by. Valid values are subject, sender, recipient, or send_time.
- `ordertype` 'asc' | 'desc': Order Ascending or Descending.
- `tz` string: Timezone Offset

## Response `200`

Analytics CSV data

## Other responses

- `400`: Bad Request ###### Produces: * missing_required_parameter_from * from_format_should_be_yyyy-mm-dd * missing_required_parameter_to * to_format_should_be_yyyy-mm-dd * missing_required_parameter_filter_by * invalid_status_value * filter_by_can_only_be_subject_or_sender_or_recipient_or_domain * smart_search_should_be_true_or_false * orderby_can_only_be_subject_or_sender_or_recipient_or_domain * ordertype_should_be_asc_or_desc
- `401`: Unauthorized This API requires a valid API Key to be provided. (Use [/authentication/authorize](#/authentication/AuthenticationLogin) to obtain an API Key) Produces: * missing_authorization_key * invalid_authorization_key * account_is_inactive

---

[API](https://skmtc.dev/serversmtp/apis/turbosmtp-public-apis.md) - [All operations](https://skmtc.dev/serversmtp/apis/turbosmtp-public-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/serversmtp/apis/turbosmtp-public-apis/revisions/8503e099b215?raw)
