---
title: "Adds a new role"
method: POST
path: "/roles"
tags: ["users"]
---

# Adds a new role

`POST /roles`

## Request body

- AuthRole
  - `id` string — role_id, this is read-only attribute
  - `name` string, required — Role name, next names are reserved: admin (admin's permissions could not be overwriten)
  - `persistent` boolean — persistent roles are built-in and can't be removed. This is read-only attribute
  - `permissions` AuthRolePermissions, required
    - `channel` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `channel.default-channel` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `channel.group` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `channel.mirror` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `channel.routes-filtered` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `subchannel` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `subchannel.group` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `subchannel.mirror` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `artifact` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `cve` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `role` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `system` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `system.license` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `system.settings` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `user.token` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `mirror` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `audit-logs` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `cve-notifications` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource

## Response `200`

the role object

- AuthRole
  - `id` string — role_id, this is read-only attribute
  - `name` string, required — Role name, next names are reserved: admin (admin's permissions could not be overwriten)
  - `persistent` boolean — persistent roles are built-in and can't be removed. This is read-only attribute
  - `permissions` AuthRolePermissions, required
    - `channel` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `channel.default-channel` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `channel.group` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `channel.mirror` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `channel.routes-filtered` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `subchannel` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `subchannel.group` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `subchannel.mirror` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `artifact` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `cve` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `role` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `system` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `system.license` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `system.settings` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `user.token` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `mirror` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `audit-logs` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource
    - `cve-notifications` 'read' | 'write' | 'manage', nullable — the lowerest permission level, which could be set for the resource

## Other responses

- `401` — Unauthenticated, no token is provided or token is invalid
- `403` — Access is forbidden
- `500` — Internal server error

---

[API](https://skmtc.net/anaconda/apis/anaconda-server-api.md) · [All operations](https://skmtc.net/anaconda/apis/anaconda-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/anaconda/anaconda-server-api/revisions/6aef0cb7a151/schema)
