---
title: "Create a Role"
method: POST
path: "/v2/roles"
tags: ["roles"]
---

# Create a Role

`POST /v2/roles`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/roles`
- Auth: HTTP bearer

Creates a custom role for the organization; the slug is derived from the name.

## Request body

- CreateRoleRequest
  - `name` string, required
  - `permissions` string[], required
  - `data_visibility_scope` 'organization' | 'business_units' | 'assigned_only'
  - `work_visibility_scope` 'organization' | 'business_units' | 'assigned_only'

## Response `201`

Successful Response

- RoleSchema
  - `id` string, required
  - `slug` string, required
  - `name` string, required
  - `permissions` string[], required
  - `permissions_expanded` string[], required
  - `data_visibility_scope` 'organization' | 'business_units' | 'assigned_only', required
  - `work_visibility_scope` 'organization' | 'business_units' | 'assigned_only', required
  - `is_system` boolean, required
  - `active_member_count` integer, required
  - `deactivated_member_count` integer, required

## Other responses

- `409`: Conflict
- `422`: Unprocessable Content

---

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