API 参考 / blueprints

保存问卷草稿(免费,带 CAS 版本)

PUT /api/v1/orgs/{orgId}/blueprint-drafts/{draftId}/survey · saveSurveyDraft

保存一份结构化问卷草稿(任意完整度,免费)。每次保存【创建一份新的 append-only 问卷版本】 并把草案指针指向它;带 CAS 版本号,并发冲突返回 409(提示「重新加载」而非静默覆盖)。

仅 active Org Admin 可保存;普通成员 404(零感知)。保存不校验完整性——校验留给 validate 端点(提交前)。PAT 不可调用本端点。

答案是结构化的(每步一个对象,字段是题 key -> 答案值),禁止只存自然语言摘要。 服务端在保存时确定性归一出 ProjectIntent 并随版本钉死(相同 answers + schemaVersion 产生逐字节一致 Intent)。之后继续编辑创建新版本,不改变已保存版本(生成任务钉定具体版本)。

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

参数

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

请求体

draftVersion(必填)
integer
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[]

响应字段 · 201

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 PUT "https://workflow.games/api/v1/orgs/{orgId}/blueprint-drafts/{draftId}/survey" \
  -H "Authorization: Bearer wfp_…" \
  -H "content-type: application/json" \
  --data '{"draftVersion":1,"schemaVersion":1,"answers":{"schemaVersion":1,"step1":{"engine":"unity","headcount":1,"roles":["programming"]},"step2":{"genres":["示例文本"],"themes":["示例文本"],"coreLoop":"示例文本"}}}'

响应示例

HTTP/1.1 201
{
  "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 正在加载…