Apply Policy to Users/Groups

Purpose

This API is used to apply a particular policy to users/groups.

OAuth Scope

Use the scope

ZohoMail.organization.policy.ALL (or) ZohoMail.organization.policy.UPDATE 

to generate the Authtoken.

ALL - Provides full access to policy.

UPDATE - Apply a particular policy to users/groups.

Request URL 

Method: PUT

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

Path Parameters

  • zoid* long
    • This parameter denotes the unique Zoho Organization Identifier for the organization.
    • This parameter can be retrieved from the Get organization Details API.
  • policyId* long
    • This parameter is used to identify the policy.
    • This parameter can be retrieved from the Get All Policies API.

 

Request Body (JSON Object)

  • mode* string
    • This parameter specifies the type of operation that is to be performed.
    • Provide the value as applyPolicyToUsers.
  • userList* JSON array of long
    • This parameter must be passed as an array of single or multiple zuids of users or zgids of groups to which the policy should be applied. Here

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request

Copiedcurl "https://mail.zoho.com/api/organization/12345678/policy/45677777" \
-X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken ***" 
-d '{
  "mode": "applyPolicyToUsers",
  "userList": [
    523234,
    342334
  ]
}

Sample Response

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