跳到主要内容

addGroup

GroupWrapper addGroup(GroupRequestDto)

POST /api/2.0/group

Add a new group

Creates a group with the given name and, optionally, a manager and a first set of members. The caller needs the permissions to edit groups and to add and remove users. The name is required and cannot be blank, and unlike the operations that add members later, this one checks every listed account upfront and rejects the whole call with 400 if any of them is unusable - a guest, a disabled account or an ID that matches nobody. The call is not idempotent: names are not unique, so repeating it creates a second group with the same name. Creating a group raises a GroupCreated webhook, and the answer holds the new group with its members included. Members can be changed afterwards through PUT api/2.0/group/{id} or the dedicated member operations.

Parameters​

NameInTypeDescriptionNotes
GroupRequestDtobodyGroupRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The new group, with its membersGroupWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no groupName, the group name is null, blank or longer than 128 characters, or one of the listed members or the manager is a guest, is disabled or does not exist--
403No permissions to perform this action--
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