Skip to main content

Overview

The addUserToUserGroup mutation adds a teammate to one of your team’s user groups, identified by their email address. The requesting user must be a team admin.

Arguments

String
required
The unique identifier of the user group.
String
required
The email address of the user to add to the group.

Usage Example

To add a user to a user group, provide the group’s ID and the user’s email as arguments to the mutation. Here’s an example of how this mutation could be used:

Error Codes

List of possible error codes that may be returned by the addUserToUserGroup mutation. Full list of error codes can be found here.

The user group or teammate could not be found, or no user matches the provided user_email.

The user you are trying to add is not in your team.

The provided user_email is not a valid email address.

The user does not have admin privileges to manage user groups.

The user is already a member of the user group.

You do not have access to this user group.

Audit Trail

A successful call records a USER_GROUP_MEMBER_ADDED audit event carrying the group_id in its metadata, so membership changes are queryable after the fact.

Additional Resources

User Groups

Querying list of user groups

Remove User from User Group

Removing a user from a user group