curl -X PATCH 'https://verification.didit.me/v3/workflows/a1b2c3d4-5678-90ab-cdef-111111111111/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"workflow_label": "Premium KYC"}'from didit import Didit
# Reads DIDIT_API_KEY.
client = Didit()
result = client.workflows.update(
"11111111-2222-3333-4444-555555555555",
features=[{
"feature": "OCR",
}, {
"feature": "AML",
}],
)
print(result)import Didit from "@didit-protocol/sdk-node";
// Reads DIDIT_API_KEY.
const didit = new Didit();
const result = await didit.workflows.update("11111111-2222-3333-4444-555555555555", {
features: [{
feature: "OCR",
}, {
feature: "AML",
}],
});
console.log(result);ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()
result, err := client.Workflows.Update(ctx, "11111111-2222-3333-4444-555555555555", didit.SimpleWorkflowUpdateRequest{
Features: didit.Some([]didit.SimpleWorkflowFeature{{
Feature: "OCR",
}, {
Feature: "AML",
}}),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)import java.util.List;
import me.didit.Didit;
import me.didit.types.SimpleWorkflowFeature;
import me.didit.types.SimpleWorkflowUpdateRequest;
// Reads DIDIT_API_KEY.
Didit client = new Didit();
var result = client.workflows().update("11111111-2222-3333-4444-555555555555", SimpleWorkflowUpdateRequest.builder()
.features(List.of(
SimpleWorkflowFeature.builder()
.feature(SimpleWorkflowFeature.Feature.of("OCR"))
.build(),
SimpleWorkflowFeature.builder()
.feature(SimpleWorkflowFeature.Feature.of("AML"))
.build()))
.build());
System.out.println(result);<?php
require 'vendor/autoload.php';
use Didit\DiditClient;
// Reads DIDIT_API_KEY.
$didit = new DiditClient();
$result = $didit->workflows->update('11111111-2222-3333-4444-555555555555', [
'features' => [[
'feature' => 'OCR',
], [
'feature' => 'AML',
]],
]);
print_r($result->toArray());require "didit"
# Reads DIDIT_API_KEY.
didit = Didit::Client.new
result = didit.workflows.update(
"11111111-2222-3333-4444-555555555555",
features: [{
feature: "OCR",
}, {
feature: "AML",
}]
)
puts result.to_husing System;
using System.Text.Json;
using Didit;
// Reads DIDIT_API_KEY.
using var client = new DiditClient();
var result = await client.Workflows.UpdateAsync("11111111-2222-3333-4444-555555555555", new SimpleWorkflowUpdateRequest
{
Features = new SimpleWorkflowFeature[]
{
new()
{
Feature = "OCR",
},
new()
{
Feature = "AML",
},
},
});
Console.WriteLine(JsonSerializer.Serialize(result));{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflow_label": "<string>",
"workflow_type": "kyc",
"is_default": true,
"is_archived": true,
"version": 123,
"status": "draft",
"published_at": "2023-11-07T05:31:56Z",
"is_simple_workflow": true,
"is_editable": true,
"workflow_url": "<string>",
"workflow_graph": {},
"features": "<string>",
"total_price": 123,
"min_price": 123,
"max_price": 123,
"special_add_on_prices": {},
"max_retry_attempts": 123,
"retry_window_days": 123,
"session_expiration_time": 123,
"questionnaire": {},
"kyb_role_settings": [
{}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"signature_availability": {
"simple": true,
"aes": true,
"qes": true
},
"is_bank_verification_enabled": true,
"bank_verification_config": {},
"is_geolocation_enabled": true,
"geolocation_config": {}
}{
"detail": "You do not have permission to perform this action."
}更新工作流 API:编辑 KYC 流程
通过 API 编程更新 Didit KYC 或 KYB 工作流:重命名、替换有序功能或调整阈值。按次计费,无需签订合同。
curl -X PATCH 'https://verification.didit.me/v3/workflows/a1b2c3d4-5678-90ab-cdef-111111111111/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"workflow_label": "Premium KYC"}'from didit import Didit
# Reads DIDIT_API_KEY.
client = Didit()
result = client.workflows.update(
"11111111-2222-3333-4444-555555555555",
features=[{
"feature": "OCR",
}, {
"feature": "AML",
}],
)
print(result)import Didit from "@didit-protocol/sdk-node";
// Reads DIDIT_API_KEY.
const didit = new Didit();
const result = await didit.workflows.update("11111111-2222-3333-4444-555555555555", {
features: [{
feature: "OCR",
}, {
feature: "AML",
}],
});
console.log(result);ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()
result, err := client.Workflows.Update(ctx, "11111111-2222-3333-4444-555555555555", didit.SimpleWorkflowUpdateRequest{
Features: didit.Some([]didit.SimpleWorkflowFeature{{
Feature: "OCR",
}, {
Feature: "AML",
}}),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)import java.util.List;
import me.didit.Didit;
import me.didit.types.SimpleWorkflowFeature;
import me.didit.types.SimpleWorkflowUpdateRequest;
// Reads DIDIT_API_KEY.
Didit client = new Didit();
var result = client.workflows().update("11111111-2222-3333-4444-555555555555", SimpleWorkflowUpdateRequest.builder()
.features(List.of(
SimpleWorkflowFeature.builder()
.feature(SimpleWorkflowFeature.Feature.of("OCR"))
.build(),
SimpleWorkflowFeature.builder()
.feature(SimpleWorkflowFeature.Feature.of("AML"))
.build()))
.build());
System.out.println(result);<?php
require 'vendor/autoload.php';
use Didit\DiditClient;
// Reads DIDIT_API_KEY.
$didit = new DiditClient();
$result = $didit->workflows->update('11111111-2222-3333-4444-555555555555', [
'features' => [[
'feature' => 'OCR',
], [
'feature' => 'AML',
]],
]);
print_r($result->toArray());require "didit"
# Reads DIDIT_API_KEY.
didit = Didit::Client.new
result = didit.workflows.update(
"11111111-2222-3333-4444-555555555555",
features: [{
feature: "OCR",
}, {
feature: "AML",
}]
)
puts result.to_husing System;
using System.Text.Json;
using Didit;
// Reads DIDIT_API_KEY.
using var client = new DiditClient();
var result = await client.Workflows.UpdateAsync("11111111-2222-3333-4444-555555555555", new SimpleWorkflowUpdateRequest
{
Features = new SimpleWorkflowFeature[]
{
new()
{
Feature = "OCR",
},
new()
{
Feature = "AML",
},
},
});
Console.WriteLine(JsonSerializer.Serialize(result));{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflow_label": "<string>",
"workflow_type": "kyc",
"is_default": true,
"is_archived": true,
"version": 123,
"status": "draft",
"published_at": "2023-11-07T05:31:56Z",
"is_simple_workflow": true,
"is_editable": true,
"workflow_url": "<string>",
"workflow_graph": {},
"features": "<string>",
"total_price": 123,
"min_price": 123,
"max_price": 123,
"special_add_on_prices": {},
"max_retry_attempts": 123,
"retry_window_days": 123,
"session_expiration_time": 123,
"questionnaire": {},
"kyb_role_settings": [
{}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"signature_availability": {
"simple": true,
"aes": true,
"qes": true
},
"is_bank_verification_enabled": true,
"bank_verification_config": {},
"is_geolocation_enabled": true,
"geolocation_config": {}
}{
"detail": "You do not have permission to perform this action."
}PATCH 进行部分更新。要重命名工作流,只需发送 workflow_label。
{
"workflow_label": "Premium KYC"
}
features 数组。这会替换之前的功能顺序和配置。
{
"features": [
{
"feature": "OCR",
"config": {
"documents_allowed": {
"USA": {
"DL": {
"enabled": 1,
"sides": 2
}
}
}
}
},
{
"feature": "AML",
"config": {
"aml_score_review_threshold": 70,
"aml_score_approve_threshold": 30
}
}
]
}
功能配置参考
在PATCH 中发送 features 时,该数组会替换之前的功能顺序和配置。请重新包含所有必需的配置。
config 对象的具体内容取决于功能。请在 工作流功能配置 中查看完整的字段列表、默认值、必填设置、取值范围和示例。
对于 OCR,省略 config.documents_allowed、发送 null 或发送 {},即可允许所有受支持的证件类型。仅当您想将工作流限制为特定国家/地区或证件类型时,才需要包含该字段。对于 QUESTIONNAIRE,config.questionnaire_uuid 为必填项。
更新工作流设置
您可以在不修改功能列表的情况下更新会话级设置。只需发送您想更改的字段。| 字段 | 类型 | 说明 |
|---|---|---|
is_white_label_enabled | 布尔值 | 为使用此工作流创建的会话启用白标定制。 |
is_desktop_allowed | 布尔值 | 允许验证流程在桌面浏览器中运行。 |
max_retry_attempts | 整数(0–10) | 验证被拒绝后允许的最大重试次数。0 表示用户在首次被拒绝后即被拦截。 |
retry_window_days | 整数(1–365)或 null | 用于统计重试次数的滚动时间窗口(天)(null = 全时段限制)。 |
session_expiration_time | 整数(3600–2419200) | 未完成会话过期前的秒数。最短 1 小时,最长 4 周。 |
{
"is_white_label_enabled": true,
"is_desktop_allowed": true,
"max_retry_attempts": 5,
"retry_window_days": 14,
"session_expiration_time": 86400
}
uuid 用作此 URL 中的 settings_uuid。授权
您的应用 API 密钥,可在 Business Console 的“开发者 -> API 密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域:针对每个资源设为无权限、只读或读写,限定于特定工作流或已通过的会话、限定于 IP 地址列表,以及设置到期日期。401 表示密钥错误、已撤销或已过期;403 表示未发送密钥、密钥无权访问该资源或操作,或请求来自其 IP 列表之外的地址;在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF URL 将为 null;没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅 https://docs.didit.me/console/api-keys。
路径参数
要更新的工作流版本 UUID。
请求体
更新工作流元数据或替换完整的线性功能列表。严格的字段白名单:此处未列出的任何键都将被拒绝并返回 400。
工作流的显示名称(最多 50 个字符)。
50将此工作流设为新会话的默认工作流。
控制版本管理。省略此项将就地更新当前版本(草稿会自动发布)。对已发布的版本传入 published 将创建并返回新版本。draft 仅在当前版本仍为草稿时有效。
draft, published 如果提供,将替换完整的功能顺序和配置。
1Show child attributes
Show child attributes
为使用此工作流创建的会话启用白标定制。
允许验证流程在桌面端浏览器上运行。
验证被拒绝后允许的最大重试次数。0 表示在首次拒绝后即阻止用户。
0 <= x <= 10用于计算重试次数的滑动时间窗口,以天为单位。null 执行历史累计限制。
1 <= x <= 365每次会话允许的最大活体检测提交次数。除非功能级配置覆盖,否则该值也会复制到生成的活体检测和年龄估算工作流节点中。
1 <= x <= 3每次会话允许的最大人脸比对提交次数。除非功能级配置覆盖,否则该值也会复制到生成的人脸比对工作流节点中。
1 <= x <= 3未完成会话过期前的秒数。最短 1 小时(3600),最长 4 周(2419200)。
3600 <= x <= 2419200响应
工作流已更新。响应体为最终版本的完整配置(与 GET /v3/workflows/{settings_uuid}/ 相同的原始 VerificationSettings 结构)。当更新创建了新版本(在已发布的记录上发送了 status: "published")时,返回的 uuid 和 version 会与您执行 PATCH 操作时的不同,后续调用请使用返回的 uuid。
以下字段均为类型化字段;该对象还包含工作流配置的每个其他列(功能开关、阈值、警告操作、允许的证件、回调)作为附加属性。不适用于该 workflow_type 的字段为 null。
每个版本对应的标识符(settings_uuid)。工作流的每个版本都有其独有的标识符。
工作流所有版本共享的稳定标识符。使用它创建的会话将采用最新发布的版本。
工作流的显示名称。
工作流模板。对于未使用模板创建的图谱工作流为 null。
kyc, kyb, adaptive_age_verification, biometric_authentication, address_verification, questionnaire_verification, email_verification, phone_verification, null 这是否为该应用的默认工作流。
已归档的工作流无法启动新会话。
工作流内的版本号。
草稿版本可编辑;已发布版本不可更改,并用于新会话。
draft, published 此版本发布的时间。草稿为 null。
当工作流没有自定义 workflow_graph 时为 true。
仅对 draft 版本为 true。
启动此工作流会话的公开 URL。
工作流的图谱结构(节点和边)。简单工作流为 null。
用 " + " 连接的已启用功能,例如 "OCR + LIVENESS"。
每次会话的价格;对于图谱工作流,为最昂贵路径的价格。
工作流中最便宜路径的价格。
工作流中最昂贵路径的价格。
特定于组织的附加项价格,未设置时为 null。
验证被拒绝后允许的重试次数。
允许重试的天数。
未完成会话过期前的秒数。
附加到工作流的问卷,或为 null。
针对 KYB 关键人员的按角色验证设置。
当前哪些电子签名等级可以签署。在设置 signature_level 之前请检查此项。在 kyc、kyb 和图谱工作流中返回。
Show child attributes
Show child attributes
简易 KYC 或 KYB 工作流是否运行银行验证。它在联系方式步骤(以及位置验证)之后、数据库核验、AML 及 IP 分析之前运行。银行验证目前尚未正式公开发布:在未启用的情况下开启将被拒绝。
简易 KYC 工作流是否运行位置验证。它在联系方式步骤之后、银行验证和数据库核验之前运行。企业(KYB)工作流无法运行该验证。
简易工作流的位置验证设置,具有与 GEOLOCATION 节点相同的键(例如 is_geolocation_geofencing_enabled 和 geolocation_max_attempts)。未知的键将被丢弃。每个键都是可选的,缺少的键保持其默认值,因此 {} 表示全部使用默认值。
{}