Delete Threads

Purpose

This API is used to delete the threads in an account.

OAuth Scope

Use the scope

MailApps.messages.ALL (or) MailApps.messages.DELETE

ALL - Full access to the messages.

DELETE - Delete threads.

To generate Authtoken, refer here.

Request URL

Method: DELETE

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

Path Parameters    

  • account_key* string   
    • This key is used to identify the account in which threads have to be deleted. It is generated during account addition.
    • This parameter can be fetched using the Get All Accounts API.

Query Parameters

  • expunge boolean
    • This parameter specifies whether the thread needs to be deleted from the trash or moved to the trash.
    • The value can be
      • true - delete from trash too.
      • false - move to trash.
    • The default value is false.
  • threadId* JSON Array of long values
    • This parameter must be passed as an array of single or multiple thread IDs that must be deleted.
    • threadId is a unique identifier assigned to a thread.
    • This parameter can be fetched using the Get All Threads API.

* - Mandatory parameter

Note:

While Messages APIs focus on retrieving individual messages, the Threads APIs are used to retrieve complete conversation threads containing multiple messages.

Sample Request

Copiedcurl "https://mail360.zoho.com/api/accounts/N7A**0CM/threads?threadId=[163626211***10, 1676262***11]" \
-X DELETE \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken ***" \

Sample Success Response

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

Sample Failure Response

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