Pipelines
Define and customize sales pipelines. Supports multiple pipelines (e.g., sales, partnerships).
|
Endpoints
| GET | /api/v1/crm/pipelines | List pipelines |
| POST | /api/v1/crm/pipelines | Create a pipeline |
| GET | /api/v1/crm/pipelines/{id} | Get a pipeline |
| PATCH | /api/v1/crm/pipelines/{id} | Update a pipeline |
| DELETE | /api/v1/crm/pipelines/{id} | Delete a pipeline |
GET
/api/v1/crm/pipelinesList pipelines
Retrieve all pipelines within the organization.
Authentication required— Include session cookie or Bearer token
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Pipeline[] | Optional | Array of pipelines |
Code Examples
curl "https://api.blueai.jp/api/v1/crm/pipelines" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"pipelines": [
{
"id": "pipe_dddddddddddddddddddddddddddddddd",
"name": "営業パイプライン",
"is_default": true,
"sort_order": 0,
"created_at": "2026-01-10T09:00:00Z",
"updated_at": "2026-01-10T09:00:00Z"
},
{
"id": "pipe_eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"name": "パートナー案件",
"is_default": false,
"sort_order": 1,
"created_at": "2026-02-01T10:00:00Z",
"updated_at": "2026-02-01T10:00:00Z"
}
]
}POST
/api/v1/crm/pipelinesCreate a pipeline
Create a new pipeline with stage definitions. Stage slugs must be unique within the pipeline.
Authentication required— Include session cookie or Bearer token
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Required | Pipeline name |
is_default | boolean | Optional | Set as default pipeline |
sort_order | number | Optional | Sort order |
| Stage[] | Optional | Array of stage definitions |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| PipelineDetail | Optional | Created pipeline with stages |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/crm/pipelines" \
-H "Cookie: better-auth.session_token=<token>" \
-H "Content-Type: application/json" \
-d '{
"name": "営業パイプライン",
"is_default": true,
"stages": [
{
"name": "リード",
"slug": "lead",
"sort_order": 0
},
{
"name": "ヒアリング",
"slug": "qualification",
"sort_order": 1
},
{
"name": "提案",
"slug": "proposal",
"sort_order": 2
},
{
"name": "交渉",
"slug": "negotiation",
"sort_order": 3
},
{
"name": "受注",
"slug": "closed_won",
"sort_order": 4
},
{
"name": "失注",
"slug": "closed_lost",
"sort_order": 5
}
]
}'Response Example
{
"pipeline": {
"id": "pipe_dddddddddddddddddddddddddddddddd",
"name": "営業パイプライン",
"is_default": true,
"sort_order": 0,
"stages": [
{
"id": "pstage_01010101010101010101010101010101",
"name": "リード",
"slug": "lead",
"sort_order": 0
},
{
"id": "pstage_02020202020202020202020202020202",
"name": "ヒアリング",
"slug": "qualification",
"sort_order": 1
},
{
"id": "pstage_03030303030303030303030303030303",
"name": "提案",
"slug": "proposal",
"sort_order": 2
},
{
"id": "pstage_04040404040404040404040404040404",
"name": "交渉",
"slug": "negotiation",
"sort_order": 3
},
{
"id": "pstage_05050505050505050505050505050505",
"name": "受注",
"slug": "closed_won",
"sort_order": 4
},
{
"id": "pstage_06060606060606060606060606060606",
"name": "失注",
"slug": "closed_lost",
"sort_order": 5
}
],
"created_at": "2026-01-10T09:00:00Z",
"updated_at": "2026-01-10T09:00:00Z"
}
}GET
/api/v1/crm/pipelines/{id}Get a pipeline
Retrieve pipeline details including all stages.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Pipeline ID |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| PipelineDetail | Optional | Pipeline details with stages |
Code Examples
curl "https://api.blueai.jp/api/v1/crm/pipelines/pipe_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"pipeline": {
"id": "pipe_dddddddddddddddddddddddddddddddd",
"name": "営業パイプライン",
"is_default": true,
"sort_order": 0,
"stages": [
{
"id": "pstage_01010101010101010101010101010101",
"name": "リード",
"slug": "lead",
"sort_order": 0
},
{
"id": "pstage_02020202020202020202020202020202",
"name": "ヒアリング",
"slug": "qualification",
"sort_order": 1
},
{
"id": "pstage_03030303030303030303030303030303",
"name": "提案",
"slug": "proposal",
"sort_order": 2
}
],
"created_at": "2026-01-10T09:00:00Z",
"updated_at": "2026-02-15T14:00:00Z"
}
}PATCH
/api/v1/crm/pipelines/{id}Update a pipeline
Update pipeline name and stage ordering. If stages are provided, all existing stages are replaced.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Pipeline ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Optional | Pipeline name |
is_default | boolean | Optional | Set as default pipeline |
sort_order | number | Optional | Sort order |
| Stage[] | Optional | Array of stage definitions (replaces all existing stages) |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| PipelineDetail | Optional | Updated pipeline |
Code Examples
curl -X PATCH "https://api.blueai.jp/api/v1/crm/pipelines/pipe_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>" \
-H "Content-Type: application/json" \
-d '{
"name": "営業パイプライン(改定)",
"stages": [
{
"name": "リード",
"slug": "lead",
"sort_order": 0
},
{
"name": "提案",
"slug": "proposal",
"sort_order": 1
},
{
"name": "受注",
"slug": "closed_won",
"sort_order": 2
},
{
"name": "失注",
"slug": "closed_lost",
"sort_order": 3
}
]
}'Response Example
{
"pipeline": {
"id": "pipe_dddddddddddddddddddddddddddddddd",
"name": "営業パイプライン(改定)",
"is_default": true,
"sort_order": 0,
"stages": [
{
"id": "pstage_01010101010101010101010101010101",
"name": "リード",
"slug": "lead",
"sort_order": 0
},
{
"id": "pstage_03030303030303030303030303030303",
"name": "提案",
"slug": "proposal",
"sort_order": 1
},
{
"id": "pstage_05050505050505050505050505050505",
"name": "受注",
"slug": "closed_won",
"sort_order": 2
},
{
"id": "pstage_06060606060606060606060606060606",
"name": "失注",
"slug": "closed_lost",
"sort_order": 3
}
],
"created_at": "2026-01-10T09:00:00Z",
"updated_at": "2026-02-20T11:00:00Z"
}
}DELETE
/api/v1/crm/pipelines/{id}Delete a pipeline
Delete the specified pipeline and all its stages. The default pipeline cannot be deleted.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Pipeline ID |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | Deletion success flag |
Code Examples
curl -X DELETE "https://api.blueai.jp/api/v1/crm/pipelines/pipe_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"success": true
}