Skip to content

Change a member's role

PATCH/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 admin role, 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_uidstringRequired

The workspace's uid. When the route also takes X-Workspace-Slug, both must name the same workspace.

member_uidstringRequired

The membership's uid from List members. This is not the member's user_uid.

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

Request body

rolestringRequired

The member's new role.

One ofadmindeveloperviewer

Response

200

The role was changed. Returns the updated member. invited_by is not included in this response.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
uidstringRequired

Unique identifier of the membership. Use it in /members/{member_uid} paths.

user_uidstringRequired

The member's user ID.

usernamestringRequired

The member's username.

emailstringRequired

The member's email address.

avatar_urlstring

API-relative path of the member's profile picture. Omitted when they have none.

rolestringRequired

The member's role.

One ofowneradmindeveloperviewer

permissionsarray of stringsRequired

The permissions the role grants.

One ofworkspace.readworkspace.manageresource.writeruntime.connectsecrets.readsecrets.managemembers.manageaudit.readbilling.readbilling.manageworkspace.transferworkspace.delete

statusstringRequired

Membership status. Only active members can access the workspace.

One ofactivesuspended

joined_atstring (date-time)Required

When the member joined.

invited_byobject

Who invited the member. Omitted for the owner and when unknown.

Show attributes
uidstringRequired

The user's ID.

usernamestringRequired

The user's username.

is_current_userbooleanRequired

true for your own membership.

Errors

StatusMeaning
400Validation failed: role is required (missing or malformed body) or role must be admin, developer, or viewer.
401The API key is missing, invalid, expired or revoked.
403Not 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.
404No member with this uid in the workspace (workspace member not found).

Errors use the standard error format.