---
title: "Assign permissions to a role"
method: PUT
path: "/resources/roles/v1/{roleId}/permissions"
tags: ["Roles"]
---

# Assign permissions to a role

`PUT /resources/roles/v1/{roleId}/permissions`

## Request

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

This route assigns permissions to a role. Add the role ID as a path parameter to the route url and include the permission IDs in the request body as an array of strings. Any pre-existing permissions will be overridden by the new permissions. Use the get roles API to get the role IDs. Use the **Get permissions** API to get the permissions IDs.

## Path parameters

- `roleId` string, required

## Headers

- `frontegg-tenant-id` string

## Request body

- AddPermissionToRoleRequest
  - `permissionIds` string[], required: Set permission ids to attach to the role

## Response `200`

- RoleResponse
  - `id` string, required
  - `vendorId` string, required
  - `tenantId` string, required
  - `key` string, required
  - `name` string, required
  - `description` string, required
  - `isDefault` boolean, required
  - `firstUserRole` boolean, required
  - `level` number, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, 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)
