Skip to main content

克隆报告预设

将精选的系统 Smart Report 预设克隆到你的客户账户中。该操作会同时返回一个 BatchConfiguration 和一个关联的 SmartReportTemplate,既可立即运行,也可进一步自定义。

此接口对客户账户而言具有幂等性。如果账户中已存在从 {systemKey} 克隆的启用中客户模板,服务器会复用该配置和模板(必要时重新映射步骤序号)并返回 reused: true。否则,将创建一个新的 BatchConfiguration(默认 inputFormat: "csv"、outputFormat: "csv"、mergeStrategy: "sequential")和一个新的客户 SmartReportTemplate(clonedFromSystemKey 设为 {systemKey}),两者通过 preferredReportTemplate 关联,并返回 reused: false。该接口同时作为 smart_report_clone_preset MCP 工具暴露。

接口​

POST https://api.verifik.co/v2/smart-batch-presets/{systemKey}/clone

也可以通过 Smart-Agent 代理 https://ai.verifik.co/v2/smart-batch-presets/{systemKey}/clone 访问,并使用你自己的客户专属 Authorization: Bearer <VERIFIK_JWT> 请求头。共享 x402 执行会被拒绝并返回 403 Forbidden。

请求头​

名称值
Content-Typeapplication/json
AuthorizationBearer <VERIFIK_JWT>

令牌必须是客户 JWT。缺少凭证或凭证无效将返回 401 Unauthorized。

参数​

名称类型必填描述
systemKeystring是来自列出报告预设的预设键。去除首尾空格,最大 120 个字符,必须匹配 /^[a-z0-9][a-z0-9._-]{1,118}$/i。

请求体​

此接口无需请求体。

请求示例​

const fetch = require("node-fetch");

async function run() {
const systemKey = "co.citizen.essential";
const res = await fetch(`https://api.verifik.co/v2/smart-batch-presets/${encodeURIComponent(systemKey)}/clone`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});
console.log(await res.json());
}

run();

响应示例​

{
"data": {
"batchConfiguration": {
"_id": "67d1b4a0e4f5a60718293b12",
"name": "Colombia Citizen Essential",
"description": "Core Colombian identity and registry verification for citizens.",
"country": "CO",
"executor": "browser",
"inputFormat": "csv",
"outputFormat": "csv",
"mergeStrategy": "sequential",
"preferredReportTemplate": "67d1b4a1e4f5a60718293b15",
"isActive": true,
"steps": [
{
"_id": "67d1b4a0e4f5a60718293b13",
"appFeature": {
"_id": "65f0a1b2c3d4e5f607182901",
"name": "Colombian Cédula Validation",
"code": "co-cedula",
"price": 0.05
},
"sequence": 1,
"enabled": true,
"parameterDefaults": {},
"queryMode": "byDocument",
"inputFieldMapping": {},
"outputFieldsToKeep": [],
"maxRetries": 3,
"retryDelayBaseSeconds": 4,
"timeoutSeconds": 30
}
],
"createdAt": "2026-10-15T14:20:00.000Z",
"updatedAt": "2026-10-15T14:20:00.000Z"
},
"template": {
"_id": "67d1b4a1e4f5a60718293b15",
"name": "Colombia Citizen Essential",
"clonedFromSystemKey": "co.citizen.essential",
"batchConfiguration": "67d1b4a0e4f5a60718293b12",
"isActive": true,
"createdAt": "2026-10-15T14:20:00.000Z",
"updatedAt": "2026-10-15T14:20:00.000Z"
},
"reused": false
}
}

注意事项​

  • 克隆预设不会执行查询,也不会消耗积分。
  • 使用相同的 {systemKey} 重复调用此接口对客户账户是安全且幂等的:系统会返回已克隆的配置和模板,并设置 reused: true。
  • 当 {systemKey} 未通过 Joi 路径校验(例如超过 120 个字符或包含不支持的字符)时,将返回 409 MissingParameter。如果匹配到的预设未配置任何步骤,则会返回包含 preset_has_no_steps 的 409 错误。
  • 如果所需预设功能在你的账户中不可用,可能会返回 500 InternalServerError。
  • 克隆完成后,请在提交数据行之前使用 batchConfiguration._id 调用获取配置输入模式,或者使用 smart_report_clone_preset MCP 工具。

相关文档​