Territories API
Territory management helps you segregate CRM records based on customer attributes such as geography, company size, or industry. This makes it easy to share the relevant records with the right members of your sales team. Territory management allows you to automatically associate Accounts, Contacts, and Deals with territories to maximize revenue.
Users with Administrator profile can enable this feature in CRM UI.
Key Benefits
Avoid complex data-sharing structure - Organizations with complex sales structures can use territories to easily share records with users in different teams. It is also convenient to group records based on the account's characteristics rather than the individual ownership of the records.
Provide a focused work environment - Distribution of customer accounts by using territories help in creating focused work environments that ensures better sales force engagement. It also increases the sales teams' efficiency by reducing the travel time and increasing the industry expertise.
Get an accurate evaluation of the sales team's performance - Generate sales reports based on territories to evaluate and measure the efficiency of sales teams by territory. Also, get a better insight into the sales contribution of each territory.
Forecast sales for each territory and set clear goals - Create separate forecast targets for each territory a user belongs to. This will give a clear picture of the goals set for the different territories for users to stay focused.
Refer to Use Territories to learn more about territory management.
Territories API
Purpose
To get the list of territories enabled for your organization.
Endpoints
Request Details
Request URL
{api-domain}/crm/{version}/settings/territories
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoCRM.settings.territories.{operation_type}
Possible operation types
ALL - Full access to territories data
READ - Read territories data
To fetch records from a territory-supported module, use the parameters "territory_id" and "include_child" in the request. Refer to Get List of Records for more details.
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v4/settings/territories"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-X GET
Copiedresponse = invokeurl
[
url: "https://www.zohoapis.com/crm/v4/settings/territories"
type: GET
connection:"crm_oauth_connection"
];
info response;
Response JSON Keys
- created_timestring
Represents the date and time at which the current territory was created.
- modified_timestring
Represents the date and time at which the current territory was last modified.
- managerJSON object
Represents the name and ID of the current territory's manager.
- parent_idstring
Represents the unique ID of the parent territory, if any.
- criteriaJSON object
Represents the territory criteria details.
- namestring
Represents the name of the territory.
- modified_byJSON object
Represents the name and ID of the user who last modified the current territory.
- descriptionstring
Represents the description of the territory, if any.
- idstring
Represents the unique ID of the territory.
- created_byJSON object
Represents the name and ID of the user who created the current territory.
Possible Errors
- INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section above. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: Client does not have ZohoCRM.settings.territories.READ scope. Create a new client with valid scope. Refer to scope section above. - NO_PERMISSIONHTTP 403
Permission denied to read
Resolution: The user does not have permission to read territories data. Contact your system administrator. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact support team. - INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above. - AUTHORIZATION_FAILEDHTTP 400
User does not have sufficient privilege to read territories
Resolution: The user does not have the permission to retrieve territories data. Contact your system administrator.
Sample Response
Copied{
"territories": [
{
"created_time": "2019-04-09T21:57:50-11:00",
"permission_type": "read_only",
"modified_time": "2019-04-09T21:57:50-11:00",
"manager": {
"name": "Patricia Boyle",
"id": "554023000000235011"
},
"account_rule_criteria": null,
"name": "Zoho",
"modified_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
},
"description": "Organization Parent Territory",
"id": "554023000000430341",
"reporting_to": null,
"deal_rule_criteria": null,
"created_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
}
},
{
"created_time": "2019-04-09T22:02:42-11:00",
"permission_type": "read_write_delete",
"modified_time": "2019-04-25T18:54:31-11:00",
"manager": {
"name": "Smith",
"id": "554023000000314027"
},
"account_rule_criteria": {
"comparator": "equal",
"field": {
"api_name": "Billing_City",
"id": "554023000000000419"
},
"value": "Chennai"
},
"name": "Chennai",
"modified_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
},
"description": null,
"id": "554023000000430409",
"reporting_to": {
"name": "Zoho",
"id": "554023000000430341"
},
"deal_rule_criteria": null,
"created_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
}
},
{
"created_time": "2019-04-09T22:47:43-11:00",
"permission_type": "read_write_delete",
"modified_time": "2019-04-09T22:47:43-11:00",
"manager": {
"name": "Smith",
"id": "554023000000314027"
},
"account_rule_criteria": {
"comparator": "equal",
"field": {
"api_name": "Account_Site",
"id": "554023000000121003"
},
"value": "Chennai - South"
},
"name": "Chennai-South",
"modified_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
},
"description": null,
"id": "554023000000430451",
"reporting_to": {
"name": "Chennai",
"id": "554023000000430409"
},
"deal_rule_criteria": null,
"created_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
}
},
{
"created_time": "2019-04-10T22:07:08-11:00",
"permission_type": "read_write_delete",
"modified_time": "2019-04-25T19:02:15-11:00",
"manager": {
"name": "Smith",
"id": "554023000000314027"
},
"account_rule_criteria": {
"comparator": "equal",
"field": {
"api_name": "Account_Site",
"id": "554023000000121003"
},
"value": "Chennai-North"
},
"name": "Chennai-North",
"modified_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
},
"description": null,
"id": "554023000000439130",
"reporting_to": {
"name": "Chennai",
"id": "554023000000430409"
},
"deal_rule_criteria": null,
"created_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
}
},
{
"created_time": "2019-04-25T20:16:36-11:00",
"permission_type": "read_write_delete",
"modified_time": "2019-04-25T20:16:36-11:00",
"manager": {
"name": "Smith",
"id": "554023000000314027"
},
"account_rule_criteria": {
"comparator": "equal",
"field": {
"api_name": "Account_Type",
"id": "554023000000000393"
},
"value": "Competitor"
},
"name": "Parent",
"modified_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
},
"description": null,
"id": "554023000000504107",
"reporting_to": {
"name": "Zoho",
"id": "554023000000430341"
},
"deal_rule_criteria": null,
"created_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
}
},
{
"created_time": "2019-04-25T20:17:26-11:00",
"permission_type": "read_write_delete",
"modified_time": "2019-04-25T20:17:26-11:00",
"manager": null,
"account_rule_criteria": {
"comparator": "equal",
"field": {
"api_name": "Industry",
"id": "554023000000000397"
},
"value": "Consulting"
},
"name": "Child",
"modified_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
},
"description": null,
"id": "554023000000504117",
"reporting_to": {
"name": "Parent",
"id": "554023000000504107"
},
"deal_rule_criteria": null,
"created_by": {
"name": "Patricia Boyle",
"id": "554023000000235011"
}
}
],
"info": {
"per_page": 200,
"count": 6,
"page": 1,
"more_records": false
}
}