---
title: "Create Role"
method: POST
path: "/iam/roles"
tags: ["IAM"]
---

# Create Role

`POST /iam/roles`

## Request

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

## Request body

- CreateRoleDto
  - `name` string, required
  - `sso_group_names` string[]
  - `permissions` string[]

## Response `200`

Role created successfully

- RoleDto
  - `id` string, uuid, required
  - `created` string, date-time, required
  - `last_updated` string, date-time, required
  - `name` string, required
  - `sso_group_names` string[]
  - `editable` boolean
  - `deletable` boolean
  - `permissions` string[], required

## Other responses

- `401`: Not authenticated
- `403`: Insufficient permissions
- `409`: Resource state conflict
- `422`: Invalid input data
- `500`: Internal server error

---

[API](https://skmtc.dev/nasuni/apis/portal-api.md) - [All operations](https://skmtc.dev/nasuni/apis/portal-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nasuni/apis/portal-api/revisions/2a505bec6d14?raw)
