Skip to main content

删除报告模板

删除归属于已认证客户的自定义 Smart Report 模板。被删除的模板文档会在 { "data": ... } 中返回。

在无头工作流与自动化测试流水线中,可使用此端点清理临时模板或下线已弃用的报告设计。内置的 "System" 模板不可删除,将返回 403(system_template_readonly)。删除模板不会消耗积分,也不会移除此前已生成的 SmartBatch 报告。

端点​

DELETE https://api.verifik.co/v2/smart-report-templates/{id}

Smart-Agent 代理(https://ai.verifik.co)暴露了完全相同的 /v2/... 路径,并同样要求携带你自己的 Authorization: Bearer <VERIFIK_JWT> 请求头。

请求头​

名称值
Acceptapplication/json
AuthorizationBearer <VERIFIK_JWT>

参数​

名称类型必填说明
idstring是Smart Report 模板 ObjectId。

请求示例​

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

async function run() {
const id = "67c1f94b2d8a1c0012a4b301";
const res = await fetch(
`https://api.verifik.co/v2/smart-report-templates/${id}`,
{
method: "DELETE",
headers: {
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);

console.log(await res.json());
}

run();

响应示例​

{
"data": {
"_id": "67c1f94b2d8a1c0012a4b301",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Driver Onboarding Report v2",
"country": "CO",
"category": "citizen",
"isActive": true
}
}

注意事项​

  • 内置 "System" 模板不可删除(返回 403 system_template_readonly)。
  • 删除后,后续针对同一 {id} 发起的 GET、PUT 或 DELETE 请求将分别返回 { "data": null }(GET)或 404 not_found(PUT/DELETE)。

相关页面​