---
title: "addRole"
method: POST
path: "/roles/"
tags: ["roles"]
---

# addRole

`POST /roles/`

## Request

- Base URL: `https://api-hub.extensiv.com`
- URL: `https://api-hub.extensiv.com/roles/`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/extensiv/apis/hub/docs/roles/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a role

## Query parameters

- `orgkey` string, uuid

## Request body

- IRole
  - `id` string, uuid, required
  - `orgKey` string, uuid, required
  - `name` string, required
  - `description` string, required
  - `creationdate` number, required
  - `permissions` string[], required

## Response `201`

OK

- object
  - `data` IRole
    - `id` string, uuid, required
    - `orgKey` string, uuid, required
    - `name` string, required
    - `description` string, required
    - `creationdate` number, required
    - `permissions` string[], required

## Other responses

- `400`: Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error
- `403`: Insufficient permissions

---

[API](https://skmtc.dev/extensiv/apis/hub.md) - [All operations](https://skmtc.dev/extensiv/apis/hub/llms.txt) - [OpenAPI document](https://skmtc.dev/extensiv/apis/hub/revisions/3f2a4976ee74?raw)
