Skip to content

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.

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 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.territories.get_territory_by_id(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.idstringRequired within parentRepresents 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
queryobjectOptionalAdditional keys: not allowed
query.includestringOptionalThe 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_detailsstringOptionalProvide whether additional details has to be included in the response.
One of: manager.zuid,manager.status, manager.zuid, manager.status

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 territory by ID — response body — territories
$ (anyOf 2)nullAlternative

Referenced models: Get territory by ID — response body — territories

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

Get territory by ID — response body — territories
FieldTypePresenceDescription and constraints
$objectRootRepresents the response returned when retrieving a territory by its unique ID.
Additional keys: not allowed
territoriesarrayRequired within parentRepresents the list of territory objects returned for the specified ID.
Maximum items: 1
Minimum items: 1
territories[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRootRepresents a single territory record returned by the API.
Additional keys: not allowed
account_rule_criteriaJSONOptionalRepresents the criteria used to auto-assign accounts to the territory.
account_rule_criteria (anyOf 1)ModelAlternativeExpand Get territory by ID — response body — territories territories item deal rule criteria value
account_rule_criteria (anyOf 2)ModelAlternativeExpand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or
account_rule_criteria (anyOf 3)nullAlternativeRepresents the absence of an account rule criteria for the territory.
Must equal: null
api_namestringRequired within parentRepresents the unique API name of the territory used in API requests.
Maximum length: 100
created_byobjectRequired within parentRepresents the user who created the territory.
Additional keys: not allowed
created_by.idstringRequired within parentRepresents the unique identifier of the user who created the territory.
Format: int64
created_by.namestringRequired within parentRepresents the display name of the user who created the territory.
Maximum length: 100
created_timestringRequired within parentRepresents the date and time the territory record took effect, in ISO 8601 format.
Format: date-time
deal_rule_criteriaJSONOptionalRepresents the criteria used to auto-assign deals to the territory.
deal_rule_criteria (anyOf 1)ModelAlternativeExpand Get territory by ID — response body — territories territories item deal rule criteria value
deal_rule_criteria (anyOf 2)ModelAlternativeExpand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or
deal_rule_criteria (anyOf 3)nullAlternativeRepresents the absence of a deal rule criteria for the territory.
Must equal: null
descriptionJSONRequired within parent
description (anyOf 1)nullAlternativeRepresents the absence of a description for the territory.
Must equal: null
description (anyOf 2)stringAlternativeRepresents the description of the territory.
Maximum length: 250
idstringRequired within parentRepresents the unique identifier of the territory.
Format: int64
lead_rule_criteriaJSONOptionalRepresents the criteria used to auto-assign leads to the territory.
lead_rule_criteria (anyOf 1)ModelAlternativeExpand Get territory by ID — response body — territories territories item deal rule criteria value
lead_rule_criteria (anyOf 2)ModelAlternativeExpand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or
lead_rule_criteria (anyOf 3)nullAlternativeRepresents the absence of a lead rule criteria for the territory.
Must equal: null
managerJSONRequired within parent
manager (anyOf 1)objectAlternativeRepresents a territory manager identified by user ID.
Additional keys: not allowed
manager (anyOf 1).idstringRequired within parentRepresents the unique identifier of the territory manager.
Format: int64
manager (anyOf 1).namestringRequired within parentRepresents the display name of the territory manager.
Maximum length: 100
manager (anyOf 1).statusstringOptionalRepresents the current status of the territory manager. Possible values: **deleted**, **rejected**, **active**, **closed**, **disabled**.
Known values: deleted, rejected, active, closed, disabled
manager (anyOf 1).zuidstringOptionalRepresents the Zoho User ID (ZUID) of the territory manager.
Format: int32
manager (anyOf 2)nullAlternativeRepresents the absence of a territory manager.
Must equal: null
modified_byobjectRequired within parentRepresents the user who last modified the territory.
Additional keys: not allowed
modified_by.idstringRequired within parentRepresents the unique identifier of the user who last modified the territory.
Format: int64
modified_by.namestringRequired within parentRepresents the display name of the user who last modified the territory.
Maximum length: 100
modified_timestringRequired within parentRepresents the date and time when the territory was last modified, in ISO 8601 format.
Format: date-time
namestringRequired within parentRepresents the display name of the territory.
Maximum length: 50
permission_typestringRequired within parentRepresents the access permission for users in this territory. Possible values: **read_write_delete**, **read_only**.
Known values: read_write_delete, read_only
reporting_toJSONRequired within parent
reporting_to (anyOf 1)objectAlternativeRepresents the parent territory to which this territory reports in the hierarchy.
Additional keys: not allowed
reporting_to (anyOf 1).idstringRequired within parentRepresents the unique identifier of the parent territory.
Format: int64
reporting_to (anyOf 1).namestringRequired within parentRepresents the display name of the parent territory.
Maximum length: 100
reporting_to (anyOf 2)nullAlternativeRepresents 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
FieldTypePresenceDescription and constraints
$objectRootRepresents 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
$disruptedbooleanOptionalIndicates whether the grouped filter criterion is in a disrupted state, typically due to an invalid or unresolvable condition within the group.
grouparrayRequired within parentContains an array of filter conditions grouped together and evaluated with the specified logical operator.
Maximum items: 25
Minimum items: 2
group[]JSONEach item
group[] (anyOf 1)ModelAlternativeExpand Get territory by ID — response body — territories territories item deal rule criteria value
group[] (anyOf 2)ModelAlternativeExpand Get territory by ID — response body — territories / territories / item / deal_rule_criteria / group_operator: AND, OR, and, or
group_operatorstringRequired within parentRepresents 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
FieldTypePresenceDescription and constraints
$JSONRootRepresents the response for an equality filter criterion that dispatches to either the EqualFilterCriterionResponse or NotEqualFilterCriterionResponse schema based on the comparator value.
$ (anyOf 1)ModelAlternativeExpand 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)ModelAlternativeExpand 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
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)numberAlternativeRepresents a numeric filter criterion value applicable to fields with a data_type of integer, currency, or double.
$ (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

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]

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.