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

# Create Role

`POST /rbac/roles`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/rbac/roles`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Create a custom role.

Requires: org:rbac:create scope

## Request body

- RoleCreate: Create schema for a custom role.
  - `name` string, required: Role name
  - `description` string, nullable: Optional description of the role
  - `scope_ids` string[]: List of scope IDs to assign to the role

## Response `201`

Successful Response

- RoleReadWithScopes: Read schema for a role with its scopes.
  - `id` string, uuid, required
  - `name` string, required
  - `slug` string, nullable
  - `description` string, nullable
  - `organization_id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `created_by` string, uuid, nullable
  - `scopes` ScopeRead[]
    - `id` string, uuid, required
    - `name` string, required
    - `resource` string, required
    - `action` string, required
    - `description` string, nullable
    - `source` 'platform' | 'custom', required: Source/ownership of a scope definition.
    - `source_ref` string, nullable
    - `organization_id` string, uuid, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `is_system` boolean, required: Whether this is a preset system role.

## Other responses

- `422`: Validation Error

---

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