Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.moduleApiNamestringRequired within parentMaximum length: 100
Minimum length: 1
Pattern: ^[A-Za-z0-9_]+$
path.recordIdstringRequired within parentMaximum length: 50
Minimum length: 1
Pattern: ^[0-9a-fA-F-]+$
bodyModelRequired within parentExpand Get related records count — request body — body

Referenced models: Get related records count — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Get related records count — response body — get related records count
$ (anyOf 2)JSONAlternative
$ (anyOf 2) (anyOf 1)ModelAlternativeExpand Get related records count — response body — value get related records count — Get Related Records Count Partial Success Response
$ (anyOf 2) (anyOf 2)ModelAlternativeExpand 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

10 more schemas are linked from the tables above, on the schema pages.

Get related records count — request body — body
FieldTypePresenceDescription and constraints
$objectRootRepresents 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_countarrayRequired within parentRepresents 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[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRootMulti-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_countarrayRequired within parentArray 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[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRootRepresents 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_countarrayRequired within parentRepresents the array of count results, one entry for each related list requested.
Maximum items: 20
get_related_records_count[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRootMulti-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_countarrayRequired within parentArray 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[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRootRepresents a single related list count specification, including the target related list and optional filtering criteria to apply before counting.
Additional keys: not allowed
paramsModelOptionalExpand Get related records count — request body — body get related records count item params
related_listModelRequired within parentExpand 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
FieldTypePresenceDescription and constraints
$JSONRootA 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)ModelAlternativeExpand Get related records count — response body — get related records count get related records count item
$ (anyOf 2)ModelAlternativeExpand 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
FieldTypePresenceDescription and constraints
$objectRootRepresents the count result for a specific related list, including the total number of matching records and the related list identifier.
Additional keys: not allowed
countJSONRequired within parent
count (anyOf 1)integerAlternativeRepresents the total number of related records matching the specified criteria.
Format: int32
Minimum: 0
count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
related_listModelRequired within parentExpand 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
FieldTypePresenceDescription and constraints
$JSONRootA 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)ModelAlternativeExpand Get related records count — response body — get related records count get related records count item
$ (anyOf 2)ModelAlternativeExpand 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
FieldTypePresenceDescription and constraints
$objectRootRepresents 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_statestringOptionalRepresents 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
approvedbooleanOptionalIndicates whether to restrict the count to approved records only.
Possible values:
**true** - Count only approved records.
**false** - Count only records that are not approved.
categorystringOptionalRepresents 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
convertedbooleanOptionalIndicates 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.
filtersModelRequired within parentExpand 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

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.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.