---
title: "Grant access to a user"
method: POST
path: "/authz/grants"
tags: ["Role and grant"]
---

# Grant access to a user

`POST /authz/grants`

Give users access to resources (NRN) in your organization.

You can **use either the role slug or the role ID** to specify the role you want to assign to the user.

## Request body

- union
  - GrantNewRoleSlug
    - `nrn` string, required — The NRN of the resource where the API key's role is assigned.
    - `user_id` integer, required — The ID of the user that **receives** the grant.
    - `role_slug` string, required — The slug of the role assigned to the API key for this NRN. > Note: See [Roles](/docs/authorization/roles) for more info. >
  - GrantNewRoleId
    - `nrn` string, required — The NRN of the resource where the API key's role is assigned.
    - `user_id` integer, required — The ID of the user that **receives** the grant.
    - `role_id` integer, required — The ID of the role assigned to the API key for this NRN. > Note: See [Roles](/docs/authorization/roles) for more info. >

## Response `200`

The operation was successful.

- union
  - GrantNewRoleSlug
    - `nrn` string, required — The NRN of the resource where the API key's role is assigned.
    - `user_id` integer, required — The ID of the user that **receives** the grant.
    - `role_slug` string, required — The slug of the role assigned to the API key for this NRN. > Note: See [Roles](/docs/authorization/roles) for more info. >
  - GrantNewRoleId
    - `nrn` string, required — The NRN of the resource where the API key's role is assigned.
    - `user_id` integer, required — The ID of the user that **receives** the grant.
    - `role_id` integer, required — The ID of the role assigned to the API key for this NRN. > Note: See [Roles](/docs/authorization/roles) for more info. >

## Other responses

- `4XX` — Client error responses due to invalid input or missing parameters.
- `5XX` — Server error responses indicating an issue on the API side.

---

[API](https://skmtc.dev/nullplatform/apis/nullplatform-api.md) · [All operations](https://skmtc.dev/nullplatform/apis/nullplatform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nullplatform/nullplatform-api/revisions/1c4ea154b159/schema)
