Roles

Role-based access control management

get

Returns all roles.

Authorizations
AuthorizationstringRequired

The bearer token can be obtained by creating a ServiceAccount.

Responses
200

Happy response.

application/json
get
/api/v1/roles
post

Creates a new role.

Authorizations
AuthorizationstringRequired

The bearer token can be obtained by creating a ServiceAccount.

Body

Contains the fields needed to create a role.

namestring · hq-resource-name · min: 1 · max: 63Required

Sets the unique name of the new role. It must be a valid HQ resource name: it can only contain lowercase alphanumeric characters or hyphens; hyphens cannot appear at the end or start; the length is 63 characters at most.

display_namestring · min: 1 · max: 150Optional

Sets the display name of the new role. If not provided, the value of "name" will be used.

descriptionstring · max: 280Optional

Sets the description of the new role.

Responses
post
/api/v1/roles
post

Adds a permission statement to an existing Role's policy. No deduplication is done.

Authorizations
AuthorizationstringRequired

The bearer token can be obtained by creating a ServiceAccount.

Path parameters
namestringRequired
Body

Describes the effect for an action and resource.

effectstring · enumRequired

Enumerates permission effects.

Possible values:
actionone ofRequired

Is either a single action or a list of actions.

stringOptional
or
string[] · min: 1Optional
resourceone ofRequired

Is either a single string or a list of strings.

stringOptional
or
string[] · min: 1Optional
Responses
200

Happy response.

application/json
post
/api/v1/roles/{name}/policy
get

Returns a specific role.

Authorizations
AuthorizationstringRequired

The bearer token can be obtained by creating a ServiceAccount.

Path parameters
namestringRequired
Responses
200

Happy response.

application/json
get
/api/v1/roles/{name}
delete

Deletes a role.

Authorizations
AuthorizationstringRequired

The bearer token can be obtained by creating a ServiceAccount.

Path parameters
namestringRequired
Responses
delete
/api/v1/roles/{name}

No content

patch

Updates a role.

Authorizations
AuthorizationstringRequired

The bearer token can be obtained by creating a ServiceAccount.

Path parameters
namestringRequired
Body

Updates a role. Absent fields are left untouched.

display_namestring · min: 1 · max: 150Optional

Updates the display name of the role.

descriptionstring · max: 280Optional

Updates the description of the role.

Responses
200

Happy response.

application/json
patch
/api/v1/roles/{name}

Last updated

Was this helpful?