> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# 更新白标品牌 API

> 通过 Didit 管理 API 更新白标品牌：修改颜色、字体和圆角，上传 Logo，并调整验证流程界面选项。



更新品牌设置提示
        将提示词复制到剪贴板



      
      

\<pre>

\`Goal: Update the white-label branding for the application tied to an API key.

Endpoint: PATCH https://verification.didit.me/v3/customization/
Auth header: x-api-key: <DIDIT_API_KEY>

Two content types:
\- application/json  -> change colors, fonts, radii and UI options
\- multipart/form-data -> upload logo images (image_square, image_rectangular, image_rectangular_dark, image_favicon)

PARTIAL update: only the fields you send are changed. The application is resolved from the API key (no path params).

JSON body fields:
\- Colors (hex '#RRGGBB' or '#RRGGBBAA'): color_primary, color_secondary, color_background, color_panel, color_panel_10, color_on_panel_1, color_on_panel_2, color_on_background, color_button_1, color_button_2, color_button_text_1, color_button_text_2, color_pill_text
\- border_radius_panel, border_radius_buttons (integers >= 0)
\- font_family (Google Font name), font_weight (must be available for the family)
\- app_public_name (string|null), privacy_policy_url (string|null)
\- skip_welcome_screen, disable_login_with_didit, hide_progress_bar (boolean)
\- callback_seconds (integer >= 0)
\- delete_logo_square, delete_logo_rectangular, delete_logo_rectangular_dark, delete_favicon (boolean) -> remove an existing logo; an upload sent in the same request wins over its delete flag

Logo upload (multipart/form-data) fields:
\- image_square (1:1)
\- image_rectangular (2:1)
\- image_rectangular_dark (2:1, the rectangular logo for dark mode; returned as logo_rectangular_dark)
\- image_favicon (max 500 KB)
Logo rules for image_square, image_rectangular and image_rectangular_dark: PNG, JPG or WebP (SVG is refused), at least 512 px on the long side, max 1 MB.

NOT allowed here (Business Console only): custom domain and white-label email.

curl (JSON):
curl -X PATCH 'https://verification.didit.me/v3/customization/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"color_primary": "#123456", "font_family": "AR One Sans"}'

curl (logo upload):
curl -X PATCH 'https://verification.didit.me/v3/customization/' \
-H 'x-api-key: YOUR_API_KEY' \
-F 'image_rectangular=@logo.png' \
-F 'image_rectangular_dark=@logo-dark.png' \
-F 'image_favicon=@favicon.ico'

Response 200: the full updated BrandingCustomization object (same shape as GET).

Failure modes:
\- 400: validation. Examples: { "color_primary": ["Invalid color format. Use '#RRGGBB' or '#RRGGBBAA' format."] }, { "image_rectangular": ["Image aspect ratio must be 2:1. Got 1024x1024 image dimensions"] }, { "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_square": ["File size should not exceed 1 MB"] }
\- 401 — missing/invalid x-api-key.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

粘贴到

## 概述根据 API 密钥确定的应用，部分更新其白标品牌设置。发送 `application/json` 可修改颜色、字体、圆角半径和界面选项；发送 `multipart/form-data` 可上传 Logo。只有您包含的字段会被更改，其他内容保持不变。## 适用场景- **设置验证流程主题**：设置品牌颜色、字体和圆角半径。
- **上传 Logo**：设置方形 Logo、矩形 Logo 及其深色模式版本，以及网站图标（favicon）。
- **优化体验**：设置公开应用名称、隐私政策 URL，以及跳过欢迎页、隐藏进度条等开关。## 上传 Logo以 `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](https://docs.didit.me/zh/console/white-label.md) 中管理这些设置。## 权限API 密钥必须具有更新该应用自定义设置的权限。## 相关内容- [获取品牌设置](https://docs.didit.me/zh/management-api/customization/get.md)
- [控制台中的白标](https://docs.didit.me/zh/console/white-label.md)


## OpenAPI

````yaml zh/openapi-25.json PATCH /v3/customization/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份证件验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/customization/:
    patch:
      tags:
        - Customization
      summary: 更新品牌定制
      description: >-
        部分更新应用的白标品牌化。发送 `application/json` 以更改颜色、字体、圆角半径和 UI 选项，或发送
        `multipart/form-data` 以上传徽标图像。仅更改您包含的字段。自定义域名和白标邮箱无法通过此 endpoint 进行设置，请在
        Business Console 中配置这些项。
      operationId: update_customization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrandingCustomizationUpdate'
            examples:
              Update colors and font:
                summary: 更改品牌颜色和字体
                value:
                  color_primary: '#123456'
                  color_button_1: '#2567FF'
                  font_family: AR One Sans
                  border_radius_buttons: 16
              Update UI options:
                summary: 更改公开名称和流程选项
                value:
                  app_public_name: Acme Verify
                  privacy_policy_url: https://acme.com/privacy
                  skip_welcome_screen: true
                  hide_progress_bar: true
                  callback_seconds: 5
              Remove a logo:
                summary: 删除当前的矩形 Logo
                value:
                  delete_logo_rectangular: true
              Remove the dark-mode logo:
                summary: 删除当前的深色模式 Logo
                value:
                  delete_logo_rectangular_dark: true
          multipart/form-data:
            schema:
              type: object
              description: 仅在上传 Logo 图片时使用 multipart/form-data。上述品牌设置字段也可以在同一请求中作为表单字段发送。
              properties:
                image_square:
                  type: string
                  format: binary
                  description: 正方形 logo（1:1 宽高比）。PNG、JPG 或 WebP 格式，长边至少 512 px，最大 **1 MB**。
                image_rectangular:
                  type: string
                  format: binary
                  description: 矩形徽标（2:1 宽高比）。PNG、JPG 或 WebP 格式，长边至少 512 px，最大 **1 MB**。
                image_rectangular_dark:
                  type: string
                  format: binary
                  description: >-
                    深色模式矩形徽标（2:1 宽高比），显示在深色背景上。PNG、JPG 或 WebP 格式，长边至少 512 px，最大
                    **1 MB**。作为 `logo_rectangular_dark` 返回。
                image_favicon:
                  type: string
                  format: binary
                  description: 网站图标（Favicon）图像。最大 **500 KB**。
            example:
              image_rectangular: (binary PNG logo, 2:1)
              image_rectangular_dark: (binary PNG logo for dark mode, 2:1)
              image_favicon: (binary favicon)
      responses:
        '200':
          description: 品牌形象已更新。返回完整的品牌形象对象（所有字段，不仅是您更改的字段）。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandingCustomization'
              examples:
                Updated:
                  value:
                    color_primary: '#123456'
                    color_secondary: '#9DA1A1'
                    color_background: '#FFFFFF'
                    color_panel: '#2567FF'
                    color_panel_10: '#1A1A1A'
                    color_on_panel_1: '#9DA1A1'
                    color_on_panel_2: '#F4F4F6'
                    color_on_background: '#000000'
                    color_button_1: '#2567FF'
                    color_button_2: '#F8F8F8'
                    color_button_text_1: '#FFFFFF'
                    color_button_text_2: '#000000'
                    color_pill_text: '#111827'
                    border_radius_panel: 10
                    border_radius_buttons: 16
                    font_family: AR One Sans
                    font_weight: '400'
                    font_url: https://fonts.googleapis.com/css2?family=AR+One+Sans
                    logo_square: null
                    logo_rectangular: https://cdn.didit.me/white_label/logo_rectangular/...
                    logo_rectangular_dark: null
                    favicon: null
                    app_public_name: Acme Verify
                    privacy_policy_url: https://acme.com/privacy
                    skip_welcome_screen: true
                    disable_login_with_didit: false
                    hide_progress_bar: false
                    callback_seconds: 3
        '400':
          description: >-
            无效的请求体。例如：格式错误的十六进制颜色、未知的字体系列或粗细、仅限 Business Console
            的字段（`domain`、`from_email`、`verify_domain`、`force_remove_domain`、`verify_email_domain`、`force_remove_email_domain`
            及其只读对应字段），或者上传的 Logo 不是 PNG、JPG 或 WebP 图像、长边小于 512 px、超过 1 MB
            或宽高比错误。在配置了自定义域名的同时将 `disable_login_with_didit` 设置为 `false` 也会返回此错误。
          content:
            application/json:
              examples:
                Bad color:
                  value:
                    color_primary:
                      - >-
                        Invalid color format. Use '#RRGGBB' or '#RRGGBBAA'
                        format.
                Bad logo:
                  value:
                    image_rectangular:
                      - >-
                        Image aspect ratio must be 2:1. Got 1024x1024 image
                        dimensions
                Unsupported logo format:
                  summary: 不是 PNG、JPG 或 WebP 图像（例如 SVG）
                  value:
                    image_rectangular_dark:
                      - Upload a PNG, JPG or WebP image.
                Logo too small:
                  summary: 长边小于 512 px
                  value:
                    image_rectangular:
                      - >-
                        Image must be at least 512 px on its long side. Got
                        400x200 image dimensions
                Logo too large:
                  summary: 超过 1 MB
                  value:
                    image_square:
                      - File size should not exceed 1 MB
                Console-only field:
                  value:
                    domain:
                      - Manage this field in the Business Console.
                Bad font weight:
                  value:
                    font_weight:
                      - >-
                        Font weight 950 is not available for Inter. Available
                        weights are: 100, 200, 300, 400, 500, 600, 700, 800, 900
        '403':
          description: API 密钥缺失、格式错误、已过期或作用域属于其他应用。密钥缺失返回 `403`；密钥错误、已撤销或已过期返回 `401`。
          content:
            application/json:
              examples:
                Invalid token:
                  value:
                    detail: You do not have permission to perform this action.
        '429':
          description: 超出速率限制。请使用指数退避重试。
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X PATCH 'https://verification.didit.me/v3/customization/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"color_primary": "#123456", "font_family": "AR One Sans"}'
        - lang: curl
          label: curl (logo upload)
          source: |-
            curl -X PATCH 'https://verification.didit.me/v3/customization/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -F 'image_rectangular=@logo.png' \
              -F 'image_rectangular_dark=@logo-dark.png' \
              -F 'image_favicon=@favicon.ico'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.customization.update(
                image_rectangular=open("image_rectangular.jpg", "rb"),
                image_rectangular_dark=open("image_rectangular_dark.jpg", "rb"),
                image_favicon=open("image_favicon.jpg", "rb"),
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit, { fileFromPath } from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.customization.update({
              image_rectangular: await fileFromPath("image_rectangular.jpg"),
              image_rectangular_dark: await fileFromPath("image_rectangular_dark.jpg"),
              image_favicon: await fileFromPath("image_favicon.jpg"),
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Customization.Update(ctx, didit.CustomizationUpdateParams{\n\tImageRectangular:     didit.Some(didit.FileFromPath(\"image_rectangular.jpg\")),\n\tImageRectangularDark: didit.Some(didit.FileFromPath(\"image_rectangular_dark.jpg\")),\n\tImageFavicon:         didit.Some(didit.FileFromPath(\"image_favicon.jpg\")),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.nio.file.Path;

            import me.didit.Didit;

            import me.didit.types.CustomizationUpdateParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.customization().update(CustomizationUpdateParams.builder()
                    .imageRectangular(Path.of("image_rectangular.jpg"))
                    .imageRectangularDark(Path.of("image_rectangular_dark.jpg"))
                    .imageFavicon(Path.of("image_favicon.jpg"))
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;
            use Didit\File;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->customization->update([
                'image_rectangular' => File::fromPath('image_rectangular.jpg'),
                'image_rectangular_dark' => File::fromPath('image_rectangular_dark.jpg'),
                'image_favicon' => File::fromPath('image_favicon.jpg'),
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.customization.update(
              image_rectangular: Pathname("image_rectangular.jpg"),
              image_rectangular_dark: Pathname("image_rectangular_dark.jpg"),
              image_favicon: Pathname("image_favicon.jpg")
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await client.Customization.UpdateAsync(new
            CustomizationUpdateParams

            {
                ImageRectangular = FileUpload.FromPath("image_rectangular.jpg"),
                ImageRectangularDark = FileUpload.FromPath("image_rectangular_dark.jpg"),
                ImageFavicon = FileUpload.FromPath("image_favicon.jpg"),
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    BrandingCustomizationUpdate:
      type: object
      description: 品牌化部分更新请求体。仅提供您想要更改的字段。十六进制颜色支持 `#RRGGBB` 或 `#RRGGBBAA`。此处不接受自定义域名和白标邮箱。
      properties:
        color_primary:
          type: string
          description: 标题/主要文本颜色。
        color_secondary:
          type: string
          description: 段落 / 次要文本颜色。
        color_background:
          type: string
          description: 页面背景颜色。
        color_panel:
          type: string
          description: 面板 / 强调色。
        color_panel_10:
          type: string
          description: 10% 不透明度的面板颜色。
        color_on_panel_1:
          type: string
          description: 面板上的辅助文本颜色。
        color_on_panel_2:
          type: string
          description: 面板上的标签/徽章颜色。
        color_on_background:
          type: string
          description: 背景上的文本颜色。
        color_button_1:
          type: string
          description: 主要按钮颜色。
        color_button_2:
          type: string
          description: 次要按钮颜色。
        color_button_text_1:
          type: string
          description: 主要按钮文本颜色。
        color_button_text_2:
          type: string
          description: 次要按钮文本颜色。
        color_pill_text:
          type: string
          description: 胶囊控件、输入框和选择器的文本颜色。
        border_radius_panel:
          type: integer
          minimum: 0
          description: 面板圆角半径（像素）。
        border_radius_buttons:
          type: integer
          minimum: 0
          description: 按钮圆角半径（以像素为单位）。
        font_family:
          type: string
          description: Google Font 字体系列名称（例如 `Inter`、`AR One Sans`）。
        font_weight:
          type: string
          description: 所选字体族可用的字重（例如 `regular`、`500`、`700`）。
        app_public_name:
          type: string
          nullable: true
          description: 验证流程中显示的公开名称。
        privacy_policy_url:
          type: string
          nullable: true
          description: 向终端用户显示的隐私政策 URL。
        skip_welcome_screen:
          type: boolean
          description: 跳过初始欢迎屏幕。
        disable_login_with_didit:
          type: boolean
          description: 以访客身份继续，而非显示 Didit 登录界面。配置了自定义域名时无法设置回 `false`（400）。
        hide_progress_bar:
          type: boolean
          description: 在流程中隐藏进度条。
        callback_seconds:
          type: integer
          minimum: 0
          description: 重定向到回调 URL 前的延迟时间（秒）。
        delete_logo_square:
          type: boolean
          description: 为 `true` 时，移除当前正方形 logo。
        delete_logo_rectangular:
          type: boolean
          description: 为 `true` 时，移除当前长方形 logo。
        delete_logo_rectangular_dark:
          type: boolean
          description: >-
            为 `true` 时，移除当前的深色模式 logo，随后 `logo_rectangular_dark` 读取为 `null`。如果同一
            multipart 请求中还上传了 `image_rectangular_dark`，则以上传内容为准。
        delete_favicon:
          type: boolean
          description: 为 `true` 时，移除当前 favicon。
    BrandingCustomization:
      type: object
      description: >-
        应用的白标品牌化：颜色、字体、圆角半径、徽标 URL 和 UI/UX 选项。徽标 URL
        为只读（通过上传图片进行设置）。不包含自定义域名和白标邮件。
      properties:
        color_primary:
          type: string
        color_secondary:
          type: string
        color_background:
          type: string
        color_panel:
          type: string
        color_panel_10:
          type: string
        color_on_panel_1:
          type: string
        color_on_panel_2:
          type: string
        color_on_background:
          type: string
        color_button_1:
          type: string
        color_button_2:
          type: string
        color_button_text_1:
          type: string
        color_button_text_2:
          type: string
        color_pill_text:
          type: string
        border_radius_panel:
          type: integer
        border_radius_buttons:
          type: integer
        font_family:
          type: string
        font_weight:
          type: string
        font_url:
          type: string
          nullable: true
          description: 只读。所选字体系列解析后的 Google Fonts 样式表 URL。
        logo_square:
          type: string
          nullable: true
          description: 方形徽标的只读 URL。通过 `image_square` 上传。
        logo_rectangular:
          type: string
          nullable: true
          description: 矩形徽标的只读 URL。通过 `image_rectangular` 上传。
        logo_rectangular_dark:
          type: string
          format: uri
          nullable: true
          description: >-
            只读。暗色模式矩形徽标的临时签名 URL，显示在深色背景上。当未设置暗色徽标或您的账户不显示矩形徽标时为 `null`。通过
            `image_rectangular_dark` 上传。
        favicon:
          type: string
          nullable: true
          description: 网站图标的只读 URL。通过 `image_favicon` 上传。
        app_public_name:
          type: string
          nullable: true
        privacy_policy_url:
          type: string
          nullable: true
        skip_welcome_screen:
          type: boolean
        disable_login_with_didit:
          type: boolean
        hide_progress_bar:
          type: boolean
        callback_seconds:
          type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.