---
title: "Create a role"
method: POST
path: "/authorization/roles"
tags: ["Authorization"]
---

# Create a role

`POST /authorization/roles`

## Request

- Base URL: `https://example.itential.io`
- URL: `https://example.itential.io/authorization/roles`
- Auth: none declared

Creates a role.

## Request body

- object
  - `role` IapRolesSchema: This is the schema for an IAP role stored in Mongo
    - `provenance` string, required
    - `name` string, required
    - `description` string, required
    - `allowedMethods` IapRolesSchemaAllowedMethodsItems[], required
      - `name` string
      - `provenance` string
    - `allowedViews` IapRolesSchemaAllowedViewsItems[], required
      - `path` string
      - `provenance` string
    - `_meta` IapRolesSchemaMeta
      - `created` string
      - `updated` string

## Response `200`

Result of role creation process

- AuthorizationCreateRoleResponse200
  - `status` 'OK' | 'Created': The status of the API request.
  - `message` string: Message containing either confirmation of the operation or the reason for the failure of the operation.
  - `data` IapRolesSchema: This is the schema for an IAP role stored in Mongo
    - `provenance` string, required
    - `name` string, required
    - `description` string, required
    - `allowedMethods` IapRolesSchemaAllowedMethodsItems[], required
      - `name` string
      - `provenance` string
    - `allowedViews` IapRolesSchemaAllowedViewsItems[], required
      - `path` string
      - `provenance` string
    - `_meta` IapRolesSchemaMeta
      - `created` string
      - `updated` string

## Other responses

- `500`: Error response from API

---

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