Associate Users with Territory

Purpose

To associate users with a territory in your Zoho CRM organization.

Endpoints

  • PUT /settings/territories/{territory_ID}/users
  • PUT /settings/territories/{territory_ID}/users/{user_ID}

Request Details

Request URL

To associate multiple users with a territory in your Zoho CRM organization.
{api-domain}/crm/{version}/settings/territories/{territory_ID}/users

To associate a specific user with a territory in your Zoho CRM organization.
{api-domain}/crm/{version}/settings/territories/{territory_ID}/users/{user_ID}

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.settings.territories.All
(and)
ZohoCRM.users.All

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/territories/431581000000744113/users"
-X PUT
-d "@addusertoterritories.json"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

In the request, "@addusertoterritories.json" contains the sample input.

Input JSON

  • users JSON Array (Mandatory if user id is not given in the request URL)

    Represents the unique ID of the user you want to associate with the territory.This can be obtained from Get Users API

Note

A single user can be associate with the territory directly through the URL with the end point {api-domain}/crm/{version}/settings/territories/{territory_ID}/users/{user_ID}

Sample Request

Copied{
  "users": 
  [
    {
      "id": "431581000000258001"
    }
  ]
}

Possible Errors

  • ALREADY_EXISTS HTTP 400

    User Already exists in this Territory.

    Resolution: Check the ID of the user you wish to associate.

  • LIMIT_EXCEEDED HTTP 400

    Maximum Users Limit reached for a territory.

    Resolution: Check the Territory users limit.Note that manager is also considered as a user.

  • INVALID_DATA HTTP 400
    • The user you are trying to associate is an inactive user.
    • Invalid user id
    • Deleted user

    Resolution: Refer to the "details" key in the response for the API name of the field that has the error in the input.

Sample Response

Copied{
    "users": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "431581000000258001"
            },
            "message": "Given User added to the mentioned territory Successfully",
            "status": "success"
        }
    ]
}