---
title: "Set a permission to multiple roles"
method: PUT
path: "/resources/permissions/v1/{permissionId}/roles"
tags: ["Permissions"]
---

# Set a permission to multiple roles

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

## Request

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

This route associates a permission to multiple roles. Add the permission ID as a path parameter to the route url and include the role IDs in the request body as an array of strings. Any pre-existing roles associated with the permission will stay associated. Use the **Get roles** API to get the role IDs.

## Path parameters

- `permissionId` string, required

## Request body

- AddRolesToPermissionRequest
  - `roleIds` string[], required: The permission will be assigned to the specified roles

## Response `200`

- PermissionResponse
  - `id` string, required
  - `key` string, required
  - `name` string, required
  - `description` string, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `roleIds` string[], required
  - `categoryId` string, required
  - `fePermission` boolean, 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)
