Delete an Email

Purpose

This API is used to delete an email.

OAuth Scope

Use the scope

ZohoMail.messages.ALL (or) ZohoMail.messages.DELETE

to generate the Authtoken.

ALL - Grants full access to messages.

DELETE - Grants access to delete messages.

Request URL

Method: DELETE

https://mail.zoho.com/api/accounts/{accountId}/folders/{folderId}/messages/{messageId}

Path Parameters

  • accountId* long
    • This parameter is used to identify the specific account to fetch details.
    • This parameter can be retrieved from the Get User Account Details API.
  • folderId* long
    • This parameter is used to identify the specific folder for which the emails need to be retrieved. 
    • This parameter can be retrieved from the Get All Folders API.
  • messageId* long
    • This parameter is the unique ID associated with the particular email. 
    • This parameter can be retrieved from List Emails API.

 

Query Parameters

  • expunge boolean
    • This parameter specifies whether the email should be deleted permanently without moving it to the trash folder.
    • Allowed values :
      • true - The email will be deleted permanently without moving it to the trash folder.
      • false - The email will be moved to the trash folder.
    • Default value : false.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request

Copiedcurl "https://mail.zoho.com/api/accounts/12345678/folders/9000000002014/messages/1710915488416100000" \
-X DELETE \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *****"

Sample Request

Copied{
  "status": {
    "code": 200,
    "description": "success"
  },
  "data": {
    "cId": 1711540991815100000
  }
}