CRM v1 current
crm. stage_ moved
Moves a client's open deal to another pipeline stage, naming the client and the stage. Creates no deals: with no open deal it refuses, and with several it refuses with the list.
Last updated
POST /api/v1/actions/crm.stage_moved- Key scope
crm.stage_moved@1- Workspace permission
api.crm.stage_movedoff by default
Two permissions, not one
Both are needed: a key with that scope, and the workspace owner having switched the permission on. Holding the key is not enough — they are two decisions made by different people.
Request
| field | type | rules | |
|---|---|---|---|
client | string | required | min 1 · max 200 |
stage | string | required | min 1 · max 120 |
lostReason | string | optional | max 500 |
Response — output when status is done
| field | type | rules | |
|---|---|---|---|
dealId | string | required | |
clientId | string | required | |
clientName | string | required | |
stageName | string | required | |
won | boolean | required | |
firstWon | boolean | required |
Example
# One request, one idempotency key: retrying with the same key never runs twice.
curl -X POST https://niiko.org/api/v1/actions/crm.stage_moved \
-H "Authorization: Bearer nk_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"client": "…",
"stage": "…"
}'
# 200 → done · 202 → pending_approval (a person signs later) · 4xx → refused, with a named reasonWhy it may refuse
Each reason names who can fix it and how. With reason stale, detail.message says what to do.
cliente_no_encontradocliente_ambiguodemasiados_clientessin_negocio_abiertovarios_negociosetapa_no_encontradanegocio_cerradoya_en_esa_etapasin_permiso
In the clients
| @vorluno/niiko-sdk | niiko.movedStage() |
| niiko (Python) | niiko.moved_stage() |
| niiko-cli | niiko run crm.stage_moved |
| n8n-nodes-niiko | crmStageMoved |
| niiko-mcp-server | crm_stage_moved |