Zoho: Get related records count
Zoho getRelatedRecordsCount.getRelatedRecordsCount: arguments, response, policy and SDK examples.
← Get related records count operations · Get started
Operation zoho.getrelatedrecordscount
Provider route: POST /crm/v8/{moduleApiName}/{recordId}/actions/get_related_records_count. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["getRelatedRecordsCount"]["getRelatedRecordsCount"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.getRelatedRecordsCount.getRelatedRecordsCount(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.get_related_records_count.get_related_records_count(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.moduleApiName | string | Required within parent | Maximum length: 100 Minimum length: 1 Pattern: ^[A-Za-z0-9_]+$ |
path.recordId | string | Required within parent | Maximum length: 50 Minimum length: 1 Pattern: ^[0-9a-fA-F-]+$ |
body | Model | Required within parent | Expand Get related records count — request body — body |
Referenced models: Get related records count — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Get related records count — response body — get related records count |
$ (anyOf 2) | JSON | Alternative | |
$ (anyOf 2) (anyOf 1) | Model | Alternative | Expand Get related records count — response body — value get related records count — Get Related Records Count Partial Success Response |
$ (anyOf 2) (anyOf 2) | Model | Alternative | Expand Get related records count — response body — value get related records count — Partial Success Mandatory Not Found Response |
Referenced models: Get related records count — response body — value get related records count — Get Related Records Count Partial Success Response, Get related records count — response body — get related records count, Get related records count — response body — value get related records count — Partial Success Mandatory Not Found Response
Schemas
Section titled “Schemas”10 more schemas are linked from the tables above, on the schema pages.
Get related records count — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the request payload for counting related records. Contains an array of related list count specifications, each identifying a related list and optional filtering criteria. Additional keys: not allowed |
get_related_records_count | array | Required within parent | Represents the array of related list count request objects. Each object specifies a related list to query and optional filtering criteria to apply before counting. Maximum items: 20 Minimum items: 1 |
get_related_records_count[] | Model | Each item | Expand Get related records count — request body — body get related records count item |
Referenced models: Get related records count — request body — body get related records count item
Get related records count — response body — value get related records count — Get Related Records Count Partial Success Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Multi-Status (HTTP 207) response returned when a request containing multiple related list count items has mixed results - some items succeed with a count while others fail with a per-item error. Each entry in get_related_records_count corresponds positionally to a requested item and independently reports either success (count + related_list) or an error (status, code, message, details). Additional keys: not allowed |
get_related_records_count | array | Required within parent | Array of per-item results, one entry per requested related list. Each entry is either a RelatedRecordCountResult (success) or a PartialSuccessItemError (failure). Maximum items: 20 Minimum items: 1 |
get_related_records_count[] | Model | Each item | Expand Get related records count — response body — value get related records count get related records count item — Partial Success Response Item |
Referenced models: Get related records count — response body — value get related records count get related records count item — Partial Success Response Item
Get related records count — response body — get related records count
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the response returned when the count operation succeeds. Contains an array of count results, one entry for each related list requested. Additional keys: not allowed |
get_related_records_count | array | Required within parent | Represents the array of count results, one entry for each related list requested. Maximum items: 20 |
get_related_records_count[] | Model | Each item | Expand Get related records count — response body — get related records count get related records count item |
Referenced models: Get related records count — response body — get related records count get related records count item
Get related records count — response body — value get related records count — Partial Success Mandatory Not Found Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Multi-Status (HTTP 207) response returned when a request contains multiple related list count items where some succeed and others fail because a required field (such as related_list) is missing. Each entry in get_related_records_count corresponds positionally to a requested item and independently reports either success (count + related_list) or a MANDATORY_NOT_FOUND error (status, code, message, details). Additional keys: not allowed |
get_related_records_count | array | Required within parent | Array of per-item results, one entry per requested related list. Each entry is either a RelatedRecordCountResult (success) or a PartialSuccessMandatoryNotFoundItemError (failure). Maximum items: 20 Minimum items: 1 |
get_related_records_count[] | Model | Each item | Expand Get related records count — response body — value get related records count get related records count item — Partial Success Mandatory Not Found Response Item |
Referenced models: Get related records count — response body — value get related records count get related records count item — Partial Success Mandatory Not Found Response Item
Get related records count — request body — body get related records count item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a single related list count specification, including the target related list and optional filtering criteria to apply before counting. Additional keys: not allowed |
params | Model | Optional | Expand Get related records count — request body — body get related records count item params |
related_list | Model | Required within parent | Expand Get related records count — request body — body get related records count item related list |
Referenced models: Get related records count — request body — body get related records count item params, Get related records count — request body — body get related records count item related list
Get related records count — response body — value get related records count get related records count item — Partial Success Response Item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | A single entry inside the get_related_records_count array of a partial-success response. Each entry is independently either a successful count result or a per-item error. |
$ (anyOf 1) | Model | Alternative | Expand Get related records count — response body — get related records count get related records count item |
$ (anyOf 2) | Model | Alternative | Expand Get related records count — response body — value / get_related_records_count / get_related_records_count / item / status: error |
Referenced models: Get related records count — response body — value / get_related_records_count / get_related_records_count / item / status: error, Get related records count — response body — get related records count get related records count item
Get related records count — response body — get related records count get related records count item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the count result for a specific related list, including the total number of matching records and the related list identifier. Additional keys: not allowed |
count | JSON | Required within parent | |
count (anyOf 1) | integer | Alternative | Represents the total number of related records matching the specified criteria. Format: int32 Minimum: 0 |
count (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
related_list | Model | Required within parent | Expand Get related records count — request body — body get related records count item related list |
Referenced models: Get related records count — request body — body get related records count item related list
Get related records count — response body — value get related records count get related records count item — Partial Success Mandatory Not Found Response Item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | A single entry inside the get_related_records_count array of a partial-success MANDATORY_NOT_FOUND response. Each entry is independently either a successful count result or a per-item MANDATORY_NOT_FOUND error. |
$ (anyOf 1) | Model | Alternative | Expand Get related records count — response body — get related records count get related records count item |
$ (anyOf 2) | Model | Alternative | Expand Get related records count — response body — value / get_related_records_count / get_related_records_count / item / code: MANDATORY NOT FOUND, message: required field not found, status: error |
Referenced models: Get related records count — response body — value / get_related_records_count / get_related_records_count / item / code: MANDATORY NOT FOUND, message: required field not found, status: error, Get related records count — response body — get related records count get related records count item
Get related records count — request body — body get related records count item params
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents optional filtering and selection parameters applied to related records before counting. Includes support for approval status, conversion status, category type, and field-level equality filters. Additional keys: not allowed |
approval_state | string | Optional | Represents the approval workflow state used to filter related records before counting. Possible values: **approved** - Count only records in the approved workflow state. One of: approved |
approved | boolean | Optional | Indicates whether to restrict the count to approved records only. Possible values: **true** - Count only approved records. **false** - Count only records that are not approved. |
category | string | Optional | Represents the category type used to filter related records before counting. Possible values: **link** - Count only link-type related records. **files** - Count only file-attachment related records. One of: link, files |
converted | boolean | Optional | Indicates whether to restrict the count to converted records only. Applicable to the Leads module. Possible values: **true** - Count only converted records. **false** - Count only records that have not been converted. |
filters | Model | Required within parent | Expand Get related records count — request body — body get related records count item params filters |
Referenced models: Get related records count — request body — body get related records count item params filters
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.getrelatedrecordscount. Catalog operation: getRelatedRecordsCount. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.