Zoho Desk exposes two dedicated REST API endpoints that let you retrieve department counts programmatically — one for the overall total and one for counts scoped to a specific department.
Why this matters
When building integrations, dashboards, or automations on top of Zoho Desk, you often need to know how many departments exist in a portal or pull metric counts tied to a particular department. Rather than scraping the UI or counting records manually, the Zoho Desk API provides purpose-built endpoints for both scenarios. This is especially useful for multi-department portals where headcount and ticket volume vary significantly across teams.
Step-by-step
Step 1. To retrieve the total department count across your Zoho Desk portal, send an HTTP GET request to the /api/v1/departments/count endpoint. [2]
Step 2. Construct your request with the appropriate base URL for your data centre (e.g. https://desk.zoho.com) and append the path /api/v1/departments/count. Include your OAuth 2.0 bearer token in the Authorization header as required by Zoho Desk's standard authentication flow. [2]
Step 3. If you need to pass query parameters (for example, to filter or paginate results), supply them as a dictionary via the p parameter of the request. The endpoint accepts an optional p parameter for this purpose. [2]
A minimal Python call using a wrapper client looks like this:
# Returns the total number of departments in your Zoho Desk portal
response = client.get_department_count()
Step 4. To retrieve department-specific counts (metrics scoped to an individual department rather than a portal-wide total), use the separate endpoint GET /api/v1/doc/departmentspecific_counts instead. [5]
Step 5. As with the previous endpoint, pass any filtering or scoping parameters as a dictionary in the p argument. The operation is identified internally as getdepartmentspecificcounts. [5]
A Python example for department-specific counts:
# Returns counts scoped to a specific department
params = {"departmentId": "<your_department_id>"}
response = client.get_departmentspecific_counts(p=params)
Step 6. Parse the JSON response body returned by either endpoint. The count value will be present in the response payload, which you can then use in your dashboard, report, or downstream automation logic. [2][5]
---
> Note: Beam Help is an independent expert support resource for Zoho products — we are not official Zoho support. For billing or account-level issues, always contact Zoho directly.
---
Common pitfalls
- Wrong endpoint for the use case.
/api/v1/departments/countgives you a portal-wide total, while/api/v1/doc/departmentspecific_countsis scoped to a single department. Using the wrong one will return unexpected or incomplete data. [2][5] - Missing or expired OAuth token. Both endpoints require a valid bearer token. If your token has expired, the API will return an authentication error rather than a count. Refresh your token before retrying. [2]
- Incorrect
pparameter format. Thepargument must be passed as a dictionary (key-value pairs). Passing it as a plain string or leaving it malformed will cause the request to fail or return unfiltered results. [2][5]
What to check
- Confirm the response HTTP status code is
200 OKbefore reading the count value from the payload — any4xxor5xxresponse indicates an authentication or configuration issue. [2] - Verify you are calling the correct endpoint for your intent: portal-wide total (
/api/v1/departments/count) versus per-department metrics (/api/v1/doc/departmentspecific_counts). [2][5] - Ensure your OAuth scope includes read access to department resources in Zoho Desk, otherwise the API will return a permissions error even with a valid token. [2]