Skip to content
Connect an agent
Organisations

Change a member's role

Sets a member's role to admin, member or reader.

PATCH/orgs/{org}/members/{userId}

TL;DR

QuestionAnswer
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

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.
userIdstringyesThe member's account id.

Request body

The body has the type ChangeMemberRoleBody.

FieldTypeRequiredDescription
role"admin" | "member" | "reader"yesadmin, 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

StatusMeaningBody
204Changed.none
400The body is not valid.ErrorResponse
401Not signed in.ErrorResponse
403Only the owner may change a role (orgs.forbidden), or the request came from an origin that may not make changes.ErrorResponse
404No such organisation or member, or the caller is not a member of the organisation.ErrorResponse
409The owner's row cannot be changed (orgs.owner_locked).ErrorResponse
429Too many requests.ErrorResponse
503Organisations are not set up on this server.ErrorResponse

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools