WebSocket API
模块: websocket
本模块包含 7 个API端点。
📋 端点列表
- 🔍
GET /api/v1/flows- List Flows - ➕
POST /api/v1/flows- Create Flow - 🔍
GET /api/v1/flows/{flow_id}- Get Flow - ✏️
PUT /api/v1/flows/{flow_id}- Update Flow - 🗑️
DELETE /api/v1/flows/{flow_id}- Delete Flow - ➕
POST /api/v1/flows/{flow_id}/validate- Validate Flow Endpoint - ➕
POST /api/v1/flows/{flow_id}/duplicate- Duplicate Flow
📖 详细说明
🔍 List Flows
List all Flow configurations.
Returns: List of FlowConfig objects
请求方式: GET /api/v1/flows
响应:
// 数组: FlowConfig[]
- `name` (string) - **必填** - Flow name
- `description` (object) - 可选 - Flow description
- `nodes` (array) - 可选 - Flow nodes
- `edges` (array) - 可选 - Flow edges
- `metadata` (object) - 可选 -
- 类型: `FlowMetadata`
- `id` (string) - **必填** - Unique flow ID
- `created_at` (string) - 可选 - Creation timestamp
- `updated_at` (string) - 可选 - Last update timestamp
- `version` (integer) - 可选 - Version number
➕ Create Flow
Create a new Flow configuration.
Args: flow_create: Flow creation data
Returns: Created FlowConfig
请求方式: POST /api/v1/flows
请求体:
// 参考模型: FlowConfigCreate
- `name` (string) - **必填** - Flow name
- `description` (object) - 可选 - Flow description
- `nodes` (array) - 可选 - Flow nodes
- `edges` (array) - 可选 - Flow edges
- `metadata` (object) - 可选 -
- 类型: `FlowMetadata`
响应:
// 参考模型: FlowConfig
- `name` (string) - **必填** - Flow name
- `description` (object) - 可选 - Flow description
- `nodes` (array) - 可选 - Flow nodes
- `edges` (array) - 可选 - Flow edges
- `metadata` (object) - 可选 -
- 类型: `FlowMetadata`
- `id` (string) - **必填** - Unique flow ID
- `created_at` (string) - 可选 - Creation timestamp
- `updated_at` (string) - 可选 - Last update timestamp
- `version` (integer) - 可选 - Version number
错误响应:
422: Validation Error
🔍 Get Flow
Get a Flow configuration by ID.
Args: flow_id: Flow ID
Returns: FlowConfig
Raises: HTTPException: If flow not found
请求方式: GET /api/v1/flows/{flow_id}
路径参数:
flow_id(string) - 必填 -
响应:
// 参考模型: FlowConfig
- `name` (string) - **必填** - Flow name
- `description` (object) - 可选 - Flow description
- `nodes` (array) - 可选 - Flow nodes
- `edges` (array) - 可选 - Flow edges
- `metadata` (object) - 可选 -
- 类型: `FlowMetadata`
- `id` (string) - **必填** - Unique flow ID
- `created_at` (string) - 可选 - Creation timestamp
- `updated_at` (string) - 可选 - Last update timestamp
- `version` (integer) - 可选 - Version number
错误响应:
422: Validation Error
✏️ Update Flow
Update a Flow configuration.
Args: flow_id: Flow ID flow_update: Flow update data
Returns: Updated FlowConfig
Raises: HTTPException: If flow not found
请求方式: PUT /api/v1/flows/{flow_id}
路径参数:
flow_id(string) - 必填 -
请求体:
// 参考模型: FlowConfigUpdate
- `name` (object) - 可选 -
- `description` (object) - 可选 -
- `nodes` (object) - 可选 -
- `edges` (object) - 可选 -
- `metadata` (object) - 可选 -
响应:
// 参考模型: FlowConfig
- `name` (string) - **必填** - Flow name
- `description` (object) - 可选 - Flow description
- `nodes` (array) - 可选 - Flow nodes
- `edges` (array) - 可选 - Flow edges
- `metadata` (object) - 可选 -
- 类型: `FlowMetadata`
- `id` (string) - **必填** - Unique flow ID
- `created_at` (string) - 可选 - Creation timestamp
- `updated_at` (string) - 可选 - Last update timestamp
- `version` (integer) - 可选 - Version number
错误响应:
422: Validation Error
🗑️ Delete Flow
Delete a Flow configuration.
Args: flow_id: Flow ID
Raises: HTTPException: If flow not found
请求方式: DELETE /api/v1/flows/{flow_id}
路径参数:
flow_id(string) - 必填 -
错误响应:
204: Successful Response422: Validation Error
➕ Validate Flow Endpoint
Validate a Flow configuration.
Args: flow_id: Flow ID
Returns: Validation result with errors and warnings
Raises: HTTPException: If flow not found
请求方式: POST /api/v1/flows/{flow_id}/validate
路径参数:
flow_id(string) - 必填 -
响应:
错误响应:
422: Validation Error
➕ Duplicate Flow
Duplicate a Flow configuration.
Args: flow_id: Flow ID to duplicate
Returns: New FlowConfig (copy of original)
Raises: HTTPException: If flow not found
请求方式: POST /api/v1/flows/{flow_id}/duplicate
路径参数:
flow_id(string) - 必填 -
响应:
// 参考模型: FlowConfig
- `name` (string) - **必填** - Flow name
- `description` (object) - 可选 - Flow description
- `nodes` (array) - 可选 - Flow nodes
- `edges` (array) - 可选 - Flow edges
- `metadata` (object) - 可选 -
- 类型: `FlowMetadata`
- `id` (string) - **必填** - Unique flow ID
- `created_at` (string) - 可选 - Creation timestamp
- `updated_at` (string) - 可选 - Last update timestamp
- `version` (integer) - 可选 - Version number
错误响应:
422: Validation Error