{"openapi": "3.1.0", "info": {"title": "启知方模拟动作接口", "version": "1.0.0", "description": "项目专用演示接口。仅处理虚构线索，不产生外部业务副作用。"}, "servers": [{"url": "https://qizhifang.cn"}], "paths": {"/api/demo/session": {"post": {"summary": "创建临时演示会话", "operationId": "demo_session", "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Empty"}}}}, "responses": {"201": {"description": "模拟操作成功", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Session"}}}}, "400": {"description": "正文须为有效 UTF-8 JSON 对象。键名不能重复，长度必须与声明一致。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "模拟会话缺失或已到期。新会话不能读取原会话数据。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "浏览器来源不匹配，或尚未同意处理模拟请求。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "端点或当前会话的请求记录不存在。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "405": {"description": "本接口只接受 POST。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "已用幂等键与本次业务参数冲突。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "411": {"description": "请提供 Content-Length。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "JSON 请求体超过 8192 字节。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "请使用 application/json，无压缩正文。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "字段、类型、来源标签、链接或行业与服务映射不符合约定。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "达到速率或内存容量边界。查看 Retry-After。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "本次模拟交付失败。可用相同会话、相同业务参数和幂等键手动重试。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/api/demo/actions": {"post": {"summary": "提交模拟咨询或预约", "operationId": "demo_actions", "security": [{"DemoSession": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Action"}, "example": {"scenario": "seal", "service_id": "svc-seal", "action": "inquiry", "question_id": "q1", "consent": true, "attribution": {"ai_source": "demo-agent", "landing_page": "/guides/seal", "utm_campaign": "demo-growth"}, "input_sources": {"ai_source": "demo", "landing_page": "form", "utm_campaign": "query"}}}}}, "responses": {"201": {"description": "模拟操作成功", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Receipt"}}}}, "200": {"description": "模拟操作成功", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Receipt"}}}}, "400": {"description": "正文须为有效 UTF-8 JSON 对象。键名不能重复，长度必须与声明一致。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "模拟会话缺失或已到期。新会话不能读取原会话数据。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "浏览器来源不匹配，或尚未同意处理模拟请求。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "端点或当前会话的请求记录不存在。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "405": {"description": "本接口只接受 POST。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "已用幂等键与本次业务参数冲突。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "411": {"description": "请提供 Content-Length。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "JSON 请求体超过 8192 字节。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "请使用 application/json，无压缩正文。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "字段、类型、来源标签、链接或行业与服务映射不符合约定。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "达到速率或内存容量边界。查看 Retry-After。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "本次模拟交付失败。可用相同会话、相同业务参数和幂等键手动重试。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "pattern": "^[A-Za-z0-9_-]{8,80}$"}}, {"name": "X-Demo-Agent", "in": "header", "required": false, "schema": {"type": "string", "pattern": "^demo-[A-Za-z0-9][A-Za-z0-9_-]{0,58}$"}, "description": "仅在正文未提供 agent_id 时使用，属于未验证自报线索。"}]}}, "/api/demo/state": {"post": {"summary": "读取本会话所选行业的回执", "operationId": "demo_state", "security": [{"DemoSession": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Scene"}}}}, "responses": {"200": {"description": "模拟操作成功", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/State"}}}}, "400": {"description": "正文须为有效 UTF-8 JSON 对象。键名不能重复，长度必须与声明一致。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "模拟会话缺失或已到期。新会话不能读取原会话数据。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "浏览器来源不匹配，或尚未同意处理模拟请求。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "端点或当前会话的请求记录不存在。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "405": {"description": "本接口只接受 POST。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "已用幂等键与本次业务参数冲突。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "411": {"description": "请提供 Content-Length。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "JSON 请求体超过 8192 字节。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "请使用 application/json，无压缩正文。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "字段、类型、来源标签、链接或行业与服务映射不符合约定。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "达到速率或内存容量边界。查看 Retry-After。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "本次模拟交付失败。可用相同会话、相同业务参数和幂等键手动重试。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/api/demo/feedback": {"post": {"summary": "为已有线索生成优化待办", "operationId": "demo_feedback", "security": [{"DemoSession": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FeedbackInput"}}}}, "responses": {"201": {"description": "模拟操作成功", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Feedback"}}}}, "200": {"description": "模拟操作成功", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Feedback"}}}}, "400": {"description": "正文须为有效 UTF-8 JSON 对象。键名不能重复，长度必须与声明一致。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "模拟会话缺失或已到期。新会话不能读取原会话数据。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "浏览器来源不匹配，或尚未同意处理模拟请求。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "端点或当前会话的请求记录不存在。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "405": {"description": "本接口只接受 POST。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "已用幂等键与本次业务参数冲突。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "411": {"description": "请提供 Content-Length。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "JSON 请求体超过 8192 字节。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "请使用 application/json，无压缩正文。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "字段、类型、来源标签、链接或行业与服务映射不符合约定。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "达到速率或内存容量边界。查看 Retry-After。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "本次模拟交付失败。可用相同会话、相同业务参数和幂等键手动重试。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/api/demo/reset": {"post": {"summary": "清除当前会话指定行业的闭环", "operationId": "demo_reset", "security": [{"DemoSession": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Scene"}}}}, "responses": {"200": {"description": "模拟操作成功", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Cleared"}}}}, "400": {"description": "正文须为有效 UTF-8 JSON 对象。键名不能重复，长度必须与声明一致。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "模拟会话缺失或已到期。新会话不能读取原会话数据。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "浏览器来源不匹配，或尚未同意处理模拟请求。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "端点或当前会话的请求记录不存在。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "405": {"description": "本接口只接受 POST。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "已用幂等键与本次业务参数冲突。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "411": {"description": "请提供 Content-Length。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "JSON 请求体超过 8192 字节。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "请使用 application/json，无压缩正文。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "字段、类型、来源标签、链接或行业与服务映射不符合约定。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "达到速率或内存容量边界。查看 Retry-After。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "本次模拟交付失败。可用相同会话、相同业务参数和幂等键手动重试。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}}, "components": {"schemas": {"Empty": {"type": "object", "properties": {}, "required": [], "additionalProperties": false}, "Scene": {"type": "object", "properties": {"scenario": {"type": "string", "enum": ["seal", "trade", "service"]}}, "required": ["scenario"], "additionalProperties": false}, "FeedbackInput": {"type": "object", "properties": {"request_id": {"type": "string", "pattern": "^req-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"}}, "required": ["request_id"], "additionalProperties": false}, "Action": {"type": "object", "properties": {"scenario": {"type": "string", "enum": ["seal", "trade", "service"]}, "service_id": {"type": "string", "enum": ["svc-seal", "svc-trade", "svc-service"]}, "action": {"type": "string", "enum": ["inquiry", "appointment"]}, "question_id": {"type": "string", "enum": ["q1", "q2", "q3"]}, "consent": {"type": "boolean", "enum": [true]}, "case_id": {"type": "string", "pattern": "^case-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"}, "simulate_failure": {"type": "boolean", "default": false}, "attribution": {"type": "object", "properties": {"ai_source": {"anyOf": [{"type": "string", "enum": ["demo-agent", "demo-form", "demo-search"]}, {"enum": [null, "", "unknown"]}]}, "ai_platform": {"anyOf": [{"type": "string", "enum": ["demo-lab", "demo-assistant"]}, {"enum": [null, "", "unknown"]}]}, "agent_id": {"anyOf": [{"type": "string", "pattern": "^demo-[A-Za-z0-9][A-Za-z0-9_-]{0,58}$"}, {"enum": [null, "", "unknown"]}]}, "conversation_id": {"anyOf": [{"type": "string", "pattern": "^demo-[A-Za-z0-9][A-Za-z0-9_-]{0,58}$"}, {"enum": [null, "", "unknown"]}]}, "citation_url": {"anyOf": [{"type": "string", "maxLength": 512, "description": "本站允许的公开路径，可含同源前缀。服务端剥离查询和片段，绝不访问所填链接。"}, {"enum": [null, "", "unknown"]}]}, "landing_page": {"anyOf": [{"type": "string", "maxLength": 512, "description": "本站允许的公开路径，可含同源前缀。服务端剥离查询和片段，绝不访问所填链接。"}, {"enum": [null, "", "unknown"]}]}, "referrer": {"anyOf": [{"type": "string", "maxLength": 512, "description": "本站允许的公开路径，可含同源前缀。服务端剥离查询和片段，绝不访问所填链接。"}, {"enum": [null, "", "unknown"]}]}, "utm_source": {"anyOf": [{"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,47}$"}, {"enum": [null, "", "unknown"]}]}, "utm_medium": {"anyOf": [{"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,47}$"}, {"enum": [null, "", "unknown"]}]}, "utm_campaign": {"anyOf": [{"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,47}$"}, {"enum": [null, "", "unknown"]}]}, "utm_term": {"anyOf": [{"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,47}$"}, {"enum": [null, "", "unknown"]}]}, "utm_content": {"anyOf": [{"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,47}$"}, {"enum": [null, "", "unknown"]}]}}, "required": [], "additionalProperties": false}, "input_sources": {"type": "object", "properties": {"ai_source": {"type": "string", "enum": ["form", "query", "demo"]}, "ai_platform": {"type": "string", "enum": ["form", "query", "demo"]}, "agent_id": {"type": "string", "enum": ["form", "query", "demo"]}, "conversation_id": {"type": "string", "enum": ["form", "query", "demo"]}, "citation_url": {"type": "string", "enum": ["form", "query", "demo"]}, "landing_page": {"type": "string", "enum": ["form", "query", "demo"]}, "referrer": {"type": "string", "enum": ["form", "query", "demo"]}, "utm_source": {"type": "string", "enum": ["form", "query", "demo"]}, "utm_medium": {"type": "string", "enum": ["form", "query", "demo"]}, "utm_campaign": {"type": "string", "enum": ["form", "query", "demo"]}, "utm_term": {"type": "string", "enum": ["form", "query", "demo"]}, "utm_content": {"type": "string", "enum": ["form", "query", "demo"]}}, "required": [], "additionalProperties": false}}, "required": ["scenario", "service_id", "action", "question_id", "consent"], "additionalProperties": false}, "Evidence": {"type": "object", "properties": {"value": {"type": ["string", "null"]}, "source": {"type": "string", "enum": ["form", "query", "demo", "header", "unknown"]}, "verified": {"const": false}}, "required": ["value", "source", "verified"]}, "Lead": {"type": "object", "properties": {"id": {"type": "string"}, "case_id": {"type": "string"}, "request_id": {"type": "string"}, "scenario": {"type": "string"}, "service_id": {"type": "string"}, "action": {"type": "string"}, "topic": {"type": "string"}, "service_name": {"type": "string"}, "company": {"type": "string"}, "question": {"type": "string"}, "question_id": {"type": "string"}, "question_type": {"type": "string"}, "content_path": {"type": "string"}, "owner": {"type": "string"}, "simulated": {"type": "boolean", "enum": [true]}, "consent": {"type": "boolean", "enum": [true]}, "stage": {"type": "integer", "minimum": 0, "maximum": 3}, "timestamp": {"type": "string", "format": "date-time"}, "attribution": {"type": "object", "properties": {"ai_source": {"$ref": "#/components/schemas/Evidence"}, "ai_platform": {"$ref": "#/components/schemas/Evidence"}, "agent_id": {"$ref": "#/components/schemas/Evidence"}, "conversation_id": {"$ref": "#/components/schemas/Evidence"}, "citation_url": {"$ref": "#/components/schemas/Evidence"}, "landing_page": {"$ref": "#/components/schemas/Evidence"}, "referrer": {"$ref": "#/components/schemas/Evidence"}, "utm_source": {"$ref": "#/components/schemas/Evidence"}, "utm_medium": {"$ref": "#/components/schemas/Evidence"}, "utm_campaign": {"$ref": "#/components/schemas/Evidence"}, "utm_term": {"$ref": "#/components/schemas/Evidence"}, "utm_content": {"$ref": "#/components/schemas/Evidence"}}, "required": ["ai_source", "ai_platform", "agent_id", "conversation_id", "citation_url", "landing_page", "referrer", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"]}}, "required": ["id", "case_id", "request_id", "scenario", "service_id", "action", "topic", "service_name", "company", "question", "question_id", "question_type", "content_path", "owner", "simulated", "consent", "stage", "timestamp", "attribution"]}, "Task": {"type": "object", "properties": {"id": {"type": "string"}, "title": {"type": "string"}, "case_id": {"type": "string"}, "request_id": {"type": "string"}, "lead_id": {"type": "string"}, "scenario": {"type": "string"}, "service_id": {"type": "string"}, "question_id": {"type": "string"}, "question_type": {"type": "string"}, "content_path": {"type": "string"}}, "required": ["id", "title", "case_id", "request_id", "lead_id", "scenario", "service_id", "question_id", "question_type", "content_path"]}, "Receipt": {"type": "object", "properties": {"request_id": {"type": "string"}, "simulated": {"type": "boolean", "enum": [true]}, "replayed": {"type": "boolean"}, "lead": {"$ref": "#/components/schemas/Lead"}, "feedback_task": {"anyOf": [{"$ref": "#/components/schemas/Task"}, {"type": "null"}]}}, "required": ["request_id", "simulated", "replayed", "lead", "feedback_task"]}, "Session": {"type": "object", "properties": {"simulated": {"type": "boolean", "enum": [true]}, "session_id": {"type": "string"}, "expires_in": {"type": "integer"}}, "required": []}, "Feedback": {"type": "object", "properties": {"simulated": {"type": "boolean", "enum": [true]}, "task": {"$ref": "#/components/schemas/Task"}}, "required": []}, "State": {"type": "object", "properties": {"simulated": {"type": "boolean", "enum": [true]}, "scenario": {"type": "string", "enum": ["seal", "trade", "service"]}, "expires_in": {"type": "integer"}, "receipts": {"type": "array", "items": {"$ref": "#/components/schemas/Receipt"}}}, "required": []}, "Cleared": {"type": "object", "properties": {"simulated": {"type": "boolean", "enum": [true]}, "scenario": {"type": "string", "enum": ["seal", "trade", "service"]}, "cleared": {"type": "boolean", "enum": [true]}}, "required": []}, "Error": {"type": "object", "properties": {"simulated": {"type": "boolean", "enum": [true]}, "error": {"type": "object", "properties": {"code": {"type": "string"}, "message": {"type": "string"}}, "required": []}, "request_id": {"type": "string"}, "retry_after": {"type": "integer"}}, "required": []}}, "securitySchemes": {"DemoSession": {"type": "apiKey", "in": "header", "name": "X-Demo-Session", "description": "短时演示会话能力。请勿放入 URL、日志或第三方应用；不提供身份认证。"}}}}