Pipelines API

Manage pipelines — the ordered stages through which deals progress.

See also: Deals & Pipelines concepts

Endpoints

MethodPathDescription
POST/pipelinesCreate a pipeline
GET/pipelinesList pipelines
GET/pipelines/:idGet a pipeline
PATCH/pipelines/:idUpdate a pipeline
DELETE/pipelines/:idDelete a pipeline
GET/pipelines/:id/dealsList deals in a pipeline
POST/pipelines/:id/stagesAdd a stage
PUT/pipelines/:id/stagesReorder stages
DELETE/pipelines/:id/stages/:stage_idRemove a stage

Create a pipeline

POST /pipelines

Request body

FieldTypeRequiredDescription
namestringyesPipeline name
is_defaultbooleannoWhether this is the default pipeline
stagesarraynoInitial stages (see Add a stage for stage fields)
metadataobjectnoArbitrary key-value data

Example

curl -X POST "$REX_URL/pipelines" \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sales Pipeline",
    "is_default": true,
    "stages": [
      { "name": "Qualified", "type": "open", "color": "#3b82f6" },
      { "name": "Proposal Sent", "type": "open", "color": "#f59e0b" },
      { "name": "Closed Won", "type": "won", "color": "#10b981" },
      { "name": "Closed Lost", "type": "lost", "color": "#ef4444" }
    ]
  }'

Response

{
  "data": {
    "id": "pipe_01HQ...",
    "name": "Sales Pipeline",
    "is_default": true,
    "stages": [
      {
        "id": "stg_01HQ...",
        "name": "Qualified",
        "position": 0,
        "type": "open",
        "color": "#3b82f6"
      },
      {
        "id": "stg_02HQ...",
        "name": "Proposal Sent",
        "position": 1,
        "type": "open",
        "color": "#f59e0b"
      },
      {
        "id": "stg_03HQ...",
        "name": "Closed Won",
        "position": 2,
        "type": "won",
        "color": "#10b981"
      },
      {
        "id": "stg_04HQ...",
        "name": "Closed Lost",
        "position": 3,
        "type": "lost",
        "color": "#ef4444"
      }
    ],
    "created_at": "2026-03-16T12:00:00Z",
    "updated_at": "2026-03-16T12:00:00Z"
  }
}

List pipelines

GET /pipelines

Query parameters

ParameterTypeDescription
cursorstringPagination cursor
limitintegerResults per page (default 50, max 200)

Example

curl "$REX_URL/pipelines" \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": [
    {
      "id": "pipe_01HQ...",
      "name": "Sales Pipeline",
      "is_default": true,
      "stages": [ ... ],
      "created_at": "2026-03-16T12:00:00Z",
      "updated_at": "2026-03-16T12:00:00Z"
    }
  ],
  "has_more": false
}

Get a pipeline

GET /pipelines/:id

Example

curl "$REX_URL/pipelines/pipe_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

Returns the full pipeline object including all stages. See Create a pipeline for the response shape.

Update a pipeline

PATCH /pipelines/:id

Request body

FieldTypeRequiredDescription
namestringnoPipeline name
is_defaultbooleannoDefault pipeline flag
metadataobjectnoArbitrary key-value data

Note: to modify stages, use the dedicated stage endpoints below.

Example

curl -X PATCH "$REX_URL/pipelines/pipe_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Enterprise Sales" }'

Response

Returns the full updated pipeline.

Delete a pipeline

DELETE /pipelines/:id

Example

curl -X DELETE "$REX_URL/pipelines/pipe_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

204 No Content on success.

List deals in a pipeline

GET /pipelines/:id/deals

Query parameters

ParameterTypeDescription
cursorstringPagination cursor
limitintegerResults per page (default 50, max 200)
statusstringFilter by deal status: open, won, lost, stalled
stage_idstringFilter by specific stage

Example

curl "$REX_URL/pipelines/pipe_01HQ.../deals?status=open" \
  -H "X-Api-Key: $REX_API_KEY"

Response

Standard deal list response. See Deals API.

Add a stage

POST /pipelines/:id/stages

Request body

FieldTypeRequiredDescription
namestringyesStage name (e.g. "Qualified", "Proposal Sent")
typestringyesStage type: open, won, lost
positionintegernoSort order (appended to end if omitted)
colorstringnoHex color for UI (e.g. #3b82f6)
probabilitynumbernoWin probability 0.0-1.0 (inferred from position if omitted)

Example

curl -X POST "$REX_URL/pipelines/pipe_01HQ.../stages" \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Negotiation",
    "type": "open",
    "color": "#8b5cf6",
    "probability": 0.7
  }'

Response

Returns the full pipeline with the new stage included.

Reorder stages

PUT /pipelines/:id/stages

Replaces the full stage ordering. All existing stage IDs must be included.

Request body

FieldTypeRequiredDescription
stage_idsarray of stringsyesStage IDs in desired order

Example

curl -X PUT "$REX_URL/pipelines/pipe_01HQ.../stages" \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stage_ids": ["stg_01HQ...", "stg_03HQ...", "stg_02HQ...", "stg_04HQ..."]
  }'

Response

Returns the full pipeline with stages in the new order.

Remove a stage

DELETE /pipelines/:id/stages/:stage_id

Example

curl -X DELETE "$REX_URL/pipelines/pipe_01HQ.../stages/stg_02HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

204 No Content on success.

Was this page helpful?

·