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.
- List pipelines
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.
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, read our documentation or visit the Harness Developer Hub.
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.
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.
To authenticate with the Harness API, you need to:
- Generate an API token on the Harness Platform.
- Send the API token you generate in the
x-api-keyheader in each request.
To generate an API token, complete the following steps:
- Go to the Harness Platform.
- On the left-hand navigation, click My Profile.
- Click +API Key, enter a name for your key and then click Save.
- Within the API Key tile, click +Token.
- 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 token you created in the Harness Platform in the x-api-key header. For example: x-api-key: YOUR_API_KEY_HERE
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.
| Field Name | Type | Default | Description |
|---|---|---|---|
| identifier | string | none | URL-friendly version of the name, used to identify a resource within it's scope and so needs to be unique within the scope. |
| name | string | none | Human-friendly name for the resource. |
| org | string | none | Limit to provided org identifiers. |
| project | string | none | Limit to provided project identifiers. |
| description | string | none | More information about the specific resource. |
| tags | map[string]string | none | List of labels applied to the resource. |
| order | string | desc | Order to use when sorting the specified fields. Type: enum(asc,desc). |
| sort | string | none | Fields 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. |
| limit | int | 30 | Pagination: Number of items to return. |
| page | int | 1 | Pagination page number strategy: Specify the page number within the paginated collection related to the number of items in each page. |
| created | int64 | none | Unix timestamp that shows when the resource was created (in milliseconds). |
| updated | int64 | none | Unix timestamp that shows when the resource was last edited (in milliseconds). |
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 Code | Description |
|---|---|
| 200 | OK |
| 201 | Created |
| 202 | Accepted |
| 204 | No Content |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 412 | Precondition Failed |
| 415 | Unsupported Media Type |
| 500 | Server Error |
To view our error response structures, go here.
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.
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.
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:
- X-Total-Elements : Indicates the total number of entries in a paginated response.
- X-Page-Number : Indicates the page number currently returned for a paginated response.
- 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 : 10The type of event that occurred
Deprecated: use metadata instead
- Harness host URLhttps://app.harness.io/iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/events
- Vanity URLhttps://app.harness.io/iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/events
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://app.harness.io/iacm/api/orgs/9l/projects/ge/workspaces/4/events \
-H 'Content-Type: application/json' \
-H 'Harness-Account: u' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"data": {
"Et incidunt.": "Corporis voluptas.",
"Provident aut et deserunt eos.": "Harum eaque ipsa incidunt iure id."
},
"event_type": "destroying",
"metadata": {
"PlannedChangesCount": 161388746259075520,
"activity_status": "incomplete",
"activity_type": "drifted",
"cost_breakdown_uuid": "Voluptate perspiciatis pariatur dolor omnis natus dolores.",
"cost_currency": "Consequatur quo ratione.",
"cost_diff_total_monthly": "Et libero incidunt doloribus harum impedit.",
"cost_diff_uuid": "Magni et impedit.",
"cost_past_total_monthly": "At minima sunt quibusdam id.",
"cost_total_monthly": "Sapiente velit.",
"cost_total_monthly_percentage_change": "Omnis expedita illum illum rerum.",
"data_length": 3931118570708046300,
"drift_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"enable_solutions_factory": true,
"git_branch": "Et harum perspiciatis.",
"git_commit_message": "Cum aut quisquam officiis.",
"git_commit_sha": "Ea expedita.",
"git_repo": "Ut voluptatem et et.",
"modules_uuid": "Sequi sit dolores architecto sit.",
"output_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"pipeline": "Optio et eos eos ad.",
"pipeline_execution_id": "Veritatis aut enim eos non aut expedita.",
"pipeline_execution_number": "Optio qui qui quos.",
"pipeline_name": "Nesciunt assumenda.",
"pipeline_stage_id": "Necessitatibus amet.",
"plan_uuid": "Quae sint placeat.",
"providers_uuid": "Iure temporibus id tempore fuga molestias reprehenderit.",
"provisioner": "Et velit.",
"provisioner_version": "Consectetur rerum impedit error iste.",
"resource_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"state_checksum": "Voluptatem blanditiis voluptatem est molestias velit.",
"state_uuid": "Temporibus temporibus.",
"terragrunt_details": [
{
"cost_breakdown_uuid": "Quibusdam recusandae esse ea.",
"cost_currency": "Et consectetur.",
"cost_diff_total_monthly": "Eos sint dignissimos aliquid ratione quos.",
"cost_diff_uuid": "Omnis eum.",
"cost_past_total_monthly": "Eos sint quidem itaque quidem.",
"cost_total_monthly": "Qui est non harum ea.",
"cost_total_monthly_percentage_change": "Sit id doloribus.",
"drift_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"output_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"path_id": "In doloribus aut minus omnis labore nulla.",
"resource_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"state_file_link": "Quo necessitatibus et.",
"status": "Culpa et."
},
{
"cost_breakdown_uuid": "Quibusdam recusandae esse ea.",
"cost_currency": "Et consectetur.",
"cost_diff_total_monthly": "Eos sint dignissimos aliquid ratione quos.",
"cost_diff_uuid": "Omnis eum.",
"cost_past_total_monthly": "Eos sint quidem itaque quidem.",
"cost_total_monthly": "Qui est non harum ea.",
"cost_total_monthly_percentage_change": "Sit id doloribus.",
"drift_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"output_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"path_id": "In doloribus aut minus omnis labore nulla.",
"resource_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"state_file_link": "Quo necessitatibus et.",
"status": "Culpa et."
},
{
"cost_breakdown_uuid": "Quibusdam recusandae esse ea.",
"cost_currency": "Et consectetur.",
"cost_diff_total_monthly": "Eos sint dignissimos aliquid ratione quos.",
"cost_diff_uuid": "Omnis eum.",
"cost_past_total_monthly": "Eos sint quidem itaque quidem.",
"cost_total_monthly": "Qui est non harum ea.",
"cost_total_monthly_percentage_change": "Sit id doloribus.",
"drift_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"output_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"path_id": "In doloribus aut minus omnis labore nulla.",
"resource_counts": {
"added": 4539908473267251000,
"changed": 596921327399798800,
"deleted": 6715161690239792000,
"imported": 2090413655402707000,
"removed": 159430498573768600,
"unchanged": 6820842778363223000
},
"state_file_link": "Quo necessitatibus et.",
"status": "Culpa et."
}
],
"trigger": {
"Et nisi aperiam optio quia.": "Aliquam quia temporibus consequatur.",
"Optio ipsam velit fugiat molestias quo.": "Sunt aspernatur enim odio sit rerum.",
"Qui excepturi animi nihil expedita officia.": "Aut quis."
}
},
"pipeline_execution_id": "Cupiditate consequuntur veritatis magnam voluptatem fuga quisquam.",
"pipeline_stage_id": "Facere similique recusandae optio et non."
}'- Harness host URLhttps://app.harness.io/iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/pipelines
- Vanity URLhttps://app.harness.io/iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/pipelines
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://app.harness.io/iacm/api/orgs/9/projects/c9/workspaces/Sint laboriosam./pipelines?limit=30&page=1' \
-H 'Harness-Account: bw1' \
-H 'x-api-key: YOUR_API_KEY_HERE'OK response.
Account is the internal customer account ID.
Array of pipelines that belong to a specific workspace
{ "account": "h", "org": "sh", "pipelines": [ "Et minus non.", "Qui fuga." ], "project": "89" }
The arguments supplied to the plan.
- Harness host URLhttps://app.harness.io/iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remote-executions
- Vanity URLhttps://app.harness.io/iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remote-executions
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://app.harness.io/iacm/api/orgs/n6w/projects/d0/workspaces/Alias voluptate esse autem quia./remote-executions' \
-H 'Content-Type: application/json' \
-H 'Harness-Account: o' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"custom_arguments": {
"Nostrum ut atque rerum ea aspernatur qui.": [
"Amet et.",
"Et quae maxime nemo quae minima veniam.",
"Ipsam qui velit quo eius ut.",
"Sed ea necessitatibus corrupti quam vitae."
],
"Veniam consequatur aliquid quis voluptas.": [
"Occaecati pariatur assumenda sed neque.",
"Aliquam saepe earum."
]
}
}'Created response.
Account is the internal customer account ID.
Created is the unix timestamp at which the resource was originally created in milliseconds.
The arguments supplied to the plan.
The boolean value indicating if the remote execution has been executed.
The ID of the remote execution.
The pipeline execution ID of the pipeline executing the remote execution
The pipeline execution URL of the pipeline executing the remote execution
The checksum of the patch file of changes that the remote execution will run against.
Modified is the unix timestamp at which the resource was last modified in milliseconds.
{ "account": "l9", "created": 2112891510037240800, "custom_arguments": { "Eligendi voluptatum illo aliquid quia.": [ … ], "Mollitia voluptatum ut facere.": [ … ], "Perferendis unde.": [ … ] }, "executed": true, "id": "bdba64ce-b622-41f4-b0a8-7c8009fd9658", "org": "q", "pipeline_execution_id": "Magnam ea dolorem.", "pipeline_execution_url": "Ea dolorum vero.", "project": "w", "sha256_checksum": "Enim harum vel placeat est commodi.", "updated": 4395568222709632000, "workspace": "Et itaque repudiandae." }