---
title: "Update role"
method: PUT
path: "/v1/roles/{role_name}"
tags: ["Security"]
---

# Update role

`PUT /v1/roles/{role_name}`

Update a role.

## Path parameters

- `role_name` string, required

## Request body

- UpdateRoleMembershipBody — UpdateRoleMembershipRequest is the request to UpdateRoleMembership.
  - `add` RoleMembership[] — Members to assign to the role.
    - `principal` string — The name of the principal assigned to the role.
  - `create` boolean — Create the role if it doesn't already exist. If the role is created in this way, the “add” list will be respected, but the “remove” list will be ignored.
  - `remove` RoleMembership[] — Members to remove from the role.
    - `principal` string — The name of the principal assigned to the role.

## Response `200`

OK

- UpdateRoleMembershipResponse — UpdateRoleMembershipResponse is the response for UpdateRoleMembership.
  - `added` RoleMembership[] — Members assigned to the role.
    - `principal` string — The name of the principal assigned to the role.
  - `removed` RoleMembership[] — Members removed from the role.
    - `principal` string — The name of the principal assigned to the role.
  - `role_name` string — The role name.

## Other responses

- `401` — Unauthenticated.
- `404` — Not Found
- `500` — Internal Server Error. Reach out to support.
- `default` — An unexpected error response.

---

[API](https://skmtc.dev/redpanda-data/apis/redpanda-cloud-data-plane-api.md) · [All operations](https://skmtc.dev/redpanda-data/apis/redpanda-cloud-data-plane-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/redpanda-data/redpanda-cloud-data-plane-api/revisions/7eef0bcc42e7/schema)
