Pipelines
Create, run, and inspect Harness pipelines, input sets, and triggers with the Harness Pipelines API.
The Pipelines API manages Harness pipelines and their runs. Use it to start a pipeline from your own tooling, read an execution's results, and manage the triggers and input sets around it.
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
accountIdentifier,orgIdentifier, andprojectIdentifieras query parameters. Most endpoints need all three, because pipelines live in a project. Go to Organizations and projects to find these identifiers.Base URL: Send requests to
https://app.harness.io/gateway/pipeline/api, followed by the endpoint path.
Example request
List the pipelines in a project:
curl -X POST "https://app.harness.io/gateway/pipeline/api/pipelines/list?accountIdentifier=ACCOUNT_ID&orgIdentifier=ORG_ID&projectIdentifier=PROJECT_ID&page=0&size=20" \
-H "x-api-key: $HARNESS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filterType": "PipelineSetup"}'Replace ACCOUNT_ID, ORG_ID, and PROJECT_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.
Pipelines: The YAML definition of the stages and steps that build, test, and deploy your software. List pipelines with
POST /pipelines/listand read one withGET /pipelines/{pipelineIdentifier}. To add a pipeline that is stored in Git, usePOST /pipelines/import. Go to Pipelines overview to understand pipeline structure.Executions: Individual runs of a pipeline. Start a run with
POST /pipeline/execute/{identifier}, list runs withPOST /pipelines/execution/summary, read one withGET /pipelines/execution/v2/{planExecutionId}, and abort one withPUT /pipeline/execute/interrupt/{planExecutionId}. Go to Troubleshoot pipeline executions to investigate a failed run.Input sets: Saved sets of runtime input values, so the same pipeline can run with different inputs. List input sets with
GET /inputSets, create one withPOST /inputSets, and run a pipeline with saved inputs usingPOST /pipeline/execute/{identifier}/inputSetList. Go to Input sets to create an input set.Triggers: Rules that start a pipeline automatically on a schedule, a Git event, or a new artifact. List triggers with
GET /triggersand create one withPOST /triggers. Go to Triggers overview to set up a trigger.Webhook triggers: Triggers that start a pipeline from an incoming webhook, and the history of events they received. Check what happened to an incoming event with
GET /webhook/triggerExecutionDetails/{eventId}. Go to Webhook triggers reference to configure a webhook trigger.Approvals: Pipeline steps that pause a run until a person or an external system approves it. Approve or reject a waiting approval with
POST /approvals/{approvalInstanceId}/harness/activity. Go to Approvals to add an approval.Data retention: How long Harness keeps pipeline execution data. Read the retention period with
GET /pipelines/retention/{accountIdentifier}. Go to Data retention to check the retention limits.
Last updated
Was this helpful?