Remove User from a Group

Table of Contents

Overview

The zoho.directory.removeUserFromGroup task is used to remove a user from the specified group in an organization.

Syntax

<response> = zoho.directory.removeUserFromGroup(<orgID>, <groupID>, <userID>, <connection>);

Scope

ZohoDirectory.Groups.DELETE

where:

ParameterDescriptionData type
responseis the variable which will hold the details of the user removed from the specified group in the organization.KEY-VALUE
<orgID>is the ID of the organization from which the user needs to be removed.NUMBER
<groupID>is the ID of the group from which the user needs to be removed.NUMBER
<userID>is the ID of the user who needs to be removed.NUMBER
<connection>is the name of the Zoho Directory connection.TEXT

Example

The following script removes a user with ID - 1510XXXXXXXX from a specified group with ID - 68XXXXXXX  from an organization with ID - 72XXXXXXX in Zoho Directory:

response = zoho.directory.removeUserFromGroup(72XXXXXXX, 68XXXXXXX, 1510XXXXXXXX, "zoho_directory_connection");

where:

response
This is the KEY-VALUEresponse returned by Zoho Directory.
72XXXXXXX
This is the NUMBERthat represents the organization ID of Zoho Directory account.
1510XXXXXXXX
This is the NUMBERthat represents the user ID of a user who needs to be deactivated.
zoho_directory_connection
This is the TEXTthat represents the link name of the connection.

Response format

{
   "status_code": 204,
   "resource_name": "members",
   "message":"Group has been unassigned successfully."
}