Grant a role on a resource to a subject

View as Markdown
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.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
subjectobjectRequired
rolestringRequired>=1 character
resourceTypeenumRequired
Allowed values:
resourceExternalIdstringRequired>=1 character

Response

The role grant was created.
idstring
roleobject
resourceobject
organizationMembershipIdstring

Errors

403
Forbidden Error