---
title: "Update a role"
method: PATCH
path: "/roles/{id}"
tags: ["Roles"]
---

# Update a role

`PATCH /roles/{id}`

## Request

- Base URL: `https://api-staging.fanheroapi.com`
- URL: `https://api-staging.fanheroapi.com/roles/{id}`
- Auth: API key in header `apiKey`

## Request body

- UpdateRoleInput
  - `name` string: Role name
  - `description` string: Role description
  - `public` boolean: If True, this role is available to all user, including those that are not logged it.
  - `default` boolean: If true, this user role is granted to any newly created organization.
  - `permissions` string[]: An array of permission IDs

## Response `200`

Role updated

- RolesDto
  - `id` string, required: Role ID
  - `permissions` PermissionDto[], required: Permissions
    - `id` string, required: Permission ID
    - `name` string, required: Permission name
    - `description` string, required: Permission description
    - `subject` SubjectDto, required
      - `id` string: Subject ID
      - `fields` string[]: Fields
      - `entity` string: Entity identified by this subject
    - `actions` string[], required: The actions that this permission allows to be performed on the subject
  - `name` string, required: Role name
  - `description` string, required: Role description
  - `public` boolean, required: If **True**, this role is available to all user, including those that are not logged it.
  - `default` boolean, required: If **True**, this role is assigned to any newly created organization.

---

[API](https://skmtc.dev/fanhero/apis/user-management-endpoints.md) - [All operations](https://skmtc.dev/fanhero/apis/user-management-endpoints/llms.txt) - [OpenAPI document](https://skmtc.dev/fanhero/apis/user-management-endpoints/revisions/3f982670c057?raw)
