/v1/workspaces/{workspace_uid}/members/{member_uid}Changes a member's role to admin, developer or viewer. The new permissions apply to the
member's next request.
Requires the owner or admin role. Some changes are not allowed:
- The owner's role cannot be changed, and no one can be made owner.
- Admins cannot give anyone the
adminrole, and cannot change another admin's role.
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
workspace_uidstringRequiredThe workspace's uid. When the route also takes X-Workspace-Slug, both must name the same workspace.
member_uidstringRequiredThe membership's uid from List members. This is not the member's user_uid.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Request body
rolestringRequiredThe member's new role.
One ofadmindeveloperviewer
Response
The role was changed. Returns the updated member. invited_by is not included in this response.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
uidstringRequiredUnique identifier of the membership. Use it in /members/{member_uid} paths.
user_uidstringRequiredThe member's user ID.
usernamestringRequiredThe member's username.
emailstringRequiredThe member's email address.
avatar_urlstringAPI-relative path of the member's profile picture. Omitted when they have none.
rolestringRequiredThe member's role.
One ofowneradmindeveloperviewer
permissionsarray of stringsRequiredThe permissions the role grants.
One ofworkspace.readworkspace.manageresource.writeruntime.connectsecrets.readsecrets.managemembers.manageaudit.readbilling.readbilling.manageworkspace.transferworkspace.delete
statusstringRequiredMembership status. Only active members can access the workspace.
One ofactivesuspended
joined_atstring (date-time)RequiredWhen the member joined.
invited_byobjectWho invited the member. Omitted for the owner and when unknown.
Show attributesHide attributes
uidstringRequiredThe user's ID.
usernamestringRequiredThe user's username.
is_current_userbooleanRequiredtrue for your own membership.
Errors
| Status | Meaning |
|---|---|
400 | Validation failed: role is required (missing or malformed body) or role must be admin, developer, or viewer. |
401 | The API key is missing, invalid, expired or revoked. |
403 | Not allowed: your role cannot manage members, the workspace owner role cannot be changed, admins cannot assign the admin role, or admins cannot change another admin's role. |
404 | No member with this uid in the workspace (workspace member not found). |
Errors use the standard error format.