Role and grant

Bulk create grants for a user

Changed on

Create multiple grants for a user in a single request. This operation is additive: it adds new grants without affecting existing ones.

The operation is transactional: if any grant fails validation, no grants are created.

You can use either role_id or role_slug for each grant in the request.

post/user/{id}/grant

Request

  • Base URL
    https://api.nullplatform.com
  • URL
    https://api.nullplatform.com/user/{id}/grant
  • Auth
    HTTP bearer

Path parameters

idinteger required

The unique identifier for the user receiving the grants.

Request body

Example request

[
  {
    "nrn": "organization=1:account=2",
    "role_slug": "developer"
  }
]

Response

All grants were created successfully.

idinteger required

The unique identifier for the grant.

nrnstring required

The NRN of the resource where the role is assigned.

user_idinteger required

The ID of the user who received the grant.

role_idinteger required

The ID of the role assigned.

role_slugstring

The slug of the role assigned.

status'active' | 'pending' required

The status of the grant.

Example response

[
  {
    "id": 12345,
    "nrn": "organization=1:account=2",
    "user_id": 789,
    "role_id": 700317756,
    "role_slug": "developer",
    "status": "active"
  }
]

Changes

    • breaking

      the response property became optional for the status

    • breaking

      the response property became optional for the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • info

      media type application/json was changed to a more specific media type application/problem+json for the response status

    • info

      media type application/json was changed to a more specific media type application/problem+json for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      response property message deprecated

    • info

      response property message deprecated

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      endpoint added