Skip to content

Change a member's role

PATCH
/api/v1/workspaces/{workspaceId}/members/{userId}
curl --request PATCH \
--url https://api.crossmart.io/api/v1/workspaces/example/members/example \
--header 'Content-Type: application/json' \
--data '{ "role": "OWNER", "customRoleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Only for members whose role yours covers, to a role yours covers. Their API keys that the new role could not have created are revoked.

workspaceId
required
string
userId
required
string
Media typeapplication/json
object
role
required

At most your own access. CUSTOM needs customRoleId.

string
Allowed values: OWNER ADMIN EDITOR APPROVER VIEWER CUSTOM
customRoleId

One of the workspace’s roles, with CUSTOM

string format: uuid
Media typeapplication/json
object
userId
required
string format: uuid
name
required
string
email
required
string
role
required
string
Allowed values: OWNER ADMIN EDITOR APPROVER VIEWER CUSTOM
customRole
required

The workspace’s own role, when role is CUSTOM

object
id
required
string format: uuid
name
required
string
joinedAt
required
string format: date-time

Example

{
"role": "OWNER"
}