---
title: "Create a new custom role."
method: POST
path: "/access-control/roles"
tags: ["access_control", "enterprise"]
---

# Create a new custom role.

`POST /access-control/roles`

Creates a new custom role and maps given permissions to that role. Note that roles with the same prefix as Fixed Roles can’t be created.

You need to have a permission with action `roles:write` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.
For example, if a user does not have required permissions for creating users, they won’t be able to create a custom role which allows to do that. This is done to prevent escalation of privileges.

## Request body

- CreateRoleForm
  - `description` string
  - `displayName` string
  - `global` boolean
  - `group` string
  - `hidden` boolean
  - `name` string
  - `permissions` Permission[]
    - `action` string
    - `created` string, date-time
    - `scope` string
    - `updated` string, date-time
  - `uid` string

## Response `201`

(empty)

- RoleDTO
  - `created` string, date-time, required
  - `delegatable` boolean
  - `description` string, required
  - `displayName` string, required
  - `global` boolean
  - `group` string, required
  - `hidden` boolean
  - `mapped` boolean
  - `name` string, required
  - `permissions` Permission[]
    - `action` string
    - `created` string, date-time
    - `scope` string
    - `updated` string, date-time
  - `uid` string, required
  - `updated` string, date-time, required
  - `version` integer, required

## Other responses

- `400` — BadRequestError is returned when the request is invalid and it cannot be processed.
- `403` — ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
- `500` — InternalServerError is a general error indicating something went wrong internally.

---

[API](https://skmtc.net/grafana/apis/http-api.md) · [All operations](https://skmtc.net/grafana/apis/http-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/grafana/http-api/versions/df55ba1718ba/schema)
