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

# Create a role

`POST /api/v1/roles`

This can only be done by a logged in user who has the required privileges.

## Request body

- MutableRole
  - `name` string
  - `description` string
  - `permissions` Permissions[]
  - `isGlobal` boolean

## Response `200`

Id of created role

- Role
  - `id` string
  - `name` string
  - `permissions` Permissions[]
  - `scope` string
  - `createdAt` string
  - `updatedAt` string
  - `isGlobal` boolean
  - `description` string

## Changes

- **2021-08-09** `214f3986034a` — 2 info
  - added the optional property `description` to the response with the `200` status
  - added the optional property `isGlobal` to the response with the `200` status
- **2021-08-06** `e3cb40d13d06` — 2 warning, 2 info
  - removed the optional property `isCreated` from the response with the `200` status
  - removed the optional property `isUpdated` from the response with the `200` status
  - added the optional property `createdAt` to the response with the `200` status
  - added the optional property `updatedAt` to the response with the `200` status
- **2021-08-06** `3c703fa51ebd` — 3 info
  - added the optional property `id` to the response with the `200` status
  - added the optional property `isCreated` to the response with the `200` status
  - added the optional property `isUpdated` to the response with the `200` status
- **2021-08-06** `e366ae458db2` — 1 warning, 1 info
  - removed the optional property `description` from the response with the `200` status
  - added the optional property `scope` to the response with the `200` status
- **2021-08-05** `bf593e163365` — 2 warning, 3 info
  - removed the request property `scope`
  - removed the optional property `scope` from the response with the `200` status
  - added the new optional request property `description`
  - added the new optional request property `isGlobal`
  - …1 more

[Full history](https://skmtc.dev/openintegrationhub/apis/iam-api-for-oih/changes/api/v1/roles/post.md)

---

[API](https://skmtc.dev/openintegrationhub/apis/iam-api-for-oih.md) · [All operations](https://skmtc.dev/openintegrationhub/apis/iam-api-for-oih/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openintegrationhub/iam-api-for-oih/revisions/016871a170fd/schema)
