Zoho: Get all territories
Zoho territories.getTerritories: arguments, response, policy and SDK examples.
← Territories operations · Get started
Operation zoho.getterritories
Provider route: GET /crm/v8/settings/territories. 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["territories"]["getTerritories"]>[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.territories.getTerritories(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.territories.get_territories(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.include | string | Optional | The additional fields to include in the response, of type string. One of: account_rule_criteria, lead_rule_criteria, deal_rule_criteria, account_rule_criteria,lead_rule_criteria, account_rule_criteria,deal_rule_criteria, lead_rule_criteria,deal_rule_criteria, account_rule_criteria,lead_rule_criteria,deal_rule_criteria Maximum length: 100 |
query.ids | array | Optional | Represents the list of Territory Ids. Maximum items: 100 Minimum items: 1 Unique items: true |
query.ids[] | string | Each item | Individual territory ID used in a comma-separated list for retrieval or operations on multiple territories. Format: int64 |
query.page | integer | Optional | Page number as an integer, starting from 1. Format: int32 Minimum: 1 |
query.per_page | integer | Optional | Represents the per page number. Format: int32 Maximum: 2000 Minimum: 1 |
query.filters | Model | Optional | Expand Related Records — request body — query filters |
query.include_inner_details | string | Optional | Provide whether additional details has to be included in the response. One of: manager.zuid,manager.status, manager.zuid, manager.status |
Referenced models: Related Records — request body — query filters
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 all territories — response body — value |
$ (anyOf 2) | null | Alternative |
Referenced models: Get all territories — response body — value
Schemas
Section titled “Schemas”27 more schemas are linked from the tables above, on the schema pages.
Related Records — request body — query filters
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | Represents the top-level filter criterion for data selection, supporting both simple field-based filters and complex grouped filters with logical operators. |
$ (anyOf 1) | Model | Alternative | Expand Related Records — request body — query filters value |
$ (anyOf 2) | Model | Alternative | Expand Related Records — request body — query / filters / group_operator: AND, OR, and, or |
Referenced models: Related Records — request body — query / filters / group_operator: AND, OR, and, or, Related Records — request body — query filters value
Get all territories — response body — value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | Represents the response for the GET /settings/territories endpoint. Returns either a paginated list of territories with an info object, or a filtered list of territories when the ids parameter is provided. |
$ (anyOf 1) | object | Alternative | Represents the paginated response containing a list of territories with pagination details. Additional keys: not allowed |
$ (anyOf 1).info | Model | Required within parent | Expand Get child territories by parent territory ID — response body — info, territories info Pagination metadata for the response. |
$ (anyOf 1).territories | array | Required within parent | Represents the list of territory objects returned in the paginated response. Maximum items: 200 Minimum items: 1 |
$ (anyOf 1).territories[] | Model | Each item | Expand Get territory by ID — response body — territories territories item Individual territory object containing detailed information about the territory. |
$ (anyOf 2) | object | Alternative | Represents the response containing territories filtered by the specified IDs. Additional keys: not allowed |
$ (anyOf 2).territories | array | Required within parent | Represents the list of territory objects filtered by the specified IDs. Maximum items: 100 Minimum items: 1 |
$ (anyOf 2).territories[] | Model | Each item | Expand Get territory by ID — response body — territories territories item Individual territory object. |
Referenced models: Get child territories by parent territory ID — response body — info, territories info, Get territory by ID — response body — territories territories item
Related Records — request body — query / filters / group_operator: AND, OR, and, or
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a grouped filter criterion containing multiple filter conditions evaluated with a logical operator. Supports recursive nesting for complex filtering logic. Additional keys: not allowed |
group | array | Required within parent | Contains an array of filter conditions grouped together and evaluated with the specified logical operator. Maximum items: 25 Minimum items: 2 |
group[] | JSON | Each item | |
group[] (anyOf 1) | Model | Alternative | Expand Related Records — request body — query filters value |
group[] (anyOf 2) | Model | Alternative | Expand Related Records — request body — query / filters / group_operator: AND, OR, and, or |
group_operator | string | Required within parent | Represents the logical operator applied between the filter conditions in the group. Possible values: AND - All conditions in the group must be satisfied. OR - At least one condition in the group must be satisfied. and - Equivalent to AND; all conditions in the group must be satisfied. or - Equivalent to OR; at least one condition in the group must be satisfied. One of: AND, OR, and, or |
Referenced models: Related Records — request body — query / filters / group_operator: AND, OR, and, or, Related Records — request body — query filters value
Related Records — request body — query filters value
Referenced models: Related Records — request body — query / filters / value / comparator: between, not between, type: merge field, pre defined, value, field, Related Records — request body — query filters value value, Related Records — request body — query / filters / value / comparator: include all, include any, exclude all, exclude any, type: merge field, pre defined, value, field, Related Records — request body — query / filters / value / comparator: less than, less equal, greater than, greater equal, type: merge field, pre defined, value, field, Related Records — request body — query / filters / value / comparator: in, not in, type: merge field, pre defined, value, field, Related Records — request body — query / filters / value / comparator: like, not like, starts with, ends with, contains, not contains, type: merge field, pre defined, value, field
Get child territories by parent territory ID — response body — info, territories info
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the pagination details for the response, including the current page, per-page count, total count, and whether more records are available. Additional keys: not allowed |
count | JSON | Required within parent | |
count (anyOf 1) | integer | Alternative | Represents the total number of records returned in the current page. Format: int32 Minimum: 0 |
count (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
more_records | boolean | Required within parent | Indicates whether more records are available in subsequent pages. |
page | JSON | Required within parent | |
page (anyOf 1) | integer | Alternative | Represents the current page number of the paginated results. Format: int32 Minimum: 1 |
page (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
per_page | JSON | Required within parent | |
per_page (anyOf 1) | integer | Alternative | Represents the number of records returned per page. Format: int32 Maximum: 2000 Minimum: 1 |
per_page (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Related Records — request body — query filters value value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | Represents an equality filter criterion that dispatches to either the EqualFilterCriterionRequest or NotEqualFilterCriterionRequest schema based on the comparator value. |
$ (anyOf 1) | Model | Alternative | Expand Related Records — request body — query / filters / value / value / comparator: equal, type: merge field, pre defined, value, field |
$ (anyOf 2) | Model | Alternative | Expand Related Records — request body — query / filters / value / value / comparator: not equal, type: merge field, pre defined, value, field |
Referenced models: Related Records — request body — query / filters / value / value / comparator: equal, type: merge field, pre defined, value, field, Related Records — request body — query / filters / value / value / comparator: not equal, type: merge field, pre defined, value, field
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.getterritories. Catalog operation: getTerritories. 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.
No-content response statuses: [204]