Zoho: Update territories
Zoho territories.updateTerritories: arguments, response, policy and SDK examples.
← Territories operations · Get started
Operation zoho.updateterritories
Provider route: PUT /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"]["updateTerritories"]>[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.updateTerritories(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.update_territories(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | object | Required within parent | Specify the territories to update. Additional keys: not allowed |
body.territories | array | Required within parent | Specify the list of territories to update. Maximum items: 100 Minimum items: 1 |
body.territories[] | object | Each item | Specify the details of each territory to update. Additional keys: not allowed |
body.territories[].account_rule_criteria | JSON | Optional | Specify the account rule criteria for the territory. Use a criteria object or a group criteria object to define the conditions. Set to null to remove the existing criteria. |
body.territories[].account_rule_criteria (anyOf 1) | Model | Alternative | Expand Related Records — request body — query filters value |
body.territories[].account_rule_criteria (anyOf 2) | Model | Alternative | Expand Related Records — request body — query / filters / group_operator: AND, OR, and, or |
body.territories[].account_rule_criteria (anyOf 3) | null | Alternative | Represents a null value that removes the account rule criteria from the territory. Must equal: null |
body.territories[].deal_rule_criteria | JSON | Optional | Specify the deal rule criteria for the territory. Use a criteria object or a group criteria object to define the conditions. Set to null to remove the existing criteria. |
body.territories[].deal_rule_criteria (anyOf 1) | Model | Alternative | Expand Related Records — request body — query filters value |
body.territories[].deal_rule_criteria (anyOf 2) | Model | Alternative | Expand Related Records — request body — query / filters / group_operator: AND, OR, and, or |
body.territories[].deal_rule_criteria (anyOf 3) | null | Alternative | Represents a null value that removes the deal rule criteria from the territory. Must equal: null |
body.territories[].description | string or null | Optional | Specify the description of the territory. Maximum length: 250 |
body.territories[].id | string | Required within parent | Specify the unique ID of the territory to update. Format: int64 |
body.territories[].lead_rule_criteria | JSON | Optional | Specify the lead rule criteria for the territory. Use a criteria object or a group criteria object to define the conditions. Set to null to remove the existing criteria. |
body.territories[].lead_rule_criteria (anyOf 1) | Model | Alternative | Expand Related Records — request body — query filters value |
body.territories[].lead_rule_criteria (anyOf 2) | Model | Alternative | Expand Related Records — request body — query / filters / group_operator: AND, OR, and, or |
body.territories[].lead_rule_criteria (anyOf 3) | null | Alternative | Represents a null value that removes the lead rule criteria from the territory. Must equal: null |
body.territories[].manager | JSON | Optional | |
body.territories[].manager (anyOf 1) | object | Alternative | Specify the manager of this territory by providing the user’s unique ID. Additional keys: not allowed |
body.territories[].manager (anyOf 1).id | string | Required within parent | Specify the unique ID of the user to assign as the manager of this territory. Maximum length: 19 |
body.territories[].manager (anyOf 2) | null | Alternative | Specify null to remove the manager from this territory. Must equal: null |
body.territories[].name | string | Optional | Specify the name of the territory. Maximum length: 50 |
body.territories[].permission_type | string | Optional | Specify the permission type for the territory. Possible values: read_write_delete - Grants full access to the territory, including read, write, and delete operations. read_only - Restricts users to read-only access for the territory. One of: read_write_delete, read_only |
body.territories[].reporting_to | JSON | Optional | |
body.territories[].reporting_to (anyOf 1) | object | Alternative | Specify the parent territory of this territory by providing its unique ID. Additional keys: not allowed |
body.territories[].reporting_to (anyOf 1).id | string | Required within parent | Specify the unique ID of the parent territory. Format: int64 |
body.territories[].reporting_to (anyOf 2) | null | Alternative | Specify null when this territory has no parent territory. Must equal: null |
Referenced models: Related Records — request body — query / filters / group_operator: AND, OR, and, or, Related Records — request body — query filters value
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 |
|---|---|---|---|
$ | Model | Root | Expand Update territories — response body |
Referenced models: Update territories — response body
Schemas
Section titled “Schemas”11 more schemas are linked from the tables above, on the schema pages.
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
Update territories — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the response returned when one or more territories are successfully updated. Additional keys: not allowed |
territories | array | Required within parent | Represents the list of territory objects updated by the request. Maximum items: 100 Minimum items: 1 |
territories[] | object | Each item | Represents the error details for a single territory update operation. Additional keys: not allowed |
territories[].code | string | Required within parent | Represents the result code for the territory update. Possible values: **SUCCESS**. Known values: SUCCESS |
territories[].details | object | Required within parent | Represents additional details about the updated territory, including its unique identifier. Additional keys: not allowed |
territories[].details.id | string | Required within parent | Represents the unique identifier of the updated territory. Format: int64 |
territories[].message | string | Required within parent | Represents the success message returned for the territory update. Possible values: **Territory Updated Successfully**. Known values: Territory Updated Successfully Maximum length: 100 |
territories[].status | string | Required within parent | Represents the status of the territory update operation. Possible values: **success**. Known values: success |
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
Related Records — request body — query / filters / value / comparator: between, not between, type: merge field, pre defined, value, field
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a filter criterion for the between and not_between comparators. The value must be an array of exactly two elements — [lower_bound, upper_bound]. The value type is determined by the field's data_type: use SimpleFilterCriterionValueString for date or datetime fields, and SimpleFilterCriterionValueNumber for integer, currency, or double fields. Resolve the data_type from the field's FieldSchema. For formula fields, use formula.return_type as the effective data_type; for rollup_summary fields, use rollup_summary.return_type. Additional keys: not allowed |
comparator | string | Required within parent | Represents the range comparison operator applied to the criterion, indicating whether the field value falls within or outside the specified bounds. Possible values: between - Matches records where the field value falls within the specified range. not_between - Matches records where the field value falls outside the specified range. One of: between, not_between |
field | JSON | Required within parent | Represents the target field definition to which the range filter criterion is applied, conforming to the base field structure. |
field (allOf 1) | Model | All variants apply | Expand Related Records — request body — query / filters / value / comparator: in, not in, type: merge field, pre defined, value, field field api name, id |
field (allOf 2) | object | All variants apply | Represents the field reference constraint that requires the api_name property to be present for the range filter criterion. Additional keys: allowed |
type | string | Optional | Indicates the value resolution mode of the criterion, distinguishing whether the filter value is a literal value, a merge field reference, a predefined system variable, or another field reference. Possible values: value - The value is a direct literal. merge_field - The value is a merge field reference. pre_defined - The value is a predefined system variable placeholder. field - The value references another field. Default: value One of: merge_field, pre_defined, value, field |
value | array | Required within parent | Contains the two boundary values — [lower_bound, upper_bound] — against which the field is evaluated for the between or not_between comparator. Maximum items: 2 Minimum items: 2 |
value[] | JSON | Each item | |
value[] (anyOf 1) | string | Alternative | Represents a string filter criterion value applicable to fields with a data_type of text, textarea, email, phone, website, autonumber, picklist, multiselectpicklist, date, or datetime, as well as any data_type not explicitly covered by SimpleFilterCriterionValueNumber, SimpleFilterCriterionValueBoolean, SimpleFilterCriterionValueObjectRequest, SimpleFilterCriterionValueObjectResponse, or the multiselect lookup value schemas. Maximum length: 255 |
value[] (anyOf 2) | number | Alternative | Represents a numeric filter criterion value applicable to fields with a data_type of integer, currency, or double. |
Referenced models: Related Records — request body — query / filters / value / comparator: in, not in, type: merge field, pre defined, value, field field api name, id
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.updateterritories. Catalog operation: updateTerritories. 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.