跳到主要内容

setGroupManager

GroupWrapper setGroupManager(id, SetManagerRequest)

PUT /api/2.0/group/{id}/manager

Set a group manager

Makes an account the manager of a group, replacing whoever managed it before. The caller needs the permissions to edit groups and to add and remove users. Both the group and the account have to exist: the operation answers 404 when the ID in the route matches no live group and also when userId matches no account, so the message of the error says which of the two was not found. The account is added to the group at the same time, so a manager does not have to be a member beforehand, and the previous manager stays in the group as an ordinary member. A group has one manager, which makes the call idempotent when it names the account that manages it already. The answer is the group with its new manager. To change the members rather than the manager, use PUT api/2.0/group/{id}/members.

Parameters​

NameInTypeDescriptionNotes
idpathUUID (uuid)The ID of the group whose manager is set, taken from the route. It has to be a group that has not been deleted, otherwise the operation answers 404.[required] [example: 00000000-0000-0000-0000-000000000000]
SetManagerRequestbodySetManagerRequestThe account to make the manager of the group.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The group with its new managerGroupWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no userId--
403No permissions to perform this action--
404No group has the specified ID, or no account has the specified userId--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.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: application/json
  • Accept: application/json