---
title: "Set the role of an organization member"
method: PUT
path: "/organizations/{organizationID}/members/{userID}/role"
tags: ["Organizations"]
---

# Set the role of an organization member

`PUT /organizations/{organizationID}/members/{userID}/role`

## Request

- Base URL: `https://api.xata.tech`
- URL: `https://api.xata.tech/organizations/{organizationID}/members/{userID}/role`
- Auth: OAuth 2
  - Implicit: `https://auth.xata.io/realms/xata/protocol/openid-connect/auth`
  - Scopes: `role:write`

Replaces the member's current role. An organization always retains at least one Admin.

## Request body

- SetOrganizationMemberRoleRequest: Request payload for setting the role of an organization member
  - `role` 'admin' | 'editor', required: The roles a member of an organization can hold

## Response `204`

Role updated

## Other responses

- `400`: Generic error response
- `401`: Error returned when authentication or authorization fails
- `403`: Error returned when authentication or authorization fails
- `404`: Generic error response
- `409`: Generic error response
- `5XX`: Unexpected Error

## Changes

- **2026-09-24** `1b3ced5b38b0`: 1 breaking
  - removed the enum value `viewer` of the request property `role`
- **2026-09-11** `dea04a8fcb58`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/xata/apis/xata-api/changes/organizations/:organizationID/members/:userID/role/put.md)

---

[API](https://skmtc.dev/xata/apis/xata-api.md) - [All operations](https://skmtc.dev/xata/apis/xata-api/llms.txt) - [OpenAPI document](https://skmtc.dev/xata/apis/xata-api/revisions/3145f2078d68?raw)
