# Pipelines API

Source: https://docs.autessa.com/docs/reference/pipelines

> Autessa Pipelines: start, watch, promote and roll back runs Generated from the Autessa OpenAPI spec.

# Pipelines API

Autessa Pipelines: start, watch, promote and roll back runs

- **Base URL:** `https://api.autessa.com`
- **Auth:** your API key in the `Authorization` header, with no `Bearer` prefix.
- **Guide:** [Pipelines](/docs/cdk/pipelines.md)
- **Status:** 0 live, 6 in preview. Preview operations are marked.

---

## A pipeline's runs, newest first

(Preview)

**GET** `/clients/pipelines/{pipelineId}/runs`

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pipelineId` | path | string | Yes |  |
| `cursor` | query | string |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array of RunDto |  |  |
| `nextCursor` | string |  | Pass as cursor for the next page; absent or null on the last page. |

```bash
curl -X GET "https://api.autessa.com/clients/pipelines/V1StGXR8Z5/runs" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Start a run from a git ref of the pipeline's repo

(Preview)

**POST** `/clients/pipelines/{pipelineId}/runs`

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pipelineId` | path | string | Yes |  |

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ref` | string | Yes | Git ref (branch, tag or commit) to fetch from the pipeline's repo |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `run` | RunDto |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/pipelines/V1StGXR8Z5/runs" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ref":"main"}'
```

---

## One run with its stages, steps and diffs

(Preview)

**GET** `/clients/pipelines/{pipelineId}/runs/{runId}`

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pipelineId` | path | string | Yes |  |
| `runId` | path | string | Yes |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `run` | RunDto |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/pipelines/V1StGXR8Z5/runs/V1StGXR8Z5" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Approve a stage waiting for approval

(Preview)

**POST** `/clients/pipelines/{pipelineId}/runs/{runId}/promote`

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pipelineId` | path | string | Yes |  |
| `runId` | path | string | Yes |  |

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `stageName` | string |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `run` | RunDto |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/pipelines/V1StGXR8Z5/runs/V1StGXR8Z5/promote" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"stageName":"string"}'
```

---

## Roll a deployed stage back

(Preview)

**POST** `/clients/pipelines/{pipelineId}/runs/{runId}/rollback`

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pipelineId` | path | string | Yes |  |
| `runId` | path | string | Yes |  |

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `stageName` | string |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `run` | RunDto |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/pipelines/V1StGXR8Z5/runs/V1StGXR8Z5/rollback" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"stageName":"string"}'
```

---

## GitHub push webhook (HMAC-verified with the pipeline's webhook secret)

(Preview)

**POST** `/clients/pipelines/{pipelineId}/webhook/github`

Verified with the pipeline's secret (X-Hub-Signature-256); the repo tarball is fetched with a stored token.

This operation is in preview. Its shape may change before it is generally available.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pipelineId` | path | string | Yes |  |
| `X-GitHub-Event` | header | string |  |  |
| `X-Hub-Signature-256` | header | string |  | HMAC-SHA256 of the body with the pipeline's webhook secret. |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string |  |  |
| `runId` | string |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/pipelines/V1StGXR8Z5/webhook/github" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Related

- [API reference overview](/docs/reference.md)
- [Errors and retries](/docs/reference.md#errors)
- [Pipelines guide](/docs/cdk/pipelines.md)

