Delete an Email

Purpose

This API is used to delete a specific email using the message ID.

OAuth Scope

Use the scope

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

ALL - Full access to the messages.

DELETE - Delete an email.

To generate Authtoken, refer here.

Request URL

Method: DELETE

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

Path Parameters

  • account_key* string
    • This key is used to identify the account from which the emails have to be deleted. It is generated during account addition.
    • This parameter can be fetched from Get all accounts API.
  • messageId* long
    • This is a unique key used to identify a specific email.

Request Body(JSON Object)

  • expunge boolean
    • This parameter specifies whether to delete the email from the trash or not.
    • The possible value can be
      • true - Delete from trash too.
      • false - Move to trash.

 

* - 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/x7**0s/messages/167**01" \
-X DELETE \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken ***" \

Sample Success Response

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

Failure response

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