Role and grant

Replace all grants for a user

Changed on

Replace all existing grants for a user with a new set of grants. This operation deletes all existing grants and creates the new ones.

  • Send an empty array [] to remove all grants from the user.
  • Send a non-empty array to replace all grants with the specified ones.

The operation is transactional: if any new grant fails validation, no changes are made.

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

put/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.

Request body

Example request

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

Response

Grants were replaced 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