API reference

Pipelines and stages

A pipeline is an ordered list of stages that leads move through. Every pipeline has an incoming stage, open stages, and won and lost stages.

The pipeline object

json
{
  "id": "pipeline_01j8z5y1b3c5d7e9f1g3h5j7k9",
  "name": { "uz-Latn": "Savdo", "ru": "Продажи", "en": "Sales" },
  "position": 0,
  "loss_reasons": [ { "id": "…", "name": { "uz-Latn": "Qimmat", "ru": "Дорого", "en": "Too expensive" } } ],
  "stages": [
    { "id": "stage_01j8z5z0a2b4c6d8e0f2g4h6j8", "pipeline_id": "pipeline_01j8z5y1b3c5d7e9f1g3h5j7k9",
      "name": { "uz-Latn": "Yangi", "ru": "Новая", "en": "New" }, "type": "incoming", "position": 0, "color": "sky", "rotting_days": null }
  ]
}
  • name fields are localized: pick the language you show.
  • A stage's type is incoming (new leads land here), open, won or lost. Moving a lead to a won or lost stage closes it.
  • rotting_days: after how many days without progress a lead in this stage counts as stalled, or null.

Endpoints

GET/v1/pipelinesleads:read

Every pipeline with its stages, in order: {"data": [ … ]}. Use it to map stage ids to names and to find the stage to move a lead to.

Creating and changing pipelines and stages is reserved for owners and admins in Kweko (Settings → Pipelines); these endpoints do not accept API keys yet, although the pipelines:manage scope exists:

POST/v1/pipelinesKweko app only
PATCH/v1/pipelines/{id}Kweko app only
POST/v1/pipelines/{id}/stagesKweko app only
PATCH/v1/pipelines/{id}/stages/{stageID}Kweko app only
PUT/v1/pipelines/{id}/stages/orderKweko app only
DELETE/v1/pipelines/{id}/stages/{stageID}Kweko app only

Deleting a stage that has leads needs ?move_to=stage_… (stage_has_leads); the incoming, won and lost stages and the last open stage cannot be deleted (stage_required).