Getting Agent States
You can use GET request to retrieve all agent state records within a time range that you specify.
We recommend that you make requests at least every 15 seconds to ensure a consistent and accurate flow of data to your workforce management or business intelligence system.
When events arrive at the RTA service on the CxEngage platform:
- The events are written as agent state records to the database and are available immediately.
- The database automatically sorts the agent state records based on their original timestamps.
![]() |
Server clock drift can occur when specifying the time parameters in a query. If your server's clock is 15 seconds ahead of the CxEngage platform, for example, you may receive events that are out of order. To avoid server clock drift with the CxEngage platform, sync your server with pool.ntp.org by adding entries to your server's ntp.conf file. Instructions are available at pool.ntp.org. |
Before You Begin
Ensure that you have completed the following tasks:
Request
Sample request
The request below gets agent state information on a tenant:
curl GET -u <username:password> -H "Content-Type: application/json" https://api.cxengage.net/v1//tenants/<tenantID>/wfm/rta
?start=<startTime>&end=<endTime>&limit=<limit>&offset=<offset>
—
Request parameters
The table below lists the parameters you can include in a request:
Response parameters
Sample response
The request returns JSON structured like the example below:
"results": [ { "platformAgentId": 15251, "eventType": "agent-not-ready", "loginTimestamp": "2017-10-06T17:50:59.690Z", "nextEventId": "0a903d70-aabf-11e7-b5e2-9a5ac3da6edd", "agentName": "Admin Subpub-Admin", "sessionId": "e98c1770-aabe-11e7-8aba-0fc9cd50d3ff", "capacity": [ { "channels": { "email": 0, "voice": 0, "workItem": 0, "messaging": 0, "sms": 0 }, "allocation": "not-allocated", "load": 0, "capacity": 1 } ], "transfers": [ { "interactionId": "73a63320-cd80-11e8-8178-02d1c7920e75", "toAgentId": "f818b240-7d3b-11e7-b08f-6e56a766befb", "transferStartTimestamp": "2018-10-11T18:07:11.382Z", "transferEndTimestamp": "2018-10-11T18:07:48.188Z" } , { "interactionId": "92d43990-cd80-11e8-8178-02d1c7920e75", "toAgentId": "f95725b0-7d3b-11e7-b08f-6e56a766befb", "transferStartTimestamp": "2018-10-11T18:08:04.908Z", "transferEndTimestamp": "2018-10-11T18:09:18.284Z" } ] "agentId": "b6828f70-a38f-11e7-bbe9-0fc9cd50d3ff", "presence": "not-ready", "end": "2017-10-06T17:51:55.079Z", "durationSeconds": 1.779, "state": "away", "reasonName": "Lunch", "reasonListName": "Away Reasons", "eventId": "0980a230-aabf-11e7-8aba-0fc9cd50d3ff", "reasonListId": "c3e00c20-87ff-11e7-b018-9a5ac3da6edd", "reasonId": "f9608f20-87fd-11e7-b018-9a5ac3da6edd", "start": "2017-10-06T17:51:53.300Z", "tenantAgentId": 9326, "allocation": "not-allocated", "direction": "inbound" }]
Response parameters
The response includes the following parameters. The response only includes the attributes that you included in the request.
Parameter | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tenantId | UUID | The unique identifier of the tenant. | ||||||||||||||||||||||||||||||||||||||||||||||||
timezone | string | The time zone for which the request was made, for example, UTC. | ||||||||||||||||||||||||||||||||||||||||||||||||
limit | integer | The number of records to return from the specified offset. | ||||||||||||||||||||||||||||||||||||||||||||||||
offset | integer | The offset from the request. | ||||||||||||||||||||||||||||||||||||||||||||||||
start | string |
The date and time, in UTC format, of the start of the time range being requested. |
||||||||||||||||||||||||||||||||||||||||||||||||
page | string | The page returned. By default, this is the first page which is page 0. | ||||||||||||||||||||||||||||||||||||||||||||||||
total | integer |
Total number of records found for the time range specified for the request. If you include the limit parameter in the request, total could be greater than limit. If total is greater than limit, there are remaining records. To get the remaining records, do the following in the subsequent request:
|
||||||||||||||||||||||||||||||||||||||||||||||||
end | string |
The date and time, in UTC format, of the end of the time range being requested. |
||||||||||||||||||||||||||||||||||||||||||||||||
results | object |
A JSON object containing the following information:
|
Copyright © 2025 Enghouse Interactive. All Rights Reserved.