Pipelines API
Pipelines
Pipeline IDs are fenced by workspace: an ID from another workspace returns the same 404 as one that does not exist.
GET /api/v1/pipelines
Every pipeline with its stages. Requires read:pipelines. A workspace always has at least one pipeline.
GET /api/v1/pipelines HTTP/1.1
Host: agentlyleads.com
Authorization: Bearer alk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxReturns { "pipelines": [ ... ] }. See the Pipeline object.
GET /api/v1/pipelines/{id}
One pipeline. Returns { "pipeline": {...} }.
POST /api/v1/pipelines
Create a pipeline. Requires write:pipelines.
{
"name": "Partnerships",
"stages": [
{ "name": "Intro" },
{ "name": "Pilot" },
{ "name": "Signed", "won": true },
{ "name": "Passed", "lost": true }
]
}stages is optional (up to 30). Leave it out and the pipeline gets the default six: New, Qualified, Proposal, Negotiation, Won, Lost. Returns 201 with { "pipeline": {...} }.
PATCH /api/v1/pipelines/{id}
Rename. Body: { "name": "Enterprise" }. Returns { "pipeline": {...} }.
DELETE /api/v1/pipelines/{id}
Deletes the pipeline and its stages. Two rules protect your deals:
- The workspace's only pipeline can't be deleted (
400). - If any deals are in the pipeline, the request is refused with
409unless you passmoveDealsTo, a stage ID in another pipeline. Those deals are moved there first, one by one, each logged as a stage change and running your stage-change automations.
DELETE /api/v1/pipelines/cmq5pipe1alk34567891?moveDealsTo=cmq5stg00alk34567890 HTTP/1.1
Host: agentlyleads.com
Authorization: Bearer alk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{ "deleted": 1, "id": "cmq5pipe1alk34567891", "movedDeals": 4 }