Account Roles [Beta]

This contains APIs for Account-scoped Roles.

List Roles

Returns a list of Roles present in the Account scope.

Securityx-api-key
Request
query Parameters
page
integer
Default: 0

Pagination page number strategy: Specify the page number within the paginated collection related to the number of items on each page.

limit
integer <= 100
Default: 30

Pagination: Number of items to return.

search_term
string

This would be used to filter resources having attributes matching the search term.

sort
string

Parameter on the basis of which sorting is done.

Enum: "identifier" "name" "created" "updated"
order
string

Order on the basis of which sorting is done.

Enum: "ASC" "DESC"
header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
200

Roles List Response body

get/v1/roles
Request samples
Response samples
[
  • {
    }
]

Create a Role

Creates a custom Role in the Account scope.

Securityx-api-key
Request
header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema:
required

Role Request body

identifier
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

Role identifier

name
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z-_ ]{0,127}$

Role name

permissions
Array of strings unique

List of the permission identifiers.

description
string <= 1024 characters

Role description

object <= 128 properties

Role tags

Responses
201

Role Response body

post/v1/roles
Request samples
{
  • "identifier": "example_role",
  • "name": "Example_Role",
  • "permissions": [
    ],
  • "description": "This is an Example Role",
  • "tags": {
    }
}
Response samples
{
  • "identifier": "example_role",
  • "name": "Example_Role",
  • "permissions": [
    ],
  • "allowed_scope_levels": [
    ],
  • "description": "This is an Example Role",
  • "tags": {
    },
  • "scope": {
    },
  • "created": 1234567890,
  • "updated": 1234567890,
  • "harness_managed": true
}

Retrieve a Role

Retrieves a Role from Account scope.

Securityx-api-key
Request
path Parameters
role
required
string

Role identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
200

Role Response body

get/v1/roles/{role}
Request samples
Response samples
{
  • "identifier": "example_role",
  • "name": "Example_Role",
  • "permissions": [
    ],
  • "allowed_scope_levels": [
    ],
  • "description": "This is an Example Role",
  • "tags": {
    },
  • "scope": {
    },
  • "created": 1234567890,
  • "updated": 1234567890,
  • "harness_managed": true
}

Update a Role

Updates a Role from Account scope.

Securityx-api-key
Request
path Parameters
role
required
string

Role identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema:
required

Role Request body

identifier
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

Role identifier

name
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z-_ ]{0,127}$

Role name

permissions
Array of strings unique

List of the permission identifiers.

description
string <= 1024 characters

Role description

object <= 128 properties

Role tags

Responses
200

Role Response body

put/v1/roles/{role}
Request samples
{
  • "identifier": "example_role",
  • "name": "Example_Role",
  • "permissions": [
    ],
  • "description": "This is an Example Role",
  • "tags": {
    }
}
Response samples
{
  • "identifier": "example_role",
  • "name": "Example_Role",
  • "permissions": [
    ],
  • "allowed_scope_levels": [
    ],
  • "description": "This is an Example Role",
  • "tags": {
    },
  • "scope": {
    },
  • "created": 1234567890,
  • "updated": 1234567890,
  • "harness_managed": true
}

Delete a Role

Deletes a custom Role from Account scope.

Securityx-api-key
Request
path Parameters
role
required
string

Role identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
200

Role Response body

delete/v1/roles/{role}
Request samples
Response samples
{
  • "identifier": "example_role",
  • "name": "Example_Role",
  • "permissions": [
    ],
  • "allowed_scope_levels": [
    ],
  • "description": "This is an Example Role",
  • "tags": {
    },
  • "scope": {
    },
  • "created": 1234567890,
  • "updated": 1234567890,
  • "harness_managed": true
}