> ## Documentation Index
> Fetch the complete documentation index at: https://developers.essal.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Pipelines

> API reference for Essal Sales pipelines — configuration, stage management, and forecasting.

## List Pipelines

`GET /v1/sales/pipelines`

***

## Get a Pipeline

`GET /v1/sales/pipelines/{id}`

```json theme={null}
{
  "id": "pip_01HXYZ1111",
  "name": "Enterprise Sales",
  "stage_count": 5,
  "deal_count": 34,
  "total_value": 2140000,
  "currency": "GBP"
}
```

***

## Create a Pipeline

`POST /v1/sales/pipelines`

```json theme={null}
{
  "name": "SMB Pipeline",
  "stages": [
    { "name": "Lead", "order": 1, "probability": 10 },
    { "name": "Discovery", "order": 2, "probability": 30 },
    { "name": "Proposal", "order": 3, "probability": 60 },
    { "name": "Closed Won", "order": 4, "probability": 100 }
  ]
}
```

***

## Update a Pipeline

`PATCH /v1/sales/pipelines/{id}`

Update the pipeline name or reorder stages:

```json theme={null}
{
  "name": "SMB & Mid-Market",
  "stages": [
    { "id": "stg_01HXYZS1", "order": 1 },
    { "id": "stg_01HXYZS2", "order": 2 }
  ]
}
```

***

## Add a Stage

`POST /v1/sales/pipelines/{id}/stages`

```json theme={null}
{ "name": "Pilot", "order": 3, "probability": 50 }
```

***

## Get Forecast

`GET /v1/sales/pipelines/{id}/forecast`

**Query Parameters**

| Parameter  | Type   | Description                  |
| ---------- | ------ | ---------------------------- |
| `period`   | string | e.g. `2026-Q3`, `2026-07`    |
| `group_by` | enum   | `stage` (default) or `owner` |

Returns weighted deal values grouped by stage or owner.

***

## Delete a Pipeline

`DELETE /v1/sales/pipelines/{id}`

A pipeline cannot be deleted if it contains open deals.
