[POST] .../v1/pipeline/add
Creates a CRM pipeline. Use this method to create a Lead or Deal pipeline before configuring stages and using it in CRM entity workflows. The method stores the pipeline, optionally clears the previous default pipeline for the same entity type, creates or syncs ACL rows, creates default stages, writes action log records, invalidates CRM and chat entity-access caches and returns new_id. The request body is required; entity_type must be Lead or Deal, name is required and limited to 200 characters and when access_all is false with no user or group access rows the server stores access_all as true. The caller must have CRM pipeline add permission; missing body or required fields, denied access, unique database constraints, transaction failures, default-stage creation errors, cache invalidation errors and action-log errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| access_all | Boolean | Optional | Grants access to all users. |
| access_group_ids | Array of Int64 | Optional | Explicit user group IDs with access. |
| access_user_ids | Array of Int64 | Optional | Explicit user IDs with access. |
| active | Boolean | Optional | Indicates whether the pipeline is active. |
| entity_type | String | Required | Entity type: Lead or Deal. Allowed values: Default, Lead, Deal, Client, Ticket. |
| is_default | Boolean | Optional | Indicates whether this is the default pipeline for the entity type. |
| name | String | Required | Pipeline name. Maximum length is 200 characters. |
Request Example
{
"entity_type": "Lead",
"name": "Lead pipeline",
"is_default": true,
"access_all": false,
"access_user_ids": [
1,
15
],
"access_group_ids": [
4
],
"active": true
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 7
}
}