Skip to main content
Update Member Role
Changes a member’s role. Only space admins can perform this action. The role also applies in the space’s child spaces. Raising someone’s role gives it to them there too, but never lowers a role they already hold there: someone who is a regular member here and an admin of a child space stays an admin there when made a moderator here. Lowering someone’s role lowers it there too: an admin made a moderator becomes a moderator in the child spaces, and a regular member loses "admin" and "moderator" there. Giving someone the role they already have changes nothing, here or in the child spaces.

Path Parameters

string
required
UUID of the space.
string
required
UUID of the membership record to update.

Body Parameters

string
required
New role: "admin", "moderator", or "member".
string
Required with a service key: the user this request acts as. The request has exactly that user’s permissions, so it is refused unless they are an admin of the space, and it is recorded as theirs. A user token always acts as its own user and must not send it (400 space/acting-user-not-allowed).

Response

string
Confirmation message.
object
Updated membership with id, role, status, joinedAt, and userId.

Errors

Returned when spaceId or memberId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
A service key sent no actingUserId.
actingUserId is not a user id.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
actingUserId was sent in the query string. On this endpoint every field, actingUserId included, goes in the request body.
Returned when a service key names an actingUserId that isn’t a user in this project.
The caller (or the user named by actingUserId) is not an admin of the space.
Someone other than the space creator promoting a member to, or demoting them from, "admin".
Lowering a role also lowers it in the child spaces, so it is refused too when the member is the last admin of one of them, named by spaceId:
Raising a member to "moderator" or "admin" while they are banned in this space or in one of its child spaces (the role also applies in the child spaces). Lowering a banned member’s role is allowed. bannedSpaceIds lists where the bans are, so they can be lifted first with Unban Member.
Raising a member to "moderator" or "admin" while their request is pending or was rejected.
See also: useUpdateMemberRole