API 参考 / blueprints

确认当前问卷版本并进入生成预检

POST /api/v1/orgs/{orgId}/blueprint-drafts/{draftId}/survey/confirm · confirmSurveyVersion

对当前生效的问卷版本执行服务端完整性校验,并把该版本从 draft 原子推进为 confirmed,同时把草案推进到 survey_ready。请求必须携带当前 surveyVersionId + draftVersion;保存或确认发生并发变化时返回 409,不确认旧输入。

确认成功与 confirm_survey_version 审计在同一控制面事务提交。已确认的同一当前版本 重复调用保持幂等。仅 active Org Admin 可调用;普通成员 404(零感知)。 PAT 不可调用本端点。

本接口要求浏览器会话。Bearer API Token 无法调用——Token 的生命周期管理必须在网页端完成。

参数

orgId(必填)
string
draftId(必填)
string

请求体

surveyVersionId(必填)
string —— 必须是草案当前 survey_version_id 指向的版本;旧版本或跨草案版本返回冲突。
draftVersion(必填)
integer —— 草案 CAS 版本;并发保存或确认后旧版本返回冲突。

响应字段 · 200

id(必填)
string
draftId(必填)
string
schemaVersion(必填)
integer
answers
SurveyAnswers —— 结构化问卷答案(每步一个对象)。
answers.schemaVersion
integer
answers.step1
SurveyStep1Answers —— 团队与资源(游戏引擎 / 人数 / 角色 / 经验 / 已有资产)。
answers.step1.engine
enum;取值:unity / unreal / godot / cocos / custom / undecided
answers.step1.headcount
integer
answers.step1.roles
string[]
answers.step1.experience
enum;取值:solo / hobby / indie / professional / aaa
answers.step1.existingAssets
string[]
answers.step2
SurveyStep2Answers —— 品类与题材(开放标签 + 核心循环)。
answers.step2.genres
string[]
answers.step2.themes
string[]
answers.step2.coreLoop
string
answers.step3
SurveyStep3Answers —— 目标市场与平台(发布平台 / 发行地区 / 目标年龄段)。
answers.step3.platforms
string[]
answers.step3.regions
string[]
answers.step3.targetAge
enum;取值:all / kids / teen / young_adult / adult
answers.step4
SurveyStep4Answers —— 竞品参照。matched 绑定公共游戏库;manual 只表示未匹配,不代表 Estimate。
answers.step4.competitors
SurveyCompetitorAnswer[]
answers.step5
SurveyStep5Answers —— 商业化(模式 / 价格档位 / 渠道)。
answers.step5.model
enum;取值:premium / f2p / ad / subscription / hybrid
answers.step5.priceTier
string
answers.step5.channels
string[]
answers.step6
SurveyStep6Answers —— 目标与约束(周期 / 预算 / 质量目标 / 硬约束 / 偏好 / 排斥 / 未确定 / 其他)。
answers.step6.timeline
enum;取值:1-3m / 3-6m / 6-12m / 12m+
answers.step6.budget
enum;取值:bootstrapped / small / mid / large
answers.step6.qualityBar
enum;取值:prototype / vertical_slice / early_access / full_release
answers.step6.constraints
SurveyConstraintAnswer[]
intent
ProjectIntent —— 把结构化答案确定性归一出的项目意图(相同 answers + schemaVersion 逐字节一致)。
intent.schemaVersion(必填)
integer
intent.team
IntentTeam
intent.team.engine
string
intent.team.headcount
integer
intent.team.roles
string[]
intent.team.experience
string
intent.team.existingAssets
string[]
intent.category
IntentCategory
intent.category.genres
string[]
intent.category.themes
string[]
intent.category.coreLoop
string
intent.market
IntentMarket
intent.market.platforms
string[]
intent.market.regions
string[]
intent.market.targetAge
string
intent.competitors
IntentCompetitor[]
intent.competitors[].marketGameId
string
intent.competitors[].entryKind(必填)
enum;取值:matched / manual
intent.competitors[].name(必填)
string
intent.competitors[].note
string
intent.monetization
IntentMonetization
intent.monetization.model
string
intent.monetization.priceTier
string
intent.monetization.channels
string[]
intent.goals
IntentGoals
intent.goals.timeline
string
intent.goals.budget
string
intent.goals.qualityBar
string
intent.goals.constraints
string[]
intent.goals.preferences
string[]
intent.goals.exclusions
string[]
intent.goals.openQuestions
string[]
intent.capability
CapabilityScore —— 团队能力分数(由人数 / 角色 / 经验 / 资产确定性推导,各分量 0-100)。
intent.capability.headcount
integer
intent.capability.roles
integer
intent.capability.experience
integer
intent.capability.assets
integer
intent.capability.total
integer
intent.hardConstraints
string[]
intent.risks
string[]
status(必填)
enum;取值:draft / confirmed
createdBy
string
createdAt(必填)
string
confirmedAt
string

错误

请求示例(curl)

curl -X POST "https://workflow.games/api/v1/orgs/{orgId}/blueprint-drafts/{draftId}/survey/confirm" \
  -H "Authorization: Bearer wfp_…" \
  -H "content-type: application/json" \
  --data '{"surveyVersionId":"018f3c2e-0000-7000-8000-000000000000","draftVersion":1}'

响应示例

HTTP/1.1 200
{
  "id": "018f3c2e-0000-7000-8000-000000000000",
  "draftId": "018f3c2e-0000-7000-8000-000000000000",
  "schemaVersion": 1,
  "status": "draft",
  "createdAt": "示例文本"
}

合同真值:OpenAPI 3.1(0.1.0)。

相关:Agent 接入指南 · 使用指南 · API 参考索引

Workflow 正在加载…