---
title: "Update a member's roles"
method: PATCH
path: "/v1/orgs/{orgId}/members/{memberId}"
tags: ["Members"]
---

# Update a member's roles

`PATCH /v1/orgs/{orgId}/members/{memberId}`

## Request

- Base URL: `https://api.spice.ai`
- URL: `https://api.spice.ai/v1/orgs/{orgId}/members/{memberId}`
- Auth: HTTP bearer

The org is `orgId` in the path. Updates the roles assigned to a specific organization member. Organization owners cannot have their roles modified.

## Path parameters

- `orgId` integer, required
- `memberId` integer, required

## Headers

- `X-Org-Name` string

## Request body

- object
  - `roles` string[], required: New roles to assign to the member

## Response `200`

Member roles updated successfully

- object
  - `user_id` integer
  - `username` string
  - `roles` string[]
  - `created_at` string, date-time

## Other responses

- `400`: Invalid request body. orgId is not a valid org id (`invalid_org_id`), or X-Org-Name does not name that org (`org_path_mismatch`).
- `401`: Unauthorized
- `403`: Insufficient scope, not an org admin/owner, cannot modify owner, only owners can modify/assign admin or owner roles. The caller is not a member of the org (`org_forbidden`). A machine credential named a different org (`org_assertion_mismatch`). The org is deleted (`org_deleted`).
- `404`: Member not found, or the membership was removed before the role change was written
- `413`: Request body too large
- `500`: The organization could not be read, or the role change failed

---

[API](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api.md) - [All operations](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/revisions/5f3b75dd847d?raw)
