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 }
]
}namefields are localized: pick the language you show.- A stage's
typeisincoming(new leads land here),open,wonorlost. Moving a lead to awonorloststage closes it. rotting_days: after how many days without progress a lead in this stage counts as stalled, ornull.
Endpoints
GET
/v1/pipelinesleads:readEvery 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 onlyPATCH
/v1/pipelines/{id}Kweko app onlyPOST
/v1/pipelines/{id}/stagesKweko app onlyPATCH
/v1/pipelines/{id}/stages/{stageID}Kweko app onlyPUT
/v1/pipelines/{id}/stages/orderKweko app onlyDELETE
/v1/pipelines/{id}/stages/{stageID}Kweko app onlyDeleting 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).