PUT api/groups/{id}/members?field={field}&clearGroup={clearGroup}

Adds one or more users to a specified group, with optional clearing of existing members.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

The unique identifier of the group to which users will be added.

integer

Required

field

(Optional) The field used to identify users. Accepts "id", "username", or "email". Defaults to "id".

string

Default value is id

clearGroup

(Optional) If true, clears all existing members from the group before adding new ones. Defaults to false.

boolean

Default value is False

Body Parameters

A list of user identifiers (IDs, usernames, or emails) to be added to the group.

Collection of string

Request Formats

application/json, text/json, application/scim+json

Sample:
[
  "sample string 1",
  "sample string 2"
]

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'List`1'.

Response Information

Resource Description

On success: HTTP 200 OK indicating users were added successfully. On failure: HTTP 400 Bad Request with a specific error message.

IHttpActionResult

None.

Response Formats

application/json, text/json, application/scim+json

Sample:

Sample not available.