> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# RequestSmartQueueHistory

POST https://api.voximplant.com/platform_api/RequestSmartQueueHistory

Gets history for the specified SmartQueue. Refer to the SmartQueue reporting guide to learn more.

**Example request:** Generate a service\_level report file in csv format for the period from 2021-03-17 00:00:00 to 2021-03-17 22:00:00.

Reference: https://docs.voximplant.ai/api-reference/management-api/reference/smartqueue/request-smart-queue-history

## Authentication

- `Authorization` header (bearer token, required) — Voximplant Management API uses signed JWT tokens generated from your service-account private key. Pass the token in the `Authorization` header as a Bearer value: ``` Authorization: Bearer $VOXIMPLANT_TOKEN ``` See [Authorization](/api-reference/management-api/authorization) for ready-to-copy snippets in bash, Python, Node.js and Go that turn your `credentials.json` into a token.

## Request

### Query parameters

- `application_id` (integer, optional) — The application ID to search by. **Required** unless **application_name** is provided.
- `application_name` (string, optional) — The application name to search by. **Required** unless **application_id** is provided.
- `user_id` (list of integer, optional) — The user ID list with a maximum of 5 values separated by semicolons (;). Use the 'all' value to select all users. Can operate as a filter for the **occupancy_rate**, **sum_agents_online_time**, **sum_agents_ready_time**, **sum_agents_dialing_time**, **sum_agents_in_service_time**, **sum_agents_afterservice_time**, **sum_agents_dnd_time**, **sum_agents_banned_time**, **min_handle_time**, **max_handle_time**, **average_handle_time**, **count_handled_calls**, **min_after_call_worktime**, **max_after_call_worktime**, **average_after_call_worktime** report types
- `user_name` (list of string, optional) — The user name list separated by semicolons (;). Can be used instead of **user_id**
- `sq_queue_id` (list of integer, required) — The SmartQueue ID list with a maximum of 5 values separated by semicolons (;). Can operate as filter for the **calls_blocked_percentage**, **count_blocked_calls**, **average_abandonment_rate**, **count_abandonment_calls**, **service_level**, **occupancy_rate**, **min_time_in_queue**, **max_time_in_queue**, **average_time_in_queue**, **min_answer_speed**, **max_answer_speed**, **average_answer_speed**, **min_handle_time**, **max_handle_time**, **average_handle_time**, **count_handled_calls**, **min_after_call_worktime**, **max_after_call_worktime**, **average_after_call_worktime** report types
- `sq_queue_name` (list of string, optional) — The SmartQueue name list separated by semicolons (;). Can be used instead of **sq_queue_id**
- `from_date` (string, required) — The from date in the selected timezone in 24-h format: YYYY-MM-DD HH:mm:ss. Default is the current time minus 1 day
- `to_date` (string, required) — The to date in the selected timezone in 24-h format: YYYY-MM-DD HH:mm:ss. Default is the current time
- `timezone` (string, optional, default: UTC) — The selected timezone or the 'auto' value (the account location)
- `interval` (string, optional, default: 0-0-1 0:0:0) — Interval format: YYYY-MM-DD HH:mm:ss. Default is 1 day
- `report_type` (list of string, required) — The report type. Possible values are: calls_blocked_percentage, count_blocked_calls, im_blocked_chats_percentage, im_count_blocked_chats, im_answered_chats_rate, average_abandonment_rate, count_abandonment_calls, service_level, im_service_level, occupancy_rate, im_agent_occupancy_rate, agent_utilization_rate, im_agent_utilization_rate, sum_agents_online_time, sum_agents_ready_time, sum_agents_dialing_time, sum_agents_in_service_time, sum_agents_in_service_incoming_time, sum_agents_in_service_outcoming_time, sum_agents_afterservice_time, sum_agents_dnd_time, sum_agents_custom_1_time, sum_agents_custom_2_time, sum_agents_custom_3_time, sum_agents_custom_4_time, sum_agents_custom_5_time, sum_agents_custom_6_time, sum_agents_custom_7_time, sum_agents_custom_8_time, sum_agents_custom_9_time, sum_agents_custom_10_time, sum_agents_banned_time, im_sum_agents_online_time, im_sum_agents_ready_time, im_sum_agents_in_service_time, im_sum_agents_dnd_time, im_sum_agents_custom_1_time, im_sum_agents_custom_2_time, im_sum_agents_custom_3_time, im_sum_agents_custom_4_time, im_sum_agents_custom_5_time, im_sum_agents_custom_6_time, im_sum_agents_custom_7_time, im_sum_agents_custom_8_time, im_sum_agents_custom_9_time, im_sum_agents_custom_10_time, im_sum_agents_banned_time, average_agents_idle_time, max_agents_idle_time, min_agents_idle_time, percentile_0_25_agents_idle_time, percentile_0_50_agents_idle_time, percentile_0_75_agents_idle_time, min_time_in_queue, max_time_in_queue, average_time_in_queue, min_answer_speed, max_answer_speed, average_answer_speed, im_min_answer_speed, im_max_answer_speed, im_average_answer_speed, min_handle_time, max_handle_time, average_handle_time, count_handled_calls, min_after_call_worktime, max_after_call_worktime, average_after_call_worktime, count_agent_unanswered_calls, im_count_agent_unanswered_chats, min_reaction_time, max_reaction_time, average_reaction_time, im_min_reaction_time, im_max_reaction_time, im_average_reaction_time, im_count_abandonment_chats, im_count_lost_chats, im_lost_chats_rate, call_count_assigned_to_queue, im_count_assigned_to_queue
- `group_by` (string, optional) — Group the result by **agent** or *queue*. The **agent** grouping is allowed only for 1 queue and for the occupancy_rate, sum_agents_online_time, sum_agents_ready_time, sum_agents_dialing_time, sum_agents_in_service_time, sum_agents_afterservice_time, sum_agents_dnd_time, sum_agents_banned_time, min_handle_time, max_handle_time, average_handle_time, count_handled_calls, min_after_call_worktime, max_after_call_worktime, average_after_call_worktime report types. The **queue** grouping allowed for the calls_blocked_percentage, count_blocked_calls, average_abandonment_rate, count_abandonment_calls, service_level, occupancy_rate, min_time_in_queue, max_time_in_queue, average_time_in_queue, min_answer_speed, max_answer_speed, average_answer_speed, min_handle_time, max_handle_time, average_handle_time, count_handled_calls, min_after_call_worktime, max_after_call_worktime, average_after_call_worktime report types
- `max_waiting_sec` (integer, optional) — Maximum waiting time. Required for the **service_level** report type

## Response

### 200

Successful response

- `result` (integer, optional) — Returns 1 if the request has been completed successfully
- `history_report_id` (integer, optional) — History report ID

## Examples

**Response**

```json
{
  "result": 1,
  "history_report_id": 533
}
```

**SDK Code**

```python Generated csv report
import requests

url = "https://api.voximplant.com/platform_api/RequestSmartQueueHistory"

querystring = {"sq_queue_id":"[1]","from_date":"2026-04-28 17:30:00","to_date":"2026-04-28 17:30:00","report_type":"[\"string\"]"}

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Generated csv report
const url = 'https://api.voximplant.com/platform_api/RequestSmartQueueHistory?sq_queue_id=%5B1%5D&from_date=2026-04-28+17%3A30%3A00&to_date=2026-04-28+17%3A30%3A00&report_type=%5B%22string%22%5D';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Generated csv report
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.voximplant.com/platform_api/RequestSmartQueueHistory?sq_queue_id=%5B1%5D&from_date=2026-04-28+17%3A30%3A00&to_date=2026-04-28+17%3A30%3A00&report_type=%5B%22string%22%5D"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Generated csv report
require 'uri'
require 'net/http'

url = URI("https://api.voximplant.com/platform_api/RequestSmartQueueHistory?sq_queue_id=%5B1%5D&from_date=2026-04-28+17%3A30%3A00&to_date=2026-04-28+17%3A30%3A00&report_type=%5B%22string%22%5D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Generated csv report
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.voximplant.com/platform_api/RequestSmartQueueHistory?sq_queue_id=%5B1%5D&from_date=2026-04-28+17%3A30%3A00&to_date=2026-04-28+17%3A30%3A00&report_type=%5B%22string%22%5D")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Generated csv report
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.voximplant.com/platform_api/RequestSmartQueueHistory?sq_queue_id=%5B1%5D&from_date=2026-04-28+17%3A30%3A00&to_date=2026-04-28+17%3A30%3A00&report_type=%5B%22string%22%5D', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Generated csv report
using RestSharp;

var client = new RestClient("https://api.voximplant.com/platform_api/RequestSmartQueueHistory?sq_queue_id=%5B1%5D&from_date=2026-04-28+17%3A30%3A00&to_date=2026-04-28+17%3A30%3A00&report_type=%5B%22string%22%5D");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Generated csv report
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/RequestSmartQueueHistory?sq_queue_id=%5B1%5D&from_date=2026-04-28+17%3A30%3A00&to_date=2026-04-28+17%3A30%3A00&report_type=%5B%22string%22%5D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```