Zoho: Get territory by ID
Zoho territories.getTerritoryById: arguments, response, policy and SDK examples.
← Territories operations · Get started
Operation zoho.getterritorybyid
Provider route: GET /crm/v8/settings/territories/{id}. 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"]["getTerritoryById"]>[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.getTerritoryById(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_territory_by_id(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.id | string | Required within parent | Represents the list of Territory Id. Provide the ID of the territory. Use the [Ger Territories API](territories.yaml#$.paths./settings/territories.get) to get the valid values. Format: int64 |
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.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 |
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 territory by ID — response body — territories |
$ (anyOf 2) | null | Alternative |
Referenced models: Get territory by ID — response body — territories
Schemas
Section titled “Schemas”14 more schemas are linked from the tables above, on the schema pages.
Get territory by ID — response body — territories
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the response returned when retrieving a territory by its unique ID. Additional keys: not allowed |
territories | array | Required within parent | Represents the list of territory objects returned for the specified ID. Maximum items: 1 Minimum items: 1 |
territories[] | Model | Each item | Expand Get territory by ID — response body — territories territories item Individual territory object. |
Referenced models: Get territory by ID — response body — territories territories item
Get territory by ID — response body — territories territories item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a single territory record returned by the API. Additional keys: not allowed |
account_rule_criteria | JSON | Optional | Represents the criteria used to auto-assign accounts to the territory. |
account_rule_criteria (anyOf 1) | Model | Alternative | Expand Get territory by ID — response body — territories territories item deal rule criteria value |
account_rule_criteria (anyOf 2) | Model | Alternative | Expand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or |
account_rule_criteria (anyOf 3) | null | Alternative | Represents the absence of an account rule criteria for the territory. Must equal: null |
api_name | string | Required within parent | Represents the unique API name of the territory used in API requests. Maximum length: 100 |
created_by | object | Required within parent | Represents the user who created the territory. Additional keys: not allowed |
created_by.id | string | Required within parent | Represents the unique identifier of the user who created the territory. Format: int64 |
created_by.name | string | Required within parent | Represents the display name of the user who created the territory. Maximum length: 100 |
created_time | string | Required within parent | Represents the date and time the territory record took effect, in ISO 8601 format. Format: date-time |
deal_rule_criteria | JSON | Optional | Represents the criteria used to auto-assign deals to the territory. |
deal_rule_criteria (anyOf 1) | Model | Alternative | Expand Get territory by ID — response body — territories territories item deal rule criteria value |
deal_rule_criteria (anyOf 2) | Model | Alternative | Expand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or |
deal_rule_criteria (anyOf 3) | null | Alternative | Represents the absence of a deal rule criteria for the territory. Must equal: null |
description | JSON | Required within parent | |
description (anyOf 1) | null | Alternative | Represents the absence of a description for the territory. Must equal: null |
description (anyOf 2) | string | Alternative | Represents the description of the territory. Maximum length: 250 |
id | string | Required within parent | Represents the unique identifier of the territory. Format: int64 |
lead_rule_criteria | JSON | Optional | Represents the criteria used to auto-assign leads to the territory. |
lead_rule_criteria (anyOf 1) | Model | Alternative | Expand Get territory by ID — response body — territories territories item deal rule criteria value |
lead_rule_criteria (anyOf 2) | Model | Alternative | Expand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or |
lead_rule_criteria (anyOf 3) | null | Alternative | Represents the absence of a lead rule criteria for the territory. Must equal: null |
manager | JSON | Required within parent | |
manager (anyOf 1) | object | Alternative | Represents a territory manager identified by user ID. Additional keys: not allowed |
manager (anyOf 1).id | string | Required within parent | Represents the unique identifier of the territory manager. Format: int64 |
manager (anyOf 1).name | string | Required within parent | Represents the display name of the territory manager. Maximum length: 100 |
manager (anyOf 1).status | string | Optional | Represents the current status of the territory manager. Possible values: **deleted**, **rejected**, **active**, **closed**, **disabled**. Known values: deleted, rejected, active, closed, disabled |
manager (anyOf 1).zuid | string | Optional | Represents the Zoho User ID (ZUID) of the territory manager. Format: int32 |
manager (anyOf 2) | null | Alternative | Represents the absence of a territory manager. Must equal: null |
modified_by | object | Required within parent | Represents the user who last modified the territory. Additional keys: not allowed |
modified_by.id | string | Required within parent | Represents the unique identifier of the user who last modified the territory. Format: int64 |
modified_by.name | string | Required within parent | Represents the display name of the user who last modified the territory. Maximum length: 100 |
modified_time | string | Required within parent | Represents the date and time when the territory was last modified, in ISO 8601 format. Format: date-time |
name | string | Required within parent | Represents the display name of the territory. Maximum length: 50 |
permission_type | string | Required within parent | Represents the access permission for users in this territory. Possible values: **read_write_delete**, **read_only**. Known values: read_write_delete, read_only |
reporting_to | JSON | Required within parent | |
reporting_to (anyOf 1) | object | Alternative | Represents the parent territory to which this territory reports in the hierarchy. Additional keys: not allowed |
reporting_to (anyOf 1).id | string | Required within parent | Represents the unique identifier of the parent territory. Format: int64 |
reporting_to (anyOf 1).name | string | Required within parent | Represents the display name of the parent territory. Maximum length: 100 |
reporting_to (anyOf 2) | null | Alternative | Represents the absence of a parent territory for this territory. Must equal: null |
Referenced models: Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or, Get territory by ID — response body — territories territories item deal rule criteria value
Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the grouped filter criterion returned in the response, containing multiple filter conditions evaluated with a logical operator. Supports recursive nesting for complex filtering logic. Additional keys: not allowed |
$disrupted | boolean | Optional | Indicates whether the grouped filter criterion is in a disrupted state, typically due to an invalid or unresolvable condition within the group. |
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 Get territory by ID — response body — territories territories item deal rule criteria value |
group[] (anyOf 2) | Model | Alternative | Expand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / 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. Known values: AND, OR, and, or |
Referenced models: Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or, Get territory by ID — response body — territories territories item deal rule criteria value
Get territory by ID — response body — territories territories item deal rule criteria value value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | Represents the response for an equality filter criterion that dispatches to either the EqualFilterCriterionResponse or NotEqualFilterCriterionResponse schema based on the comparator value. |
$ (anyOf 1) | Model | Alternative | Expand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / value / value / comparator: equal, type: merge field, value, pre defined, field |
$ (anyOf 2) | Model | Alternative | Expand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / value / value / comparator: not equal, type: merge field, value, pre defined, field |
Referenced models: Get territory by ID — response body — territories / territories / item / deal_rule_criteria / value / value / comparator: equal, type: merge field, value, pre defined, field, Get territory by ID — response body — territories / territories / item / deal_rule_criteria / value / value / comparator: not equal, type: merge field, value, pre defined, field
Get territory by ID — response body — territories / territories / item / deal_rule_criteria / value / comparator: less than, less equal, greater than, greater equal, type: merge field, pre defined, value, field value value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | number | Alternative | Represents a numeric filter criterion value applicable to fields with a data_type of integer, currency, or double. |
$ (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.getterritorybyid. Catalog operation: getTerritoryById. 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]