# Create roles

Add a new role across all accounts (tenants).

This route does not assign permissions to the role. Use the attach permissions to role route to manage role permissions.

Endpoint: POST /resources/roles/v1
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Header parameters:

  - `frontegg-tenant-id` (string)
    For relating a role to a specific account (tenant), use `get accounts (tenants)` API to find the account (tenant) Ids

## Request fields (application/json):

  - `key` (string, required)

  - `name` (string, required)

  - `description` (string)

  - `isDefault` (boolean)
    This role will be assigned for every user that will be added without specified roles

  - `migrateRole` (boolean)
    Set this property to `true` together with `isDefault` in order to assign this role to all users

  - `firstUserRole` (boolean)
    This role will be assigned to the first user of a tenant (new tenants only)

  - `level` (number, required)
    Role level for roles elevation, lower level means stronger role.

## Response 201 fields (application/json):

  - `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, required)

  - `updatedAt` (string, required)

  - `permissions` (array, required)

