---
title: "Retrieve a statistic"
method: POST
path: "/api/stats/{name}"
tags: ["Statistics"]
---

# Retrieve a statistic

`POST /api/stats/{name}`

## Path parameters

- `name` 'overview' | 'total-tickets-created' | 'total-tickets-replied' | 'total-tickets-closed' | 'total-messages-sent' | 'total-messages-received' | 'median-first-response-time' | 'median-resolution-time' | 'total-one-touch-tickets' | 'support-volume' | 'resolution-time' | 'first-response-time' | 'tickets-created-per-hour-per-weekday' | 'tickets-per-tag' | 'tickets-created-per-channel' | 'tickets-created-per-channel-per-day' | 'tickets-closed-per-agent' | 'tickets-closed-per-agent-per-day' | 'messages-sent-per-macro' | 'satisfaction-surveys' | 'latest-satisfaction-surveys' | 'intents-occurrence' | 'intents-overview' | 'intents-breakdown-per-day' | 'revenue-overview' | 'revenue-per-agent' | 'revenue-per-day' | 'revenue-per-ticket' | 'self-service-volume-per-flow' | 'self-service-article-recommendation-performance' | 'self-service-top-reported-issues' | 'self-service-products-with-most-issues-and-return-requests' | 'self-service-workflows-performance', required

## Request body

- object
  - `filters` object, required — Miscellaneous criteria to define the scope of the statistic.
    - `period` object — Time period to filter the statistic by.
      - `start_datetime` string, date-time, required — Start of the time period.
      - `end_datetime` string, date-time, required — End of the time period.
    - `agents` integer[] — ID of users to filter the statistic by.
    - `channels` string[] — Channels to filter the statistic by.
    - `campaigns` string[] — Campaigns to filter the statistic by.
    - `tags` integer[] — ID of tags to filter the statistic by.
    - `integrations` integer[] — ID of integrations to filter the statistic by.
    - `score` integer[] — Satisfaction survey scores to filter the statistic by.

## Response `201`

The requested statistic

- Statistic
  - `data` object — The data of the statistic. Data structure varies according to the type of the statistic (e.g. key metric, bar chart, table)
  - `meta` object — Timestamps used to build the statistic.
    - `end_datetime` string, date-time, required — End of the time period.
    - `previous_end_datetime` string, date-time — End of the previous time period.
    - `previous_start_datetime` string, date-time — Start of the previous time period.
    - `start_datetime` string, date-time, required — Start of the time period.

---

[API](https://skmtc.net/gorgias/apis/gorgias-rest-api.md) · [All operations](https://skmtc.net/gorgias/apis/gorgias-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gorgias/gorgias-rest-api/revisions/36f2e31f4e81/schema)
