# Change a member's role

> Page: https://docs.plotwork.dev/api/patch-orgs-org-members-user-id. Index of every page: https://docs.plotwork.dev/llms.txt

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`](https://docs.plotwork.dev/api/schemas.md#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`](https://docs.plotwork.dev/api/schemas.md#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`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | Only the owner may change a role (orgs.forbidden), or the request came from an origin that may not make changes. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such organisation or member, or the caller is not a member of the organisation. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 409 | The owner's row cannot be changed (orgs.owner_locked). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Organisations are not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
