> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/software-delivery-agent-apis/pipelines.md).

# 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-key` header on every request. Go to [Manage API keys](https://developer.harness.io/harness-platform/use-harness-platform/automation/api/add-and-manage-api-keys) to create a key and token.
* **Account, organization, and project IDs**: Send `accountIdentifier`, `orgIdentifier`, and `projectIdentifier` as query parameters. Most endpoints need all three, because pipelines live in a project. Go to [Organizations and projects](https://developer.harness.io/harness-platform/use-harness-platform/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:

```bash
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/list` and read one with `GET /pipelines/{pipelineIdentifier}`. To add a pipeline that is stored in Git, use `POST /pipelines/import`. Go to [Pipelines overview](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/pipelines-overview) to understand pipeline structure.
* **Executions**: Individual runs of a pipeline. Start a run with `POST /pipeline/execute/{identifier}`, list runs with `POST /pipelines/execution/summary`, read one with `GET /pipelines/execution/v2/{planExecutionId}`, and abort one with `PUT /pipeline/execute/interrupt/{planExecutionId}`. Go to [Troubleshoot pipeline executions](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/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 with `POST /inputSets`, and run a pipeline with saved inputs using `POST /pipeline/execute/{identifier}/inputSetList`. Go to [Input sets](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/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 /triggers` and create one with `POST /triggers`. Go to [Triggers overview](https://developer.harness.io/harness-platform/use-harness-platform/triggers/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](https://developer.harness.io/harness-platform/use-harness-platform/triggers/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](https://developer.harness.io/harness-platform/use-harness-platform/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](https://developer.harness.io/harness-platform/use-harness-platform/references/data-retention) to check the retention limits.
