🇨🇳 简体中文
🇺🇸 English
🇯🇵 日本語
Skip to the content.

WebSocket API

模块: websocket

本模块包含 7 个API端点。

📋 端点列表


📖 详细说明

🔍 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

错误响应:


🔍 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}

路径参数:

响应:

// 参考模型: 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

错误响应:


✏️ 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}

路径参数:

请求体:

// 参考模型: 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

错误响应:


🗑️ Delete Flow

Delete a Flow configuration.

Args: flow_id: Flow ID

Raises: HTTPException: If flow not found

请求方式: DELETE /api/v1/flows/{flow_id}

路径参数:

错误响应:


➕ 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

路径参数:

响应:


错误响应:


➕ 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

路径参数:

响应:

// 参考模型: 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

错误响应: