---
title: "Create a deal pipeline"
method: POST
path: "/pipelines"
tags: ["Reference Data"]
---

# Create a deal pipeline

`POST /pipelines`

Creates a deal pipeline with its stages. A pipeline must include at least one ACTIVE, one WON, and one LOST stage. Returns the new pipeline with stage IDs (dps_) you can use when creating deals.

## Request body

- PipelineInput
  - `name` string, required — Pipeline name
  - `icon` string — Tabler icon name for the pipeline. Defaults to an icon.
  - `isActive` boolean — Whether the pipeline is active. Defaults to true.
  - `stages` PipelineStageInput[], required — Stages for the pipeline. Must include at least one ACTIVE, one WON, and one LOST stage.
    - `name` string, required — Stage name
    - `position` number, required — Display order in the pipeline (lower comes first)
    - `probability` number — Win probability percentage (0-100). Defaults to 0.
    - `rottingInDays` number — Days a deal can sit in this stage before it is flagged as rotting. Defaults to 0 (disabled).
    - `type` 'ACTIVE' | 'WON' | 'LOST' — Stage type. Defaults to ACTIVE. A pipeline must have at least one of each.

## Response `200`

OK

- Pipeline
  - `id` string, required — Pipeline ID (dpl_ prefix)
  - `name` string, required — Pipeline name
  - `stages` PipelineStage[], required
    - `id` string, required — Pipeline stage ID (dps_ prefix)
    - `name` string, required — Stage name
    - `position` number, required — Display order in the pipeline
    - `probability` number, required — Win probability percentage
    - `type` 'ACTIVE' | 'WON' | 'LOST', required — Stage type. Moving a deal to a WON or LOST stage updates deal status.

## Other responses

- `400` — Validation error or bad request
- `401` — Missing or invalid API key
- `403` — Insufficient permission
- `404` — Resource not found
- `429` — Rate limit exceeded

---

[API](https://skmtc.net/heffl/apis/heffl-api-v2-beta.md) · [All operations](https://skmtc.net/heffl/apis/heffl-api-v2-beta/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/heffl/heffl-api-v2-beta/versions/27006cfef4d8/schema)
