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.

Note

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.

Request Details

Request URL

{api-domain}/crm/{version}/settings/territories

{api-domain}/crm/{version}/settings/territories/{territoryid}

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

Parameters

  • filters
    Filters parameter can be used to retrieve the territories details that you are searching for.
    eg:?filters={"field": {"api_name" : "manager.id"},"value":"431581000000278001" ,"comparator": "equal"}
    This can be used to find the territories whose manager is J Smith (whose user id is 431581000000278001 )
    Keys and comparators
    • Keys reporting_to.id, manager.id, id, permission_type, created_by, modified_by
      Comparators equal, not_equal
    • Key name
      Comparators equal, not_equal, ends_with, starts_with, contains, not_contains
    • Keys created_time, modified_time
      Comparators less_equal, between, greater_than, less_than, equal
  • ids

    Represents the unique ID of the territory to retrieve.

  • pageinteger, optional

    To get the list of records from the respective pages. Default value for page is 1.
    Possible values: Positive Integer values only.

  • per_pageinteger, optional

    To get the list of records available per page. The default and the maximum possible value is 200.
    Possible values: Positive Integer values only.

Note

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/v5/settings/territories"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-X GET
Copiedresponse = invokeurl
[
	url: "https://www.zohoapis.com/crm/v5/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.

  • managerJSON object

    Represents the name and ID of the current territory's manager.

  • account_rule_criteria JSON Object

    Represents the criteria for account module territory rules(comparator,field and value)

  • descriptionstring

    Represents the description of the territory, if any.

  • lead_rule_criteria JSON Object

    Represents the criteria for lead module territory rules(comparator,field and value)

  • reporting_tostring

    Represents the unique ID of the parent territory, if any.

  • deal_rule_criteria JSON Object

    Represents the criteria for deal module territory rules(comparator,field and value)

  • permission_type string

    Represents the type of permission for the territory. Possible values are read_only and read_write_delete.

  • modified_timestring

    Represents the date and time at which the current territory was last modified.

  • namestring

    Represents the name of the territory.

  • modified_byJSON object

    Represents the name and ID of the user who last modified the current territory.

  • idstring

    Represents the unique ID of the territory.

Note

If deal rule or lead rule is not enabled for your org then the key won't be present in the response

Possible Errors

  • 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.

  • 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.

  • 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.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in Server. Contact support team.

Sample Response

Copied{
    "territories": [
        {
            "created_time": "2023-02-02T15:54:53+05:30",
            "manager": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "account_rule_criteria": null,
            "description": "Organization Parent Territory",
            "lead_rule_criteria": null,
            "reporting_to": null,
            "deal_rule_criteria": null,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "permission_type": "read_only",
            "modified_time": "2023-06-10T12:13:13+05:30",
            "name": "Zoho",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "id": "431581000000272796"
        },
        {
            "created_time": "2023-06-10T12:17:53+05:30",
            "manager": {
                "name": "J Smith",
                "id": "431581000000278001"
            },
            "account_rule_criteria": {
                "comparator": "equal",
                "field": {
                    "api_name": "Billing_City",
                    "id": "431581000000000657"
                },
                "value": "Chennai"
            },
            "description": null,
            "lead_rule_criteria": null,
            "reporting_to": {
                "name": "Zoho",
                "id": "431581000000272796"
            },
            "deal_rule_criteria": null,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "permission_type": "read_write_delete",
            "modified_time": "2023-06-10T12:23:23+05:30",
            "name": "Chennai",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "id": "431581000000744113"
        },
        {
            "created_time": "2023-06-10T12:20:00+05:30",
            "manager": {
                "name": "J Smith",
                "id": "431581000000278001"
            },
            "account_rule_criteria": {
                "comparator": "equal",
                "field": {
                    "api_name": "Account_Site",
                    "id": "431581000000000649"
                },
                "value": "Chennai - South"
            },
            "description": null,
            "lead_rule_criteria": {
                "comparator": "equal",
                "field": {
                    "api_name": "City",
                    "id": "431581000000000931"
                },
                "value": "Chennai"
            },
            "reporting_to": {
                "name": "Chennai",
                "id": "431581000000744113"
            },
            "deal_rule_criteria": null,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "permission_type": "read_write_delete",
            "modified_time": "2023-06-10T12:23:16+05:30",
            "name": "Chennai-South",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "id": "431581000000744125"
        },
        {
            "created_time": "2023-06-10T12:23:02+05:30",
            "manager": {
                "name": "J Smith",
                "id": "431581000000278001"
            },
            "account_rule_criteria": {
                "comparator": "equal",
                "field": {
                    "api_name": "Account_Site",
                    "id": "431581000000000649"
                },
                "value": "Chennai-North"
            },
            "description": null,
            "lead_rule_criteria": null,
            "reporting_to": {
                "name": "Chennai",
                "id": "431581000000744113"
            },
            "deal_rule_criteria": null,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "permission_type": "read_write_delete",
            "modified_time": "2023-06-10T12:23:10+05:30",
            "name": "Chennai North",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "id": "431581000000744137"
        },
        {
            "created_time": "2023-06-10T12:27:29+05:30",
            "manager": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "account_rule_criteria": {
                "comparator": "equal",
                "field": {
                    "api_name": "Account_Type",
                    "id": "431581000000000617"
                },
                "value": "Competitor"
            },
            "description": null,
            "lead_rule_criteria": null,
            "reporting_to": {
                "name": "Zoho",
                "id": "431581000000272796"
            },
            "deal_rule_criteria": null,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "permission_type": "read_write_delete",
            "modified_time": "2023-06-10T12:27:29+05:30",
            "name": "Parent",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "id": "431581000000744159"
        },
        {
            "created_time": "2023-06-10T12:28:06+05:30",
            "manager": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "account_rule_criteria": {
                "comparator": "equal",
                "field": {
                    "api_name": "Industry",
                    "id": "431581000000000621"
                },
                "value": "Consulting"
            },
            "description": null,
            "lead_rule_criteria": null,
            "reporting_to": {
                "name": "Parent",
                "id": "431581000000744159"
            },
            "deal_rule_criteria": null,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "permission_type": "read_only",
            "modified_time": "2023-06-10T12:28:31+05:30",
            "name": "Child",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "id": "431581000000744169"
        },
        {
            "created_time": "2023-06-10T12:30:29+05:30",
            "manager": {
                "name": "J Smith",
                "id": "431581000000278001"
            },
            "account_rule_criteria": null,
            "description": null,
            "lead_rule_criteria": {
                "comparator": "equal",
                "field": {
                    "api_name": "City",
                    "id": "431581000000000931"
                },
                "value": "Chennai"
            },
            "reporting_to": {
                "name": "Zoho",
                "id": "431581000000272796"
            },
            "deal_rule_criteria": null,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "permission_type": "read_write_delete",
            "modified_time": "2023-06-10T12:30:29+05:30",
            "name": "Chennai Leads",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "id": "431581000000744183"
        }
    ],
    "info": {
        "per_page": 200,
        "count": 7,
        "page": 1,
        "more_records": false
    }
}