Skip to main content
POST
Create custom role

Authorizations

Authorization
string
header
required

Body

application/json
name
string
required

A human-friendly name for the custom role

Example:

"Ops team"

key
string
required

The custom role key

Example:

"role-key-123abc"

policy
object[]
required

Resource statements for custom role

description
string

Description of custom role

Example:

"An example role for members of the ops team"

basePermissions
enum<string>

When this field is omitted, reader is stored, and it grants read access across every project in addition to the policy. A value of no_access grants only what the policy allows.

Available options:
reader,
no_access
Example:

"reader"

resourceCategory
string

The category of resources this role is intended to manage. Can be organization, project, or any. This field is immutable.

Response

Custom role response

_id
string
required

The ID of the custom role

Example:

"1234a56b7c89d012345e678f"

The location and content type of related resources

key
string
required

The key of the custom role

Example:

"example-custom-role"

name
string
required

The name of the custom role

Example:

"Example custom role"

policy
object[]
required

An array of the policies that comprise this custom role

_access
object

Details on the allowed and denied actions for this custom role

description
string

The description of the custom role

Example:

"This custom role is just an example"

basePermissions
string

When this field is omitted, reader is stored, and it grants read access across every project in addition to the policy. A value of no_access grants only what the policy allows.

Example:

"reader"

resourceCategory
string

The category of resources this role is intended to manage. Can be organization, project, or any. Once set, this field cannot be changed.

assignedTo
object

The number of teams and members this role is assigned to

_presetBundleVersion
integer

If created from a preset, the preset bundle version

_presetStatements
object[]

If created from a preset, the read-only statements copied from the preset