Pipeline stages
Your contact board is made of stages, like New lead, Contacted and Won. A contact sits in one stage at a time: its pipeline_stage holds the stage’s id. To move a contact, send a stage id as pipeline_stage when you update the contact. These routes tell you which ids exist and let you change them.
Stages are grouped into pipelines. Every account has a main pipeline (id default) and can add more. Stage ids are unique across the whole account, so a stage id alone says which pipeline a contact is in. A contact whose stage id matches no stage shows in the main pipeline. You can have up to 50 stages across all your pipelines, and up to 20 pipelines counting the main one.
Until you change your stages, your board uses the built-in ones: new_lead, contacted, interested, qualified, won and lost. A contact with no stage counts as new_lead. The value off_board is reserved: it takes contacts off the board without deleting them.
Removing a stage never deletes contacts and never leaves them on a stage that is gone. A change that would remove a stage still holding contacts is refused with 409 until you move them out.
#The stage object
idstring- The stage id. This is the value a contact’s
pipeline_stageholds. Up to 60 characters. New ids are made by Ready from the stage name, for examplehot_leads. namestring- The name on the board. Up to 40 characters.
colorstring- A hex color like
#3B82F6. Anything else is saved as#94A3B8. pipeline_id, pipeline_namestring- The pipeline the stage belongs to. Only on stages in the top level
datalist.
#The pipeline object
idstringdefaultfor the main pipeline, otherwise an id likep_3f9a1c2e.namestring- The pipeline’s name. The main one is called
Main pipelineuntil you rename it. Up to 60 characters. is_defaultbooleantruefor the main pipeline. It can be renamed but not deleted.stagesobject[]- Its stages in board order, each with
id,nameandcolor.
#List stages
Your saved stage list and your pipelines. Any team member can read it.
Returns
pipelinesobject[]- Read stage ids from
pipelines[].stages. Your stages split into pipeline objects, main first. Always filled in, with the built-in stages whendataisnull. dataobject[] or null- Your saved list: every stage across all pipelines, main pipeline first.
nulluntil you change your stages: you are on the built-in ones.
#Add stages
Adds stages to the end of your main pipeline. It only adds: it never removes, renames or reorders a stage, so no contact is moved. To remove or change stages, update a pipeline. A stage whose id or name (any case) is already there is skipped, so sending the same request twice adds nothing. Needs the edit_contacts permission.
Parameters
appendobject[]Required- The stages to add, each
{"name": "...", "color": "..."}. Leave outidand Ready makes one from the name. Anidyou send is kept, unless it isoff_boardor repeated in the list. stagesobject[]- Rarely needed. The list to start from. Used only if you never changed your stages; otherwise the saved list is used. Without it, the built-in stages are the start.
Returns data and pipelines as List stages does.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_stages | No append list, or the result would have more than 50 stages. |
| 400 | invalid_field | append or stages isn’t a list. |
| 409 | stages_changed | Your stages changed while this was saving. Read them again and retry. |
#Count contacts per stage
How many contacts are in each stage. Spam and deleted contacts are not counted. The numbers can be up to 90 seconds old. Needs the view_reports permission, and a team seat that sees only its assigned contacts is refused.
Returns
by_stageobject- Stage id to count. Includes any stage id a contact holds, even one no longer on the board. Contacts with no stage are counted under
new_lead. totalinteger- The sum of
by_stage.
Errors
| HTTP | Code | When |
|---|---|---|
| 403 | permission_denied | Your seat lacks view_reports. |
| 403 | report_scope_forbidden | Your seat sees only its assigned contacts. |
| 503 | report_unavailable | The counts couldn’t be loaded. Retry in a minute. |
#Move every contact out of a stage
Moves all your contacts in one stage to another stage, or off the board. This can’t be undone, and contacts moved into a stage that already has contacts can’t be told apart afterwards. Read the stage’s count with Count contacts per stage first. Do this before you remove a stage that still has contacts. Sending it again moves 0. Needs the edit_contacts permission, and a team seat that sees only its assigned contacts is refused.
Parameters
fromstringRequired- The stage id to empty. It doesn’t have to be on the board, so you can also clear an old id.
new_leadincludes contacts with no stage. tostringRequired- A stage id on your board, or
off_boardto take the contacts off the board and keep them. The same value asfrommoves nothing.
Returns
movedinteger- How many contacts were moved.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_stages | from or to is missing, or to isn’t a stage on your board. |
| 400 | invalid_field | from or to is a list or an object. |
| 403 | report_scope_forbidden | Your seat sees only its assigned contacts. |
#List pipelines
Every pipeline with its stages, main pipeline first. Any team member can read it.
Returns a list of pipeline objects in data.
#Create a pipeline
Adds a pipeline. Ready makes every stage id from the stage name, so two pipelines can both have a "New lead" stage with different ids. Returns 201. Needs the edit_contacts permission.
Parameters
namestringRequired- Up to 60 characters.
stagesobject[]- Its stages in order, each
{"name": "...", "color": "..."}. Anyidyou send is ignored. Without a list you get New lead, Contacted, Qualified, Won and Lost. Idempotency-Keystring · header- A retry with the same key returns the first answer instead of making a second pipeline.
Returns data and pipelines as List stages does, plus pipeline_id, the new pipeline’s id.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_pipeline | No name, no stage with a name, already 20 pipelines, or more than 50 stages in total. |
| 400 | invalid_field | name is a list or an object. |
| 409 | stages_changed | Your stages changed while this was saving. Read them again and retry. |
#Update a pipeline
Renames a pipeline, replaces its stages, or both. Send the full stage list you want: stages you leave out are removed. Sending the same request again saves the same thing. Needs the edit_contacts permission.
Parameters
idstring · pathRequired- The pipeline id.
defaultis the main pipeline. namestring- The new name, up to 60 characters.
stagesobject[]- The pipeline’s new stages in board order, each
{"id": "...", "name": "...", "color": "..."}.Keeping, adding and removing stages
Send a stage’s currentidto keep it (with a new name or color if you like). A row without anid, or with an id from another pipeline, is a new stage and gets a new id. Rows without a name are skipped. A stage of this pipeline that you leave out is removed. If any removed stage still has contacts, nothing is saved and you get409with that stage’s id and count: move its contacts first, then retry. Contacts are never moved for you here. Spam and deleted contacts don’t block a removal; they keep the old stage id.
Returns data and pipelines as List stages does.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_pipeline | An empty name, no stage left, or more than 50 stages in total. |
| 400 | invalid_field | stages isn’t a list, or name is a list or an object. |
| 404 | PIPELINE_NOT_FOUND | No pipeline with this id on your account. |
| 409 | stage_has_contacts | A removed stage still has contacts. The body adds stage_id and count. |
| 409 | stages_changed | Your stages changed while this was saving. Read them again and retry. |
#Delete a pipeline
Removes a pipeline and its stages. The main pipeline can’t be deleted. If the pipeline still has contacts, you must say where they go with move_to; without it you get 409 with the count and nothing changes. The move and the delete happen together or not at all. Needs the edit_contacts permission, and a team seat that sees only its assigned contacts can’t delete a pipeline that has contacts.
Parameters
idstring · pathRequired- The pipeline id.
move_tostring · query- A stage id in another pipeline, or
off_boardto take the contacts off the board and keep them.
Returns data and pipelines as List stages does, plus moved, how many contacts were moved.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_pipeline | The id is default. |
| 400 | invalid_move_to | move_to isn’t a stage in another pipeline or off_board. |
| 400 | invalid_field | move_to is sent more than once. |
| 403 | report_scope_forbidden | The pipeline has contacts and your seat sees only its assigned contacts. |
| 404 | PIPELINE_NOT_FOUND | No pipeline with this id on your account, including one you already deleted. |
| 409 | pipeline_has_contacts | The pipeline has contacts and you sent no move_to. The body adds count. |
| 409 | stages_changed | Your stages changed while this was saving. Nothing was moved. Retry. |