---
title: "Get Metrics"
method: POST
path: "/v1/metrics"
tags: ["Analytics"]
---

# Get Metrics

`POST /v1/metrics`

Get fine grained analytics data from Trata AI like call, duration stats, etc.

## Request body

- BatchMetricsRequests
  - `requests` MetricsRequest[], required
    - `id` string, required — Unique identifier for the metric request. This can be helped to co-relate the request and response
    - `name` 'CALLS' | 'CALL_DURATION' | 'APPOINTMENT_SCHEDULED' | 'PROSPECTS' | 'INTERESTED' | 'NOT_INTERESTED', required
    - `fromDate` string, date, required — Start date to get metric request
    - `toDate` string, date, required — End date until get metric request
    - `aggregationPeriod` 'MONTHLY' | 'WEEKLY' | 'DAILY', required
    - `aggregationFormula` 'COUNT' | 'SUM' | 'MEDIAN', required

## Response `200`

Successful Response

- BatchMetricsResponse
  - `responses` MetricsResponse[], required
    - `id` string, required — Unique identifier for the metric response. This will help co-relate the request and response
    - `name` 'CALLS' | 'CALL_DURATION' | 'APPOINTMENT_SCHEDULED' | 'PROSPECTS' | 'INTERESTED' | 'NOT_INTERESTED', required
    - `datapoints` MetricResponseDataPoint[], required — List of data points for the metric response
      - `timestamp` string, date, required — Timestamp of the data point
      - `value` string, required — Value which will be a string representation of integer or floating number

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/tratahq/apis/trata-ai-api.md) · [All operations](https://skmtc.net/tratahq/apis/trata-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tratahq/trata-ai-api/revisions/8f7b69ee5a90/schema)
