---
id: grants-create
title: "Grant access to a user"
description: "Give users access to resources (NRN) in your organization."
sidebar_label: "Grant access to a user"
hide_title: true
hide_table_of_contents: true
api: eJztWNtu20YQ/ZXFvDQxGEm+JQCBBHAubd0Hx7BlNIUtGKPlSNyE3GX2IkcR+O/FLEmLsp1r0QYp/EJRy73MnDlndndWkJGTVlVeGQ0p/KYWJIIj6wRKSc4Jb4QlZ4KV5MSDo5Ojh0JpsTTBCmPnqNVH5LGDC32h/zJBSNRiays4EqR8Tlb4nIQ1BQlXhLkwvYbDl1tbPL+rSKrZcv1haYK4Qu35Izqn5prf+DObNrjQkIDHuYP0HE54AOpMzC1qD5METEU22nSYQQqx2aXSEnqCBBzJYJVfQnq+gimhJXsQfA7p+aSeJGDpfSDnn5tsCekKpNGetOdXrKpCyTjx8K1jtFbgZE4l8pvR9HoW5/TKFwQpnDml52vP2eRlxR/M9C1JD81aylLGbmjLTrF7lyrjb6agyzhukkBl2SevyPFS3DVddbM5b5Xm2TcDOc5JHJ0cCTNrYG1DKK5yshSbDo4PxTta/uIaG5VroaZsAAnQByyr6Ec/yk+3U5TSBO2fbqcaS3IVSuLWNThP96Bee7I2VGlPc7J3Wnr4sjOUxwmfoxdbW5YkqQU5ZklOTYCb4F9b92Q02t1+8mT/cd2H7KvQaeg4W7Ouc7/jWguQmEXOKsd4Rpo/E0fGUypOicQ5889NHgwzI90Qg8+NbcEa8qzuYRxfGktC6ZkZXOhnmy5ARgsqOMBQ13VyJ4EOX34PfVR2T55vIs93LPkjmbO2v+bU1fEmunpEV8/REaPZ9o/hv5mU0hUssAh0TY1PRWynR690e2d3b0NvGxxObjD3H6/Bf/u+skzAkquMdo1bO6MR/9wO1PVeIK7QCRfinjYLBbP0Prf/ZPK8z+33uf0+t/dye0yEe2/e3M59LwpF2guy1lhxnSpFFoj9UHqBhcqE0lXwfCQvlYuErNBiSZ6s+6YE+Tn2Oo8+uBcm48N3tAcSKMk5nNNtCvd6fzlav4/Hx6IZIaTJmMyVJUfasy8crOZmoaSQfTwe0GA+SMTeaMSPbX7s8mPv4QbB90ajmkHYsOUTqjoQJcpcaXpkCTOcFtSuFe2KtJXoac40INfYRnZBVsxQFcHSprSmmF22N5G4g0fYvsKIqVU0S0QeStRrS3q9Omo3xvF0HRoX8BwzcdIsegHccKY75lJ2AZvg9HuziV1Ev2xklil+xUJk5FEVTuDUBL82a3OdcUxScZ24h5dYzIwtKRMRXe1RsTo7SvcZ3B0V9u9SyGkD/02FKJ1Fnuu5QC2Uc4GE0dfKdyqj/5k0XB+Ilgz7LI390Q4/djcDv//jVMHOWo3FZdPpsoHsP9PHYbu8aKnzivs0SuEWJUmcaVygKnjWW4K5c/i/Kp0DLYKmDxVJT1nrkpEyWEvZQBwXhI6Et0uBc1RaFOjJdqqJdvnccAmlMo6pWyGXSSBuZx+HTV0lFlTYHRfPx8EWkELufeXS4RArNdChKKoCPWt2IE0JvJt1NZhTlknD7n4l5hoHnohXiN04LcZOkLQvvxpboocU/vhzHO8dLL+TdQHnVYfEF+4dnzux9A4s11vyJ68+CfBmHi88ZF0TtO3BaDCC9Q5+0D8M8BBGt8SYNtgMLsIxtL36G8bDz0069IpTP1PZromspw9+WBWoIgSRNquWYOcQCQZJW7rjTJgzA9NzWK2m6OjMFnXNze8DWS7kTRJYoFUsu1jHSyAnzMhGTr6jJR+IGqwejXn9pLuQ3k7efEhvRhxISZX/bN9JTyTHr0/HzMy2cFjGBAkWrzjp4xWkAFya5NGR8LFtBQXqeYjqh2ZO5jFuyuAG7ZubaPMJ9bJn4WrV9Bibd6TrGpLWFc//oZ7Udf03e22Kpg==
sidebar_class_name: "post api-method"
info_path: docs/api/authorization
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Grant access to a user"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/authz/grants"}
  context={"endpoint"}
>
  
</MethodEndpoint>



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.


<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={undefined}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"oneOf":[{"title":"Using role slug","type":"object","required":["nrn","user_id","role_slug"],"properties":{"nrn":{"type":"string","description":"The NRN of the resource where the API key's role is assigned.","example":"organization=1:account=1:namespace=1:application=4"},"user_id":{"type":"integer","description":"The ID of the user that **receives** the grant.\n","example":700317756},"role_slug":{"type":"string","description":"The slug of the role assigned to the API key for this NRN.\n\n> Note: See [Roles](/docs/authorization/roles) for more info.\n>\n","example":"developer"}}},{"title":"Using role ID","type":"object","required":["nrn","user_id","role_id"],"properties":{"nrn":{"type":"string","description":"The NRN of the resource where the API key's role is assigned.","example":"organization=1:account=1:namespace=1:application=4"},"user_id":{"type":"integer","description":"The ID of the user that **receives** the grant.\n","example":700317756},"role_id":{"type":"integer","description":"The ID of the role assigned to the API key for this NRN.\n\n> Note: See [Roles](/docs/authorization/roles) for more info.\n>\n","example":700317756}}}],"title":"grantNewBase"},"examples":{"Using role slug":{"value":{"nrn":"organization=1:account=2","user_id":1234,"role_slug":"developer"}},"Using role ID":{"value":{"nrn":"organization=1:account=2","user_id":1234,"role_id":700317756}}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The operation was successful.","content":{"application/json":{"schema":{"oneOf":[{"title":"Using role slug","type":"object","required":["nrn","user_id","role_slug"],"properties":{"nrn":{"type":"string","description":"The NRN of the resource where the API key's role is assigned.","example":"organization=1:account=1:namespace=1:application=4"},"user_id":{"type":"integer","description":"The ID of the user that **receives** the grant.\n","example":700317756},"role_slug":{"type":"string","description":"The slug of the role assigned to the API key for this NRN.\n\n> Note: See [Roles](/docs/authorization/roles) for more info.\n>\n","example":"developer"}}},{"title":"Using role ID","type":"object","required":["nrn","user_id","role_id"],"properties":{"nrn":{"type":"string","description":"The NRN of the resource where the API key's role is assigned.","example":"organization=1:account=1:namespace=1:application=4"},"user_id":{"type":"integer","description":"The ID of the user that **receives** the grant.\n","example":700317756},"role_id":{"type":"integer","description":"The ID of the role assigned to the API key for this NRN.\n\n> Note: See [Roles](/docs/authorization/roles) for more info.\n>\n","example":700317756}}}],"title":"grantNewBase"}}}},"4XX":{"description":"Client error responses due to invalid input or missing parameters.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific client error (e.g., 400, 401, 403, 404).","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"bad_request"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Bad Request\", \"Unauthorized\").","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}},"5XX":{"description":"Server error responses indicating an issue on the API side.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific server error (e.g., 500, 502, 503).","example":500},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"internal_server_error"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Internal Server Error\", \"Service Unavailable\").","example":"Internal Server Error"},"message":{"type":"string","description":"Additional details about the error.","example":"An unexpected error occurred. Please try again later."}}}}}}}}
>
  
</StatusCodes>


      