パイプライン(Pipelines)
営業パイプラインの定義・ステージカスタマイズを行います。複数パイプライン(営業・パートナー等)に対応しています。
|
エンドポイント
| GET | /api/v1/crm/pipelines | パイプライン一覧を取得 |
| POST | /api/v1/crm/pipelines | パイプラインを作成 |
| GET | /api/v1/crm/pipelines/{id} | パイプラインを取得 |
| PATCH | /api/v1/crm/pipelines/{id} | パイプラインを更新 |
| DELETE | /api/v1/crm/pipelines/{id} | パイプラインを削除 |
GET
/api/v1/crm/pipelinesパイプライン一覧を取得
組織内のすべてのパイプラインを取得します。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
レスポンスフィールド
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| Pipeline[] | 任意 | パイプラインの配列 |
コード例
curl "https://api.blueai.jp/api/v1/crm/pipelines" \
-H "Cookie: better-auth.session_token=<token>"レスポンス例
{
"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/pipelinesパイプラインを作成
新しいパイプラインをステージ定義とともに作成します。ステージの slug はパイプライン内で一意である必要があります。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
リクエストボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
name | string | 必須 | パイプライン名 |
is_default | boolean | 任意 | デフォルトパイプラインに設定 |
sort_order | number | 任意 | 表示順 |
| Stage[] | 任意 | ステージ定義の配列 |
レスポンスフィールド
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| PipelineDetail | 任意 | 作成されたパイプライン(ステージ含む) |
コード例
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
}
]
}'レスポンス例
{
"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}パイプラインを取得
指定したパイプラインの詳細をステージ一覧とともに取得します。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 必須 | パイプライン ID |
レスポンスフィールド
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| PipelineDetail | 任意 | パイプライン詳細(ステージ含む) |
コード例
curl "https://api.blueai.jp/api/v1/crm/pipelines/pipe_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"レスポンス例
{
"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}パイプラインを更新
パイプライン名やステージの並び順を変更します。stages を指定した場合、既存のステージは全て置き換えられます。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 必須 | パイプライン ID |
リクエストボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
name | string | 任意 | パイプライン名 |
is_default | boolean | 任意 | デフォルトパイプラインに設定 |
sort_order | number | 任意 | 表示順 |
| Stage[] | 任意 | ステージ定義の配列(指定すると全置換) |
レスポンスフィールド
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| PipelineDetail | 任意 | 更新後のパイプライン |
コード例
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
}
]
}'レスポンス例
{
"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}パイプラインを削除
指定したパイプラインとその全ステージを削除します。デフォルトパイプラインは削除できません。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 必須 | パイプライン ID |
レスポンスフィールド
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
success | boolean | 任意 | 削除成功フラグ |
コード例
curl -X DELETE "https://api.blueai.jp/api/v1/crm/pipelines/pipe_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"レスポンス例
{
"success": true
}