Delink and Transfer Records

Purpose

To delink a user from the territory and assign the open records to the user of another territory.

Request Details

Request URL

To delink and transfer from all territories: {api-domain}/crm/{version}/users/{id}/territories/actions/transfer_and_delink
To delink and transfer from a specific territory: {api-domain}/crm/{version}/users/{id}/territories/{territory_id}/actions/transfer_and_delink

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.users.{operation_type}
(or)
scope=ZohoCRM.settings.territories.{operation_type}

Possible operation types

ALL - Full access to the record
UPDATE - Update records in the module

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v3/users/3652397000000281001/territories/actions/transfer_and_delink"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@updateuserterritory.json"
-X PUT

Input JSON Key

  • idstring, mandatory

    Represents the unique ID of the territory that you want to transfer the open records from.

  • transfer_to_userJSON object, mandatory

    Represents the unique ID of the new user that you want to transfer the open records to.

Sample Input

Copied{
    "transfer_and_delink": [
        {
            "id": "3652397000007612015",
            "transfer_to_user": {
                "id": "3652397000000186017"
            }
        }
    ]
}

Possible Errors

  • INVALID_DATAHTTP 400

    You have specified an invalid ID for territory or the user in the input.
    Resolution: Use the Get Territories API to get the unique IDs of the territories and the Get Users API for the user ID.

  • DEPENDENT_FIELD_MISSINGHTTP 400

    You have not specified the user's details you want to transfer the open records to.
    Resolution: You must specify the user's details in the "transfer_to_user" JSON object.

  • MANDATORY_NOT_FOUNDHTTP 400

    You have not specified the "transfer_and_delink" array in the input body.
    Resolution: "transfer_and_delink" is the root element of the input body for this API.

  • CANNOT_DELINKHTTP 400

    You have specified the territory's manager's ID in the input.
    Resolution: You cannot delink and transfer the records in a territory from the manager of that territory.

  • NOT_ALLOWEDHTTP 400

    Logged in users cannot update or delink their own territories.

  • NOT_ALLOWEDHTTP 400

    The user IDs of the new and existing territories are the same.

  • INVALID_DATAHTTP 400

    The user is invalid.
    Resolution: You can only delink and transfer records to an active CRM user.

  • INVALID_DATAHTTP 400

    Parent Territory cannt be associated with the user
    Resolution: You cannot delink and transfer records from the parent territory.

  • INVALID_DATAHTTP 400

    Territory ID is not linked with the user
    Resolution: The user is not a part of the territory you want to transfer records to.

Sample Response

Copied{
    "transfer_and_delink": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "3652397000007612015"
            },
            "message": "Territory is delinked from user successfully",
            "status": "success"
        }
    ]
}