Remove All Labels from Emails

Purpose

This API is used to remove all labels from a single email or multiple emails.

OAuth Scope

Use the scope

MailApps.messages.ALL (or) MailApps.messages.UPDATE

ALL - Full access to the messages.

UPDATE - Remove labels from emails.

To generate Authtoken, refer here.

Request URL

Method: PUT

https://mail360.zoho.com/api/accounts/{account_key}/messages

Path Parameters

  • account_key* string
    • This key is used to identify the account. It is generated during account addition.
    • This parameter can be fetched from Get all accounts API.

Request Body (JSON Object)

  • mode* string
    • This parameter represents the type of operation that is to be performed.
    • Provide the value as removeAllLabels.
  • messageId* JSON Array of long values
    • This parameter needs to be passed as an array of single or multiple message IDs of emails that need to be unlabelled. Each message ID serves as a unique identifier for an email.

 

* - Mandatory parameter

Note:

While the Messages APIs focus on individual messages, the Threads APIs deal with entire conversation threads, each of which contains multiple messages.

Sample request

Copiedcurl "https://mail360.zoho.com/api/accounts/x**B00s/messages" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken 802432953.9d**b4ac3" \
-d '{
  "mode" :"removeAllLabels",
  "messageId":"[1675839032459140122,1675839056963140305]"
}' 

Sample response

Copied{
    "status": {
        "code": 200,
        "description": "success"
    }
}

Sample Failure Response

Copied{
    "status": {
        "code": 500,
        "description": "Internal Error"
    },
    "data": {
        "moreInfo": "Internal Error"
    }
}