Skip to content

Set Member Role

PUT
/v1/members/{user_id}
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.

user_id
required
string format: uuid
project_id

A workspace of the organization; omit it for the organization itself. A workspace key names its own workspace.

string | null format: uuid

A workspace of the organization; omit it for the organization itself. A workspace key names its own workspace.

Media type application/json
RoleRequest

PUT /v1/members/{user_id}: give a person a role (on the workspace the query’s project_id names, else on the organization).

object
role
required
string
Allowed values: viewer contributor admin owner

The change and the role they hold now

Media type application/json
RoleChange

What setting or removing a role did.

object
space_id
required

The space the role is on

string format: uuid
kind
required
string
Allowed values: organization workspace
name
required
string
slug
string | null
root_id

Its organization

string | null format: uuid
parent_id
string | null format: uuid
user
required
GrantSubject
object
user_id
required
string format: uuid
email
string | null
display_name
string | null
username
string | null
role

The role granted here now; null once removed

string
nullable
Allowed values: viewer contributor admin owner
from

The role granted here before

string
nullable
Allowed values: viewer contributor admin owner
changed
required

False when the role was already that

boolean
effective

The role they hold here now, inherited or not; null when they hold none

object
role
required
string
Allowed values: viewer contributor admin owner
inherited
required
boolean
granted_on
required
SpaceRef

Enough of a space to name it.

object
space_id
required
string format: uuid
kind
required
string
Allowed values: organization workspace
name
required
string
slug
string | null
icon

A workspace’s icon; null for none

string | null
kept

Removed from the organization: the workspaces they stay a guest of

Array<object>
nullable
KeptWorkspace
object
space_id
required
string format: uuid
name
string | null
role
string
nullable
Allowed values: viewer contributor admin owner
Example
{
"kind": "organization",
"role": "viewer",
"from": "viewer",
"effective": {
"role": "viewer",
"granted_on": {
"kind": "organization"
}
},
"kept": [
{
"role": "viewer"
}
]
}

Refused by the role rules

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
Example generated
{
"detail": "example"
}

Invalid or missing API key

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
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)

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
Example generated
{
"detail": "example"
}

Not found or not readable

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
Example generated
{
"detail": "example"
}

The organization’s last owner stays

Media type application/json
ErrorResponse

Standard error response.

object
detail
required

Error message describing what went wrong

string
Example generated
{
"detail": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Array<object>
ValidationError
object
loc
required
Location
Array<string | integer>
msg
required
Message
string
type
required
Error Type
string
input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}