---
title: "Change a member's role."
method: PATCH
path: "/organizations/{organizationId}/users/{userId}"
tags: ["organizations"]
---

# Change a member's role.

`PATCH /organizations/{organizationId}/users/{userId}`

## Request

- Base URL: `https://api.shorebird.dev/api/v1`
- URL: `https://api.shorebird.dev/api/v1/organizations/{organizationId}/users/{userId}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Sets the member's role in a team organization. Requires the
`organizationMembers.update` permission, which the `admin` and
`owner` roles hold.

Setting `owner` transfers ownership: only the current owner may do
it, and it also requires `organizations.transfer`. Only the owner
may change the owner's own role, and only by transferring
ownership: changing it to anything else is a conflict, since an
organization always has an owner. Roles other than `developer` must
be offered by the organization's plan
(`shorebird_plan_insufficient_tier` otherwise).

## Request body

- UpdateOrganizationUserRequest: The request body for PATCH /organizations/{organizationId}/users/{userId}.
  - `role` 'owner' | 'admin' | 'appManager' | 'developer' | 'viewer' | 'auditor' | 'scim' | 'none', required: A role that a user can have relative to an Organization or App.

## Response `204`

The member's role was changed.

## Other responses

- `400`: The organization id is not an integer (`organization_id_malformed`), the user id is not an integer (`organization_users_error`), or the body could not be parsed (`organizations_users_update_error`).
- `403`: The caller lacks a required permission, a non-owner tried to change the owner's role or to transfer ownership (`organizations_users_update_error`), or the plan does not offer the role (`shorebird_plan_insufficient_tier`).
- `404`: No such organization or the caller is not a member of it (`organization_membership_guard_error`), or the user is not a member (`organizations_users_update_error`).
- `409`: The member is the owner and the new role is not `owner`; transfer ownership to another member first (`organizations_users_update_error`).
- `424`: Reading the member's role or the plan, or changing the role, failed (`organizations_users_update_error` or `shorebird_plan_lookup_error`).
- `default`: Standard error response. Emitted for any non-2xx status where a body can be decoded into an [ErrorResponse].

---

[API](https://skmtc.dev/shorebird/apis/shorebird-codepush-api.md) - [All operations](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/revisions/941da8871d10?raw)
