---
title: "Agent Statistics"
method: POST
path: "/api/AgentStatistic"
tags: ["Manage Agents"]
---

# Agent Statistics

`POST /api/AgentStatistic`

## Request

- Base URL: `https://your-instance.stats.pbx.commpeak.com`
- URL: `https://your-instance.stats.pbx.commpeak.com/api/AgentStatistic`
- Auth: API key in header `X-API-KEY`

### Agent Statistic API

#### Description

This API endpoint is used to retrieve agent statistics for a specified period.

#### Request Body

- `start_time` (text, Required): Beginning time of the period (Y-m-d H:00:00)
    
- `format` (text): The format of the response
    
- `agent_ids` (text): Search by agent id, example 1 || 1,2,3...
    
- `desk_ids` (text): Search by desk id, example 1 || 1,2,3...
    
- `end_time` (text): End time of the period, default current date time (Y-m-d H:00:00)
    

#### Response

The response for this request is a JSON object with the following properties:

- `success` (string): Indicates the success status of the request
    
- `message` (string): Provides additional information or error message
    

#### Response JSON Schema

``` json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  }
}

 ```

## Request body `application/x-www-form-urlencoded`

- object
  - `agent_ids` string
  - `desk_ids` string
  - `end_time` string
  - `format` string
  - `start_time` string

## Response `200`

successful

- object
  - `message` string
  - `success` string

## Other responses

- `400`: Error: Bad Request
- `401`: Unauthorized

---

[API](https://skmtc.dev/commpeak/apis/pbx-stats-api.md) - [All operations](https://skmtc.dev/commpeak/apis/pbx-stats-api/llms.txt) - [OpenAPI document](https://skmtc.dev/commpeak/apis/pbx-stats-api/revisions/2f599eb625f8?raw)
