Add members to a team.
Permissions required: add-team-member or edit-team-member
Changelog
| Version | Description |
|---|---|
| 9.0.0 | Assigning roles now requires the matching permission: set-owner, set-moderator or set-leader for those roles, and access-permissions for any other role except member. |
The authToken of the authenticated user.
The userId of the authenticated user.
{
"teamId": "63f3efc4b000b6b6d86704b2",
"members": [
{
"userId": "rYhzFRd2QZjNwAAXX",
"roles": [
"member"
]
}
]
}Enter the team ID. Alternatively, enter the teamName parameter and provide the team's name as the value.
The users (IDs and roles) to add to the team.
To assign roles, you also need the permission for each role in the team's main room: set-owner for owner, set-moderator for moderator, and set-leader for leader. Any other role except member requires access-permissions, and the admin role also requires assign-admin-role. If you don't have them, the request fails with a 403 error.
OK
{
"success": true
}Bad Request
{
"success": false,
"error": "must have required property 'members'\n must have required property 'teamName'\n must match exactly one schema in oneOf",
"errorType": "error-invalid-params"
}Unauthorized
{
"success": false,
"error": "You must be logged in to do this."
}Forbidden
{
"success": false,
"error": "forbidden"
}