sumsub-create-questionnaire
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSumsub — Create Questionnaire
Sumsub — 创建问卷
Builds a questionnaire definition JSON payload from a compact spec, POSTs it
to the Sumsub API, and reports the resulting (client-supplied slug) and
(server-assigned identifier).
id_id根据简洁规范构建问卷定义JSON负载,将其提交至Sumsub API,并返回生成的(客户端提供的slug)和(服务器分配的标识符)。
id_idEndpoints
接口端点
| Method | Path | When |
|---|---|---|
| | Create a new questionnaire. Fails with |
| | Update an existing questionnaire (by |
| | Read one questionnaire (verify what landed; resolve |
| | List all questionnaires. (Stays on the non-agent path.) |
| | List questionnaires with the levels that reference them. (Stays on the non-agent path.) |
All require permission . Body shape is the
questionnaire schema — client-settable
fields only (, , audit metadata are server-managed).
manageClientSettingsclientIdcreatedAtPOST vs PATCH — these are now strict. POST refuses an existing; PATCH refuses a missing one. The pre-INT-4893 "single POST upsert" behavior is gone — always pick the right verb up front (call GET /{id} first if unsure whether the questionnaire exists).id
| 方法 | 路径 | 适用场景 |
|---|---|---|
| | 创建新问卷。若 |
| | 更新现有问卷(通过请求体中的 |
| | 读取单个问卷(验证已提交内容;通过已知 |
| | 列出所有问卷。(使用非agent路径) |
| | 列出被各等级引用的问卷。(使用非agent路径) |
所有接口均需权限。请求体需符合问卷 schema — 仅包含客户端可设置字段(、、审计元数据由服务器管理)。
manageClientSettingsclientIdcreatedAtPOST与PATCH的区别 — 两者现在有严格区分。POST会拒绝已存在的;PATCH会拒绝不存在的id。INT-4893之前的“单POST请求自动更新”行为已取消 — 请务必提前选择正确的请求方法(若不确定问卷是否存在,先调用GET /{id}接口)。id
Auth — App Token + secret (sandbox only)
认证 — App Token + 密钥(仅限沙箱环境)
This skill talks to the public Sumsub API and signs each request per
the authentication reference.
The full how-it-works writeup lives in the
skill — read it if you hit .
sumsub-api-auth401 Invalid signature⚠️ Sandbox tokens only. Do not accept or use a production App Token here. If the user offers one, refuse and ask them to generate a sandbox pair at https://cockpit.sumsub.com/checkus/devSpace/appTokens (toggle the workspace to Sandbox first, then Create). Token + secret are shown once — copy both before closing the dialog. The helper script enforces this — it rejects tokens that don't start with.sbx:
| Var | Example |
|---|---|
| |
| The paired secret shown once at token creation. |
| Optional. Defaults to |
If the user has already supplied credentials in conversation, reuse them;
otherwise ask once before running. Never echo the secret back.
本技能调用公开的Sumsub API,并按照认证参考文档对每个请求进行签名。完整的工作机制说明请查看技能 — 若遇到错误,请阅读该文档。
sumsub-api-auth401 Invalid signature⚠️ 仅限沙箱令牌。请勿接受或使用生产环境的App Token。若用户提供生产令牌,请拒绝并要求他们在https://cockpit.sumsub.com/checkus/devSpace/appTokens生成沙箱令牌对(先将工作区切换为Sandbox,再点击Create)。令牌和密钥仅会显示一次 — 请在关闭对话框前复制两者。辅助脚本会强制执行此规则 — 拒绝所有不以开头的令牌。sbx:
| 变量 | 示例 |
|---|---|
| |
| 创建令牌时显示的配对密钥。 |
| 可选参数。默认值为 |
若用户已在对话中提供凭证,请复用;否则在执行前询问一次。切勿回显密钥。
Tenant entitlements
租户权限
Creating a questionnaire requires the entitlement. Before doing anything else, invoke the skill and verify that is present in the array.
QUESTIONNAIREsumsub-check-permissionsQUESTIONNAIREallowedIf is not in — stop immediately. Do not build or POST the questionnaire. Tell the user the entitlement is missing and that they need to contact their CSM or Sumsub support to get it enabled.
QUESTIONNAIREallowed创建问卷需要权限。在执行任何操作前,调用技能,确认在数组中。
QUESTIONNAIREsumsub-check-permissionsQUESTIONNAIREallowed若不在数组中 — 立即停止操作。请勿构建或提交问卷。告知用户缺少该权限,需要联系客户成功经理或Sumsub支持团队启用。
QUESTIONNAIREallowedProcedure
操作流程
-
Fetch tenant entitlements — see section above.
-
Gather spec. Map the user's questions into the compact spec format below — never hand-write the full localized payload.
-
Validate — confirmis a unique slug, every item has a supported
id, every conditional reference points to a realtype.<sectionId>.<itemId> -
Generate payload by runningwith the spec on stdin. Inspect the output briefly.
${CLAUDE_SKILL_DIR}/scripts/build_questionnaire.py -
Create vs. update — POST/PATCH scripts accept the payload as a path argument or on stdin (pipe it fromfor a one-liner):
build_questionnaire.py- New — POST via (or
${CLAUDE_SKILL_DIR}/scripts/post_questionnaire.sh <payload.json>). If the user already supplied an… | post_questionnaire.sh -they used before, GET it first viaidto avoid a${CLAUDE_SKILL_DIR}/scripts/get_questionnaire.sh.409 CONFLICT - Update existing — GET via first so the user sees what they're overwriting; then PATCH via
${CLAUDE_SKILL_DIR}/scripts/get_questionnaire.sh.${CLAUDE_SKILL_DIR}/scripts/patch_questionnaire.sh <payload.json>
- New — POST via
-
Build the dashboard link. Readand
idfrom the response body (both fields are present on the persisted questionnaire) and format:clientIdhttps://cockpit.sumsub.com/checkus/sdkIntegrations/questionnaireDetails/<id>?clientId=<clientId>&xSNSEnv=sbxThequery param targets the Sandbox workspace — it is the canonical sandbox link param shared across all skills.xSNSEnv=sbx -
Report — lead with the human-readable title:
- , section/item count, country/lang coverage if relevant.
title - Dashboard link as a clickable markdown link.
- Final line: .
Questionnaire ID (for level wiring / future PATCH): <id>
Surface any 4xx with thefield from the error body. Fordescriptionon POST — suggest PATCH instead.409 CONFLICT
-
获取租户权限 — 见上文章节。
-
收集规范。将用户提供的问题映射为下方的简洁规范格式 — 切勿手动编写完整的本地化负载。
-
验证 — 确认是唯一的slug,每个条目都有支持的
id,每个条件引用都指向有效的type。<sectionId>.<itemId> -
生成负载 — 通过标准输入传入规范,运行。简要检查输出内容。
${CLAUDE_SKILL_DIR}/scripts/build_questionnaire.py -
创建与更新 — POST/PATCH脚本接受路径参数形式的负载 或 标准输入形式的负载(可通过管道输出实现一键操作):
build_questionnaire.py- 创建新问卷 — 通过(或
${CLAUDE_SKILL_DIR}/scripts/post_questionnaire.sh <payload.json>)执行POST请求。若用户提供了之前使用过的… | post_questionnaire.sh -,请先通过id调用GET接口,避免返回${CLAUDE_SKILL_DIR}/scripts/get_questionnaire.sh错误。409 CONFLICT - 更新现有问卷 — 先通过调用GET接口,让用户查看即将覆盖的内容;再通过
${CLAUDE_SKILL_DIR}/scripts/get_questionnaire.sh执行PATCH请求。${CLAUDE_SKILL_DIR}/scripts/patch_questionnaire.sh <payload.json>
- 创建新问卷 — 通过
-
构建控制台链接。从响应体中读取和
id(两者均存在于已保存的问卷中),并格式化为:clientIdhttps://cockpit.sumsub.com/checkus/sdkIntegrations/questionnaireDetails/<id>?clientId=<clientId>&xSNSEnv=sbx查询参数用于指向沙箱工作区 — 这是所有技能通用的标准沙箱链接参数。xSNSEnv=sbx -
结果反馈 — 以易读的标题开头:
- 、章节/条目数量、相关国家/语言覆盖范围(若适用)。
title - 控制台链接:以可点击的markdown链接形式展示。
- 最后一行:。
问卷ID(用于等级关联/后续PATCH操作): <id>
若返回4xx错误,展示错误体中的字段。若POST请求返回description错误 — 建议用户改用PATCH请求进行更新。409 CONFLICT
Compact spec format
简洁规范格式
JSON or YAML accepted on stdin. English titles are auto-wrapped into / . Use strings for show/hide logic — see references/questionnaire-schema.md for syntax.
localizedTitlelocalizedDescconditionjson
{
"id": "source-of-funds",
"title": "Source of Funds",
"desc": "Optional one-liner shown to applicants.",
"showTitleAsStepName": true,
"sections": [
{
"id": "primary",
"title": "Primary Source",
"desc": "Optional section description.",
"condition": null,
"items": [
{"id": "main", "title": "Main source?", "type": "select", "required": true,
"options": [["salary","Salary"],["business","Business"],["other","Other"]]},
{"id": "other", "title": "Specify", "type": "text",
"condition": "primary.main = other"}
]
}
]
}支持通过标准输入传入JSON或YAML格式。英文标题会自动封装为 / 。使用字符串实现显示/隐藏逻辑 — 语法请参考references/questionnaire-schema.md。
localizedTitlelocalizedDescconditionjson
{
"id": "source-of-funds",
"title": "Source of Funds",
"desc": "Optional one-liner shown to applicants.",
"showTitleAsStepName": true,
"sections": [
{
"id": "primary",
"title": "Primary Source",
"desc": "Optional section description.",
"condition": null,
"items": [
{"id": "main", "title": "Main source?", "type": "select", "required": true,
"options": [["salary","Salary"],["business","Business"],["other","Other"]]},
{"id": "other", "title": "Specify", "type": "text",
"condition": "primary.main = other"}
]
}
]
}Supported item types
支持的条目类型
texttextAreadatedateTimeboolselectphoneselectDropdownmultiSelectcountrySelectcountryMultiSelectfileAttachmentmultiFileAttachmentsselectselectDropdownmultiSelectoptions: [[value, title], ...]texttextAreadatedateTimeboolselectphoneselectDropdownmultiSelectcountrySelectcountryMultiSelectfileAttachmentmultiFileAttachmentsselectselectDropdownmultiSelectoptions: [[value, title], ...]Outputs
输出结果
On success, lead with the human-readable info:
- , section/item count,
title.createdAt - Dashboard link: . Render as a clickable markdown link so the user can jump to the entity. Both
https://cockpit.sumsub.com/checkus/sdkIntegrations/questionnaireDetails/<id>?clientId=<clientId>&xSNSEnv=sbxandidare in the POST response body;clientIdtargets the Sandbox workspace.xSNSEnv=sbx - Finally, on its own line: .
Questionnaire ID (slug, for level wiring / future PATCH): <id>
On failure: print HTTP status + / from the error envelope; do not retry blindly. On from POST — suggest PATCH for an update.
descriptiontype409 CONFLICT成功时,以易读信息开头:
- 、章节/条目数量、
title。createdAt - 控制台链接:。以可点击的markdown链接形式展示,方便用户直接跳转至该实体。
https://cockpit.sumsub.com/checkus/sdkIntegrations/questionnaireDetails/<id>?clientId=<clientId>&xSNSEnv=sbx和id均可在POST响应体中获取;clientId用于指向沙箱工作区。xSNSEnv=sbx - 最后单独一行:。
问卷ID(slug,用于等级关联/后续PATCH操作): <id>
失败时:输出HTTP状态码 + 错误包中的/字段;请勿盲目重试。若POST请求返回错误 — 建议用户改用PATCH请求进行更新。
descriptiontype409 CONFLICTNames, not ids, in user-facing messages
用户消息中使用名称而非ID
This applies to every message about the questionnaire — pre-POST summary, mid-flow status updates, diagnostics — not only the final report:
- Refer to the questionnaire by ("Applicant basics"), not by its
titleslug, in prose.id - The slug belongs only on the final dedicated line (
id) — that line is the one place a raw id is correct, because the user needs to copy it into a level'sQuestionnaire ID (slug): <id>.questionnaireDefId - When mentioning sections or items, prefer their over their
title.id
此规则适用于所有与问卷相关的消息 — POST前的摘要、流程中的状态更新、诊断信息 — 不仅仅是最终报告:
- 在文本描述中,使用问卷的(如“申请人基础信息”)而非
titleslug。id - slug格式的仅应出现在最后单独的一行(
id) — 这是唯一适合展示原始ID的位置,因为用户需要将其复制到等级的问卷ID(slug): <id>中。questionnaireDefId - 提及章节或条目时,优先使用其而非
title。id
Hand-off to sumsub-create-level
sumsub-create-level移交至sumsub-create-level
技能
sumsub-create-levelThe returned here (the questionnaire slug) is what you pass on a level's doc-set. The level skill accepts it as (canonical) or (alias):
idQUESTIONNAIREquestionnaireDefIdquestionnaireIdjson
{
"type": "QUESTIONNAIRE",
"questionnaireDefId": "<id from this skill>"
}See .
sumsub-create-level/examples/with-presets.json本技能返回的(问卷slug)需传入等级的文档集中。等级技能接受(标准参数)或(别名参数):
idQUESTIONNAIREquestionnaireDefIdquestionnaireIdjson
{
"type": "QUESTIONNAIRE",
"questionnaireDefId": "<本技能返回的id>"
}示例请查看。
sumsub-create-level/examples/with-presets.jsonSee also
相关链接
- references/questionnaire-schema.md — full field list, condition expressions, gotchas.
- examples/source-of-funds.json — multi-section spec with conditional branches.
- references/questionnaire-schema.md — 完整字段列表、条件表达式、注意事项。
- examples/source-of-funds.json — 包含条件分支的多章节规范示例。