---
title: "Assign Set Permissions"
method: POST
path: "/v2/facts/{proj_id}/{env_id}/set_rules"
tags: ["Condition Set Rules"]
---

# Assign Set Permissions

`POST /v2/facts/{proj_id}/{env_id}/set_rules`

Grant permissions to a user set *on* a resource set.

If the permission is already granted, it is skipped.

## 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").

## Request body

- ConditionSetRuleCreate
  - `user_set` string, required — The userset that will be given permission, i.e: all the users matching this rule will be given the specified permission
  - `permission` string, required — The permission that will be granted to the userset *on* the resourceset. The permission can be either a resource action id, or `{resource_key}:{action_key}`, i.e: the "permission name".
  - `resource_set` string, required — The resourceset that represents the resources that are granted for access, i.e: all the resources matching this rule can be accessed by the userset to perform the granted *permission*
  - `is_role` boolean — if True, will set the condition set rule to the role's autogen user-set.
  - `is_resource` boolean — if True, will set the condition set rule to the resource's autogen resource-set.

## Response `200`

Successful Response

- ConditionSetRuleRead[]
  - `id` string, uuid, required — Unique id of the condition set rule
  - `key` string, required — A unique id by which Permit will identify this condition set rule.
  - `user_set` string, required — the userset that is currently granted permissions, i.e: all the users matching this rule are granted the permission on the resourceset
  - `permission` string, required — a permission that is currently granted to the userset *on* the resourceset.
  - `resource_set` string, required — the resourceset that represents the resources that are currently granted for access, i.e: all the resources matching this rule can be accessed by the userset to perform the granted *permission*
  - `organization_id` string, uuid, required — Unique id of the organization that the condition set rule belongs to.
  - `project_id` string, uuid, required — Unique id of the project that the condition set rule belongs to.
  - `environment_id` string, uuid, required — Unique id of the environment that the condition set rule belongs to.
  - `created_at` string, date-time, required — Date and time when the condition set rule was created (ISO_8601 format).
  - `updated_at` string, date-time, required — Date and time when the condition set rule was last updated/modified (ISO_8601 format).

## Other responses

- `422` — Validation Error

---

[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-service-production.skmtc.workers.dev/v1/apis/permit/permit-io-api/revisions/0235743bf8a2/schema)
