Create a Pipeline
Purpose
To create a pipeline with various stages that a deal passes through.
Request Details
Request URL
{api-domain}/crm/{version}/settings/pipeline?layout_id={layout_id}
Header
Authorization: Zoho-oauthtoken <access_token>
Scope
scope=ZohoCRM.settings.pipeline.CREATE
Parameters
- layout_idstring, mandatory
The unique ID of the layout in which the pipeline must be created.
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v7/settings/pipeline?layout_id=3652397000000091023"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@input.json"
Request JSON
- display_valueString, mandatory
The name of the pipeline you want to create. This key accepts an alphanumeric value.
- mapsJSON array, mandatory
The different stages that a deal has to pass through in the sales pipeline. Thi array contains the following keys:
- sequence_number - integer, mandatory - The order in which the stage must be displayed. If the value of this key is "1", then this stage will be displayed first.
- id - string, mandatory - The unique ID of the stage. Use the Fields Metadata API to obtain the unique ID of the field.
Sample Input
Copied{
"pipeline": [
{
"display_value": "Pipeline2",
"default": true,
"maps": [
{
"sequence_number": 1,
"id": "3652397000000006815",
"display_value": "Closed Won"
},
{
"sequence_number": 2,
"id": "3652397000000006817",
"display_value": "Closed Lost"
}
]
}
]
}
Possible Errors
- MANDATORY_NOT_FOUNDHTTP 400
You have not included the key "display_value" (name of the pipeline) in the input.
Resolution: "display_value" is a mandatory key in the input. - INVALID_DATAHTTP 400
The ID of the stage in the "maps" object is invalid.
Resolution: Use the Fields Metadata API to obtain the unique IDs of the stages. - DUPLICATE_DATAHTTP 400
A pipeline with the same name already exists.
Resolution: The name of the pipeline must be unique. - REQUIRED_PARAM_MISSINGHTTP 400
You have not included the mandatory parameter "layout_id" in your request.
Resolution: Specify valid layout ID in the request.
Sample Response
Copied{
"pipeline": [
{
"code": "SUCCESS",
"details": {
"id": "3652397000003712004"
},
"message": "Pipeline created",
"status": "success"
}
]
}