Use this API to get various metrics about one or more tickets in the Zendesk account.

JSON Format

Ticket Metrics are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
agent_wait_time_in_minutes object true false Number of minutes the agent spent waiting during calendar and business hours
assigned_at string true false When the ticket was assigned
assignee_stations integer true false Number of assignees the ticket had
assignee_updated_at string true false When the assignee last updated the ticket
created_at string true false When the record was created
first_resolution_time_in_minutes object true false Number of minutes to the first resolution time during calendar and business hours
full_resolution_time_in_minutes object true false Number of minutes to the full resolution during calendar and business hours
group_stations integer true false Number of groups the ticket passed through
id integer true false Automatically assigned when the client is created
initially_assigned_at string true false When the ticket was initially assigned
latest_comment_added_at string true false When the latest comment was added
on_hold_time_in_minutes object true false Number of minutes on hold
reopens integer true false Total number of times the ticket was reopened
replies integer true false The number of public replies added to a ticket by an agent
reply_time_in_minutes object true false Number of minutes to the first reply during calendar and business hours
requester_updated_at string true false When the requester last updated the ticket
requester_wait_time_in_minutes object true false Number of minutes the requester spent waiting during calendar and business hours
solved_at string true false When the ticket was solved
status_updated_at string true false When the status of the ticket was last updated
ticket_id integer true false Id of the associated ticket
updated_at string true false When the record was last updated
url string true false The API url of the ticket metric

Example

{  "agent_wait_time_in_minutes": {    "business": 737,    "calendar": 2391  },  "assigned_at": "2011-05-05T10:38:52Z",  "assignee_stations": 1,  "assignee_updated_at": "2011-05-06T10:38:52Z",  "created_at": "2009-07-20T22:55:29Z",  "first_resolution_time_in_minutes": {    "business": 737,    "calendar": 2391  },  "full_resolution_time_in_minutes": {    "business": 737,    "calendar": 2391  },  "group_stations": 7,  "id": 33,  "initially_assigned_at": "2011-05-03T10:38:52Z",  "latest_comment_added_at": "2011-05-09T10:38:52Z",  "on_hold_time_in_minutes": {    "business": 637,    "calendar": 2290  },  "reopens": 55,  "replies": 322,  "reply_time_in_minutes": {    "business": 737,    "calendar": 2391  },  "requester_updated_at": "2011-05-07T10:38:52Z",  "requester_wait_time_in_minutes": {    "business": 737,    "calendar": 2391  },  "solved_at": "2011-05-09T10:38:52Z",  "status_updated_at": "2011-05-04T10:38:52Z",  "ticket_id": 4343,  "updated_at": "2011-05-05T10:38:52Z"}

List Ticket Metrics

  • GET /api/v2/ticket_metrics

Returns a list of tickets with their metrics.

Tickets are ordered chronologically by created date, from newest to oldest. The last ticket listed may not be the absolute oldest ticket in your account due to ticket archiving.

Archived tickets are not included in the response. See About archived tickets in the Support Help Center.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Agents

Using curl

curl https://{subdomain}.zendesk.com/api/v2/ticket_metrics \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "ticket_metrics": [    {      "agent_wait_time_in_minutes": {        "business": 0,        "calendar": 0      },      "assigned_at": "2020-07-20T06:21:26Z",      "assignee_stations": 0,      "assignee_updated_at": "2020-07-20T06:21:26Z",      "created_at": "2020-07-21T01:01:42Z",      "first_resolution_time_in_minutes": {        "business": 0,        "calendar": 0      },      "full_resolution_time_in_minutes": {        "business": 0,        "calendar": 0      },      "group_stations": 0,      "id": 33,      "initially_assigned_at": "2020-07-20T06:21:26Z",      "latest_comment_added_at": "2020-07-21T01:17:16Z",      "on_hold_time_in_minutes": {        "business": 0,        "calendar": 0      },      "reopens": 0,      "replies": 1,      "reply_time_in_minutes": {        "business": 16,        "calendar": 16      },      "requester_updated_at": "2020-07-21T01:17:16Z",      "requester_wait_time_in_minutes": {        "business": 0,        "calendar": 0      },      "solved_at": "2020-07-20T06:21:26Z",      "status_updated_at": "2020-07-21T01:01:41Z",      "ticket_id": 1517,      "updated_at": "2020-07-21T01:17:16Z",      "url": "https://example.zendesk.com/api/v2/ticket_metrics/33.json"    },    {      "agent_wait_time_in_minutes": {        "business": 0,        "calendar": 0      },      "assigned_at": "2020-07-20T06:21:26Z",      "assignee_stations": 0,      "assignee_updated_at": "2020-07-20T06:21:26Z",      "created_at": "2020-07-20T06:21:27Z",      "first_resolution_time_in_minutes": {        "business": 0,        "calendar": 0      },      "full_resolution_time_in_minutes": {        "business": 0,        "calendar": 0      },      "group_stations": 0,      "id": 34,      "initially_assigned_at": "2020-07-20T06:21:26Z",      "latest_comment_added_at": "2020-07-20T06:21:26Z",      "on_hold_time_in_minutes": {        "business": 0,        "calendar": 0      },      "reopens": 0,      "replies": 0,      "reply_time_in_minutes": {        "business": 0,        "calendar": 0      },      "requester_updated_at": "2020-07-20T06:21:26Z",      "requester_wait_time_in_minutes": {        "business": 0,        "calendar": 0      },      "solved_at": "2020-07-20T06:21:26Z",      "status_updated_at": "2020-07-20T06:21:26Z",      "ticket_id": 1511,      "updated_at": "2020-07-20T06:21:27Z",      "url": "https://example.zendesk.com/api/v2/ticket_metrics/34.json"    }  ]}

Show Ticket Metrics

  • GET /api/v2/ticket_metrics/{ticket_metric_id}
  • GET /api/v2/tickets/{ticket_id}/metrics

Returns a specific metric, or the metrics of a specific ticket.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Agents

Parameters

Name Type In Required Description
ticket_metric_id string Path true The id of the ticket metric to retrieve

Using curl

curl https://{subdomain}.zendesk.com/api/v2/ticket_metrics/{ticket_metric_id} \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "ticket_metric": [    {      "agent_wait_time_in_minutes": {        "business": 0,        "calendar": 0      },      "assigned_at": "2020-07-20T06:21:26Z",      "assignee_stations": 0,      "assignee_updated_at": "2020-07-20T06:21:26Z",      "created_at": "2020-07-21T01:01:42Z",      "first_resolution_time_in_minutes": {        "business": 0,        "calendar": 0      },      "full_resolution_time_in_minutes": {        "business": 0,        "calendar": 0      },      "group_stations": 0,      "id": 33,      "initially_assigned_at": "2020-07-20T06:21:26Z",      "latest_comment_added_at": "2020-07-21T01:17:16Z",      "on_hold_time_in_minutes": {        "business": 0,        "calendar": 0      },      "reopens": 0,      "replies": 1,      "reply_time_in_minutes": {        "business": 16,        "calendar": 16      },      "requester_updated_at": "2020-07-21T01:17:16Z",      "requester_wait_time_in_minutes": {        "business": 0,        "calendar": 0      },      "solved_at": "2020-07-20T06:21:26Z",      "status_updated_at": "2020-07-21T01:01:41Z",      "ticket_id": 1517,      "updated_at": "2020-07-21T01:17:16Z",      "url": "https://example.zendesk.com/api/v2/ticket_metrics/33.json"    }  ]}