Reports API
Reports API allows you to access and extract all the Reports data available in LiveChat.
This document describes the LiveChat Reports API v3.3. This is the latest stable version recommended for the production use.
To call the Reports API, you need to use a Bearer access token. Learn how to get it.
You can find all the requests from the Reports API v3.3 in Postman. In our collection, we use environment variables for the API version and the access token. Importing the collection from the link below downloads the LiveChat Web API environment as well. Remember to replace sample tokens with your own.
The API endpoint |
---|
https://api.livechatinc.com/v3.3/reports/<resource>/<action> |
Header | Value | Required | Notes |
---|
Authorization | Bearer <token> | Yes | Your access token |
X-API-Version | 3.3 | No | You can specify the API version in the URL instead. |
Shows the average chatting duration of agents within a license.
| |
---|
Method URL | https://api.livechatinc.com/v3.3/reports/chats/agents_chatting_duration |
HTTP method | GET |
Required scopes | reports_read |
Query String | Required | Notes |
---|
to | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
from | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
agents | no | Agent emails separated by a comma; if not specified, returns the data for all agents within the license. |
groups | no | Group IDs separated by a comma |
tags | no | Names of tags separated by a comma |
customer_client_ids | no | Client IDs separated by a comma |
distribution | no | Possible values: hour , day-hours , day , month ; defaults to day |
timezone | no | Timezone in the TZ format (e.g. America/Phoenix). Defaults to the requester's timezone. If not present, from is parsed to get the requester's timezone. |
tagged | no | Possible values: true , 1 , false , 0 |
Field | Notes |
---|
total | The total number of chats in the specified date range. |
records | Contains distribution objects, for example, day . |
records.day.count | The total number of chats agents had that day . |
records.day.seconds | The average chat duration agents had that day . |
Shows the distribution of tags for chats.
| |
---|
Method URL | https://api.livechatinc.com/v3.3/reports/chats/tags |
HTTP method | GET |
Required scopes | reports_read |
Query String | Required | Notes |
---|
to | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
from | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
distribution | yes | Possible values: hour , day-hours , day , month , year |
timezone | no | Timezone in the TZ format (e.g. America/Phoenix). Defaults to the requester's timezone. If not present, from is parsed to get the requester's timezone. |
agents | no | Agent emails separated by a comma; if not specified, returns the data for all agents within the license. |
groups | no | Group IDs separated by a comma |
names | no | The names of tags separated by a comma; when tags=:without: , you will get the total number of chats without tags, when tags=:with: you will get the total number of chats with tags. |
Field | Notes |
---|
total | The total number of chats in the specified date range. |
records | Contains the distribution objects, for example, day . |
records.day.<tag> | The total number of chats tagged with <tag> . |
Shows how many chats occurred during the specified period.
| |
---|
Method URL | https://api.livechatinc.com/v3.3/reports/chats/total_chats |
HTTP method | GET |
Required scopes | reports_read |
Query String | Required | Notes |
---|
to | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
from | yes | Date in the RFC3339 format, which also contains a timezone. This timezone will be used if no timezone is provided. |
distribution | no | Possible values: hour , day-hours , day , month ; defaults to day |
timezone | no | Timezone in the TZ format (e.g. America/Phoenix). Defaults to the requester's timezone. If not present, from is parsed to get the requester's timezone. |
agents | no | Agent emails separated by a comma; if not specified, returns the data for all agents within the license. |
agent_assigned | no | Possible values: true , 1 , false , 0 |
groups | no | Group IDs separated by a comma |
customer_client_ids | no | Client IDs separated by a comma |
tags | no | Names of tags separated by a comma |
tagged | no | Possible values: true , 1 , false , 0 |
Field | Notes |
---|
total | The total number of chats in the specified date range. |
records | Contains the distribution objects, for example, day . |
records.day.total | The total number of chats that day . |
records.day.continuous | The number of continuous chats that day . |
If you found a bug or a typo, you can create an issue on GitHub. In case of any questions or feedback, don't hesitate to contact us at developers@livechat.com