Change a member's role
PATCH
/api/v1/workspaces/{workspaceId}/members/{userId}
const url = 'https://api.crossmart.io/api/v1/workspaces/example/members/example';const options = { method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{"role":"OWNER","customRoleId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string
userId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
role
required
At most your own access. CUSTOM needs customRoleId.
string
customRoleId
One of the workspace’s roles, with CUSTOM
string format: uuid
Responses
Section titled “Responses”Media typeapplication/json
object
userId
required
string format: uuid
name
required
string
email
required
string
role
required
string
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"}