---
title: "Bulk create role assignments"
method: POST
path: "/v2/facts/{proj_id}/{env_id}/role_assignments/bulk"
tags: ["Role Assignments", "Bulk Operations"]
---

# Bulk create role assignments

`POST /v2/facts/{proj_id}/{env_id}/role_assignments/bulk`

## Request

- Base URL: `https://api.permit.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.permit.io/v2/facts/{proj_id}/{env_id}/role_assignments/bulk`
- Auth: HTTP bearer

## Path parameters

- `proj_id` string, required: Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").
- `env_id` string, required: Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").

## Query parameters

- `missing_user_policy` 'fail' | 'ignore' | 'create': An enumeration.

## Request body

- RoleAssignmentCreate[]
  - `role` string, required: the role that will be assigned (accepts either the role id or the role key)
  - `tenant` string: the tenant the role is associated with (accepts either the tenant id or the tenant key)
  - `resource_instance` string: the resource instance the role is associated with (accepts either the resource instance id or key using this format resource_type:resource_instance)The resource instance will be implicitly created if the tenant parameter is specified and the resource instance does not exist.
  - `user` string, required: the user the role will be assigned to (accepts either the user id or the user key)

## Response `200`

Successful Response

- BulkRoleAssignmentReport
  - `assignments_created` integer

## Other responses

- `404`: The project or environment does not exist, or a user (with missing_user_policy=fail, the default), role, tenant or resource named by an assignment, or a resource instance named by id, does not exist. The whole batch is rejected and nothing is created.
- `409`: Conflict - including a request whose tenant differs from the tenant the named resource instance already exists in. The whole batch is rejected and nothing is created.
- `422`: Validation Error

## Changes

- **2026-10-01** `59e1c8cb3a9d`: 1 info
  - added the non-success response with the status `404`
- **2026-09-30** `b83a93e22587`: 1 info
  - added the non-success response with the status `409`

[Operation history](https://skmtc.dev/permit/apis/permit-io-api/changes/v2/facts/:proj_id/:env_id/role_assignments/bulk/post.md)

---

[API](https://skmtc.dev/permit/apis/permit-io-api.md) - [All operations](https://skmtc.dev/permit/apis/permit-io-api/llms.txt) - [OpenAPI document](https://skmtc.dev/permit/apis/permit-io-api/revisions/fa0edf4238b3?raw)
