跳转到主要内容
PATCH

概述

根据 API 密钥确定的应用,部分更新其白标品牌设置。发送 application/json 可修改颜色、字体、圆角半径和界面选项;发送 multipart/form-data 可上传 Logo。只有您包含的字段会被更改,其他内容保持不变。

适用场景

  • 设置验证流程主题:设置品牌颜色、字体和圆角半径。
  • 上传 Logo:设置方形 Logo、矩形 Logo 及其深色模式版本,以及网站图标(favicon)。
  • 优化体验:设置公开应用名称、隐私政策 URL,以及跳过欢迎页、隐藏进度条等开关。
以 multipart/form-data 发送 Logo:
  • image_square:宽高比 1:1。
  • image_rectangular:宽高比 2:1。
  • image_rectangular_dark:宽高比 2:1。深色模式使用的矩形 Logo,显示在深色背景上。
  • image_favicon:最大 500 KB。
image_square、image_rectangular 和 image_rectangular_dark 必须是 PNG、JPG 或 WebP 图片,长边至少 512 px,且最大为 1 MB。 系统会拒绝 SVG 文件。 响应会返回最终的 logo_square、logo_rectangular、logo_rectangular_dark 和 favicon URL。 要删除 Logo,请将对应的 delete_logo_square、delete_logo_rectangular、delete_logo_rectangular_dark 或 delete_favicon 标志设为 true。 删除深色模式 Logo 后,logo_rectangular_dark 的值为 null。 如果同一请求既上传 Logo 又发送其删除标志,则以上传为准。 上传被拒绝时,会返回 400,并附带字段名和原因,例如:
  • {"image_rectangular_dark": ["Upload a PNG, JPG or WebP image."]}
  • {"image_rectangular": ["Image must be at least 512 px on its long side. Got 400x200 image dimensions"]}
  • {"image_rectangular": ["Image aspect ratio must be 2:1. Got 1024x1024 image dimensions"]}
  • {"image_square": ["File size should not exceed 1 MB"]}

注意事项

  • 应用由 API 密钥确定,因此没有路径参数。
  • 十六进制颜色支持 #RRGGBB 或 #RRGGBBAA。font_weight 必须是所选 font_family 可用的字重。
  • 此处无法配置自定义域名和白标邮件。 请在 Business Console 中管理这些设置。

权限

API 密钥必须具有更新该应用自定义设置的权限。

相关内容

授权

x-api-key
string
header
必填

您的应用 API 密钥,可在 Business Console 的“开发者 -> API 密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域:针对每个资源设为无权限、只读或读写,限定于特定工作流或已通过的会话、限定于 IP 地址列表,以及设置到期日期。401 表示密钥错误、已撤销或已过期;403 表示未发送密钥、密钥无权访问该资源或操作,或请求来自其 IP 列表之外的地址;在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF URL 将为 null;没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅 https://docs.didit.me/console/api-keys。

请求体

品牌化部分更新请求体。仅提供您想要更改的字段。十六进制颜色支持 #RRGGBB 或 #RRGGBBAA。此处不接受自定义域名和白标邮箱。

color_primary
string

标题/主要文本颜色。

color_secondary
string

段落 / 次要文本颜色。

color_background
string

页面背景颜色。

color_panel
string

面板 / 强调色。

color_panel_10
string

10% 不透明度的面板颜色。

color_on_panel_1
string

面板上的辅助文本颜色。

color_on_panel_2
string

面板上的标签/徽章颜色。

color_on_background
string

背景上的文本颜色。

color_button_1
string

主要按钮颜色。

color_button_2
string

次要按钮颜色。

color_button_text_1
string

主要按钮文本颜色。

color_button_text_2
string

次要按钮文本颜色。

color_pill_text
string

胶囊控件、输入框和选择器的文本颜色。

border_radius_panel
integer

面板圆角半径(像素)。

必填范围: x >= 0
border_radius_buttons
integer

按钮圆角半径(以像素为单位)。

必填范围: x >= 0
font_family
string

Google Font 字体系列名称(例如 Inter、AR One Sans)。

font_weight
string

所选字体族可用的字重(例如 regular、500、700)。

app_public_name
string | null

验证流程中显示的公开名称。

privacy_policy_url
string | null

向终端用户显示的隐私政策 URL。

skip_welcome_screen
boolean

跳过初始欢迎屏幕。

disable_login_with_didit
boolean

以访客身份继续,而非显示 Didit 登录界面。配置了自定义域名时无法设置回 false(400)。

hide_progress_bar
boolean

在流程中隐藏进度条。

callback_seconds
integer

重定向到回调 URL 前的延迟时间(秒)。

必填范围: x >= 0
delete_logo_square
boolean

为 true 时,移除当前正方形 logo。

delete_logo_rectangular
boolean

为 true 时,移除当前长方形 logo。

delete_logo_rectangular_dark
boolean

为 true 时,移除当前的深色模式 logo,随后 logo_rectangular_dark 读取为 null。如果同一 multipart 请求中还上传了 image_rectangular_dark,则以上传内容为准。

delete_favicon
boolean

为 true 时,移除当前 favicon。

响应

品牌形象已更新。返回完整的品牌形象对象(所有字段,不仅是您更改的字段)。

应用的白标品牌化:颜色、字体、圆角半径、徽标 URL 和 UI/UX 选项。徽标 URL 为只读(通过上传图片进行设置)。不包含自定义域名和白标邮件。

color_primary
string
color_secondary
string
color_background
string
color_panel
string
color_panel_10
string
color_on_panel_1
string
color_on_panel_2
string
color_on_background
string
color_button_1
string
color_button_2
string
color_button_text_1
string
color_button_text_2
string
color_pill_text
string
border_radius_panel
integer
border_radius_buttons
integer
font_family
string
font_weight
string
font_url
string | null

只读。所选字体系列解析后的 Google Fonts 样式表 URL。

logo_square
string | null

方形徽标的只读 URL。通过 image_square 上传。

logo_rectangular
string | null

矩形徽标的只读 URL。通过 image_rectangular 上传。

logo_rectangular_dark
string<uri> | null

只读。暗色模式矩形徽标的临时签名 URL,显示在深色背景上。当未设置暗色徽标或您的账户不显示矩形徽标时为 null。通过 image_rectangular_dark 上传。

favicon
string | null

网站图标的只读 URL。通过 image_favicon 上传。

app_public_name
string | null
privacy_policy_url
string | null
skip_welcome_screen
boolean
disable_login_with_didit
boolean
hide_progress_bar
boolean
callback_seconds
integer
最后修改于 2026年11月7日