Organisations
Change a member's role
Sets a member's role to admin, member or reader.
PATCH
/orgs/{org}/members/{userId}TL;DR
| Question | Answer |
|---|---|
| What does it do? | Change a member's role. |
| What does it take? | A JSON body of type ChangeMemberRoleBody. |
| What does it return? | Status 204 with no body. |
| What can go wrong? | 400 the body is not valid; 401 not signed in; 403 only the owner may change a role (orgs.forbidden), or the request came from an origin that may not make changes; 404 no such organisation or member, or the caller is not a member of the organisation; 409 the owner's row cannot be changed (orgs.owner_locked); 429 too many requests; 503 organisations are not set up on this server. Every failure uses the one error envelope. |
What it does
Sets a member's role to admin, member or reader. Only the owner may. The owner's own row cannot be changed (409 orgs.owner_locked).
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
org | string | yes | The organisation's id or its slug. |
userId | string | yes | The member's account id. |
Request body
The body has the type ChangeMemberRoleBody.
| Field | Type | Required | Description |
|---|---|---|---|
role | "admin" | "member" | "reader" | yes | admin, member or reader. An admin can invite and remove members and readers, rename the organisation and manage its keys; a member can publish and change their own diagrams; a reader can view and download and change nothing. Only the owner offers admin or changes a role. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 204 | Changed. | none |
| 400 | The body is not valid. | ErrorResponse |
| 401 | Not signed in. | ErrorResponse |
| 403 | Only the owner may change a role (orgs.forbidden), or the request came from an origin that may not make changes. | ErrorResponse |
| 404 | No such organisation or member, or the caller is not a member of the organisation. | ErrorResponse |
| 409 | The owner's row cannot be changed (orgs.owner_locked). | ErrorResponse |
| 429 | Too many requests. | ErrorResponse |
| 503 | Organisations are not set up on this server. | ErrorResponse |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint, and the error envelope |
| Schemas | Every request and response type |
| Tool reference | The operations as callable tools |