roles

This contains APIs for CRUD on roles

List roles in the given scope

Request
Security:
ApiKey (readwrite)
query Parameters
pageIndex
integer <int32>
Default: 0
pageSize
integer <int32>
Default: 50
Array of objects (SortOrder)
accountIdentifier
string
orgIdentifier
string
projectIdentifier
string
searchTerm
string
Responses
400

Bad Request

403

Unauthorized

500

Internal server error

default

Paginated list of roles in the given scope

get/authz/api/roles
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/authz/api/roles?pageIndex=0&pageSize=50&sortOrders=%5Bobject%20Object%5D&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&searchTerm=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Create a Custom Role in a scope

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
string
orgIdentifier
string
projectIdentifier
string
Request Body schema:
identifier
string
name
string
permissions
Array of strings unique
allowedScopeLevels
Array of strings unique
description
string
object
Responses
400

Bad Request

403

Unauthorized

500

Internal server error

default

Created Role

post/authz/api/roles
Request samples
{
  • "identifier": "string",
  • "name": "string",
  • "permissions": [
    ],
  • "allowedScopeLevels": [
    ],
  • "description": "string",
  • "tags": {
    }
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get a Role by identifier

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
string
orgIdentifier
string
projectIdentifier
string
Responses
400

Bad Request

403

Unauthorized

500

Internal server error

default

Queried Role

get/authz/api/roles/{identifier}
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/authz/api/roles/:identifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update a Custom Role by identifier

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
string
orgIdentifier
string
projectIdentifier
string
Request Body schema:
identifier
string
name
string
permissions
Array of strings unique
allowedScopeLevels
Array of strings unique
description
string
object
Responses
400

Bad Request

403

Unauthorized

500

Internal server error

default

Updated Role

put/authz/api/roles/{identifier}
Request samples
{
  • "identifier": "string",
  • "name": "string",
  • "permissions": [
    ],
  • "allowedScopeLevels": [
    ],
  • "description": "string",
  • "tags": {
    }
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Delete a Custom Role in a scope

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
string
orgIdentifier
string
projectIdentifier
string
Responses
400

Bad Request

403

Unauthorized

500

Internal server error

default

Deleted Role

delete/authz/api/roles/{identifier}
Request samples
curl -i -X DELETE \
  'https://app.harness.io/gateway/authz/api/roles/:identifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}