---
title: "Change a member's workspace role"
method: PATCH
path: "/members/{userId}"
---

# Change a member's workspace role

`PATCH /members/{userId}`

## Request

- Base URL: `https://craaft.io/api/v1`
- URL: `https://craaft.io/api/v1/members/{userId}`
- Auth: HTTP bearer

Owner/admin only. Flips a member between `admin` and `member`. The
owner role can't be set or changed here.

## Request body

- object
  - `role` 'admin' | 'member', required

## Response `200`

Updated

- Member
  - `userId` string, uuid, required
  - `email` string, email, required
  - `name` string, required
  - `role` 'owner' | 'admin' | 'member', required
  - `avatarUrl` string, required: Empty when no upload; otherwise /api/v1/users/{id}/avatar
  - `joinedAt` string, date-time, required
  - `boardAccess` BoardAccess[]: Explicit board grants the caller is allowed to see. Omitted when the row is a workspace owner/admin (implicit access to every board) OR when a non-admin caller is reading someone else's row. Empty array means "this member has no explicit grants".
    - `projectId` string, uuid, required
    - `name` string, required
    - `role` 'admin' | 'contributor', required

## Other responses

- `400`: Missing / invalid role
- `401`: Missing or invalid token
- `403`: Caller isn't a workspace owner/admin
- `404`: Resource doesn't exist or caller isn't a member of its workspace

---

[API](https://skmtc.dev/craaft/apis/craaft-api.md) · [All operations](https://skmtc.dev/craaft/apis/craaft-api/llms.txt) · [OpenAPI document](https://skmtc.dev/craaft/apis/craaft-api/revisions/3a1e9d30d7dc?raw)
