Pipelines & stages — full CRUD

Create pipeline (auto-seeds 6 stages)

curl -s -X POST "https://api.live-direct-marketing.online/api/pipelines" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Outbound 2026","currency":"USD"}'

Add / rename / delete a stage

# add
curl -s -X POST "https://api.live-direct-marketing.online/api/pipelines/$P/stages" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Discovery call","sortOrder":3,"probability":40}'

# rename / change probability
curl -s -X PATCH "https://api.live-direct-marketing.online/api/pipelines/$P/stages/$S" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Discovery — booked","probability":50}'

# delete
curl -s -X DELETE "https://api.live-direct-marketing.online/api/pipelines/$P/stages/$S" \
  -H "Authorization: Bearer $LDM_KEY"

Reorder stages

curl -s -X PATCH "https://api.live-direct-marketing.online/api/pipelines/$P/stages/reorder" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d '{"stageIds":["$S1","$S2","$S3","$S4"]}'

Hide a technical stage from kanban

Same as in /leads-pipeline. Hidden stages still hold leads, but the kanban filters them by default; toolbar exposes a toggle.

curl -s -X PATCH "https://api.live-direct-marketing.online/api/pipelines/$P/stages/$S" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" -d '{"isHidden":true}'

Stage automations (move on dialog received, etc.)

curl -s "https://api.live-direct-marketing.online/api/pipelines/stages/$S/automations" \
  -H "Authorization: Bearer $LDM_KEY"

curl -s -X POST "https://api.live-direct-marketing.online/api/pipelines/stages/$S/automations" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d '{"trigger":"DIALOG_RECEIVED","action":"MOVE_TO_STAGE","actionParams":{"stageId":"$NEXT"}}'