PUT - Disable User

Purpose

The API is used to disable a user.

OAuth Scope

Use the scope

ZohoMail.organization.accounts.ALL (or) 

ZohoMail.organization.accounts.UPDATE

to generate the Authtoken.

ALL - Grants full access to accounts.

UPDATE - Grants access to update account information.

Request URL

Method: PUT

Using admin authentication:

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

Path Parameters

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

Request Body (JSON Object)

  • zuid* long
    • This parameter is the unique identifier for each user in an organization. 
    • This value can be retrieved using the GET all org user details API.
  • mode* string
    • This parameter represents the type of operation that is to be performed.
    • Provide the value as disableUser.
  • blockIncoming boolean
    • This parameter specifies whether to block the incoming for the user.  
    • Allowed values:
      • true 
      • false
  • removeMailforward boolean
    • This parameter specifies whether to remove all forwarding action added to this user.
    • Allowed values:
      • true 
      • false
  • removeGroupMembership boolean
    • This parameter specifies whether to remove the user from all groups.
    • Allowed values:
      • true 
      • false
  • removeAlias boolean
    • This parameter specifies whether to remove the alias for the user or not.  
    • Allowed values:
      • true
      • false

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request

Copiedcurl "https://mail.zoho.com/api/organization/1234567890/accounts/1234567890000899" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Zoho-oauthtoken *****" \
-d '{
 "mode":"disableUser",
 "blockIncoming":"true",
 "removeMailforward":"true",
 "removeGroupMembership":"true",
 "removeAlias":"true",
 "zuid":"11111111"
}'

Sample Response

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