---
title: "Create a new RBAC User Role"
method: POST
path: "/{workspace}/rbac/users/{RBACUserIdForNestedEntities}/roles"
tags: ["RBACUserRoles"]
---

# Create a new RBAC User Role

`POST /{workspace}/rbac/users/{RBACUserIdForNestedEntities}/roles`

Create a new RBAC User Role

## Path parameters

- `workspace` string, required

## Request body

- RBACUserRole
  - `role` string, nullable — The RBAC role assigned to the user.
  - `role_source` 'idp' | 'local', nullable — The origin of the RBAC user role.
  - `user` object, nullable — The RBAC user associated with the role.
    - `id` string
  - `user_id` string, nullable — The RBAC user ID associated with the role.

## Response `201`

Successfully created RBAC User Role

- RBACUserRole
  - `role` string, nullable — The RBAC role assigned to the user.
  - `role_source` 'idp' | 'local', nullable — The origin of the RBAC user role.
  - `user` object, nullable — The RBAC user associated with the role.
    - `id` string
  - `user_id` string, nullable — The RBAC user ID associated with the role.

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.net/kong/apis/kong-enterprise-admin-api.md) · [All operations](https://skmtc.net/kong/apis/kong-enterprise-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/kong-enterprise-admin-api/revisions/28b1f8a59cdc/schema)
