Project Roles [Beta]

This contains APIs for Project-scoped Roles.

List Roles

Returns a list of Roles present in the Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

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/orgs/{org}/projects/{project}/roles
Request samples
Response samples
[
  • {
    }
]

Create a Role

Creates a custom Role in the Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project 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
201

Role Response body

post/v1/orgs/{org}/projects/{project}/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 Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

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/orgs/{org}/projects/{project}/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 Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

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/orgs/{org}/projects/{project}/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 Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

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/orgs/{org}/projects/{project}/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
}