HTTP API 参考(59 项)
版本基线:2026-12-01,核心源码提交 fa86a42292830d77277712ea30f7ecbd6d710c2d。具体部署版本及扩展能力以实例为准。
API · 59 项 · MCP · 1 个对外工具 · CLI · 73 个末级命令
纳入 56 个 Agent 共享集成接口及 3 个工作流入口,排除纯页面与后台配置管理接口。共享接口按程序化执行用途筛选;这是本版集成范围,不代表源码存在独立的官方公共 API 白名单。
2026-12-01 对本地实例完成 20 个抽样场景:认证、Agent/模型发现、会话创建与查询、消息发送/读取、分页、状态和 SSE 等。发送指令返回 HTTP 200、API_SAMPLE_OK,耗时 29.85 秒;不是全部 59 个接口或所有部署的验收。逐接口 422、SSE 和消息输出说明已按实测校正。
1 工作流服务接口清单(3 项)
| 服务 | 方法 | 路径 | 用途 | 认证 |
|---|---|---|---|---|
| 已发布工作流独立服务 | POST | /invoke | 同步调用工作流并返回结果 | 发布所得 API Key,x-api-key 请求头 |
| 已发布工作流独立服务 | GET | /health | 查询该已发布服务的运行准备状态 | 此处理器不校验 API Key |
| 核心服务上的工作流触发入口 | POST | /webhook/workflows/{workflow_id}/{trigger_id} | 外部系统提交事件,匹配触发器并执行 | 触发器 API Key 或 HMAC |
配套提供两份 OpenAPI:openapi-published-workflow.json 与 openapi-workflow-webhook.json。两者部署基地址不同,不应混用。本节工作流接口为上述 3 项,另有 7 节共享集成接口;FastAPI 自带的 /docs、/redoc、/openapi.json 是文档基础设施,不列为业务 API。
2 发布前提与凭据
由管理员在 Flocks 工作流发布界面完成发布,向调用方提供服务地址、API Key、工作流输入输出定义和版本信息。本文不暴露该界面的管理接口。对外服务支持 local/docker 发布驱动;受部署管理的工作流会被源码拒绝发布为独立服务,应由部署方确认可发布范围。
独立服务地址记为 WORKFLOW_SERVICE_URL,Webhook 所在核心地址记为 FLOCKS_BASE。工作流发布 API Key、触发器 Secret 与核心后台 API Token 是不同凭据。本节工作流入口不使用核心管理 Token;7 节共享 Agent 接口使用核心 API Token。
3 POST /invoke
功能:执行所发布工作流的快照并返回结果。执行等待时间取决于工作流、模型和外部依赖。
请求头
| 名称 | 必填 | 说明 |
|---|---|---|
| Content-Type | 是 | application/json |
| x-api-key | 发布服务配置了 API Key 时必填 | 使用发布结果中的 Key;标准发布会生成/沿用 Key。源码工厂允许未配置 Key 的实例,不应将这种实例当成鉴权已开启 |
请求体:对象本身必填,以下字段均可省略。
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| inputs | object | {} | 工作流输入;具体键和约束由所发布工作流定义 |
| request_id | string 或 null | null | 调用方关联 ID,原样回传;不是源码承诺的幂等键 |
| timeout_s | number 或 null | null | 传给工作流执行器的超时秒数;接口模型未声明正数校验 |
| trace | boolean | false | 是否开启执行跟踪 |
| ensure_requirements | boolean | false | 是否要求执行器处理运行依赖 |
curl -sS "$WORKFLOW_SERVICE_URL/invoke" \
-H "x-api-key: $WORKFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{},"request_id":"req-001","timeout_s":60,"trace":false,"ensure_requirements":false}'HTTP 200 返回体
| 字段 | 类型 | 说明 |
|---|---|---|
| request_id | string 或 null | 回传请求关联 ID |
| workflow_id | string | 服务绑定的工作流 ID |
| release_id | string | 发布快照 ID |
| status | string | 执行器当前返回 SUCCEEDED、FAILED、CANCELLED 或 TIMED_OUT;客户端须检查业务状态 |
| run_id | string 或 null | 工作流运行 ID |
| outputs | object | 工作流输出,具体结构由工作流定义 |
| error | string 或 null | 工作流运行错误信息 |
| duration_ms | integer | 服务测量的调用耗时,毫秒 |
{"request_id":"req-001","workflow_id":"workflow-example","release_id":"release-example","status":"SUCCEEDED","run_id":"run-example","outputs":{},"error":null,"duration_ms":120}以上为结构示例,不是实际运行记录。HTTP 200 也可能携带 FAILED/TIMED_OUT/CANCELLED 业务结果;不要只凭 HTTP 状态认定任务成功。request_id 未实现自动去重,含副作用的工作流不能据此放心重复提交。
错误响应
| HTTP 状态 | 返回形式 | 条件 |
|---|---|---|
| 401 | {"detail":"Invalid API key"} | Key 缺失或不匹配 |
| 422 | {"detail":[...]} | FastAPI/Pydantic 输入校验失败 |
| 503 | {"detail":{"request_id":...,"workflow_id":...,"release_id":...,"status":"FAILED","error":...,"duration_ms":...}} | MCP 子系统未准备好,或启动的关键插件/受管内容加载失败等导致服务未就绪 |
| 403 | {"detail":"Workflow invocation stopped by extension"} | 扩展拒绝执行 |
| 500 | detail 对象,结构同 503 | 工作流执行过程中抛出异常 |
这些是独立服务的异常形式,不使用核心 Web 后端的 error/message envelope。代理、网络或部署扩展仍可产生其他错误。
4 GET /health
无需请求体。该处理器不要求 x-api-key。
curl -sS "$WORKFLOW_SERVICE_URL/health"| 返回字段 | 类型 | 说明 |
|---|---|---|
| ok | boolean | 当前等于 mcp_ready |
| mcp_ready | boolean | 服务启动准备状态 |
| mcp_error | string 或 null | 启动/MCP 准备失败原因 |
| workflow_id | string | 绑定工作流 ID |
| release_id | string | 发布快照 ID |
mcp_ready=true 时返回 200,否则返回 503,响应字段相同。此检查不代表某次工作流必然成功,也不代表所有外部依赖持续可用。
5 POST /webhook/workflows/{workflow_id}/{trigger_id}
前提:工作流已存在,触发器类型为 webhook 或 custom_webhook,且 enabled=true。该入口跳过核心全局登录门禁,但强制验证触发器自身认证。
| 路径参数 | 类型 | 必填 | 含义 |
|---|---|---|---|
| workflow_id | string | 是 | 已配置工作流 ID |
| trigger_id | string | 是 | 已配置触发器 ID |
认证 A:API Key
触发器 auth.type=api_key。默认从 x-api-key 请求头读取,缺失时读取 api_key 查询参数;名称可由触发器 headerName/queryParam 改写。期望值来自触发器 apiKey 或 secretRef。未配置有效 Secret、值错误或未配置认证均拒绝。
认证 B:HMAC
触发器 auth.type=hmac。使用 secretRef 对应的 Secret,以 HTTP 原始请求体字节计算 HMAC-SHA256 十六进制摘要。默认请求头为 x-flocks-signature,可由 headerName 改写。接受纯十六进制摘要或 sha256=<摘要>;签名必须针对实际发送的字节,不能先重新格式化 JSON。
请求体与映射
处理器先按 UTF-8 JSON 解析;失败则按 UTF-8 文本接收并替换非法字节。请求体可以是任意 JSON 值或文本,不存在核心固定的告警字段模型。body、headers、query、pathParams 等形成触发事件,随后按触发器 filter/mapping/inputs 配置生成工作流输入。调用方应取得该触发器的业务输入样例。
投递 ID 与去重
按顺序选取首个非空请求头:x-flocks-delivery-id、x-idempotency-key、idempotency-key、x-delivery-id,去除首尾空格并截取前 200 字符。路由设计的重复投递窗口默认为 300 秒,可由 FLOCKS_WEBHOOK_REPLAY_WINDOW_S 改写,0 禁用。但当前核心 WorkflowStore.claim_webhook_delivery 为不记录占位的空实现;仅当部署的存储后端实际实现占位时才会去重,不能仅凭此参数承诺已实现幂等。未提供 ID 时使用请求体 SHA-256 参与去重;去重窗口并非永久的 exactly-once 承诺。
curl -sS "$FLOCKS_BASE/webhook/workflows/<WORKFLOW_ID>/<TRIGGER_ID>" \
-H "x-api-key: $WEBHOOK_API_KEY" \
-H "x-flocks-delivery-id: delivery-001" \
-H "Content-Type: application/json" \
-d '{"example":"按触发器实际业务约定替换"}'HTTP 200 返回体
| 字段 | 类型 | 说明 |
|---|---|---|
| ok | boolean | 正常响应为 true;不等于工作流业务成功 |
| duplicate | boolean | 是否命中重复投递 |
| matched | boolean | 是否匹配触发器;重复投递时 false |
| executed | boolean | 是否执行;重复投递时 false |
| inputs | object | 映射后的输入;重复投递时 {} |
| deliveryId | string 或 null | 本次投递 ID;重复时返回先前记录的 ID |
{"ok":true,"duplicate":false,"matched":true,"executed":true,"inputs":{},"deliveryId":"delivery-001"}Webhook 返回体不提供 /invoke 的 outputs/run_id 结构。需要同步拿到工作流输出的集成应选择独立服务 /invoke。
错误响应
该入口由核心服务处理,处理器 HTTPException 通常返回 {"error":"HTTPException","message":<说明>}。
| HTTP 状态 | 典型原因 |
|---|---|
| 400 | 触发器类型不匹配、不支持的认证类型、过滤器错误 |
| 401 | 未配置认证/Secret、API Key 或 HMAC 错误 |
| 403 | 触发器关闭或扩展拒绝 |
| 404 | 工作流或触发器不存在 |
| 500 | 未处理异常;通常为 {"error":"InternalServerError","message":"Internal server error"} |
| 503 | 核心关键扩展初始化失败等全局不可用情况 |
执行前过滤失败或 ingress.before 拒绝时,源码会尝试释放去重占位以允许重试;可能已发生副作用的其他失败仍保留记录。调用方需区分明确拒绝、重复投递和结果未知。
6 源码依据
- 独立工作流应用、请求模型与响应:
flocks/workflow/service_runtime.py,InvokeRequest、create_service_app。 - 发布边界:
flocks/workflow/center.py,_refuse_managed_publish。 - Webhook 认证、去重与返回:
flocks/server/routes/workflow.py,_authorize_webhook_trigger、invoke_workflow_webhook_trigger。 - 业务状态与结果模型:
flocks/workflow/runner.py,RunWorkflowResult。
7 Agent 会话与执行控制接口(56 项)
这组接口同时供 WebUI/TUI 和外部程序使用。源码 SessionCreateRequest 明确支持 entry="api",不能因接口由 Web 后端承载而排除。本文纳入完成 Agent 集成闭环所需的共享接口,不把全部后台路由都当作公共产品 API。此清单是本版按用途确定的集成范围,不代表源码中存在独立的“官方公共 API 白名单”。
| 能力 | 数量 |
|---|---|
| 会话、指令、结果、上下文与执行控制 | 45 |
| Agent 发现与详情 | 2 |
| 模型发现与详情 | 2 |
| SSE 实时事件 | 1 |
| 运行时权限请求读取与回复 | 3 |
| Agent 提问读取与回复 | 3 |
认证与调用顺序
这些共享接口使用核心服务地址及 API Token:Authorization: Bearer <TOKEN>,或 X-Flocks-API-Token: <TOKEN>。不能使用工作流发布 Key 替代。服务端通过 flocks admin generate-api-token 配置 Token。资源访问控制、许可证与部署策略仍会参与判定。
先发现 Agent/模型,再创建 entry=api 的会话;向 message 或 prompt_async 发送 agent、parts 和可选 model。创建会话本身不执行任务,同一 sessionID 支持连续交互。异步接收返回 202,accepted/queued 仅表示接收或排队;可读取 turn、status、message 或订阅 event 获取进度和结果。
# 1. 创建由程序驱动的会话,读取返回的 id
curl -sS "$FLOCKS_BASE/api/session" \
-H "Authorization: Bearer $FLOCKS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"自动化任务","entry":"api"}'
# 2. 指定实际存在的 Agent,发送指令
curl -sS "$FLOCKS_BASE/api/session/$SESSION_ID/message" \
-H "Authorization: Bearer $FLOCKS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"agent":"rex","parts":[{"type":"text","text":"请概括当前项目"}]}'
# 3. 订阅执行事件,按 SSE 逐帧处理
curl -N "$FLOCKS_BASE/api/event" \
-H "Authorization: Bearer $FLOCKS_API_TOKEN"model 可选,结构为 {"providerID":"实际供应商","modelID":"实际模型"}。POST .../prompt_async 使用相同 PromptRequest。GET .../turn/{turnID} 可跟踪客户端指定的 turnID。权限/提问接口用于运行时交互,不应误认为能绕过部署策略;entry=api 的运行策略也可能直接拒绝需要无人确认的动作。
核心服务输入校验错误为 422 {"error":"ValidationError","message":"Request validation failed","details":[...]};HTTPException 通常为 {"error":"HTTPException","message":...}。鉴权门禁、只读托管内容和部署扩展可有不同 envelope。文件下载按实际媒体类型读取,SSE 为 text/event-stream,事件为直接的 type/properties 对象,不是 directory/payload 包装。
共享接口完整索引
GET /api/session/status
Get session status
Retrieve the current status of all sessions (idle, busy, retry)
源码:flocks/server/routes/session.py:869。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
无声明参数。
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"type": "object",
"title": "Response Get Session Status Api Session Status Get"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L925
resultGET /api/session/{sessionID}/status
Get session runtime status
Get the current runtime status of a specific session
源码:flocks/server/routes/session.py:970。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRuntimeStatusResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L992
await _build_session_runtime_status(session)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')GET /api/session/{sessionID}/turn/
Get how a turn stands
The receipt of a prompt or command sent with turnID: accepted, queued, running, done, failed, removed, or lost
源码:flocks/server/routes/session.py:995。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | turnID | 是 | {"type": "string", "title": "Turnid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true,
"title": "Response Session.Turnbyid"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1016
{'turnID': turnID, 'sessionID': sessionID, **receipt}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Turn {turnID} not found')GET /api/session
List sessions
Get a list of all sessions, sorted by most recently updated
源码:flocks/server/routes/session.py:1074。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| query | view | 否 | {"anyOf": [{"const": "list", "type": "string"}, {"type": "null"}], "description": "Use lightweight list rows", "title": "View"} | Use lightweight list rows |
| query | manager | 否 | {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Apply session-manager visibility filters", "title": "Manager"} | Apply session-manager visibility filters |
| query | directory | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter by project directory", "title": "Directory"} | Filter by project directory |
| query | projectID | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter by effective project ID", "title": "Projectid"} | Filter by effective project ID |
| query | roots | 否 | {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Only return root sessions (no parentID)", "title": "Roots"} | Only return root sessions (no parentID) |
| query | start | 否 | {"anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Filter sessions updated on or after this timestamp", "title": "Start"} | Filter sessions updated on or after this timestamp |
| query | search | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter by title (case-insensitive)", "title": "Search"} | Filter by title (case-insensitive) |
| query | limit | 否 | {"anyOf": [{"type": "integer", "minimum": 1}, {"type": "null"}], "description": "Maximum sessions to return", "title": "Limit"} | Maximum sessions to return |
| query | offset | 否 | {"anyOf": [{"type": "integer", "minimum": 0}, {"type": "null"}], "description": "Number of filtered sessions to skip", "title": "Offset"} | Number of filtered sessions to skip |
| query | category | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter by category: user or task", "title": "Category"} | Filter by category: user or task |
| query | status | 否 | {"enum": ["active", "archived", "all"], "type": "string", "description": "Filter by session status", "default": "active", "title": "Status"} | Filter by session status |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionResponse"
},
{
"$ref": "#/components/schemas/SessionListItem"
}
]
},
"title": "Response List Sessions Api Session Get"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1187
response
# 返回变量赋值
[await _session_to_response_with_goal(s, effective_project_ids[s.id], shared_project_ids) for s in filtered]
# L1209
response
# 返回变量赋值
[await _session_to_response_with_goal(s, effective_project_ids[s.id], shared_project_ids) for s in filtered]POST /api/session
Create session
Create a new session
源码:flocks/server/routes/session.py:1338。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
无声明参数。
请求体
{
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionCreateRequest"
},
{
"type": "null"
}
],
"title": "Request"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1528
await _session_to_response_with_goal(session)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail='Auto mode is only available for user, entity configuration, and workflow sessions')
HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail='Auto mode can only be enabled from the WebUI')
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f'Auto mode is unavailable: {auto_reason}')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Project {request.projectID} not found')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=f'Project directory is {project.path_status}')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Parent session {request.parentID} not found')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail='Parent and child sessions must belong to the same project')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=f'Project {request.projectID} is no longer available')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc))GET /api/session/
Get session
Get session by ID
源码:flocks/server/routes/session.py:1703。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionDetailResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1726
SessionDetailResponse(**response.model_dump(), webUrl=_session_web_url(session.id))直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')GET /api/session/{sessionID}/children
Get session children
Get all child sessions forked from the specified parent
源码:flocks/server/routes/session.py:1792。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SessionResponse"
},
"title": "Response Get Session Children Api Session Sessionid Children Get"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1809
[await _session_to_response_with_goal(s) for s in children if SessionPolicy.can_read(s, current_user)]直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')GET /api/session/{sessionID}/todo
Get session todos
Get the todo list for a session
源码:flocks/server/routes/session.py:1825。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TodoInfo"
},
"title": "Response Get Session Todos Api Session Sessionid Todo Get"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1844
[TodoInfo(**todo.model_dump(exclude_none=True)) for todo in todos]
# L1847
[]直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')POST /api/session/{sessionID}/todo
Update session todos
Update the todo list for a session
源码:flocks/server/routes/session.py:1850。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TodoInfo"
},
"title": "Todos"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TodoInfo"
},
"title": "Response Update Session Todos Api Session Sessionid Todo Post"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1878
todos直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=500, detail=str(e))GET /api/session/{sessionID}/context
Get Session Context
源码:flocks/server/routes/session.py:1910。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| query | before | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Before"} | — |
| query | limit | 否 | {"type": "integer", "maximum": 200, "minimum": 1, "default": 100, "title": "Limit"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1921
await build_session_context(session, include_roots=SessionPolicy.is_owner(session, current_user), before=before, limit=limit)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=400, detail=str(exc))GET /api/session/{sessionID}/context/files/{resourceID}/metadata
Get Session Context file metadata
源码:flocks/server/routes/session.py:1948。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | resourceID | 是 | {"type": "string", "title": "Resourceid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1953
session_resource_metadata(resource)GET /api/session/{sessionID}/context/files/{resourceID}/content
Read Session Context text file
源码:flocks/server/routes/session.py:1956。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | resourceID | 是 | {"type": "string", "title": "Resourceid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1970
{'resourceID': resource.resource_id, 'content': content, 'truncated': truncated, 'size': resource.path.stat().st_size, 'previewLimitBytes': max_bytes}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=415, detail='File type is not supported for text preview')GET /api/session/{sessionID}/context/files/{resourceID}/download
Download Session Context file
源码:flocks/server/routes/session.py:1987。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | resourceID | 是 | {"type": "string", "title": "Resourceid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L1992
_download_response(resource.path, filename=resource.filename)POST /api/session/{sessionID}/context/folders
Add Session Context folder
源码:flocks/server/routes/session.py:1995。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContextFolderCreateRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2042
{'id': result_entry['id'], 'kind': 'folder', 'displayName': result_entry['displayName'], 'status': 'available'}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=400, detail=str(exc))
HTTPException(status_code=404, detail=f'Session {sessionID} not found')DELETE /api/session/{sessionID}/context/folders/
Remove Session Context folder
源码:flocks/server/routes/session.py:2050。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | rootID | 是 | {"type": "string", "title": "Rootid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2077
{'removed': True, 'id': rootID}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=404, detail='Context folder not found')
HTTPException(status_code=404, detail=f'Session {sessionID} not found')GET /api/session/{sessionID}/context/roots/{rootID}/list
List Session Context folder
源码:flocks/server/routes/session.py:2103。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | rootID | 是 | {"type": "string", "title": "Rootid"} | — |
| query | path | 否 | {"type": "string", "default": "", "title": "Path"} | — |
| query | offset | 否 | {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"} | — |
| query | limit | 否 | {"type": "integer", "maximum": 200, "minimum": 1, "default": 100, "title": "Limit"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2126
{'rootID': rootID, 'path': path, **page}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=404, detail=str(exc))
HTTPException(status_code=400, detail=str(exc))
HTTPException(status_code=403, detail=str(exc))GET /api/session/{sessionID}/context/roots/{rootID}/content
Read Session Context folder text file
源码:flocks/server/routes/session.py:2129。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | rootID | 是 | {"type": "string", "title": "Rootid"} | — |
| query | path | 是 | {"type": "string", "title": "Path"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2144
{'path': path, 'content': content, 'truncated': truncated, 'size': target.stat().st_size, 'previewLimitBytes': max_bytes}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=415, detail='File type is not supported for text preview')GET /api/session/{sessionID}/context/roots/{rootID}/download
Download Session Context folder file
源码:flocks/server/routes/session.py:2168。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | rootID | 是 | {"type": "string", "title": "Rootid"} | — |
| query | path | 是 | {"type": "string", "title": "Path"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2180
_download_response(target)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=400, detail='Context path is not a file')POST /api/session/{sessionID}/archive
Archive session
Archive a session and its descendants without deleting persisted data
源码:flocks/server/routes/session.py:2183。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2191
await archive_session_for_user(sessionID, current_user)POST /api/session/{sessionID}/restore
Restore session
Restore an archived session and its descendants
源码:flocks/server/routes/session.py:2194。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2202
await restore_session_for_user(sessionID, current_user)DELETE /api/session/
Permanently delete session
Permanently delete a session tree and its persisted history
源码:flocks/server/routes/session.py:2313。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "boolean",
"title": "Response Delete Session Api Session Sessionid Delete"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2322
await delete_session_for_user(sessionID, current_user)PATCH /api/session/
Update session
Update session properties
源码:flocks/server/routes/session.py:2391。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionUpdateRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2500
await _session_to_response_with_goal(session)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail='Auto mode cannot be combined with a pinned provider/model')
HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail='Auto mode is only available for user, entity configuration, and workflow sessions')
HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail='Auto mode can only be enabled from the WebUI')
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f'Auto mode is unavailable: {auto_reason}')
HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail='provider and model must be updated together')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')POST /api/session/{sessionID}/abort
Abort session
Abort an active session and stop any ongoing processing
源码:flocks/server/routes/session.py:2749。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AbortSessionResult"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2774
AbortSessionResult(status='stopped' if ran_here else 'unconfirmed')
# L2776
AbortSessionResult(status='stopped' if ran_here else 'not_running')
# L2783
AbortSessionResult(status=outcome, generation=target.generation)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')POST /api/session/{sessionID}/init
Initialize session
Analyze the current application and create an AGENTS.md file with project-specific agent configurations
源码:flocks/server/routes/session.py:2812。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InitRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "boolean",
"title": "Response Initialize Session Api Session Sessionid Init Post"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2862
True直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f'Provider {request.providerID} not found')POST /api/session/{sessionID}/fork
Fork session
Create a new session by forking at a specific message point
源码:flocks/server/routes/session.py:2865。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/ForkRequest"
},
{
"type": "null"
}
],
"title": "Request"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2903
await _session_to_response_with_goal(forked)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Message {message_id} not found in session {sessionID}')
HTTPException(status_code=409, detail='Only completed replies can be forked')GET /api/session/{sessionID}/diff
Get session diff
Get file diffs for a session or specific message
源码:flocks/server/routes/session.py:2906。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| query | messageID | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Message ID to get diff for", "title": "Messageid"} | Message ID to get diff for |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FileDiff"
},
"title": "Response Get Session Diff Api Session Sessionid Diff Get"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L2936
[]
# L2937
[FileDiff(**diff) for diff in diffs]
# L2940
[]直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')POST /api/session/{sessionID}/summarize
Summarize session
Generate a summary using AI compaction
源码:flocks/server/routes/session.py:2950。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SummarizeRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "boolean",
"title": "Response Summarize Session Api Session Sessionid Summarize Post"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L3023
True直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')POST /api/session/{sessionID}/revert
Revert session
Revert session to a specific message point
源码:flocks/server/routes/session.py:3032。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RevertRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L3072
await _session_to_response_with_goal(updated)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Message {request.messageID} not found in session {sessionID}')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc))POST /api/session/{sessionID}/unrevert
Unrevert session
Restore previously reverted messages
源码:flocks/server/routes/session.py:3075。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L3103
await _session_to_response_with_goal(updated)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc))GET /api/session/{sessionID}/message
Get session messages
Get all messages in a session
源码:flocks/server/routes/session.py:3457。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| query | limit | 否 | {"anyOf": [{"type": "integer", "maximum": 100, "minimum": 1}, {"type": "null"}], "description": "Maximum messages to return", "title": "Limit"} | Maximum messages to return |
| query | before | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Load messages before this message id", "title": "Before"} | Load messages before this message id |
| query | after | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Load messages after this message id", "title": "After"} | Load messages after this message id |
| query | around | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Load a page containing this message id", "title": "Around"} | Load a page containing this message id |
| query | page | 否 | {"type": "boolean", "description": "Return paged response metadata", "default": false, "title": "Page"} | Return paged response metadata |
| query | include_archived | 否 | {"type": "boolean", "description": "Include compacted/archived messages", "default": true, "title": "Include Archived"} | Include compacted/archived messages |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageWithParts"
}
},
{
"$ref": "#/components/schemas/MessagePage"
}
],
"title": "Response Get Session Messages Api Session Sessionid Message Get"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L3536
MessagePage(sessionID=sessionID, items=result, hasMore=has_more, nextBefore=next_before, hasNewer=has_newer, nextAfter=next_after)
# L3544
result
# 返回变量赋值
[await _message_with_parts_to_response(msg_with_parts, session_id=sessionID, cwd=cwd) for msg_with_parts in messages_with_parts]直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=422, detail='Only one message cursor may be supplied')
HTTPException(status_code=404, detail='Message cursor not found')
HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail='Failed to load session messages')GET /api/session/{sessionID}/message/
Get message
Get a specific message by ID
源码:flocks/server/routes/session.py:3555。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | messageID | 是 | {"type": "string", "title": "Messageid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageWithParts"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L3577
await _message_with_parts_to_response(msg_with_parts, session_id=sessionID, cwd=os.getcwd())直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Message {messageID} not found in session {sessionID}')DELETE /api/session/{sessionID}/message/{messageID}/part/
Delete message part
Delete a specific part from a message
源码:flocks/server/routes/session.py:3589。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | messageID | 是 | {"type": "string", "title": "Messageid"} | — |
| path | partID | 是 | {"type": "string", "title": "Partid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "boolean",
"title": "Response Delete Message Part Api Session Sessionid Message Messageid Part Partid Delete"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L3622
True直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(e))
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Part {partID} not found in message {messageID}')PATCH /api/session/{sessionID}/message/{messageID}/part/
Update message part
Update a specific part in a message
源码:flocks/server/routes/session.py:3625。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | messageID | 是 | {"type": "string", "title": "Messageid"} | — |
| path | partID | 是 | {"type": "string", "title": "Partid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessagePartInfo"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessagePartInfo"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L3682
_part_to_response_info(updated, session_id=sessionID, message_id=messageID)
# L3698
body直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail='Part IDs do not match URL parameters')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=404, detail='Message part not found')
HTTPException(status_code=400, detail='Message part type and tool are immutable')
HTTPException(status_code=400, detail='Tool state is server-managed')
HTTPException(status_code=404, detail='Message part not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(e))
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Part {partID} not found in message {messageID}')POST /api/session/{sessionID}/message/{messageID}/resend
Replay edited user message
Update a user message and regenerate subsequent assistant output
源码:flocks/server/routes/session.py:4150。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | messageID | 是 | {"type": "string", "title": "Messageid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageEditRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"202": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"title": "Response Resend Session Message Api Session Sessionid Message Messageid Resend Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L4260
{'status': 'accepted', 'sessionID': sessionID, 'messageID': messageID}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail='Edited message text cannot be empty')
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail='Only user messages can be resent')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail='Session is currently generating a response')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc))POST /api/session/{sessionID}/message/{messageID}/regenerate
Regenerate assistant message
Discard an assistant reply and regenerate it from its parent user message
源码:flocks/server/routes/session.py:4263。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | messageID | 是 | {"type": "string", "title": "Messageid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"202": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"title": "Response Regenerate Session Message Api Session Sessionid Message Messageid Regenerate Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L4377
{'status': 'accepted', 'sessionID': sessionID, 'messageID': messageID}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Message {messageID} not found in session {sessionID}')
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail='Only assistant messages can be regenerated')
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail='Assistant message does not have a parent user message')
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail='Assistant parent message must be a user message')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail='Session is currently generating a response')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc))POST /api/session/{sessionID}/message
Send message
Send a new message and get AI response
源码:flocks/server/routes/session.py:4380。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PromptRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "成功完成本次 Agent 回合;正文包含消息信息与消息片段,业务错误仍需检查 info.error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageWithParts"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}成功响应字段说明
info:消息元信息对象。包含 id、sessionID、role、模型标识、time 等;助手消息可包含 finish 和 error。字段类型见 MessageWithParts、AssistantMessageInfo 与 UserMessageInfo 模型。HTTP 200 不应单独作为 Agent 任务成功的依据,客户端还应检查 info.error 与业务结果。
parts:消息片段数组。按 type 区分文本、工具调用及其他片段;type="text" 时从 text 读取文本。片段字段并非全部固定,空文本片段可能出现,客户端应保留顺序并按类型处理。
实测成功示例(节选):HTTP 200;返回 {"info":{"role":"assistant","finish":"stop","error":null},"parts":[{"type":"text","text":""},{"type":"text","text":"API_SAMPLE_OK"}]}。为便于阅读省略 ID、时间戳及其他字段,不能把此节选当作全部必填字段。
2026-12-01 本地服务实测:耗时 29.85 秒,回复 API_SAMPLE_OK,finish=stop,无业务错误。该结果验证了当前实例的一次调用,不代表所有模型或输入均成功。
源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L4461
result
# 返回变量赋值
await Instance.provide(directory=working_directory, init=instance_bootstrap, fn=lambda: _process_session_message(sessionID, session, request, working_directory, lifecycle_generation=lifecycle_generation, uploader_user_id=current_user.id))直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')GET /api/session/{sessionID}/prompt_queue
List queued prompts
List pending non-blocking prompts for a session
源码:flocks/server/routes/session.py:6134。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true,
"title": "Response List Prompt Queue Api Session Sessionid Prompt Queue Get"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6151
{'sessionID': sessionID, 'items': [item.model_dump() for item in items]}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')POST /api/session/{sessionID}/prompt_queue
Queue prompt
Queue a prompt without writing it to the formal message history
源码:flocks/server/routes/session.py:6154。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PromptRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"202": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true,
"title": "Response Enqueue Prompt Api Session Sessionid Prompt Queue Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6185
{'status': 'queued', 'sessionID': sessionID, 'queueID': item.id}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc))PATCH /api/session/{sessionID}/prompt_queue/
Update queued prompt
Update the text part of a queued prompt
源码:flocks/server/routes/session.py:6188。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | queueID | 是 | {"type": "string", "title": "Queueid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PromptQueueUpdateRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true,
"title": "Response Update Prompt Queue Item Api Session Sessionid Prompt Queue Queueid Patch"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6217
{'status': 'updated', 'sessionID': sessionID, 'item': item.model_dump()}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail='Queued prompt text cannot be empty')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(exc))DELETE /api/session/{sessionID}/prompt_queue/
Remove queued prompt
Remove a queued prompt before it executes
源码:flocks/server/routes/session.py:6220。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | queueID | 是 | {"type": "string", "title": "Queueid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true,
"title": "Response Remove Prompt Queue Item Api Session Sessionid Prompt Queue Queueid Delete"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6255
{'status': 'removed', 'sessionID': sessionID, 'queueID': queueID}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(exc))POST /api/session/{sessionID}/prompt_queue/{queueID}/run_now
Run queued prompt now
Abort the current prompt and run the selected queued prompt next
源码:flocks/server/routes/session.py:6258。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
| path | queueID | 是 | {"type": "string", "title": "Queueid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"202": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true,
"title": "Response Run Prompt Queue Item Now Api Session Sessionid Prompt Queue Queueid Run Now Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6293
{'status': 'accepted', 'sessionID': sessionID, 'queueID': queueID}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(exc))POST /api/session/{sessionID}/prompt_async
Send async message
Send a message asynchronously (returns immediately)
源码:flocks/server/routes/session.py:6296。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PromptRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"202": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6411
{'status': 'queued', 'sessionID': sessionID, 'queueID': item.id, **({'turnID': turn_id} if turn_id else {})}
# L6429
{'status': 'accepted', 'sessionID': sessionID, **({'turnID': turn_id} if turn_id else {})}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(exc))
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc))POST /api/session/{sessionID}/command
Send command
Execute a slash command in the session (returns 202, result via SSE)
源码:flocks/server/routes/session.py:6469。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CommandRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"202": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6523
{'status': 'created', 'sessionID': forked.id, 'action': 'fork'}
# L6534
{'status': 'accepted', 'sessionID': child.id, 'action': 'btw'}
# L6546
{'status': 'accepted', 'sessionID': sessionID, 'action': 'insert'}
# L6555
{**result, 'action': 'steer'}
# L6594
{'status': 'accepted', 'sessionID': sessionID, **({'turnID': turn_id} if turn_id else {})}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(exc))
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=401, detail='Authentication required')
HTTPException(status_code=400, detail='Session control commands do not accept attachments')
HTTPException(status_code=400, detail='Use /fork without arguments')
HTTPException(status_code=400, detail=f'/{request.command} requires a message')
HTTPException(status_code=409, detail={'message': 'Task is queued; retry Run now on the existing queue item', 'queueID': queued['queueID']})POST /api/session/{sessionID}/shell
Run shell command
Execute a shell command in the session context
源码:flocks/server/routes/session.py:6686。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ShellRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6743
result
# 返回变量赋值
await SessionRunner.shell(session_id=sessionID, agent=request.agent, command=request.command, model=model, event_publish_callback=publish_event)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(exc))
HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc))
HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail='execution stopped by extension')POST /api/session/{sessionID}/clear
Clear Session
Clear session messages
Removes all messages from the session while keeping the session itself.
源码:flocks/server/routes/session.py:6855。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | sessionID | 是 | {"type": "string", "title": "Sessionid"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L6876
{'status': 'success', 'sessionID': sessionID, 'deletedMessages': deleted_count}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f'Session {sessionID} not found')
HTTPException(status_code=500, detail=f'Failed to clear session: {str(e)}')GET /api/model/
List all models
List all available models across all providers
源码:flocks/server/routes/model.py:144。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| query | provider | 否 | {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter by provider ID", "title": "Provider"} | Filter by provider ID |
| query | streaming | 否 | {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Filter by streaming support", "title": "Streaming"} | Filter by streaming support |
| query | tools | 否 | {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Filter by tool support", "title": "Tools"} | Filter by tool support |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ModelListResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L169
await _collect_models(provider=provider, streaming=streaming, tools=tools)GET /api/model/{model_id:path}
Get model details
Get detailed information about a specific model
源码:flocks/server/routes/model.py:615。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | model_id | 是 | {"type": "string", "title": "Model Id"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ModelDetail"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L647
_to_model_detail(model, provider_id, _definition_index(provider_id).get(model.id))
# L656
_to_model_detail(model, pid, _definition_index(pid).get(model.id))直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=404, detail=f'Model {model_id} not found')
HTTPException(status_code=500, detail=str(e))GET /api/agent
List agents
List all available agents with model overrides applied.
源码:flocks/server/routes/agent.py:389。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
无声明参数。
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/AgentResponse"
},
"type": "array",
"title": "Response List Agents Api Agent Get"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L402
result
# 返回变量赋值
[]直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=500, detail=str(e))GET /api/agent/
Get agent
Get a specific agent by name with model override applied.
源码:flocks/server/routes/agent.py:408。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | name | 是 | {"type": "string", "title": "Name"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentResponse"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L418
await _build_single_agent_response(agent, overrides, delegatable_overrides, all_tool_names)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=404, detail=f'Agent {name} not found')
HTTPException(status_code=500, detail=str(e))GET /api/event
Subscribe to events
Subscribe to server-sent events (SSE) stream
源码:flocks/server/routes/event.py:648。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
无声明参数。
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "持续 SSE 事件流;每个 data 行为 JSON 事件对象",
"content": {
"text/event-stream": {
"schema": {
"type": "string"
},
"example": "data: {\"type\":\"server.connected\",\"properties\":{}}\n\n"
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L667
StreamingResponse(sse_generator(queue, request), media_type='text/event-stream', headers={'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'X-Accel-Buffering': 'no'})GET /api/question/session/{session_id}/pending
List pending questions for a session
Return all unanswered Question requests for the given session
源码:flocks/server/routes/question.py:143。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | session_id | 是 | {"type": "string", "title": "Session Id"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"title": "Response Get Pending Question Requests Api Question Session Session Id Pending Get"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L153
list_question_requests(session_id)POST /api/question/{request_id}/reply
Reply to question request
Reply to a QuestionRequest with answers for all questions
源码:flocks/server/routes/question.py:156。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | request_id | 是 | {"type": "string", "title": "Request Id"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QuestionRequestReply"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true,
"title": "Response Reply Question Request Api Question Request Id Reply Post"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L192
{'success': True}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=404, detail='Question request not found')POST /api/question/{request_id}/reject
Reject question request
Reject a QuestionRequest (user doesn't want to answer)
源码:flocks/server/routes/question.py:195。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | request_id | 是 | {"type": "string", "title": "Request Id"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "boolean"
},
"title": "Response Reject Question Request Api Question Request Id Reject Post"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L226
{'success': True}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=404, detail='Question request not found')GET /api/permission
List permissions
Get all pending permission requests
源码:flocks/server/routes/permission.py:193。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
无声明参数。
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/PermissionInfo"
},
"type": "array",
"title": "Response List Permissions Api Permission Get"
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L223
resultGET /api/permission/{permission_id}
Get permission
Get a specific permission request
源码:flocks/server/routes/permission.py:281。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | permission_id | 是 | {"type": "string", "title": "Permission Id"} | — |
请求体
无声明请求体;如存在原始请求读取,以下方源码记录为准。
声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PermissionInfo"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L296
PermissionInfo(id=info.id, sessionID=info.session_id, messageID=info.metadata.get('messageID', ''), toolID=(info.tool or {}).get('name', info.permission), permission=info.permission, patterns=info.patterns, always=info.always, metadata=info.metadata, time=info.time)直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=404, detail='Permission not found')POST /api/permission/{permission_id}/reply
Reply to permission
Reply to a permission request (allow or deny)
源码:flocks/server/routes/permission.py:309。认证:核心 Cookie/API Token,并受处理器权限控制。
请求参数
| 位置 | 名称 | 必填 | 类型与约束 | 说明 |
|---|---|---|---|---|
| path | permission_id | 是 | {"type": "string", "title": "Permission Id"} | — |
请求体
{
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PermissionReplyRequest"
}
}
}
}声明响应($ref 对应下方模型;空 Schema 表示未声明固定结构,不能解释为无响应体)。
{
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "boolean"
},
"title": "Response Reply Permission Api Permission Permission Id Reply Post"
}
}
}
},
"422": {
"description": "核心服务输入校验失败",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}源码返回分支(Python 表达式;不伪造动态工具/运行时输出的固定字段):
# L365
{'success': True}直接错误分支(还可能叠加全局/下游错误):
HTTPException(status_code=404, detail='Permission not found')
HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail='Network trust response is not allowed for this permission request')
HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail='Network confirmations require an explicit trust response')8 共享接口请求与响应模型
必填字段见 required;nullable 与可省略不是同一概念。动态 dict、文件及工具返回以业务定义为准。
AbortSessionResult
{
"properties": {
"status": {
"type": "string",
"enum": [
"stopped",
"requested",
"unconfirmed",
"not_running"
],
"title": "Status"
},
"generation": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Generation"
}
},
"type": "object",
"required": [
"status"
],
"title": "AbortSessionResult",
"description": "What an abort came to.\n\n``stopped``: the run has ended. ``requested``: the node running it took\nthe request and is stopping it. ``unconfirmed``: the request was recorded\n(or could not be), but no node answered for the run -- its node may be\ngone, and the run is released when its lease expires. ``not_running``:\nnothing of the session was executing."
}AgentModelInfo
{
"properties": {
"modelID": {
"type": "string",
"title": "Modelid"
},
"providerID": {
"type": "string",
"title": "Providerid"
}
},
"type": "object",
"required": [
"modelID",
"providerID"
],
"title": "AgentModelInfo",
"description": "Agent model configuration"
}AgentResponse
{
"properties": {
"name": {
"type": "string",
"title": "Name"
},
"nameCn": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Namecn"
},
"group": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Group"
},
"group_readonly": {
"type": "boolean",
"title": "Group Readonly",
"default": false
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"descriptionCn": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Descriptioncn"
},
"mode": {
"type": "string",
"title": "Mode",
"default": "primary"
},
"native": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Native",
"default": true
},
"hidden": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Hidden",
"default": false
},
"topP": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Topp"
},
"temperature": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Temperature"
},
"color": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Color"
},
"permission": {
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array",
"title": "Permission"
},
"model": {
"anyOf": [
{
"$ref": "#/components/schemas/AgentModelInfo"
},
{
"type": "null"
}
]
},
"prompt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Prompt"
},
"promptProtected": {
"type": "boolean",
"title": "Promptprotected",
"default": false
},
"options": {
"additionalProperties": true,
"type": "object",
"title": "Options"
},
"delegatable": {
"type": "boolean",
"title": "Delegatable",
"default": true
},
"steps": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Steps"
},
"skills": {
"items": {
"type": "string"
},
"type": "array",
"title": "Skills"
},
"tools": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tools"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
}
},
"type": "object",
"required": [
"name"
],
"title": "AgentResponse",
"description": "Agent response - Flocks TUI compatible format.\n\nIncludes required 'permission' and 'options' fields."
}AssistantMessageInfo
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"sessionID": {
"type": "string",
"title": "Sessionid"
},
"role": {
"type": "string",
"const": "assistant",
"title": "Role",
"default": "assistant"
},
"time": {
"additionalProperties": true,
"type": "object",
"title": "Time"
},
"parentID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Parentid"
},
"modelID": {
"type": "string",
"title": "Modelid"
},
"providerID": {
"type": "string",
"title": "Providerid"
},
"mode": {
"type": "string",
"title": "Mode",
"default": "rex"
},
"agent": {
"type": "string",
"title": "Agent",
"default": "rex"
},
"path": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"title": "Path"
},
"cost": {
"type": "number",
"title": "Cost",
"default": 0.0
},
"tokens": {
"additionalProperties": true,
"type": "object",
"title": "Tokens"
},
"error": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Error"
},
"summary": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Summary"
},
"finish": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Finish"
},
"compacted": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Compacted"
}
},
"type": "object",
"required": [
"id",
"sessionID",
"time",
"modelID",
"providerID",
"path"
],
"title": "AssistantMessageInfo",
"description": "Assistant message info - Flocks TUI compatible format.\n\nFlocks expects:\n{\n \"id\": string,\n \"sessionID\": string,\n \"role\": \"assistant\",\n \"time\": { \"created\": number, \"completed\"?: number },\n \"parentID\": string,\n \"modelID\": string,\n \"providerID\": string,\n \"mode\": string,\n \"agent\": string,\n \"path\": { \"cwd\": string, \"root\": string },\n \"cost\": number,\n \"tokens\": { \"input\": number, \"output\": number, ... },\n // optional fields...\n}"
}ChatType
{
"type": "string",
"enum": [
"direct",
"group",
"channel"
],
"title": "ChatType"
}CommandRequest
{
"properties": {
"command": {
"type": "string",
"title": "Command",
"description": "Command name"
},
"arguments": {
"type": "string",
"title": "Arguments",
"description": "Command arguments",
"default": ""
},
"argumentsJson": {
"anyOf": [
{},
{
"type": "null"
}
],
"title": "Argumentsjson",
"description": "Structured command arguments"
},
"messageID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Messageid",
"description": "Message ID"
},
"agent": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Agent",
"description": "Agent name"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Model",
"description": "Model string (provider/model)"
},
"variant": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Variant",
"description": "Model variant"
},
"parts": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Parts",
"description": "Additional parts"
},
"turnID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Turnid",
"description": "Client-chosen id of this turn; GET /session/{id}/turn/{turnID} says how it stands"
}
},
"type": "object",
"required": [
"command"
],
"title": "CommandRequest",
"description": "Request to execute a command"
}ContextFolderCreateRequest
{
"properties": {
"path": {
"type": "string",
"title": "Path"
},
"displayName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Displayname"
}
},
"type": "object",
"required": [
"path"
],
"title": "ContextFolderCreateRequest",
"description": "Add one read-only folder to the Session Context UI."
}FileDiff
{
"properties": {
"file": {
"type": "string",
"title": "File",
"description": "File path"
},
"before": {
"type": "string",
"title": "Before",
"description": "Content before changes",
"default": ""
},
"after": {
"type": "string",
"title": "After",
"description": "Content after changes",
"default": ""
},
"additions": {
"type": "integer",
"title": "Additions",
"description": "Lines added",
"default": 0
},
"deletions": {
"type": "integer",
"title": "Deletions",
"description": "Lines deleted",
"default": 0
}
},
"type": "object",
"required": [
"file"
],
"title": "FileDiff",
"description": "File diff info for API compatibility"
}ForkRequest
{
"properties": {
"messageID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Messageid",
"description": "Message ID to fork up to"
},
"inclusive": {
"type": "boolean",
"title": "Inclusive",
"default": false
},
"completedOnly": {
"type": "boolean",
"title": "Completedonly",
"default": false
}
},
"type": "object",
"title": "ForkRequest",
"description": "Request to fork session"
}HTTPValidationError
{
"type": "object",
"required": [
"error",
"message",
"details"
],
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {}
}
},
"description": "核心服务请求输入校验失败的响应;业务 HTTPException 的结构见总说明。"
}InitRequest
{
"properties": {
"modelID": {
"type": "string",
"title": "Modelid",
"description": "Model ID"
},
"providerID": {
"type": "string",
"title": "Providerid",
"description": "Provider ID"
},
"messageID": {
"type": "string",
"title": "Messageid",
"description": "Message ID"
}
},
"type": "object",
"required": [
"modelID",
"providerID",
"messageID"
],
"title": "InitRequest",
"description": "Request to initialize session"
}MessageEditRequest
{
"properties": {
"text": {
"type": "string",
"title": "Text",
"description": "Updated raw text content"
},
"partID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Partid",
"description": "Specific text part ID to edit"
}
},
"type": "object",
"required": [
"text"
],
"title": "MessageEditRequest",
"description": "Request to edit message text."
}MessagePage
{
"properties": {
"sessionID": {
"type": "string",
"title": "Sessionid"
},
"items": {
"items": {
"$ref": "#/components/schemas/MessageWithParts"
},
"type": "array",
"title": "Items",
"default": []
},
"hasMore": {
"type": "boolean",
"title": "Hasmore",
"default": false
},
"nextBefore": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Nextbefore"
},
"hasNewer": {
"type": "boolean",
"title": "Hasnewer",
"default": false
},
"nextAfter": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Nextafter"
}
},
"type": "object",
"required": [
"sessionID"
],
"title": "MessagePage",
"description": "Paged message response used by the WebUI session page."
}MessagePartInfo
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"messageID": {
"type": "string",
"title": "Messageid"
},
"sessionID": {
"type": "string",
"title": "Sessionid"
},
"type": {
"type": "string",
"title": "Type"
},
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Text"
},
"time": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Time"
},
"synthetic": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Synthetic"
},
"tool": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Tool"
},
"state": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "State"
},
"callID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Callid"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Metadata"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Url"
},
"mime": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Mime"
},
"filename": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Filename"
},
"resourceID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Resourceid"
}
},
"type": "object",
"required": [
"id",
"messageID",
"sessionID",
"type"
],
"title": "MessagePartInfo",
"description": "Message part info for API compatibility"
}MessageWithParts
{
"properties": {
"info": {
"anyOf": [
{
"$ref": "#/components/schemas/UserMessageInfo"
},
{
"$ref": "#/components/schemas/AssistantMessageInfo"
}
],
"title": "Info"
},
"parts": {
"items": {
"$ref": "#/components/schemas/MessagePartInfo"
},
"type": "array",
"title": "Parts",
"default": []
}
},
"type": "object",
"required": [
"info"
],
"title": "MessageWithParts",
"description": "Message with parts for API compatibility"
}ModelCapabilities
{
"properties": {
"streaming": {
"type": "boolean",
"title": "Streaming",
"description": "Supports streaming",
"default": true
},
"tools": {
"type": "boolean",
"title": "Tools",
"description": "Supports tool calling",
"default": true
},
"vision": {
"type": "boolean",
"title": "Vision",
"description": "Supports vision/images",
"default": false
},
"json_mode": {
"type": "boolean",
"title": "Json Mode",
"description": "Supports JSON mode",
"default": false
}
},
"type": "object",
"title": "ModelCapabilities",
"description": "Model capabilities"
}ModelDetail
{
"properties": {
"id": {
"type": "string",
"title": "Id",
"description": "Model ID"
},
"name": {
"type": "string",
"title": "Name",
"description": "Human-readable name"
},
"provider": {
"type": "string",
"title": "Provider",
"description": "Provider ID"
},
"max_tokens": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Max Tokens",
"description": "Maximum tokens"
},
"context_window": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Context Window",
"description": "Context window size"
},
"capabilities": {
"$ref": "#/components/schemas/ModelCapabilities"
},
"pricing": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Pricing",
"description": "Pricing info"
},
"metadata": {
"additionalProperties": true,
"type": "object",
"title": "Metadata",
"description": "Additional metadata"
}
},
"type": "object",
"required": [
"id",
"name",
"provider"
],
"title": "ModelDetail",
"description": "Detailed model information"
}ModelInfo
{
"properties": {
"providerID": {
"type": "string",
"title": "Providerid",
"description": "Provider ID"
},
"modelID": {
"type": "string",
"title": "Modelid",
"description": "Model ID"
}
},
"type": "object",
"required": [
"providerID",
"modelID"
],
"title": "ModelInfo",
"description": "Model selection info for API compatibility"
}ModelListResponse
{
"properties": {
"models": {
"items": {
"$ref": "#/components/schemas/ModelDetail"
},
"type": "array",
"title": "Models"
},
"total": {
"type": "integer",
"title": "Total"
},
"providers": {
"items": {
"type": "string"
},
"type": "array",
"title": "Providers"
}
},
"type": "object",
"required": [
"models",
"total",
"providers"
],
"title": "ModelListResponse",
"description": "Response for model list"
}PermissionInfo
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"sessionID": {
"type": "string",
"title": "Sessionid"
},
"messageID": {
"type": "string",
"title": "Messageid"
},
"toolID": {
"type": "string",
"title": "Toolid"
},
"permission": {
"type": "string",
"title": "Permission"
},
"patterns": {
"items": {
"type": "string"
},
"type": "array",
"title": "Patterns"
},
"always": {
"items": {
"type": "string"
},
"type": "array",
"title": "Always"
},
"metadata": {
"additionalProperties": true,
"type": "object",
"title": "Metadata"
},
"time": {
"additionalProperties": {
"type": "integer"
},
"type": "object",
"title": "Time"
}
},
"type": "object",
"required": [
"id",
"sessionID",
"messageID",
"toolID",
"permission",
"patterns",
"always",
"metadata",
"time"
],
"title": "PermissionInfo",
"description": "Permission info for API response"
}PermissionReplyRequest
{
"properties": {
"allow": {
"type": "boolean",
"title": "Allow"
},
"always": {
"type": "boolean",
"title": "Always",
"default": false
},
"response": {
"anyOf": [
{
"type": "string",
"enum": [
"trust_tool_network",
"trust_network_target"
]
},
{
"type": "null"
}
],
"title": "Response"
}
},
"type": "object",
"required": [
"allow"
],
"title": "PermissionReplyRequest",
"description": "Request to reply to a permission"
}PermissionRule
{
"properties": {
"permission": {
"type": "string",
"title": "Permission",
"description": "Permission name (tool name)"
},
"action": {
"type": "string",
"enum": [
"allow",
"deny"
],
"title": "Action",
"description": "Action: allow or deny",
"default": "allow"
},
"pattern": {
"type": "string",
"title": "Pattern",
"description": "Pattern to match",
"default": "*"
}
},
"type": "object",
"required": [
"permission"
],
"title": "PermissionRule",
"description": "Permission rule for API compatibility"
}PromptQueueUpdateRequest
{
"properties": {
"text": {
"type": "string",
"title": "Text",
"description": "Updated queued prompt text"
}
},
"type": "object",
"required": [
"text"
],
"title": "PromptQueueUpdateRequest"
}PromptRequest
{
"properties": {
"parts": {
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array",
"title": "Parts",
"description": "Message parts"
},
"model": {
"anyOf": [
{
"$ref": "#/components/schemas/ModelInfo"
},
{
"type": "null"
}
],
"description": "Model selection"
},
"messageID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Messageid",
"description": "Message ID"
},
"agent": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Agent",
"description": "Agent name"
},
"displayText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Displaytext",
"description": "User-visible message text"
},
"noReply": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Noreply",
"description": "Skip AI response"
},
"mockReply": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Mockreply",
"description": "Inject a mock assistant message after noReply user message"
},
"tools": {
"anyOf": [
{
"additionalProperties": {
"type": "boolean"
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Tools",
"description": "Tool settings (deprecated)"
},
"system": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "System",
"description": "System prompt override"
},
"variant": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Variant",
"description": "Model variant"
},
"executionMode": {
"$ref": "#/components/schemas/SessionExecutionMode",
"description": "Execution mode for this user turn",
"default": "build"
},
"turnID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Turnid",
"description": "Client-chosen id of this turn; GET /session/{id}/turn/{turnID} says how it stands"
}
},
"type": "object",
"title": "PromptRequest",
"description": "Request to send a prompt/message\n\nSchema follows standard SessionPrompt.PromptInput format"
}QuestionRequestReply
{
"properties": {
"answers": {
"items": {
"items": {
"type": "string"
},
"type": "array"
},
"type": "array",
"title": "Answers"
}
},
"type": "object",
"required": [
"answers"
],
"title": "QuestionRequestReply",
"description": "Batch reply: one answer-list per question."
}RevertRequest
{
"properties": {
"messageID": {
"type": "string",
"title": "Messageid",
"description": "Message ID to revert to"
},
"partID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Partid",
"description": "Part ID for partial revert"
}
},
"type": "object",
"required": [
"messageID"
],
"title": "RevertRequest",
"description": "Request to revert session"
}SessionCreateRequest
{
"properties": {
"parent_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Parent Id",
"description": "Parent session ID"
},
"project_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Project Id",
"description": "Project ID"
},
"title": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
],
"title": "Title",
"description": "Session title"
},
"permission": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/PermissionRule"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Permission",
"description": "Permission rules"
},
"category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Category",
"description": "Session category (e.g. 'user', 'workflow')"
},
"entry": {
"anyOf": [
{
"type": "string",
"enum": [
"webui",
"api"
]
},
{
"type": "null"
}
],
"title": "Entry",
"description": "How the session is driven. 'api': a program creates and runs it, with nobody in the WebUI to answer a prompt. Omitted: 'webui'."
},
"model_auto": {
"type": "boolean",
"title": "Model Auto",
"description": "Enable WebUI runtime model failover for this session",
"default": false
}
},
"type": "object",
"title": "SessionCreateRequest",
"description": "Request to create a new session\n\nSchema follows standard Session.create format (matches Flocks):\n- parentID: optional parent session ID\n- title: optional session title\n- permission: optional permission ruleset\n\nNote: Model is not stored at session level (matches Flocks).\nModel is selected per-message based on priority:\nrequest.model > agent.model > lastModel > defaultModel"
}SessionDetailResponse
{
"properties": {
"id": {
"type": "string",
"title": "Id",
"description": "Session ID"
},
"slug": {
"type": "string",
"title": "Slug",
"description": "Session slug",
"default": ""
},
"projectID": {
"type": "string",
"title": "Projectid",
"description": "Project ID"
},
"effectiveProjectID": {
"type": "string",
"title": "Effectiveprojectid",
"description": "Project used for session manager grouping"
},
"directory": {
"type": "string",
"title": "Directory",
"description": "Working directory"
},
"parentID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Parentid",
"description": "Parent session ID"
},
"summary": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Summary",
"description": "Session summary with diffs"
},
"title": {
"type": "string",
"title": "Title",
"description": "Session title"
},
"version": {
"type": "string",
"title": "Version",
"description": "Session version",
"default": "1.0.0"
},
"time": {
"$ref": "#/components/schemas/SessionTime",
"description": "Session timestamps"
},
"permission": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Permission",
"description": "Permission rules"
},
"revert": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Revert",
"description": "Revert state"
},
"category": {
"type": "string",
"title": "Category",
"description": "Session category: user or task",
"default": "user"
},
"status": {
"type": "string",
"title": "Status",
"description": "Session status: active or archived",
"default": "active"
},
"provider": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Provider",
"description": "Pinned provider ID"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Model",
"description": "Pinned model ID"
},
"model_pinned": {
"type": "boolean",
"title": "Model Pinned",
"description": "Whether provider/model are pinned for this session",
"default": false
},
"model_auto": {
"type": "boolean",
"title": "Model Auto",
"description": "Whether WebUI Auto mode is selected",
"default": false
},
"ownerUserID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owneruserid",
"description": "Session owner user id"
},
"ownerUsername": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Ownerusername",
"description": "Session owner username"
},
"canWrite": {
"type": "boolean",
"title": "Canwrite",
"description": "Whether current user can continue this session",
"default": false
},
"canDelete": {
"type": "boolean",
"title": "Candelete",
"description": "Whether current user can delete this session",
"default": false
},
"isShared": {
"type": "boolean",
"title": "Isshared",
"description": "Whether this session is locally shared",
"default": false
},
"goal": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionGoalResponse"
},
{
"type": "null"
}
],
"description": "Persisted session goal state"
},
"webUrl": {
"type": "string",
"title": "Weburl",
"description": "Relative WebUI path; browser access requires session read permission"
}
},
"type": "object",
"required": [
"id",
"projectID",
"effectiveProjectID",
"directory",
"title",
"time",
"webUrl"
],
"title": "SessionDetailResponse"
}SessionExecutionMode
{
"type": "string",
"enum": [
"build",
"plan",
"goal"
],
"title": "SessionExecutionMode",
"description": "Execution mode selected for a user turn."
}SessionGoalResponse
{
"properties": {
"status": {
"type": "string",
"enum": [
"active",
"paused",
"completed",
"blocked"
],
"title": "Status",
"description": "Goal status"
},
"objective": {
"type": "string",
"title": "Objective",
"description": "Goal objective"
},
"reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Reason",
"description": "Last goal judge reason"
}
},
"type": "object",
"required": [
"status",
"objective"
],
"title": "SessionGoalResponse",
"description": "Persisted goal state shown by the WebUI composer banner."
}SessionListItem
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"projectID": {
"type": "string",
"title": "Projectid"
},
"projectName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Projectname"
},
"effectiveProjectID": {
"type": "string",
"title": "Effectiveprojectid"
},
"directory": {
"type": "string",
"title": "Directory"
},
"title": {
"type": "string",
"title": "Title"
},
"time": {
"$ref": "#/components/schemas/SessionTime"
},
"category": {
"type": "string",
"title": "Category",
"default": "user"
},
"channelID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Channelid"
},
"channelChatType": {
"anyOf": [
{
"$ref": "#/components/schemas/ChatType"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"title": "Status",
"default": "active"
},
"parentID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Parentid"
},
"provider": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Provider"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Model"
},
"model_pinned": {
"type": "boolean",
"title": "Model Pinned",
"default": false
},
"model_auto": {
"type": "boolean",
"title": "Model Auto",
"default": false
},
"ownerUserID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owneruserid"
},
"ownerUsername": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Ownerusername"
},
"canWrite": {
"type": "boolean",
"title": "Canwrite",
"default": false
},
"canDelete": {
"type": "boolean",
"title": "Candelete",
"default": false
},
"isShared": {
"type": "boolean",
"title": "Isshared",
"default": false
}
},
"type": "object",
"required": [
"id",
"projectID",
"effectiveProjectID",
"directory",
"title",
"time"
],
"title": "SessionListItem",
"description": "Lightweight session row for the session manager sidebar."
}SessionResponse
{
"properties": {
"id": {
"type": "string",
"title": "Id",
"description": "Session ID"
},
"slug": {
"type": "string",
"title": "Slug",
"description": "Session slug",
"default": ""
},
"projectID": {
"type": "string",
"title": "Projectid",
"description": "Project ID"
},
"effectiveProjectID": {
"type": "string",
"title": "Effectiveprojectid",
"description": "Project used for session manager grouping"
},
"directory": {
"type": "string",
"title": "Directory",
"description": "Working directory"
},
"parentID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Parentid",
"description": "Parent session ID"
},
"summary": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Summary",
"description": "Session summary with diffs"
},
"title": {
"type": "string",
"title": "Title",
"description": "Session title"
},
"version": {
"type": "string",
"title": "Version",
"description": "Session version",
"default": "1.0.0"
},
"time": {
"$ref": "#/components/schemas/SessionTime",
"description": "Session timestamps"
},
"permission": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Permission",
"description": "Permission rules"
},
"revert": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Revert",
"description": "Revert state"
},
"category": {
"type": "string",
"title": "Category",
"description": "Session category: user or task",
"default": "user"
},
"status": {
"type": "string",
"title": "Status",
"description": "Session status: active or archived",
"default": "active"
},
"provider": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Provider",
"description": "Pinned provider ID"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Model",
"description": "Pinned model ID"
},
"model_pinned": {
"type": "boolean",
"title": "Model Pinned",
"description": "Whether provider/model are pinned for this session",
"default": false
},
"model_auto": {
"type": "boolean",
"title": "Model Auto",
"description": "Whether WebUI Auto mode is selected",
"default": false
},
"ownerUserID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owneruserid",
"description": "Session owner user id"
},
"ownerUsername": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Ownerusername",
"description": "Session owner username"
},
"canWrite": {
"type": "boolean",
"title": "Canwrite",
"description": "Whether current user can continue this session",
"default": false
},
"canDelete": {
"type": "boolean",
"title": "Candelete",
"description": "Whether current user can delete this session",
"default": false
},
"isShared": {
"type": "boolean",
"title": "Isshared",
"description": "Whether this session is locally shared",
"default": false
},
"goal": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionGoalResponse"
},
{
"type": "null"
}
],
"description": "Persisted session goal state"
}
},
"type": "object",
"required": [
"id",
"projectID",
"effectiveProjectID",
"directory",
"title",
"time"
],
"title": "SessionResponse",
"description": "Session response - Flocks compatible\n\nMatches Flocks Session.Info format."
}SessionRuntimeStatusResponse
{
"properties": {
"sessionID": {
"type": "string",
"title": "Sessionid",
"description": "Session ID"
},
"webUrl": {
"type": "string",
"title": "Weburl",
"description": "Relative WebUI path; archived sessions may not be viewable"
},
"lifecycleStatus": {
"type": "string",
"enum": [
"active",
"archived"
],
"title": "Lifecyclestatus",
"description": "Persisted session lifecycle status"
},
"status": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionStatusIdle"
},
{
"$ref": "#/components/schemas/SessionStatusQueued"
},
{
"$ref": "#/components/schemas/SessionStatusBusy"
},
{
"$ref": "#/components/schemas/SessionStatusRetry"
},
{
"$ref": "#/components/schemas/SessionStatusCompacting"
},
{
"$ref": "#/components/schemas/SessionStatusDreaming"
}
],
"title": "Status",
"description": "Current runtime status"
},
"isProcessing": {
"type": "boolean",
"title": "Isprocessing",
"description": "Whether accepted session work is still in progress"
},
"pendingPromptCount": {
"type": "integer",
"minimum": 0.0,
"title": "Pendingpromptcount",
"description": "Number of prompts waiting in the session queue",
"default": 0
},
"observedAt": {
"type": "integer",
"title": "Observedat",
"description": "Server observation timestamp in milliseconds"
}
},
"type": "object",
"required": [
"sessionID",
"webUrl",
"lifecycleStatus",
"status",
"isProcessing",
"observedAt"
],
"title": "SessionRuntimeStatusResponse",
"description": "Runtime status snapshot for one session."
}SessionStatusBusy
{
"properties": {
"type": {
"type": "string",
"const": "busy",
"title": "Type",
"default": "busy"
}
},
"type": "object",
"title": "SessionStatusBusy",
"description": "Busy status"
}SessionStatusCompacting
{
"properties": {
"type": {
"type": "string",
"const": "compacting",
"title": "Type",
"default": "compacting"
},
"message": {
"type": "string",
"title": "Message",
"description": "Display message",
"default": "Compacting context…"
}
},
"type": "object",
"title": "SessionStatusCompacting",
"description": "Compacting status - context compression in progress"
}SessionStatusDreaming
{
"properties": {
"type": {
"type": "string",
"const": "dreaming",
"title": "Type",
"default": "dreaming"
},
"message": {
"type": "string",
"title": "Message",
"description": "Display message"
}
},
"type": "object",
"required": [
"message"
],
"title": "SessionStatusDreaming",
"description": "Dreaming status - manual self-improvement is in progress."
}SessionStatusIdle
{
"properties": {
"type": {
"type": "string",
"const": "idle",
"title": "Type",
"default": "idle"
}
},
"type": "object",
"title": "SessionStatusIdle",
"description": "Idle status"
}SessionStatusQueued
{
"properties": {
"type": {
"type": "string",
"const": "queued",
"title": "Type",
"default": "queued"
}
},
"type": "object",
"title": "SessionStatusQueued",
"description": "Queued status - accepted work is waiting to enter the session loop."
}SessionStatusRetry
{
"properties": {
"type": {
"type": "string",
"const": "retry",
"title": "Type",
"default": "retry"
},
"attempt": {
"type": "integer",
"title": "Attempt",
"description": "Retry attempt number"
},
"message": {
"type": "string",
"title": "Message",
"description": "Error message"
},
"next": {
"type": "integer",
"title": "Next",
"description": "Next retry timestamp (ms)"
},
"maxAttempts": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Maxattempts",
"description": "Retry budget for this kind of failure"
},
"rateLimited": {
"type": "boolean",
"title": "Ratelimited",
"description": "True when the provider rejected the request as rate-limited (429)",
"default": false
},
"providerID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Providerid",
"description": "Provider being retried"
},
"modelID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Modelid",
"description": "Model being retried"
}
},
"type": "object",
"required": [
"attempt",
"message",
"next"
],
"title": "SessionStatusRetry",
"description": "Retry status.\n\nThe same object feeds both channels clients use: the ``session.status``\nSSE event and the ``/api/session/status`` poll they fall back to after a\nrefresh or a dropped stream. Keep every field a client needs here so the\ntwo never disagree."
}SessionTime
{
"properties": {
"created": {
"type": "integer",
"title": "Created",
"description": "Creation timestamp (ms)"
},
"updated": {
"type": "integer",
"title": "Updated",
"description": "Last update timestamp (ms)"
},
"compacting": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Compacting",
"description": "Compaction timestamp (ms)"
},
"archived": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Archived",
"description": "Archive timestamp (ms)"
}
},
"type": "object",
"required": [
"created",
"updated"
],
"title": "SessionTime",
"description": "Session time information for API compatibility"
}SessionUpdateRequest
{
"properties": {
"title": {
"anyOf": [
{
"type": "string",
"maxLength": 200,
"minLength": 1
},
{
"type": "null"
}
],
"title": "Title",
"description": "New title"
},
"time": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Time",
"description": "Time updates (archived)"
},
"provider": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Provider",
"description": "Pinned provider ID"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Model",
"description": "Pinned model ID"
},
"model_pinned": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Model Pinned",
"description": "Whether provider/model are pinned for this session"
},
"model_auto": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Model Auto",
"description": "Whether WebUI Auto mode is selected"
}
},
"type": "object",
"title": "SessionUpdateRequest",
"description": "Request to update session"
}ShellRequest
{
"properties": {
"agent": {
"type": "string",
"title": "Agent",
"description": "Agent name"
},
"command": {
"type": "string",
"title": "Command",
"description": "Shell command to execute"
},
"model": {
"anyOf": [
{
"$ref": "#/components/schemas/ModelInfo"
},
{
"type": "null"
}
],
"description": "Model selection"
}
},
"type": "object",
"required": [
"agent",
"command"
],
"title": "ShellRequest",
"description": "Request to run shell command"
}SummarizeRequest
{
"properties": {
"providerID": {
"type": "string",
"title": "Providerid",
"description": "Provider ID"
},
"modelID": {
"type": "string",
"title": "Modelid",
"description": "Model ID"
},
"auto": {
"type": "boolean",
"title": "Auto",
"description": "Auto compaction mode",
"default": false
}
},
"type": "object",
"required": [
"providerID",
"modelID"
],
"title": "SummarizeRequest",
"description": "Request to summarize session"
}TodoInfo
{
"properties": {
"id": {
"type": "string",
"title": "Id",
"description": "Todo ID"
},
"content": {
"type": "string",
"title": "Content",
"description": "Task description"
},
"activeForm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Activeform",
"description": "Active/progressive task description"
},
"status": {
"type": "string",
"enum": [
"pending",
"in_progress",
"completed",
"cancelled"
],
"title": "Status",
"description": "Status: pending, in_progress, completed, cancelled"
},
"priority": {
"type": "string",
"title": "Priority",
"description": "Priority: high, medium, low",
"default": "medium"
}
},
"type": "object",
"required": [
"id",
"content",
"status"
],
"title": "TodoInfo",
"description": "Todo item info for API compatibility"
}UserMessageInfo
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"sessionID": {
"type": "string",
"title": "Sessionid"
},
"role": {
"type": "string",
"const": "user",
"title": "Role",
"default": "user"
},
"time": {
"additionalProperties": true,
"type": "object",
"title": "Time"
},
"agent": {
"type": "string",
"title": "Agent",
"default": "rex"
},
"model": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"title": "Model"
},
"summary": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Summary"
},
"system": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "System"
},
"tools": {
"anyOf": [
{
"additionalProperties": {
"type": "boolean"
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Tools"
},
"variant": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Variant"
},
"compacted": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Compacted"
},
"executionMode": {
"$ref": "#/components/schemas/SessionExecutionMode",
"default": "build"
}
},
"type": "object",
"required": [
"id",
"sessionID",
"time",
"model"
],
"title": "UserMessageInfo",
"description": "User message info - Flocks TUI compatible format.\n\nFlocks expects:\n{\n \"id\": string,\n \"sessionID\": string,\n \"role\": \"user\",\n \"time\": { \"created\": number },\n \"agent\": string,\n \"model\": { \"providerID\": string, \"modelID\": string },\n // optional fields...\n}"
}ValidationError
{
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
},
"input": {
"title": "Input"
},
"ctx": {
"type": "object",
"title": "Context"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}9 计数边界
按 HTTP 方法 + 规范路径计数;同一路径 GET 和 POST 分别算接口。仅保留 /api 规范前缀,兼容的 /session、/agent 等不重复纳入。共享接口 56 个,加工作流接口 3 个,合计 59 个。
排除页面分组列表、统计看板、最近会话快捷列表、模型调用轨迹调试、文件预览、页面分享和项目移动;也排除 Agent/模型配置写入、永久权限规则管理、设备/工具/插件管理、WebUI 页面 API 管理和工作流发布管理。文件内容/下载与上下文目录管理保留,用于外部任务的输入输出。运行时提问与权限回复保留,用于执行闭环。
| 排除的会话接口 | 原因 |
|---|---|
| POST /api/session/list-grouped | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
| GET /api/session/metrics | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
| GET /api/session/recent | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
GET /api/session/{sessionID}/metrics | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
GET /api/session/{sessionID}/statistics | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
GET /api/session/{sessionID}/trajectory/{messageID}/requests/{partID} | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
GET /api/session/{sessionID}/trajectory | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
GET /api/session/{sessionID}/context-usage | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
GET /api/session/{sessionID}/context/files/{resourceID}/preview | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
GET /api/session/{sessionID}/context/roots/{rootID}/preview | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
PATCH /api/session/{sessionID}/project | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
POST /api/session/{sessionID}/share-local | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
POST /api/session/{sessionID}/unshare-local | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |
POST /api/session/{sessionID}/permissions/{permissionID} | 页面组织/展示/统计/调试,或采用规范权限接口而不纳入旧会话回复入口 |