# Pipelines and stages

Returns the agency’s pipelines and the stages inside each one. Use the stage uid when you filter or move a deal.

Source: https://dev.alterestate.com/deals/pipelines
Last updated: 2026-10-13

A pipeline is a funnel (Sales, Rentals, Prospects). A stage is a column inside that funnel. List pipelines first, then list stages with the pipeline uid. The list of pipelines does not embed its stages.

## List pipelines

```http
GET https://secure.alterestate.com/api/v1/deals/pipeline/
```

Authentication: `Authorization: Token your_api_key_here`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pipe_type` | query | string | no | deals, prospects, won, accounting or properties. Omit it to return every type. |
| `is_active` | query | boolean | no | true returns only active pipelines. |

Example request:

```bash
curl --request GET \
  --url 'https://secure.alterestate.com/api/v1/deals/pipeline/?pipe_type=deals' \
  --header 'Authorization: Token your_api_key_here' \
  --header 'Accept: application/json'
```

Response 200 OK:

```json
[
  {
    "id": 12,
    "uid": "PIPE01SALE",
    "name": "Sales",
    "pipe_type": "deals",
    "default": true,
    "is_active": true,
    "totalDeals": 42
  }
]
```

## List stages

```http
GET https://secure.alterestate.com/api/v1/deals/stages/
```

Authentication: `Authorization: Token your_api_key_here`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pipeline` | query | string | no | Pipeline uid from List pipelines. Returns that funnel’s stages, active ones only, in column order. |
| `pipe_type` | query | string | no | deals, prospects, won, accounting or properties. Use it instead of pipeline to list stages across funnels of that type. |

Example request:

```bash
curl --request GET \
  --url 'https://secure.alterestate.com/api/v1/deals/stages/?pipeline=PIPE01SALE' \
  --header 'Authorization: Token your_api_key_here' \
  --header 'Accept: application/json'
```

Response 200 OK:

```json
[
  {
    "uid": "STGNEW001",
    "name": "New",
    "order": 0,
    "pipeline": "PIPE01SALE",
    "pipeline_string": "Sales",
    "is_active": true,
    "closing_probability": 10,
    "conversion_rate": "0.00",
    "max_days_on_stage": null,
    "deals_count": 18
  },
  {
    "uid": "STGVISIT01",
    "name": "Showing",
    "order": 2,
    "pipeline": "PIPE01SALE",
    "pipeline_string": "Sales",
    "is_active": true,
    "closing_probability": 40,
    "conversion_rate": "0.00",
    "max_days_on_stage": 14,
    "deals_count": 7
  }
]
```

## Retrieve a pipeline with its stages

```http
GET https://secure.alterestate.com/api/v1/deals/funnels/{uid}/
```

Authentication: `Authorization: Token your_api_key_here`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uid` | path | string | yes | Pipeline uid. |

Example request:

```bash
curl --request GET \
  --url 'https://secure.alterestate.com/api/v1/deals/funnels/PIPE01SALE/' \
  --header 'Authorization: Token your_api_key_here' \
  --header 'Accept: application/json'
```

Response 200 OK:

```json
{
  "id": 12,
  "uid": "PIPE01SALE",
  "name": "Sales",
  "pipe_type": "deals",
  "default": true,
  "pipeline": [
    {
      "uid": "STGNEW001",
      "name": "New",
      "order": 0,
      "is_active": true,
      "closing_probability": 10,
      "deals": []
    },
    {
      "uid": "STGVISIT01",
      "name": "Showing",
      "order": 2,
      "is_active": true,
      "closing_probability": 40,
      "deals": []
    }
  ]
}
```

Response 404 Not Found:

```json
{
  "detail": "Not found."
}
```

## How the three calls fit together

- List pipelines returns one object per funnel. totalDeals is the number of non-prospect deals on that pipeline.
- List stages is the call to use before you filter or move a deal. Pass pipeline={uid}. order is the column order, starting at 0.
- Retrieve a pipeline with its stages returns the same funnel in one response. The stages array is named pipeline. deals on each stage is always empty; load deals with List deals and stage={uid}.

## pipe_type

| Value | Funnel |
| --- | --- |
| deals | Sales pipeline. This is the one List deals uses. |
| prospects | Prospect statuses. |
| won | Stages after a deal is won. |
| accounting | Accounting statuses on a closing sheet. |
| properties | Property pipeline. |

## Status codes

| Status | Meaning |
| --- | --- |
| 200 | The request succeeded. |
| 400 | A parameter or the body is invalid. The response names the field. |
| 401 | The token is missing, invalid, or the user cannot open this deal. |
| 404 | The resource or route does not exist. |
| 429 | Too many requests. Wait and retry. |
| 500 | Server error while processing the request. |

> When you PATCH a deal’s stage, the stage uid must belong to that deal’s pipeline. Send pipeline and stage together only when you are moving the deal to another funnel.

- [Filter deals by pipeline or stage](https://dev.alterestate.com/deals/list)
- [Move a deal to a stage](https://dev.alterestate.com/deals/edit)

## FAQ

### Does the pipeline list include stages?

No. GET /api/v1/deals/pipeline/ returns funnels only. GET /api/v1/deals/stages/?pipeline={uid} returns their stages, or GET /api/v1/deals/funnels/{uid}/ returns one funnel with stages nested under pipeline.

### Which uid do I send when I edit a deal’s stage?

The stage uid from List stages or from the nested pipeline array. The stage has to belong to the deal’s current pipeline.
