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

# Create a role

`POST /roles`

## Request body

- RoleAPIModifyRole
  - `logTypeAccess` string[] — The log types that the role can or cannot access, according to the `logTypeAccessKind` field. This field should be omitted if `logTypeAccessKind` has a value of `ALLOW_ALL` or `DENY_ALL`
  - `logTypeAccessKind` 'ALLOW' | 'ALLOW_ALL' | 'DENY' | 'DENY_ALL' — Defines the role's access to log types. This field is required and has effect only if the datalake RBAC feature is enabled.
  - `name` string, required — The name of the role
  - `permissions` string[], required

## Response `200`

OK response.

- RoleAPIRole
  - `createdAt` string
  - `id` string — ID of the role
  - `logTypeAccess` string[] — The log types that the role can or cannot access, according to the `logTypeAccessKind` field. This field should be omitted if `logTypeAccessKind` has a value of `ALLOW_ALL` or `DENY_ALL`
  - `logTypeAccessKind` 'ALLOW' | 'ALLOW_ALL' | 'DENY' | 'DENY_ALL', required — Defines the role's access to log types. This field is required and has effect only if the datalake RBAC feature is enabled.
  - `name` string, required — The name of the role
  - `permissions` string[], required
  - `updatedAt` string

## Other responses

- `400` — bad_request: Bad Request response.

---

[API](https://skmtc.net/panther/apis/panther-rest-api.md) · [All operations](https://skmtc.net/panther/apis/panther-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/panther/panther-rest-api/versions/eb177cb9d6a1/schema)
