PUT/v1/user/membership

Set a user's teams

Sets the teams assigned to a user, replacing the specified team membership set. Supply the user's username and an array of team UUIDs; each UUID must be unique. You need the ACCESS_MANAGEMENT or ACCESS_MANAGEMENT_UPDATE permission.

2 body fields

The username and list of team UUIDs to assign to the user.

teamsarray<string>required
The unique UUIDs of the teams to assign to the user.
usernamestringrequired
The user's username. Must contain at least one character.

5 status codes
200Returns the updated user object, including the user's username, permissions, and teams.
emailstringoptional
permissionsarray<object>optional
teamsarray<object>optional
usernamestringrequired
304Returned when the user is already a member of the specified team or teams.
400Returned when the request is invalid.
detailstringrequired
Human-readable explanation specific to this occurrence of the problem
instancestringoptional
Reference URI that identifies the specific occurrence of the problem
statusintegerrequired
HTTP status code generated by the origin server for this occurrence of the problem
titlestringrequired
Short, human-readable summary of the problem type
typestringoptional
A URI reference that identifies the problem type
401Returned when the request is unauthorized.
404Returned when the user or one or more specified teams could not be found.

Error handling

A 400 is returned when username or teams is missing or the request is invalid; username must contain at least one character, and teams must contain unique values. A 401 is returned when the request is unauthorized. A 404 is returned when the user or one or more specified teams cannot be found.