Beam Help
Get help now

How-to · Zoho DESK

How to count all contracts in Zoho Desk

Get a total count of all contracts across your Zoho Desk accounts.

Retrieving a total contract count in Zoho Desk is straightforward via a single REST API call that returns the aggregate number of contracts associated with your account.


Why this matters


When you need a quick dashboard figure, a health check, or a trigger condition in an automation workflow, knowing the exact number of contracts on record is essential. Rather than paginating through every contract record and tallying results manually, Zoho Desk exposes a dedicated count endpoint that returns this figure in one round trip. This is especially useful for reporting scripts, integration health checks, or pre-processing logic before bulk operations.


Step-by-step


Step 1. Ensure you have a valid Zoho Desk API OAuth token with the appropriate scope to read contract data. Without proper authentication your request will be rejected before it reaches the count resource. Confirm your OAuth client is set up in the Zoho Developer Console and that the token has not expired.


Step 2. Send a GET request to the following endpoint:


GET /api/v1/accounts/contracts/count

This is the dedicated operation (listallcontracts_count) that returns the total number of contracts in your Zoho Desk account. [1]


Step 3. Optionally, pass a p parameter in the query string if you need to filter or paginate the count result. The endpoint accepts p as an optional parameter. [1]


Step 4. If you are calling this from Python, you can use the following pattern (paraphrased from the SDK helper):


def get_contracts_count(client, filters=None):
    """Return the total contract count from Zoho Desk."""
    return client.request("GET", "/api/v1/accounts/contracts/count", filters, None)

Pass your authenticated client object as client and supply any optional filter dictionary as filters. [1]


Step 5. Parse the JSON response body. The returned payload will contain the count value you need. Store or display this figure as required by your workflow — for example, writing it to a dashboard field, logging it, or using it as a conditional check before triggering downstream automation.


Step 6. If you are building a recurring report or scheduled job, wrap the call in a loop with appropriate rate-limit handling. Zoho Desk enforces API call limits per account, so avoid hammering the endpoint in rapid succession.


Common pitfalls


  • Missing or expired OAuth token. The endpoint will return an authentication error if your token has lapsed. Always refresh the token before making the call, particularly in long-running scripts.
  • Incorrect base URL. Make sure you are using the correct data-centre domain (e.g., desk.zoho.com, desk.zoho.eu, desk.zoho.com.au) as the base for /api/v1/accounts/contracts/count. Using the wrong regional domain will result in a 404 or redirect. [1]
  • Confusing Zoho Desk contracts with Zoho Contracts. Zoho Contracts is a separate, dedicated contract lifecycle management product. The API endpoint described here is specific to the contracts feature within Zoho Desk accounts — not the standalone Zoho Contracts application. [1]
  • Assuming p is mandatory. The p parameter is optional. Omitting it will still return a valid count for all contracts without any filter applied. [1]

What to check


  • Verify the response value is non-null — a null or empty response usually indicates a permissions issue rather than zero contracts.
  • Confirm the endpoint base URL matches your Zoho Desk data centre region — mismatched regions are a common silent failure point.
  • Cross-reference the returned count against the Zoho Desk UI — navigate to the Contracts section in your Desk portal and compare the visible total to the API result to confirm the call is scoped correctly.

---


*Beam Help is an independent expert support resource for Zoho products and is not official Zoho support. For billing or account-level issues, please contact Zoho directly.*

Sources cited

  1. [1] GET /api/v1/accounts/contracts/count
  2. [2] [Free Webinar] Learning Table Series 2026 – Customer agreement & contract management using Zoho Creator
  3. [3] Automating Vendor Contract Management between Zoho Contracts and Zoho Books using Zoho Flow
  4. [4] What's New
  5. [5] Count Function in Zoho Table
  6. [6] Upgrade your contract lifecycle management with Zoho Contracts 2.0!
  7. [7] What's new in Zoho Contracts?
  8. [8] Extracting record counts for Zoho Creator C6 application Using Zoho RPA