---
title: "Create custom role"
method: POST
path: "/api/v1/roles"
tags: ["Roles"]
---

# Create custom role

`POST /api/v1/roles`

Create a custom role bundling a set of permissions at either account or project scope.

Get the list of valid permission strings from [List Permissions](#tag/Permissions/operation/listPermissions).

## Request body

- CreateRoleRequest
  - `name` string, required
  - `slug` string, required
  - `description` string
  - `scope` 'account' | 'project', required
  - `permissions` string[], required

## Response `201`

Role created

- object
  - `success` boolean
  - `data` Role
    - `id` string, uuid, required
    - `account_id` string, uuid — Empty for built-in system roles
    - `name` string, required
    - `slug` string, required
    - `description` string
    - `scope` 'account' | 'project', required — Whether the role grants account-level or project-level permissions
    - `permissions` string[], required — Permission strings (e.g. `vm.create`, `project.members.view`). See [List Permissions](#tag/Permissions/operation/listPermissions).
    - `is_system` boolean, required — `true` for built-in roles (Owner, Admin, Member, Operator, etc.) which cannot be edited or deleted. `false` for custom roles.
    - `created_by` string, uuid
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `400` — Invalid request parameters

## Changes

- **2026-05-08** `64c270db1c2e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/rafftechnologies/apis/raff-api/changes/api/v1/roles/post.md)

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) · [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rafftechnologies/raff-api/revisions/2f4df56be77c/schema)
