Beam Help
Get help now

How-to · Zoho DESK

How to retrieve ticket metrics in Zoho Desk

Fetch performance and SLA metrics for a specific ticket.

Ticket metrics in Zoho Desk are available through a single REST endpoint that returns performance data for any individual ticket — no dashboard navigation required.


Why this matters


When you need to audit response times, measure SLA compliance, or pull raw performance data into a reporting pipeline, the Zoho Desk API gives you direct programmatic access to per-ticket metrics. This is especially useful for teams building custom dashboards or automating quality-assurance checks without manually browsing the Desk agent interface.


Step-by-step


Step 1. Confirm your OAuth token carries the correct Desk scopes before making any API call. At minimum you need Desk.tickets.READ in your authorised scope list — broader options such as Desk.tickets.ALL also satisfy this requirement. [3]


Step 2. Identify the numeric ticket_id for the ticket whose metrics you want. You can find this in the Zoho Desk agent portal URL, which follows the pattern https://desk.zoho.{dc}/agent/{portal}/tickets/details/{TicketId}, or by querying the tickets list endpoint first. [4]


Step 3. Send a GET request to the metrics endpoint, substituting your ticket's ID into the path:


GET /api/v1/tickets/{ticket_id}/metrics

The endpoint accepts ticket_id as a required path parameter and an optional p parameter for any additional query options you wish to pass. [1]


Step 4. In Python, the call looks like this using the ZohoDeskApi wrapper:


metrics = api.get_ticket_metrics(ticket_id="12345")

Pass an optional dictionary as the second argument (p) if you need to include extra query parameters. [1]


Step 5. Parse the response dictionary that comes back. Our team recommends printing or logging the full response during development so you can see exactly which metric fields your Desk organisation returns — field availability can vary by plan and configuration. [5]


Step 6. If you are building a conversational or automated workflow, the Zoho Desk assistant pattern is to always call the tool with real data rather than guessing values. Confirm you have the ticket_id before invoking the endpoint; if it is missing, ask for it explicitly before proceeding. [5]


Common pitfalls


  • Missing or wrong OAuth scopes. If your token was minted without Desk.tickets.READ (or Desk.tickets.ALL), the API will return an authorisation error. Double-check the scope string in your OAuth configuration — each scope must be comma-separated with no trailing spaces. [3]

  • Stale access tokens. Zoho access tokens expire (typically after one hour). The API layer should automatically refresh using the stored refreshtoken; if you see 401 errors, verify that your token-refresh logic is writing the new accesstoken back to your connection store before retrying. [8]

  • Wrong data centre domain. Desk is hosted across multiple regional data centres. The base URL changes depending on your DC — for example https://desk.zoho.com for .com accounts versus https://desk.zoho.{dc} for EU, IN, AU, and other regions. Using the wrong domain will result in connection or 404 errors. [4]

  • Org ID not set. The ZohoDeskClient requires a valid orgid header on every request. If your connection record does not yet have deskorg_id populated, the client will attempt to auto-discover it by calling the organisations endpoint on first use. Ensure this discovery step completes successfully before calling the metrics endpoint. [8]

What to check


  • Verify the response contains the expected metric fields (e.g. response time, resolution time) and that none are null due to the ticket still being open or unassigned.
  • Confirm your OAuth scopes include at least Desk.tickets.READ and that the token has been refreshed if it is more than an hour old. [3]
  • Cross-reference the returned ticket_id in the Desk agent portal URL to make sure you queried the correct ticket. [4]

---


*Beam Help provides independent expert guidance for Zoho products and is not official Zoho support.*

Sources cited

  1. [1] GET /api/v1/tickets/{ticket_id}/metrics
  2. [2] server.py: build_zoho_links
  3. [3] config.py
  4. [4] planner.py
  5. [5] server.py: chat_stream
  6. [6] zoho_oauth.py
  7. [7] server.py: get_zoho_api
Get Ticket Metrics | Beam Help