---
title: "Update a company role"
method: PATCH
path: "/v1/companies/{company_id}/company_roles/{id}"
tags: ["Company role"]
---

# Update a company role

`PATCH /v1/companies/{company_id}/company_roles/{id}`

## Request

- Base URL: `https://api.cardda.com`
- URL: `https://api.cardda.com/v1/companies/{company_id}/company_roles/{id}`
- Auth: HTTP bearer

Updates a company role's `name`/`description` and, when a `permissions`
array is supplied, replaces the role's permission set. If any supplied
permission id does not exist a `404` is returned.

## Path parameters

- `company_id` string, uuid, required
- `id` string, required

## Parameters

- `#/paths/~1v1~1users/get/parameters/0` (unresolved $ref)

## Request body

- object
  - `name` string
  - `description` string
  - `permissions` string[]: Full replacement set of permission ids for the role.

## Response `200`

The updated company role.

- CompanyRole: A custom role scoped to a company, carrying a set of permissions.
  - `id` string, uuid, required
  - `company_id` string, uuid, required
  - `name` string, required
  - `description` string, nullable
  - `permissions` object[]: Permissions granted by this role (only `id` and `name` are returned).
    - `id` string, uuid
    - `name` string
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `401`: Unauthorized
- `404`: Company role or a supplied permission not found
- `422`: Validation failed

---

[API](https://skmtc.dev/cardda/apis/banking-api.md) - [All operations](https://skmtc.dev/cardda/apis/banking-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cardda/apis/banking-api/revisions/ff1aeb3fda8b?raw)
