Skip to main content

moveMembersTo

GroupWrapper moveMembersTo(fromId, toId)

PUT /api/2.0/group/{fromId}/members/{toId}

Move group members

Moves every member of one group into another group, emptying the first one. The caller needs the permissions to edit groups and to add and remove users, and both IDs have to belong to groups that have not been deleted, otherwise the operation answers 404. The source group is kept, only without members, so delete it separately through DELETE api/2.0/group/{id} if it is no longer needed. Members that cannot be group members any more are silently skipped rather than failing the call, and an account that already belongs to the destination is simply left there. The answer is the destination group with its members, not the source one. To move a chosen few instead of everybody, use PUT api/2.0/group/{id}/members and DELETE api/2.0/group/{id}/members.

Parameters​

NameInTypeDescriptionNotes
fromIdpathUUID (uuid)The ID of the group the members are taken from. It is emptied but not deleted, and it has to be a group that has not been deleted already.[required] [example: 00000000-0000-0000-0000-000000000000]
toIdpathUUID (uuid)The ID of the group the members are moved into. It is the group the answer describes, and it has to be a group that has not been deleted already.[required] [example: 11111111-1111-1111-1111-111111111111]

Responses​

Status codeDescriptionTypeResponse headers
200The destination group with its membersGroupWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
403No permissions to perform this action--
404No group has one of the specified IDs--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
400Bad Request.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

GroupWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: Not defined
  • Accept: application/json