API Reference
The reference below covers every endpoint in the Pipelines API. Code examples are generated automatically; the live playground is disabled to prevent accidental writes to production from the docs site.
/api/v1/pipelinesAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/pipelines"{ "pipelines": [ { "id": "cmq5pipe0alk34567890", "name": "Sales Pipeline", "isDefault": true, "order": 0, "createdAt": "2026-06-01T10:00:00.000Z", "updatedAt": "2026-09-27T14:02:00.000Z", "stages": [ { "id": "cmq5stg00alk34567890", "name": "New", "order": 0, "won": false, "lost": false, "dealCount": 12 }, { "id": "cmq5stg10alk34567890", "name": "Qualified", "order": 1, "won": false, "lost": false, "dealCount": 8 }, { "id": "cmq5stg20alk34567890", "name": "Won", "order": 2, "won": true, "lost": false, "dealCount": 20 }, { "id": "cmq5stg30alk34567890", "name": "Lost", "order": 3, "won": false, "lost": true, "dealCount": 9 } ] } ]}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: read:pipelines."}{ "error": "Rate limit exceeded."}/api/v1/pipelinesAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/pipelines" \ -H "Content-Type: application/json" \ -d '{ "name": "Partnerships", "stages": [ { "name": "Intro" }, { "name": "Pilot" }, { "name": "Signed", "won": true }, { "name": "Passed", "lost": true } ] }'{ "pipeline": { "id": "string", "name": "string", "isDefault": true, "order": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "stages": [ { "id": "string", "name": "string", "order": 0, "won": true, "lost": true, "dealCount": 0 } ] }}{ "error": "A stage can't be both won and lost."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:pipelines."}{ "error": "Rate limit exceeded."}/api/v1/pipelines/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The pipeline's ID.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/pipelines/string"{ "pipeline": { "id": "cmq5pipe0alk34567890", "name": "Sales Pipeline", "isDefault": true, "order": 0, "createdAt": "2026-06-01T10:00:00.000Z", "updatedAt": "2026-09-27T14:02:00.000Z", "stages": [ { "id": "cmq5stg00alk34567890", "name": "New", "order": 0, "won": false, "lost": false, "dealCount": 12 }, { "id": "cmq5stg10alk34567890", "name": "Qualified", "order": 1, "won": false, "lost": false, "dealCount": 8 }, { "id": "cmq5stg20alk34567890", "name": "Won", "order": 2, "won": true, "lost": false, "dealCount": 20 }, { "id": "cmq5stg30alk34567890", "name": "Lost", "order": 3, "won": false, "lost": true, "dealCount": 9 } ] }}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: read:pipelines."}{ "error": "Pipeline not found."}{ "error": "Rate limit exceeded."}/api/v1/pipelines/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The pipeline's ID.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/api/v1/pipelines/string" \ -H "Content-Type: application/json" \ -d '{ "name": "Enterprise" }'{ "pipeline": { "id": "string", "name": "string", "isDefault": true, "order": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "stages": [ { "id": "string", "name": "string", "order": 0, "won": true, "lost": true, "dealCount": 0 } ] }}{ "error": "name is required."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:pipelines."}{ "error": "Pipeline not found."}{ "error": "Rate limit exceeded."}/api/v1/pipelines/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The pipeline's ID.
Query Parameters
A stage ID in a different pipeline to move this pipeline's deals to.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/api/v1/pipelines/string"{ "deleted": 1, "id": "string", "movedDeals": 0}{ "error": "You can't delete your only pipeline."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:pipelines."}{ "error": "Pipeline not found."}{ "error": "This pipeline still has 4 deal(s). Pass moveDealsTo with a stage id from another pipeline to move them first."}{ "error": "Rate limit exceeded."}/api/v1/pipelines/{id}/stagesAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The pipeline's ID.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/pipelines/string/stages" \ -H "Content-Type: application/json" \ -d '{ "name": "Pilot" }'{ "stage": { "id": "cmq5stg40alk34567890", "name": "Pilot", "order": 4, "won": false, "lost": false, "dealCount": 0 }}{ "error": "A stage can't be both won and lost."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:pipelines."}{ "error": "Pipeline not found."}{ "error": "Rate limit exceeded."}/api/v1/pipelines/{id}/stages/reorderAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The pipeline's ID.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/pipelines/string/stages/reorder" \ -H "Content-Type: application/json" \ -d '{ "stageIds": [ "cmq5stg00alk34567890", "cmq5stg10alk34567890", "cmq5stg20alk34567890", "cmq5stg30alk34567890" ] }'{ "pipeline": { "id": "string", "name": "string", "isDefault": true, "order": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "stages": [ { "id": "string", "name": "string", "order": 0, "won": true, "lost": true, "dealCount": 0 } ] }}{ "error": "stageIds must list all 4 stages of this pipeline."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:pipelines."}{ "error": "Pipeline not found."}{ "error": "Rate limit exceeded."}/api/v1/stages/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The stage's ID.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/api/v1/stages/string" \ -H "Content-Type: application/json" \ -d '{ "name": "Closed won" }'{ "stage": { "id": "string", "name": "string", "order": 0, "won": true, "lost": true, "dealCount": 0 }}{ "error": "A stage can't be both won and lost."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:pipelines."}{ "error": "Stage not found."}{ "error": "Rate limit exceeded."}/api/v1/stages/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The stage's ID.
Query Parameters
Another stage ID to move this stage's deals to.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/api/v1/stages/string"{ "deleted": 1, "id": "string", "movedDeals": 0}{ "error": "A pipeline needs at least one stage."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:pipelines."}{ "error": "Stage not found."}{ "error": "This stage still has 3 deal(s). Pass moveDealsTo with another stage id to move them first."}{ "error": "Rate limit exceeded."}