Zoho: Remove territories from a record
Zoho territories.removeTerritoriesFromRecord: arguments, response, policy and SDK examples.
← Territories operations · Get started
Operation zoho.removeterritoriesfromrecord
Provider route: POST /crm/v8/{module}/{record}/actions/remove_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"]["removeTerritoriesFromRecord"]>[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.removeTerritoriesFromRecord(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.remove_territories_from_record(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.record | string | Required within parent | The unique ID of the record, of type string. Use the [Get Records API](record.yaml#$.paths./{module}.get) to get the valid values. Format: int64 |
path.module | string | Required within parent | The API name of the CRM module, of type string. use the [Get Modules API](modules.yaml#$.paths/settings/modules.get) to get the valid values. Maximum length: 100 |
body | object | Required within parent | Specify the territories and the record from which they are to be removed. Additional keys: not allowed |
body.data | array | Required within parent | Specify the list of records and their associated territories to remove from the record. Maximum items: 1 Minimum items: 1 |
body.data[] | object | Each item | Specify the record and its associated territories to remove. Additional keys: not allowed |
body.data[].Territories | array | Required within parent | Specify the list of territories to remove from the record. Maximum items: 100 Minimum items: 1 |
body.data[].Territories[] | object | Each item | Specify a territory object containing the unique territory ID to remove from the record. Additional keys: not allowed |
body.data[].Territories[].id | string | Required within parent | Specify the unique ID of the territory to remove from the record. Format: int64 |
body.data[].id | string | Optional | Specify the unique ID of the record from which to remove territories. Format: int64 |
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 Remove territories from a record — response body — data |
$ (anyOf 2) | JSON | Alternative | Returns a scheduled or synchronous response when territories are removed from a record. |
$ (anyOf 2) (anyOf 1) | Model | Alternative | Expand Remove territories from a record — response body — value data |
$ (anyOf 2) (anyOf 2) | Model | Alternative | Expand Remove territories from a record — response body — data |
Referenced models: Remove territories from a record — response body — value data, Remove territories from a record — response body — data
Schemas
Section titled “Schemas”Remove territories from a record — response body — value data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the response returned when a single-record territory removal job has been scheduled. Additional keys: not allowed |
data | array | Required within parent | Represents the list of scheduled territory removal results. Maximum items: 1 Minimum items: 1 |
data[] | Model | Each item | Expand Remove territories from a record — response body — value data data item |
Referenced models: Remove territories from a record — response body — value data data item
Remove territories from a record — response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the response returned when territories are successfully removed from a record. Additional keys: not allowed |
data | array | Required within parent | Represents the list of territory removal results for the records. Maximum items: 1 Minimum items: 1 |
data[] | Model | Each item | Expand Remove territories from a record — response body — data data item |
Referenced models: Remove territories from a record — response body — data data item
Remove territories from a record — response body — value data data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the error details for a single scheduled territory removal operation. Additional keys: not allowed |
code | string | Required within parent | Represents the result code for the scheduled territory removal. Possible values: **SCHEDULED**. Known values: SCHEDULED |
details | Model | Required within parent | Expand Remove territories from a record — response body — value data data item details |
message | string | Required within parent | Represents the success message returned when the territory removal is scheduled. Possible values: **Territory removal process scheduled successfully**. Known values: Territory removal process scheduled successfully |
status | string | Required within parent | Represents the status of the scheduled territory removal operation. Possible values: **success**. Known values: success |
Referenced models: Remove territories from a record — response body — value data data item details
Remove territories from a record — response body — data data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the error details for a single territory removal operation. Additional keys: not allowed |
code | string | Required within parent | Represents the result code for the territory removal. Possible values: **SUCCESS**. Known values: SUCCESS |
details | object | Required within parent | Represents additional details about the territory removal, including the record identifier. Additional keys: not allowed |
details.id | string | Required within parent | Represents the unique identifier of the record from which territories were removed. Format: int64 |
message | string | Required within parent | Represents the success message returned for the territory removal. Possible values: **the territories data removed successfully**. Known values: the territories data removed successfully |
status | string | Required within parent | Represents the status of the territory removal operation. Possible values: **success**. Known values: success |
Remove territories from a record — response body — value data data item details
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents additional details about the scheduled territory removal, including the record and job identifiers. Additional keys: not allowed |
id | string | Required within parent | Represents the unique identifier of the record for which territory removal was scheduled. Format: int64 |
job_id | string | Required within parent | Represents the unique identifier of the scheduled territory removal job. Format: int64 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.removeterritoriesfromrecord. Catalog operation: removeTerritoriesFromRecord. 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.