The addUsersToGroup() GraphQL mutation is used to add users to an existing group.

For more information on user authorization, see the Managing Users & Permissions documentation page. In particular, read the section on groups, Managing Groups.

Syntax

Below is the syntax for the addUsersToGroup() mutation field:

graphql
addUsersToGroup(
      input: AddUsersToGroupInput!
   ): AddUsersToGroupMutation!

Given Datatypes

For the input (i.e., AddUsersToGroupInput), there are a couple of parameters that may be given. Below is a list of them along with their datatype and a description of each:

Table: AddUsersToGroupInput

ParameterTypeRequired[a]DefaultDescription
users[userId]yes A list of user IDs to add to group.
groupIdstring  The unique identifier for the group.

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.


Returned Datatypes

As indicated by the syntax above, this mutation will return data using the datatype, AddUsersToGroupMutation. Below is the parameter of that datatype:

Table: AddUsersToGroupMutation

ParameterTypeRequired[a]DefaultDescription
groupGroupyes The group for which to add mutation (see Group Table).

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.