Move Emails
Purpose
This API is used to move single or multiple emails to a different folder.
OAuth Scope
Use the scope
MailApps.messages.ALL (or) MailApps.messages.READ
ALL - Full access to the messages.
UPDATE - Move messages.
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 moveMessage.
- messageId* JSON Array of long
- This parameter should be passed as an array of single or multiple message IDs of emails which has to be moved to the specified destination folder. Each message ID serves as a unique identifier for an email or message.
- destfolderId* long
- This parameter specifies the ID of the destination folder to which emails need to be moved.
* - 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/x7k**0s/messages" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken 802**11a0274d5ac77" \
-d '{
"mode" :"moveMessage",
"messageId":"[164522103243001,16452210000001]",
"destfolderId":"182024000000003011"
}'
Sample Success Response
Copied{
"status": {
"code": 200,
"description": "success"
}
}
Sample Failure Response
Copied{
"status": {
"code": 500,
"description": "Internal Error"
},
"data": {
"moreInfo": "Internal Error"
}
}