DELETE - Delete User Account

Purpose

The API is used to delete a user's mailbox. Any user account that is a part of an organization can be deleted using this API.

OAuth Scope

Use the scope

ZohoMail.organization.accounts.ALL (or) ZohoMail.organization.accounts.DELETE 

to generate the Authtoken.

ALL - Grants full access to accounts.

DELETE - Grants delete access to accounts.

Request URL 

Method: DELETE

https://mail.zoho.com/api/organization/{zoid}/accounts

Path Parameters

  • zoid* long
    • This parameter denotes the unique Zoho Organization Identifier for the organization. 
    • This value can be retrieved using the GET organization details API.

Request Body (JSON Object)

  • accountList* JSON array of long
    • This parameter needs to be passed as an array of single or multiple zuids whose mailboxes are to be deleted.
    • This value can be retrieved using the GET all org user details API.
  • emailList *JSON array of string
    • This parameter needs to be passed as an array of single or multiple email addresses whose mailboxes are to be deleted.

 

Note:

Providing either an accountList or  an emailList is mandatory.

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request (Using Email Address)

Copiedcurl "https://mail.zoho.com/api/organization/1234567890/accounts/111111156" \
-X DELETE \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Zoho-oauthtoken *****" \
-d '{
"emailList":["rebecca@zylker.com","paula@zylker.com"]
}'

Sample Request ( Using zuid)

Copiedcurl "https://mail.zoho.com/api/organization/1234567890/accounts/111111156" \
-X DELETE \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Zoho-oauthtoken *****" \
-d '{
"accountList":["8887771","8999998"]
}'

Sample Response

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