Skip to content
Navigation

Grant a role on a resource to a subject

Creates a role grant (a share) on a resource. Authorization: the caller must be an organization administrator, or hold the resource’s share permission on the target (space:share for space, spacetype:share for spacetype; settings has no share permission and is administrator-only); otherwise returns 403 forbidden. Body: subject (name exactly one of organizationMembershipId or groupId), role (role slug), resourceType (space | spacetype | settings), resourceExternalId. settings resources are created lazily (idempotent) before granting. Returns the created grant.

POST
https://api.cloudraker.com/authorization/grants
Try it
Request body
Live API request

This request can change data or incur charges for the selected organization.

Authorization

  • bearerAuth
    HTTP
    required

Request body JSON required

  • subject
    object
    required
    • organizationMembershipId
      optional
      string
      minLength: 1
    • groupId
      optional
      string
      minLength: 1
  • role
    string
    required
    minLength: 1
  • resourceType
    space
    or
    spacetype
    or
    settings
    required
  • resourceExternalId
    string
    required
    minLength: 1

Returns

200

The role grant was created.

JSON
  • id
    string
    required
  • role
    object
    required
    • slug
      string
      required
  • resource
    object
    required
    • id
      string
      required
    • externalId
      string
      required
    • resourceTypeSlug
      string
      required
  • organizationMembershipId
    optional
    string

400

Validation Error
JSON
  • success
    false
    required
  • error
    array of
    unknown
    required
  • data
    unknown
    required

403

Caller is not an admin and lacks the resource’s share permission

Type to search…

↑↓ navigate↵ selectEsc close