Skip to main content
POST
Grant a role on an organization

Authorizations

Authorization
string
header
required

A personal access token (POST /v1/auth/tokens) or a machine identity token (POST /v1/projects/{project_id}/identities/{identity_id}/tokens), both prefixed qumo_pat_. A token's scopes cap what it can do; see Scopes and permissions. A personal token names no organization: on a route whose path names no project or organization, pass ?organization_id=.

Path Parameters

id
string<uuid>
required

The organization's id.

Body

application/json
principal_type
enum<string>
required
Available options:
user,
identity
Example:

"user"

principal_id
string<uuid>
required

The user's or identity's id.

Example:

"5e7a9c3b-1d2f-4b6e-8a0c-7f3d9e1b5a24"

role_id
enum<string>
required

The role to grant. roles/platform.admin is never grantable, and roles/organization.admin only on an organization.

Available options:
roles/project.viewer,
roles/project.editor,
roles/project.admin,
roles/organization.admin
Example:

"roles/project.editor"

Response

The created binding.

The binding a grant created, and what the grant revoked.

id
string<uuid>
required
Example:

"1a3c5e7f-9b2d-4f6a-8e0c-2d4f6a8b0c1e"

principal_type
enum<string>
required
Available options:
user,
identity
Example:

"user"

principal_id
string
required

The user's or identity's id.

Example:

"5e7a9c3b-1d2f-4b6e-8a0c-7f3d9e1b5a24"

role_id
string
required
Example:

"roles/project.editor"

scope_type
enum<string>
required
Available options:
project,
organization,
platform
Example:

"project"

scope_id
string<uuid>
required

The project's or organization's id; the nil UUID for platform scope.

Example:

"9b1d6e2f-4a3c-4f8b-a7e5-0c9d2b4f6e81"

principal_name
string

The user's or identity's name, in lists. Absent when the principal no longer exists.

Example:

"Hanako Yamada"

principal_email
string

The user's email, in lists. Absent for identities.

revoked_identity_tokens
integer

How many of the identity's tokens the grant revoked, because it gave the identity a permission it did not hold. Absent when none were. Mint a new token after such a grant.

Required range: x >= 1
Example:

2