Access Control
Manage roles, role assignments, resource groups, and permissions, and check access, with the Harness Access Control API.
The Access Control API manages role-based access control (RBAC) in Harness. Use it to decide who can do what, and to check whether a user or service account has a permission.
Request basics
API key token: Send it in the
x-api-keyheader on every request. Go to Manage API keys to create a key and token.Account, organization, and project IDs: Send
accountIdentifieras a query parameter on every request. AddorgIdentifierandprojectIdentifierto work with roles and assignments in an organization or project. Go to Organizations and projects to find these identifiers.Base URL: Send requests to
https://app.harness.io/gateway/authz/api, followed by the endpoint path.
Example request
List the roles in your account:
curl "https://app.harness.io/gateway/authz/api/roles?accountIdentifier=ACCOUNT_ID" \
-H "x-api-key: $HARNESS_API_KEY"Replace ACCOUNT_ID with your own values, and set HARNESS_API_KEY to your API key token.
Find an endpoint
Endpoint paths are relative to the base URL.
Roles: Named sets of permissions, such as Pipeline Executor, that you give to users, user groups, and service accounts. List roles with
GET /roles. Go to Manage roles to create and edit roles.Role assignments: The link between a principal, a role, and a resource group. An assignment is what actually grants access. List assignments with
GET /roleassignmentsand grant access withPOST /roleassignments.Resource groups: The set of resources, such as specific pipelines or all secrets, that a role assignment applies to. Their endpoints are in the Core Platform API, starting with
GET /v2/resourcegroup. Go to Manage resource groups to define a resource group.Permissions: The individual actions a role can allow, such as View, Create, Edit, or Execute on a resource type. List permissions with
GET /permissions. Go to Permissions reference to look up each permission.Access checks: Requests that ask whether a principal can perform an action on a resource, without performing it. Check a permission with
POST /acl. Go to API permissions reference to see which permissions each API call needs.
Last updated
Was this helpful?