> For the complete documentation index, see [llms.txt](https://openapi.logto.io/dev/llms.txt)

# Create a role

> POST /api/roles
> 
> Create a new role with the given data.



## Servers
- Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.)


## Authentication methods
- O auth2


## Parameters



### Body: application/json (object)

- **tenantId** (string)

- **name** (string)
  The name of the role. It should be unique within the tenant.

- **description** (string)

- **type** (string)
  The type of the role. It cannot be changed after creation.

- **isDefault** (boolean)

- **scopeIds** (array[string])
  The initial API resource scopes assigned to the role.



## Responses
### 200
The created role.

#### Body: application/json (object)
- **tenantId** (string)

- **id** (string)

- **name** (string)

- **description** (string)

- **type** (string)

- **isDefault** (boolean)


### 400
Bad Request

### 401
Unauthorized

### 403
Forbidden

### 404
Not Found

### 422
Unprocessable Content


[Powered by Bump.sh](https://bump.sh)
