The Agent Events API provides access to agent-related updates across your Zendesk Chat account.

This API is currently in limited availability.

JSON Format

Incremental Agent Events are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
account_id integer true false The agent’s account id
agent_id integer true false The agent’s unique identifier
field_name string true false The agent attribute that changed on this event. Possible values are "status" or "engagements".
id string true false The event's unique identifier
previous_value true false The value of the attribute before the change. For a status change, possible values are "offline", "online", "away" or "invisible". For an engagements change, the value is the number of concurrent chats (engagements) that the agent was involved in.
timestamp string true false The date and time in seconds when the event happened
value true false The value of the attribute after the change. It can be either a string or an integer. Possible values are the same as previous_value.

Example

{  "account_id": 2,  "agent_id": 980824,  "field_name": "status",  "id": "R6vTSXc.agent:980824.WEuQDQ",  "previous_value": "online",  "timestamp": "2018-10-19T12:33:50.140101Z",  "value": "away"}

Incremental Agent Events Export

  • GET /api/v2/incremental/agent_events

Returns an agent_events object that consists of a chronologically ordered list of any agent-related update generated since the given start time. An event captures:

  • Either any agent status change,
  • Or a change in the number of any agent’s engagements.

Common Response Properties

See the Incremental Exports documentation.

Allowed for

  • Owner
  • Administrator

Resource Expansion

Not applicable.

Parameters

Name Type In Required Description
fields string Query false Response properties required. See Resource Expansion
limit integer Query false The number of results to be returned. Default and max 1000
start_id string Query false Defaults to empty string
start_time integer Query false A Unix epoch time in microseconds. See Start time. Defaults to 0

Using curl

curl "https://www.zopim.com/api/v2/incremental/agent_events" \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "agent_events": [    {      "account_id": 2,      "agent_id": 980824,      "field_name": "status",      "id": "R6vTSXc.agent:980824.WEuQDQ",      "previous_value": "online",      "timestamp": "2018-10-19T12:33:50.140101Z",      "value": "away"    },    {      "account_id": 2,      "agent_id": 980824,      "field_name": "engagements",      "id": "R6vTXhl.agent:980824.y7Q4aI",      "previous_value": 0,      "timestamp": "2018-10-19T12:34:09.989524Z",      "value": 1    },    {      "account_id": 2,      "agent_id": 980824,      "field_name": "engagements",      "id": "R6vTZ0i.agent:980824.wpOTDT",      "previous_value": 1,      "timestamp": "2018-10-19T12:34:15.008359Z",      "value": 0    }  ],  "count": 3,  "end_id": "R7AfRxf.agent:980824.72oQk1",  "end_time": 1540176932.8872,  "next_page": "https://www.zopim.com/api/v2/incremental/agent_events?start_time=1540176932.887200\u0026start_id=R7AfRxf.agent%3A980824.72oQk1"}