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

# Create a company role

`POST /v1/companies/{company_id}/company_roles`

## Request

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

Creates a new custom role for the company with an optional set of
permissions (passed as an array of permission ids).

## Path parameters

- `company_id` string, uuid, required

## Parameters

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

## Request body

- object
  - `name` string, required
  - `description` string
  - `permissions` string[]: Ids of the permissions to grant to the role.

## Response `201`

The created 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 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)
