Overview
TheaddUserToUserGroup 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 theaddUserToUserGroup mutation. Full list of error codes can be found here.
object_not_found
object_not_found
The user group or teammate could not be found, or no user matches the provided user_email.
not_in_team
not_in_team
The user you are trying to add is not in your team.
invalid_arguments
invalid_arguments
The provided user_email is not a valid email address.
require_elevated_privilege
require_elevated_privilege
The user does not have admin privileges to manage user groups.
bad_request
bad_request
The user is already a member of the user group.
forbidden
forbidden
You do not have access to this user group.
paid_required
paid_required
Managing user groups requires a Business plan or higher.
Audit Trail
A successful call records aUSER_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