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. The space’s owner (its userId: the creator of a top-level space, the root space’s creator for a sub-space) always stays an admin of their space. Only the space’s owner can promote or demote admins, so no one else can lower the owner’s role, and the owner can’t step down either: this route refuses their own id.

Path Parameters

string
required
UUID of the space.
string
required
UUID of the member’s user: their user id, not their membership id. Your own id is refused (400 space/own-member-id): your own membership is /spaces/:spaceId/members/me.

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

The updated membership record, as a SpaceMember object. When the member already has role, nothing changes and the record is returned as it is.
string
Membership id.
string
The space.
string
The member.
'admin' | 'moderator' | 'member'
The new role.
'pending' | 'active' | 'banned' | 'rejected'
The member’s status, unchanged.
string
When the membership became active (ISO 8601).
string
When the membership record was created (ISO 8601).

Errors

Returned when spaceId or userId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
userId is the acting user (the token’s user, or the user named by actingUserId). This route acts on another member; check your own membership with GET /spaces/:spaceId/members/me and leave with DELETE /spaces/:spaceId/members/me.
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.
userId has no membership in this space.
Someone other than the space’s owner 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