Set Member Role
const url = 'https://example.com/v1/members/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"role":"viewer"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/members/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "role": "viewer" }'Give a person a role on the organization, or on one workspace with
project_id, or move them to another. Needs members:write; the
creator needs spaces:members there and never grants above their own
role. An organization role is for its members (invite anyone else); a
workspace role raises a member above their organization role, or makes a
guest.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Query Parameters
Section titled “Query Parameters ”A workspace of the organization; omit it for the organization itself. A workspace key names its own workspace.
A workspace of the organization; omit it for the organization itself. A workspace key names its own workspace.
Request Body required
Section titled “Request Body required ”PUT /v1/members/{user_id}: give a person a role (on the workspace
the query’s project_id names, else on the organization).
object
Responses
Section titled “ Responses ”The change and the role they hold now
What setting or removing a role did.
object
The space the role is on
Its organization
object
The role granted here now; null once removed
The role granted here before
False when the role was already that
The role they hold here now, inherited or not; null when they hold none
object
Enough of a space to name it.
object
A workspace’s icon; null for none
Removed from the organization: the workspaces they stay a guest of
object
Example
{ "kind": "organization", "role": "viewer", "from": "viewer", "effective": { "role": "viewer", "granted_on": { "kind": "organization" } }, "kept": [ { "role": "viewer" } ]}Refused by the role rules
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Invalid or missing API key
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}The key lacks members:write, or its creator may not give or take this role here (nobody grants above their own role)
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Not found or not readable
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}The organization’s last owner stays
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Validation Error
object
object
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}