Apply Labels to Emails
Purpose
This API is used to apply labels to 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 - Apply label to 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 applyLabel.
- messageId* JSON Array of long
- This parameter should be passed as an array of single or multiple message IDs of emails that need to be labelled. Each message ID serves as a unique identifier for an email or message.
- labelId* JSON Array of long
- This parameter should be passed as an array of single or multiple label IDs that need to be applied to emails. Each label ID serves as a unique identifier for a label.
* - 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
Copied
Sample Success Response
Copied
Sample Failure Response
Copied