Skip to main content

更新批处理配置

更新你客户账户下已有的 BatchConfiguration。只需发送需要修改的字段;省略的字段将保留其当前值。

如果请求中包含 steps,服务器会将缺失的 sequence 值标准化为 index + 1,并将 retryDelayBaseSeconds 限制为 >= 1、timeoutSeconds 限制为 >= 5。更新 notification 会自动同步关联的 Verifik Webhook,修改 executor 则会将新的执行器传播至非终态的子批次。更新配置不会执行查询,也不会消耗积分。

接口​

PUT https://api.verifik.co/v2/batch-configurations/{id}

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

请求头​

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

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

参数​

名称类型必填描述
idstring是要更新的 BatchConfiguration ObjectId。

请求体​

所有请求体字段均为可选,仅需传入需要更新的属性。

名称类型必填描述
namestring否配置的显示名称。去除首尾空格,最多 150 个字符。
descriptionstring否可选的工作流摘要说明。最多 800 个字符。
countrystring否国家范围。服务器会自动去除首尾空格并转为大写。
stepsobject[]否替换整个有序步骤数组。缺失的 sequence 默认设为 index + 1;retryDelayBaseSeconds 限制为 >= 1,timeoutSeconds 限制为 >= 5。
inputFormatstring否默认输入格式:csv、jsonl 或 xlsx。
outputFormatstring否默认输出格式:csv、jsonl 或 xlsx。
mergeStrategystring否步骤执行策略:sequential、parallel-independent 或 parallel-with-fallback。
notificationobject否完成通知设置(webhookUrl 和 emailOnCompletion)。设置 webhookUrl 时会自动同步创建一个启用状态的 Verifik Webhook。
scheduleExpressionstring否用于自动运行的定时调度表达式。
preferredReportTemplatestring否关联到此配置的 SmartReportTemplate ObjectId。
visitaFlowobject否定义步骤链的可视化节点图({{results.N.field}} 表达式会从派生输入模式的手动输入字段中排除)。
isActiveboolean否配置是否处于启用状态。
executorstring否执行目标:queue、featureRunner 或 browser(featureRunner 会持久化保存为 browser)。变更时会同步更新非终态的子批次。

请求示例​

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

async function run() {
const id = "67d1b4a0e4f5a60718293b12";
const res = await fetch(`https://api.verifik.co/v2/batch-configurations/${id}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
body: JSON.stringify({
name: "Colombia KYC Workflow (Updated)",
mergeStrategy: "parallel-independent",
notification: {
webhookUrl: "https://example.com/webhooks/smart-reports",
emailOnCompletion: ["compliance@example.com"]
},
isActive: true
}),
});
console.log(await res.json());
}

run();

响应示例​

{
"data": {
"_id": "67d1b4a0e4f5a60718293b12",
"name": "Colombia KYC Workflow (Updated)",
"description": "Core Colombian identity and registry verification for citizens.",
"country": "CO",
"executor": "browser",
"inputFormat": "csv",
"outputFormat": "csv",
"mergeStrategy": "parallel-independent",
"preferredReportTemplate": "67d1b4a1e4f5a60718293b15",
"notification": {
"webhookUrl": "https://example.com/webhooks/smart-reports",
"emailOnCompletion": ["compliance@example.com"]
},
"isActive": true,
"steps": [
{
"_id": "67d1b4a0e4f5a60718293b13",
"appFeature": {
"_id": "65f0a1b2c3d4e5f607182901",
"name": "Colombian Cédula Validation",
"code": "co-cedula",
"url": "/v2/co/cedula",
"method": "GET",
"price": 0.05,
"smartCheckPrice": 0.05,
"country": "Colombia"
},
"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-15T15:45:00.000Z"
}
}

注意事项​

  • 发送 steps 会替换配置上的整个 steps 数组,而不会就地局部修补单个步骤。
  • steps 中缺失的 sequence 值会被标准化为 index + 1,retryDelayBaseSeconds 会限制为 >= 1,timeoutSeconds 会限制为 >= 5。
  • 更改 executor 会同步更新属于此配置的任何非终态子批次。
  • ID 不存在或跨客户时返回 404(not_found),而 Mongoose 模式校验错误则返回 422(UnprocessableEntity)。

相关文档​