# 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 parameters Content-type: application/json - **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 Parameters: 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)