---
title: "Create a new analytics export"
method: POST
path: "/analytics/exports"
tags: ["Analytics"]
---

# Create a new analytics export

`POST /analytics/exports`

Create a new analytics export of messages or events (activities) over a specific time span.
The export will be executed asynchronously. The response will include a link that can be used to retrieve the export status & result. Refer to the [Analytics](https://dev.frontapp.com/reference/analytics) topic for details about specific metrics.


Required scope: `analytics:read`

## Request body

- union
  - object
    - `columns` AnalyticsMessagesColumns[], required — List of the columns to include in the export.
    - `type` 'messages' | 'events', required — The type of export to create. The type you specify determines which columns are available for the export.
    - `start` number, required — Start time of the data to include in the export (seconds since 1970-01-01T00:00:00+00). Will be rounded down to the start of the day.
    - `end` number, required — End time of the data to include in the export (seconds since 1970-01-01T00:00:00+00). Will be rounded up to the end of the day.
    - `timezone` string — [IANA name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the timezone to format the dates with. If omitted, the export will use Etc/UTC.
    - `filters` union — Resources to compute the analytics for. Defaults to all.
      - TagIds
        - `tag_ids` ResourceID[], required
      - TeammateIds
        - `teammate_ids` ResourceID[], required
      - ChannelIds
        - `channel_ids` ResourceID[], required
      - InboxIds
        - `inbox_ids` ResourceID[], required
      - TeamIds
        - `team_ids` ResourceID[], required
      - AccountIds
        - `account_ids` ResourceID[], required
  - object
    - `columns` union[], required — List of the columns to include in the export. **Fixed columns** are plain strings selected from the predefined list (e.g., `"Message ID"`). **Parameterized columns** require an additional parameter and must be specified as an object with `name` and `id` fields. Supported parameterized prefixes: - `Time spent in Ticket Status` — `id` is the ticket status public API ID (e.g., `sts_123`) - `Transitions to Ticket Status` — `id` is the ticket status public API ID (e.g., `sts_123`) - `Smart QA score` — `id` is the Smart QA criteria name (e.g., `Comprehension`) - `Custom Field` — `id` is the custom field public API ID (e.g., `fld_456`) - `Updated Custom Field` — `id` is the custom field public API ID (e.g., `fld_456`) Example: `["Message ID", {"name": "Time spent in Ticket Status", "id": "sts_123"}, {"name": "Smart QA score", "id": "Comprehension"}]`
      - union
        - 'Activity ID' | 'Type' | 'Source' | 'Message ID' | 'Segment ID' | 'Conversation ID' | 'Ticket IDs' | 'Segment' | 'Segment start' | 'Segment end' | 'Direction' | 'Status' | 'Status at activity time' | 'Inbox' | 'Inbox API ID' | 'Inbox at activity time' | 'Inbox API IDs at activity time' | 'Previous inbox IDs' | 'Message date' | 'Autoreply' | 'Reaction time' | 'Total reply time' | 'Handle time' | 'Response time' | 'Stage resolution time' | 'Replies to resolution' | 'Ticket resolution time' | 'Ticket replies to resolution' | 'Attributed to' | 'Assignee' | 'Author' | 'Contact name' | 'Contact handle' | 'Account names' | 'From' | 'To' | 'Cc' | 'Bcc' | 'Extract' | 'Tags' | 'Tag API IDs' | 'Tags at activity time' | 'Tag API IDs at activity time' | 'Tag application duration' | 'Activity API ID' | 'Message API ID' | 'Comment API ID' | 'Conversation API ID' | 'Message original ID' | 'New Conversation' | 'First response' | 'Business hours' | 'Subject' | 'Account name' | 'Survey rating' | 'Survey comment' | 'Segment closed' | 'Segment contains messages' | 'Last segment activity' | 'Added tag' | 'Added tag API ID' | 'Removed tag' | 'Removed tag API ID' | 'Segment cumulative teammates' | 'Ticket status name' | 'Ticket status category' | 'Time spent in Ticket Status' | 'Transitions to Ticket Status' | 'Smart QA score' | 'Custom Field' | 'Updated Custom Field'
        - AnalyticsActivitiesSmartQAParameterizedColumn
          - `name` 'Smart QA score', required
          - `id` 'Comprehension' | 'Solution_Offered' | 'Professionalism' | 'Professional_Behavior' | 'Professional_Relationship' | 'Readability' | 'Grammar_Spelling' | 'General_Empathy' | 'Cognitive_Empathy' | 'Emotional_Empathy' | 'Compassionate_Empathy' | 'Tone' | 'Adaptive_Tone' | 'Neutral_Tone' | 'Positive_Tone' | 'Brevity' | 'Demo_Offered' | 'Information_Gathering' | 'Upsell' | 'Friendly' | 'Greeting_Offered' | 'Personalisation' | 'Adaptability', required
        - AnalyticsActivitiesNumericParameterizedColumn
          - `name` 'Time spent in Ticket Status' | 'Transitions to Ticket Status' | 'Custom Field' | 'Updated Custom Field', required
          - `id` union, required — Public API string ID (e.g., sts_123 for ticket statuses, fld_456 for custom fields) or legacy numeric ID
            - string
            - integer
    - `type` 'messages' | 'events', required — The type of export to create. The type you specify determines which columns are available for the export.
    - `start` number, required — Start time of the data to include in the export (seconds since 1970-01-01T00:00:00+00). Will be rounded down to the start of the day.
    - `end` number, required — End time of the data to include in the export (seconds since 1970-01-01T00:00:00+00). Will be rounded up to the end of the day.
    - `timezone` string — [IANA name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the timezone to format the dates with. If omitted, the export will use Etc/UTC.
    - `filters` union — Resources to compute the analytics for. Defaults to all.
      - TagIds
        - `tag_ids` ResourceID[], required
      - TeammateIds
        - `teammate_ids` ResourceID[], required
      - ChannelIds
        - `channel_ids` ResourceID[], required
      - InboxIds
        - `inbox_ids` ResourceID[], required
      - TeamIds
        - `team_ids` ResourceID[], required
      - AccountIds
        - `account_ids` ResourceID[], required

## Response `201`

An analytics export.

- AnalyticsExportResponse
  - `_links` object, required
    - `self` string — Link to analytics export
  - `id` string, required — The public ID of the analytics export
  - `status` 'running' | 'done' | 'too_big' | 'failed', required — Status of the analytics
  - `progress` integer, required — Number ranging from 0 to 100 corresponding to the percentage of the analytics processed.
  - `url` string — The URL from which the export data can be downloaded. Only displays after you make a GET request to the link included in the POST response.
  - `filename` string — The filename of the export with extension included. Only displays after you make a GET request to the link included in the POST response.
  - `size` number, nullable — Size (in bytes) of the export data. Only displays after you make a GET request to the link included in the POST response.
  - `created_at` number — Timestamp (in seconds) at which the export was requested.
  - `filters` union, required — Resources to compute the analytics for. Defaults to all.
    - TagIds
      - `tag_ids` ResourceID[], required
    - TeammateIds
      - `teammate_ids` ResourceID[], required
    - ChannelIds
      - `channel_ids` ResourceID[], required
    - InboxIds
      - `inbox_ids` ResourceID[], required
    - TeamIds
      - `team_ids` ResourceID[], required
    - AccountIds
      - `account_ids` ResourceID[], required

---

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