---
title: "Create a new role"
method: POST
path: "/resources/roles/v2"
tags: ["Account roles"]
---

# Create a new role

`POST /resources/roles/v2`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/roles/v2`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/roles/v2/post.ts> (a function with typed inputs; its response is checked against the schema)

This route adds a new role for a specific tenant. Send the tenant ID in the **`frontegg-tenant-id`** header. Add the required permissions within the request body to customize the role.

## Headers

- `frontegg-tenant-id` string

## Request body

- AddRoleWithPermissionsRequest
  - `key` string, required
  - `name` string, required
  - `description` string
  - `isDefault` boolean: This role will be assigned for every user that will be added without specified roles
  - `baseRoleId` string, required: Role level of the new role will be based on this parameter
  - `permissionIds` string[], required

## Response `200`

- AddRoleWithPermissionsResponse
  - `id` string, required
  - `vendorId` string, required
  - `tenantId` string, required
  - `key` string, required
  - `name` string, required
  - `description` string, required
  - `isDefault` boolean, required
  - `permissions` string[], required

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
