AVAILABLE WITH BUSINESS SUBSCRIPTION

Request: POST /group/{group_id}/members

Permissions to Run the Request

Account Owner, Account Administrators, Department Administrators, or custom roles

Request Headers

Header

Description

Authorization (required)Access token. You can obtain a token by making a request.
ParameterDescription
group_id (required)The ID of a group whose users you want to replace.

The users whose IDs are indicated in the method will completely replace existing group members. That means that an empty userIds parameter sent within the method will remove all users from the group. If two user IDs are sent, all previous groups members will be deleted from the group and two new participants will be added.

Important: 

Let's say, a Department Administrator or a user with a role with custom settings allowing them to replace group users sends a list of new users which should be added to the group. There are already some users in the group, both from departments the sender manages and from departments the sender doesn't have access to. 

After the method is performed, all new users sent within the method will be added to the group. But concerning existing members, only users from the departments the sender manages and their daughter departments will be removed. 

Participants who belong to the departments which aren't managed by the sender will remain in the group.


Response Codes

Code

Text

Description

200OKUsers replacement was successfully completed.
400Bad RequestA request error.
401UnauthorizedAn authorization error.
403Permission deniedThe user doesn't have enough permissions to replace group users.

Sample Request

POST /group/b1496214-acab-11e9-8db0-120a62f268a9/members https/1.1
Host: api-learn.ispringlearn.com
Authorization: p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8"?>
<request>
	<userIds>
		<id>3fa85f64-5717-4562-b3fc-2c963f66afa6</id>
        <id>16b113ea-e2e9-11e9-87d9-aa9d91baa591</id>
	</userIds>
</request>
XML

Sample Response

https/1.1 200 OK
XML