Remove Tags from Records

Purpose

To delete the tags associated with records.

Request Details

Request URL

{api-domain}/crm/{version}/{module_api_name}/actions/remove_tags

To remove tags from a specific record:
{api-domain}/crm/{version}/{module_api_name}/{record_id}/actions/remove_tags

Supported modules

Leads, Accounts, Contacts, Deals, Campaigns, Tasks, Cases, Events, Calls, Solutions, Products, Vendors, Price Books, Quotes, Sales Orders, Purchase Orders, Invoices, Custom, and Activities

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.modules.ALL
(or)
scope=ZohoCRM.modules.{module_name}.{operation_type}

Possible module names

leads, accounts, contacts, deals, campaigns, tasks, cases, events, calls, solutions, products, vendors, pricebooks, quotes, salesorders, purchaseorders, invoices, and custom

Possible operation types

ALL - Full access to the record
WRITE - Edit records in the module

Input JSON

  • tagsJSON Object, mandatory

    Specify the names of the tags you want to remove from the record.

  • idsJSON Array, mandatory when removing tags from multiple records

    Specify comma separated records IDs from which the tags must be removed.

Sample Request to Remove Multiple Tags from Multiple Records

Copiedcurl "https://www.zohoapis.com/crm/v4/Leads/actions/remove_tags"
-X POST
-d @input.json
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Copiedtag1 = Map();
tag1.put("name","Prime");
tag2 = Map();
tag2.put("name","Attend First");
tags_list = List();
tags_list.add(tag1);
tags_list.add(tag2);
param = Map();
param.put("tags",tags_list);
recordIDs = List();
recordIDs.add('554023000002365002');
recordIDs.add('554023000001736019');
param.put("ids",recordIDs);

res = invokeurl
[
	url :"https://www.zohoapis.com/crm/v4/Leads/actions/remove_tags"
	type :POST
	parameters: param.toString()
	connection:"zohooauth"
];

Sample Input

Copied{
    "tags": [
        {
            "name": "Prime"
        },
        {
            "name": "Attend First"
        }
    ],
    "ids": [
        "554023000000793002",
        "554023000000792001"
    ]
}

Sample Response

Copied{
    "data": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "554023000000793002",
                "tags": [
                    {
                        "name": "Nurture",
                        "id": "554023000002555018",
                        "color_code": "#57B1FD"
                    }
                ]
            },
            "message": "tags updated successfully",
            "status": "success"
        },
        {
            "code": "SUCCESS",
            "details": {
                "id": "554023000000792001",
                "tags": [
                    {
                        "name": "Nurturing Lead",
                        "id": "554023000002172011",
                        "color_code": "#57B1FD"
                    },
                    {
                        "name": "web",
                        "id": "554023000001180007",
                        "color_code": null
                    }
                ]
            },
            "message": "tags updated successfully",
            "status": "success"
        }
    ],
    "locked_count": "0"
}

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.modules.{module_name}.WRITE scope. Create a new client with valid scope. Refer to scope section above.

  • NO_PERMISSIONHTTP 403

    Permission denied to remove tags
    Resolution: The user does not have permission to remove tags from the records. 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 remove tags
    Resolution: The user does not have the permission to remove tags from the records. Contact your system administrator.

  • INVALID_MODULEHTTP 400

    The module name given seems to be invalid
    Resolution: You have specified an invalid module name or there is no tab permission, or the module could have been removed from the available modules. Specify a valid module API name.

  • INVALID_MODULEHTTP 400

    The given module is not supported in API
    Resolution: The modules such as Documents and Projects are not supported in the current API. (This error will not be shown, once these modules are been supported). Specify a valid module API name.

Sample Request to Remove Tags from a Record

Copiedcurl "https://www.zohoapis.com/crm/v4/Leads/554023000000792001/actions/remove_tags"
-X POST
-d @input.json
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Copiedtag1 = Map();
tag1.put("name","Prime");
tag2 = Map();
tag2.put("name","Attend First");
tags_list = List();
tags_list.add(tag1);
tags_list.add(tag2);
param = Map();
param.put("tags",tags_list);

res = invokeurl
[
	url :"https://www.zohoapis.com/crm/v4/Leads/554023000000792001/actions/remove_tags"
	type :POST
	parameters: param.toString()
	connection:"zohooauth"
];

Sample Input

Copied{
    "tags": [
        {
            "name": "Prime"
        },
        {
            "name": "Attend First"
        }
    ]
}

Sample Response

Copied{
    "data": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "554023000000792001",
                "tags": [
                    {
                        "name": "web",
                        "id": "554023000001180007"
                    }
                ]
            },
            "message": "tags updated successfully",
            "status": "success"
        }
    ]
}