---
title: "Update role"
method: PATCH
path: "/resources/roles/v1/{roleId}"
tags: ["Roles"]
---

# Update role

`PATCH /resources/roles/v1/{roleId}`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/roles/v1/{roleId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/roles/v1/:roleId/patch.ts> (a function with typed inputs; its response is checked against the schema)

This route updates an existing role. Add the role ID as a path parameter to the route url to specify which role you are updating. Send the updated information about the role in the PATCH body. Note that you do not update permissions for the role here. Use the attach permissions to role route to do that. Use the **Get roles** API to get the role ID.

## Path parameters

- `roleId` string, required

## Headers

- `frontegg-tenant-id` string

## Request body

- UpdateRoleRequest
  - `isDefault` boolean: This role will be assigned for every user that will be added without specified roles
  - `firstUserRole` boolean: This role will be assigned to the first user of a tenant (new tenants only)
  - `migrateRole` boolean: Set this property to `true` together with `isDefault` in order to assign this role to all users
  - `level` number: Role level for roles elevation, lower level means stronger role.
  - `key` string
  - `name` string
  - `description` string

## Response `200`

- RoleResponse
  - `id` string, required
  - `vendorId` string, required
  - `tenantId` string, required
  - `key` string, required
  - `name` string, required
  - `description` string, required
  - `isDefault` boolean, required
  - `firstUserRole` boolean, required
  - `level` number, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `permissions` string[], required

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
