Skip to content

Harness APIs (1.0)

The Harness Software Delivery Platform uses OpenAPI Specification v3.0. Harness constantly improves these APIs. Please be aware that some improvements could cause breaking changes.

Introduction

The Harness API allows you to integrate and use all the services and modules we provide on the Harness Platform. If you use client-side SDKs, Harness functionality can be integrated with your client-side automation, helping you reduce manual efforts and deploy code faster.

For more information about how Harness works, visit the Harness Developer Hub.

How it works

The Harness API is a RESTful API that uses standard HTTP verbs. You can send requests in JSON, YAML, or form-data format. The format of the response matches the format of your request. You must send a single request at a time and ensure that you include your authentication key. For more information about this, go to Authentication.

Get started

Before you start integrating, get to know our API better by reading the following topics:

The methods you need to integrate with depend on the functionality you want to use. Work with your Harness Solutions Engineer to determine which methods you need.

Authentication

To authenticate with the Harness API, you need to:

  1. Generate an API token on the Harness Platform.
  2. Send the API token you generate in the x-api-key header in each request.

Generate an API token

To generate an API token, complete the following steps:

  1. Go to the Harness Platform.
  2. On the left-hand navigation, click My Profile.
  3. Click +API Key, enter a name for your key and then click Save.
  4. Within the API Key tile, click +Token.
  5. Enter a name for your token and click Generate Token. Important: Make sure to save your token securely. Harness does not store the API token for future reference, so make sure to save your token securely before you leave the page.

Send the API token in your requests

Send the token you created in the Harness Platform in the x-api-key header. For example: x-api-key: YOUR_API_KEY_HERE

Requests and Responses

The structure for each request and response is outlined in the API documentation. We have examples in JSON and YAML for every request and response. You can use our online editor to test the examples.

Common Parameters [Beta]

Field NameTypeDefaultDescription
identifierstringnoneURL-friendly version of the name, used to identify a resource within it's scope and so needs to be unique within the scope.
namestringnoneHuman-friendly name for the resource.
orgstringnoneLimit to provided org identifiers.
projectstringnoneLimit to provided project identifiers.
descriptionstringnoneMore information about the specific resource.
tagsmap[string]stringnoneList of labels applied to the resource.
orderstringdescOrder to use when sorting the specified fields. Type: enum(asc,desc).
sortstringnoneFields on which to sort. Note: Specify the fields that you want to use for sorting. When doing so, consider the operational overhead of sorting fields.
limitint30Pagination: Number of items to return.
pageint1Pagination page number strategy: Specify the page number within the paginated collection related to the number of items in each page.
createdint64noneUnix timestamp that shows when the resource was created (in milliseconds).
updatedint64noneUnix timestamp that shows when the resource was last edited (in milliseconds).

Status Codes

Harness uses conventional HTTP status codes to indicate the status of an API request. Generally, 2xx responses are reserved for success and 4xx status codes are reserved for failures. A 5xx response code indicates an error on the Harness server.

Error CodeDescription
200OK
201Created
202Accepted
204No Content
400Bad Request
401Unauthorized
403Forbidden
412Precondition Failed
415Unsupported Media Type
500Server Error

To view our error response structures, go here.

Versioning [Beta]

Harness Version

The current version of our Beta APIs is yet to be announced. The version number will use the date-header format and will be valid only for our Beta APIs.

Generation

All our beta APIs are versioned as a Generation, and this version is included in the path to every API resource. For example, v1 beta APIs begin with app.harness.io/v1/, where v1 is the API Generation.

The version number represents the core API and does not change frequently. The version number changes only if there is a significant departure from the basic underpinnings of the existing API. For example, when Harness performs a system-wide refactoring of core concepts or resources.

Pagination [Beta]

We use pagination to place limits on the number of responses associated with list endpoints. Pagination is achieved by the use of limit query parameters. The limit defaults to 30. Its maximum value is 100.

Following are the pagination headers supported in the response bodies of paginated APIs:

  1. X-Total-Elements : Indicates the total number of entries in a paginated response.
  2. X-Page-Number : Indicates the page number currently returned for a paginated response.
  3. X-Page-Size : Indicates the number of entries per page for a paginated response.

For example:

X-Total-Elements : 30
X-Page-Number : 0
X-Page-Size : 10
Download OpenAPI description
Languages
Servers
Mock server

https://apidocs.harness.io/_mock/openapi-merged/

Harness host URL

https://app.harness.io/

Vanity URL

https://{vanity}/

Organization

Create and manage organizations in your account. You use organizations to group together related projects. For example, you can use an organization to group together projects within a business unit or division.

Operations

Project [Beta]

This contains APIs for projects.

Operations

Project

This contains APIs related to Project as defined in Harness

Operations

Account Secrets [Beta]

This contains APIs for account-scoped secrets.

Operations

Organization Secrets [Beta]

This contains APIs for organization-scoped secrets.

Operations

Project Secrets [Beta]

This contains APIs for project-scoped secrets.

Operations

Secrets

This contains APIs related to Secrets as defined in Harness

Operations

Account Connectors [Beta]

This contains APIs for Account-scoped Connectors.

Operations

Organization Connectors [Beta]

This contains APIs for Organization-scoped Connectors.

Operations

Project Connectors [Beta]

This contains APIs for Project-scoped Connectors.

Operations

Connectors

This contains APIs related to Connectors as defined in Harness

Operations

GoogleSecretManagerConnector

This contains APIs specific to Google Secret Manager Connector as defined in Harness

Operations

Account Roles [Beta]

This contains APIs for Account-scoped Roles.

Operations

Organization Roles [Beta]

This contains APIs for Organization-scoped Roles.

Operations

Project Roles [Beta]

This contains APIs for Project-scoped Roles.

Operations

Roles

This contains APIs for CRUD on roles

Operations

Account Resource Groups [Beta]

This contains APIs for Account-scoped Resource Groups.

Operations

Organization Resource Groups [Beta]

This contains APIs for Organization-scoped Resource Groups.

Operations

Project Resource Groups [Beta]

This contains APIs for Project-scoped Resource Groups.

Operations

Filter Resource Groups [Beta]

This contains the filter endpoint for Resource Groups.

Operations

Account Role Assignments [Beta]

This contains APIs for Account-scoped Role Assignments.

Operations

Organization Role Assignments [Beta]

This contains APIs for Organization-scoped Role Assignments.

Operations

Project Role Assignments [Beta]

This contains APIs for Project-scoped Role Assignments.

Operations

Role Assignments

This contains APIs for CRUD on role assignments

Operations

Access Control List

This contains the APIs to perform access control checks

Operations

Account Banner

This contains APIs for Account Banners.

Operations

Account Banner

This contains APIs for Account Banners.

Operations

Account Licensed Modules

This contains APIs for Account Licensed Modules.

Operations
Operations

Account Webhooks

This contains APIs for Account Webhooks.

Operations

AccountSetting

This contains APIs related to Account Settings as defined in Harness

Operations

Accounts

This contains APIs related to accounts as defined in Harness

Operations
Operations

Analyze Organization Access Policy

Operations
Operations

ApiKey

This fetches API keys defined in Harness

Operations

Audit

This contains APIs related to Audit as defined in Harness

Operations

AuditFilters

This contains APIs related to Filter of type Audit as defined in Harness

Operations

Authentication Settings

This contains APIs related to Authentication settings as defined in Harness

Operations

Canny

This contains APIs required for the creation of Canny tickets

Operations

Devops Essentials License Data By Account

Operations

EULA [Beta]

This contains APIs for EULA.

Operations

Filter

This contains APIs related to Filter as defined in Harness

Operations

Invite

This contains APIs related to Invite as defined in Harness

Operations

IP Allowlist [Beta]

This contains APIs for IP Allowlist.

Operations

Nextgen Ldap

This contains APIs related to Nextgen Ldap as defined in Harness

Operations

Notification Channels

This contains APIs for Notification Channels

Operations

Notification Rules

This contains APIs for Notification Rules

Operations

OIDC

This contains APIs related to the Harness OIDC config

Operations

Oidc-Access-Token

This contains APIs related to OIDC Access Token generation as defined in Harness

Operations

Oidc-ID-Token

This contains APIs related to OIDC ID Token generation as defined in Harness

Operations

Org Webhooks

This contains APIs for Org Webhooks.

Operations

Permissions

This contains the APIs related to permissions

Operations

Project Webhooks

This contains APIs for Project Webhooks.

Operations

Secret Managers

This contains APIs related to SecretManagers as defined in Harness

Operations

Service Account

This has all the APIs specific to the Service Accounts in Harness.

Operations

Setting

This contains APIs related to Settings as defined in Harness

Operations

SMTP

This contains APIs related to SmtpConfig as defined in Harness

Operations

Source Code Manager

Contains APIs related to Source Code Manager

Operations

Token

This contains APIs related to Token as defined in Harness

Operations

User

This contains APIs related to User as defined in Harness

Operations

User Group

This contains APIs related to User Group as defined in Harness

Operations

Variables

This contains APIs related to Variables as defined in Harness.

Operations

Agent mTLS Endpoint Management

Contains APIs related to Agent mTLS Endpoint management.

Operations

Delegate Download Resource

Contains APIs related to Downloading Delegates

Operations

Delegate Group Tags Resource

Contains APIs related to Delegate Group Tags management

Operations

Delegate Setup Resource

Contains Delegate Setup APIs

Operations

Delegate Token Resource

Contains APIs related to Delegate Token management

Operations

Pipelines [Beta]

This contains APIs for performing CRUD operations on Pipelines.

Operations

Input Sets [Beta]

This contains APIs for Input Sets.

Operations

Approvals

This contains APIs for Approvals.

Operations

Pipeline Execution [Beta]

This contains APIs for Pipeline Execution.

Operations

Pipeline Dashboard

This contains APIs related to Pipeline Dashboard

Operations

Pipeline Input Set

This contains APIs related to Input Sets

Operations

Pipeline

This contains pipeline APIs for files as provided as runtime input during pipeline execution

Operations

Pipeline Execution Details

This contains APIs for fetching Pipeline Execution Details

Operations

Pipeline Execute

This contains APIs for Executing a Pipeline

Operations

Pipeline Refresh

This contains APIs related to validation of templates in pipeline yaml

Operations

Pipeline data retention

This contains APIs related to retention of pipeline execution data

Operations

Triggers [Beta]

This contains APIs for performing CRUD operations on Triggers.

Operations

TriggersEvents

This contains APIs related to Trigger Event History.

Operations

Webhook Triggers

This contains APIs related to Webhook Triggers.

Operations

Webhook Event Handler

Contains APIs corresponding to Webhook Triggers.

Operations

Registries

APIs to create, update, list registries

Operations

Artifacts

APIs to get, list artifacts

Operations

Docker Artifacts

APIs to get details of docker artifacts

Operations

Helm Artifacts

APIs to get details of helm artifacts

Operations

Webhooks

APIs to create, update, list webhooks

Operations
Operations
Operations

Database Schema

This contains APIs for performing CRUD operations on Database Schema Entity

Operations

Database Instance

This contains APIs for performing CRUD operations on Database Instance Entity

Operations

Deployed State

This contains APIs for tracking changeSet deployment status

Operations

Execution Config

This contains APIs for execution config for image tags

Operations

Migration State

This contains APIs for getting Migration State of Database Schema Entity

Operations

K8s Release Service Mapping [Beta]

This contains APIs for Fetching Release details regarding a pod.

Operations

CustomDeployment

This contains APIs related to Custom Deployment

Operations

Environments

This contains APIs related to Environments

Operations

EnvironmentGroup

This contains APIs related to EnvironmentGroup.

Operations

Infrastructures

This contains APIs related to Infrastructure Definitions

Operations

Usage

This contains APIs specific to CD license usage

Operations

Request

Security
x-api-key
Path
usageTypestringrequired
Enum"ServiceDeployment""Gitops""PipelineExecution"
Query
accountIdentifierstring

Account Identifier for the Entity.

timestampinteger(int64)
Default 0
curl -i -X GET \
  'https://apidocs.harness.io/_mock/openapi-merged/ng/api/license-usage-cd/v2/{usageType}/csv/download?accountIdentifier=string&timestamp=0' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

Bad Request

Body
statusstring
Enum"SUCCESS""FAILURE""ERROR"
codestring
Enum"DEFAULT_ERROR_CODE""INVALID_ARGUMENT""INVALID_EMAIL""DOMAIN_NOT_ALLOWED_TO_REGISTER""COMMNITY_EDITION_NOT_FOUND""DEPLOY_MODE_IS_NOT_ON_PREM""USER_ALREADY_REGISTERED""USER_INVITATION_DOES_NOT_EXIST""USER_DOES_NOT_EXIST""USER_INVITE_OPERATION_FAILED"
messagestring
correlationIdstring
errorsArray of objects(ValidationError)
Response
{ "status": "SUCCESS", "code": "DEFAULT_ERROR_CODE", "message": "string", "correlationId": "string", "errors": [ { … } ] }

Download CSV Active Services report

Request

Security
x-api-key
Query
accountIdentifierstring

Account Identifier for the Entity.

timestampinteger(int64)
Default 0
curl -i -X GET \
  'https://apidocs.harness.io/_mock/openapi-merged/ng/api/usage/cd/active-services/csv/download?accountIdentifier=string&timestamp=0' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

Bad Request

Body
statusstring
Enum"SUCCESS""FAILURE""ERROR"
codestring
Enum"DEFAULT_ERROR_CODE""INVALID_ARGUMENT""INVALID_EMAIL""DOMAIN_NOT_ALLOWED_TO_REGISTER""COMMNITY_EDITION_NOT_FOUND""DEPLOY_MODE_IS_NOT_ON_PREM""USER_ALREADY_REGISTERED""USER_INVITATION_DOES_NOT_EXIST""USER_DOES_NOT_EXIST""USER_INVITE_OPERATION_FAILED"
messagestring
correlationIdstring
errorsArray of objects(ValidationError)
Response
{ "status": "SUCCESS", "code": "DEFAULT_ERROR_CODE", "message": "string", "correlationId": "string", "errors": [ { … } ] }

Gets License Usage By Module, Timestamp, and Account Identifier

Request

Security
x-api-key
Query
accountIdentifierstring

Account id to get the license usage.

timestampinteger(int64)
curl -i -X GET \
  'https://apidocs.harness.io/_mock/openapi-merged/ng/api/usage/CD/serviceInstancesLicense?accountIdentifier=string&timestamp=0' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

Bad Request

Body
statusstring
Enum"SUCCESS""FAILURE""ERROR"
codestring
Enum"DEFAULT_ERROR_CODE""INVALID_ARGUMENT""INVALID_EMAIL""DOMAIN_NOT_ALLOWED_TO_REGISTER""COMMNITY_EDITION_NOT_FOUND""DEPLOY_MODE_IS_NOT_ON_PREM""USER_ALREADY_REGISTERED""USER_INVITATION_DOES_NOT_EXIST""USER_DOES_NOT_EXIST""USER_INVITE_OPERATION_FAILED"
messagestring
correlationIdstring
errorsArray of objects(ValidationError)
Response
{ "status": "SUCCESS", "code": "DEFAULT_ERROR_CODE", "message": "string", "correlationId": "string", "errors": [ { … } ] }

File Store

This contains APIs related to File Store in Harness

Operations

Service Dashboard

This contains APIs related to Service Dashboard

Operations

ServiceOverrides

This contains APIs related to Service Overrides V2

Operations

Rollback

This contains APIs related to Post Prod Rollback of specific service

Operations

tas

This contains APIs related to tas

Operations

Freeze CRUD

This contains APIs related to Freeze CRUD

Operations

Freeze Evaluation

This contains APIs related to evaluation Freeze status

Freeze Schema

This contains APIs related to construct schema for Freeze

Account Services [Beta]

This contains APIs for account-scoped services.

Operations

Organization Services [Beta]

This contains APIs for organization-scoped services.

Operations

Project Services [Beta]

This contains APIs for project-scoped services.

Operations

Services

This contains APIs related to Services

Operations

Account Rancher Infrastructure [Beta]

This contains APIs for Rancher infra entities for account level.

Operations

Org Rancher Infrastructure [Beta]

This contains APIs for Rancher infra entities for org level.

Operations

Project Rancher Infrastructure [Beta]

This contains APIs for Rancher infra entities for project level.

Operations

Account Templates [Beta]

This contains APIs for Account-scoped Templates.

Operations

Organization Templates [Beta]

This contains APIs for Organization-scoped Templates.

Operations

Project Templates [Beta]

This contains APIs for Project-scoped Templates.

Operations

Templates

This contains a list of APIs specific to the Templates Validations and Refresh

Operations

Global Templates

This contains a list of APIs specific to the Global Templates

Operations
Operations
Operations
Operations

Clusters

This contains APIs related to Gitops Clusters

Operations
Operations
Operations
Operations
Operations

Hosts

This contains APIs related to Hosts as defined in Harness

Operations
Operations
Operations
Operations
Operations
Operations
Operations

ValidateHost

This contains APIs related to SSH or WinRm host validation

Operations

Account GitX Webhooks

This contains APIs for Account GitX Webhooks.

Operations
Operations
Operations

Cloud Cost Anomalies

Get details about any anomalous spike in your cloud costs

Operations

Cloud Cost BI Dashboards

Get details of BI-dashboards specific to CCM

Operations

Cloud Cost Budget Groups

Manage Budget Groups and receive alerts when your costs exceed (or are forecasted to exceed) your configured budget group.

Operations

Cloud Cost Budgets

Manage Budgets and receive alerts when your costs exceed (or are forecasted to exceed) your budget.

Operations

Cloud Cost K8S Connectors Metadata

Health related metadata for your k8S clusters having cost access enabled.

Operations

Cloud Cost Details

Fetch cloud cost data for cost analysis

Operations

Cloud Cost Overview

Get overview of CCM features.

Operations

Cloud Cost Cost Categories

Allows you to categorize based on business requirements and get a contextual view of your expenses.

Operations

RuleEnforcement

This contains APIs related to Rule Enforcement

Operations

Rule

This contains APIs related to Governance Rule Management

Operations

Rule Executions

This contains APIs related to Rule Executions

Operations

Rule Sets

Rule sets serve as logical bindings on top of individual rules that help you organize and manage rules.

Operations

Governance Overview

This contains APIs related to CCM Governance Overview Page

Operations

Cloud Cost Perspectives Folders

Group your Perspectives using Folders in ways that are more meaningful to your business needs.

Operations

Cloud Cost Perspective Reports

Manage cost reports created on Perspectives.

Operations

Cloud Cost Perspectives

Group your resources using Perspectives in ways that are more meaningful to your business needs.

Operations

Cloud Cost Recommendations Details

Cloud Cost Recommendations details for workloads and node pools.

Operations

Cloud Cost Recommendations

Recommendations for workloads and node pools.

Operations

Cloud Cost Recommendation Jira

Cloud Cost recommendation CRUD apis for jira.

Operations

Cloud Cost Recommendation Servicenow

Cloud Cost recommendation CRUD apis for servicenow.

Operations

Cloud Cost Recommendation Ignore List

Cloud Cost recommendation CRUD apis for recommendations ignore list.

Operations

Cloud Cost AutoStopping Rules

This contains APIs to create and manage AutoStopping Rules for your cloud resources.

Operations

Cloud Cost AutoStopping Rules V2

This contains Autostopping v2 APIs that support the usage of Autostopping Proxy for managing cloud resources.

Operations

Cloud Cost AutoStopping Load Balancers

This contains APIs to create and manage load balancers used for AutoStopping.

Operations

Cloud Cost AutoStopping Fixed Schedules

This contains APIs to manage fixed schedules for the AutoStopping Rules.

Operations

Commitment Orchestrator Events APIs

This contains APIs to fetch commitment orchestrator events data.

Operations

API Keys

APIs to create and manage Feature Flag SDK API Keys

Operations

Feature Flags

APIs to create and manage Feature Flags

Operations

Targets

APIs to create and manage Feature Flag Targets

Operations

Target Groups

APIs to create and manage Feature Flag Target Groups

Operations

Environment Perspectives

APIs to create and manage Feature Flag Environment perspectives

Operations

Anomalies

APIs to manage Anomalies on the Feature Flag Service

Operations
Operations

Tags

APIs to create and manage Feature Flag Tags

Operations

Monitored Services

This contains APIs related to CRUD operations of Monitored Services

Operations

SLOs dashboard

This contains APIs related to SLOs dashboard

Operations

NG SLOs

This contains APIs related to CRUD operations of SLOs (simple & composite)

Operations

SLOs

This contains APIs related to CRUD operations of SLOs

Operations

Downtime

This contains APIs related to CRUD operations of Downtime

Operations

Srm Notification

This contains APIs related to CRUD operations of srm notifications

Operations

Entities

APIs for managing catalog Entities which represent the core components of your system. Entities can represent services, APIs, user groups, resources, and more. These endpoints allow you to create, retrieve, update, delete, and query entities across different scopes.

Operations

Catalog Custom Properties

Catalog Custom Properties

Operations

Scores Information

Scores Information

Operations

DataSource Information

DataSource Information

Operations

Kubernetes DataPoints Information

Kubernetes DataPoints Information

Operations

IDP App Configurations

IDP App Configurations

Operations

Plugin Information

Plugin Information

Operations
Operations
Operations
Operations
Operations
Operations

dashboard

Aggregate summary of policies, policy sets and evaluations for display on the dashboard

Operations

examples

Example rego policies and corresponding input

Operations

policies

Create, edit and delete Governance policies written in rego

Operations
Operations

evaluations

Access evaluation results

Operations

policysets

Create, edit and delete Governance policy sets

Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations

usage

Usage service handles licencing

Operations

approvals

Approval service handles the approval API to approve or reject pipeline executions

Operations

costs

Costs Service handles the API related with the costs attached to workspaces. This API is read only as all the cost are generated in the plugin side

Operations

executions

Executions Service handles the API for workflow executions.

At this time it is a read-only API with no ability to directly create or edit executions. Instead these are triggered from the Workspaces Service.

Operations

module-registry

The module-registry service is a private registry for Terraform/Opentofu modules

Operations

workspaces

Workspaces Service handles the API for managing workspaces and triggering workflows against them.

Operations

settings

Settings service handles all API endpoints related to configuration settings

Operations

tf-standard-backend

HTTP standard backend for Terraform

Operations

variables

Variables Service handles the API for managing workspace variables.

Operations

Exemptions

Access and modify Exemptions to Security Issues

Operations

Issues

Access and modify Security Issues

Operations

Scans

Access and modify Security Test Scans

Operations

Products

Access Scan Tool information

Operations

Test Targets

Access and modify Scan Targets

Operations

Target Variants

Access and modify Scan Target Variants

Operations

Collection categories

This contains APIs specific to the Collection categories

Operations

Collections

This contains APIs specific to Collections

Operations

Contributors

This contains APIs specific to the Contributors

Operations

DORA

This contains APIs specific to the DORA reports

Operations

Git Branches

Contains APIs related to Git Sync Branch

Operations

Git Full Sync

Contains APIs related to Git Full Sync

Operations

Git Sync Settings

Contains APIs related to Git Sync Settings

Operations

Git Sync

Contains APIs for CRUD on Git Sync

Operations

Git Sync Errors

Contains APIs related to Git Sync Errors

Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations