> ## 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：KYCフローの編集

> DiditのKYC・KYBワークフローをAPIでプログラムから更新できます。名前の変更、機能の順序指定での置き換え、しきい値の調整に対応。従量課金で契約は不要です。



ワークフロー更新APIのプロンプト
        プロンプトをクリップボードにコピー



      
      

\<pre>

\`Update a simple Didit workflow through the Management API.

Endpoint:
PATCH https://verification.didit.me/v3/workflows/{settings_uuid}/

Authentication:
Use the x-api-key header with my Didit API key.

Requirements:
\- Use PATCH and include only the fields I want to change.
\- To rename the workflow, send workflow_label only.
\- To change workflow checks, send the full desired features array. This replaces the previous feature order and config.
\- Do not send workflow_graph, branches, actions, webhooks, or conditional logic.
\- Send features in the exact execution order.
\- Use uppercase feature values such as OCR, LIVENESS, FACE_MATCH, AML, QUESTIONNAIRE, EMAIL_VERIFICATION, PHONE_VERIFICATION, or PROOF_OF_ADDRESS.
\- Configure each feature with the fields from /management-api/workflows/feature-configs.
\- For an OCR feature, omit config.documents_allowed or send an empty object to allow every supported document type. Send config.documents_allowed only to restrict the allowed documents.
\- Keep dependency order valid. For example, put OCR before FACE_MATCH.
\- If the workflow includes QUESTIONNAIRE, use the latest questionnaire_id as config.questionnaire_uuid.

Example metadata update body:
\{
"workflow_label": "Premium KYC"
}

Example full feature replacement body:
\{
"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
  }
}
]
}

Build the API call, handle validation errors, and return the updated workflow response.`

\</pre>



      
      

貼り付け先

部分的な更新には`PATCH`を使用します。ワークフローの名前を変更する場合は、`workflow_label`のみを送信してください。```json theme={null}
{
  "workflow_label": "Premium KYC"
}
```ワークフローのチェック内容を変更するには、変更後の`features`配列全体を送信します。これにより、以前の機能の順序と設定が置き換えられます。```json theme={null}
{
  "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
      }
    }
  ]
}
```v3 APIではワークフローをシンプルに保ちます。直線的なパスが1本と、最終ステータスのステップが1つだけです。分岐、アクションノード、Webhookノードはここでは受け付けられません。## 機能設定リファレンス`PATCH`で`features`を送信すると、その配列によって以前の機能の順序と設定が置き換えられます。必須の設定はすべて改めて含めてください。`config`オブジェクトの正確な内容は機能によって異なります。フィールドの一覧、デフォルト値、必須の設定、値の範囲、例については[ワークフローの機能設定](https://docs.didit.me/ja/management-api/workflows/feature-configs.md)を参照してください。`OCR`では、`config.documents_allowed`を省略するか、`null`または`{}`を送信すると、サポートされているすべての書類タイプが許可されます。ワークフローを特定の国や書類タイプに限定したい場合にのみ含めてください。`QUESTIONNAIRE`では`config.questionnaire_uuid`が必須です。## ワークフロー設定の更新機能の一覧に触れずに、セッションレベルの設定を部分的に更新できます。変更したいフィールドのみを送信してください。| フィールド | 型 | 説明 |
| - | - | - |
| `is_white_label_enabled` | boolean | このワークフローで作成されたセッションのホワイトラベルカスタマイズを有効にします。 |
| `is_desktop_allowed` | boolean | デスクトップブラウザで認証フローを実行できるようにします。 |
| `max_retry_attempts` | integer (0–10) | 認証が却下された後に許可される再試行の最大回数です。`0`の場合、最初の却下でユーザーはブロックされます。 |
| `retry_window_days` | integer (1–365)または`null` | 再試行回数のカウントに使用する日数単位のローリングウィンドウです(`null`の場合は全期間での上限)。 |
| `session_expiration_time` | integer (3600–2419200) | 未完了のセッションが期限切れになるまでの秒数です。最小1時間、最大4週間です。 |```json theme={null}
{
  "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`として使用してください。


## OpenAPI

````yaml ja/openapi-25.json PATCH /v3/workflows/{settings_uuid}/
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/workflows/{settings_uuid}/:
    patch:
      tags:
        - Workflows
      summary: ワークフローを更新
      description: >-
        ワークフローを更新します。バージョン管理は、送信する`status`フィールドとバージョンの現在の状態によって決まります。(1)
        **公開済み**バージョンで`status`を指定しない場合→公開済みバージョンがその場で更新されます（同じ`uuid`、同じ`version`）。(2)
        **下書き**で`status`を指定しない場合→下書きが更新され、直ちに公開されます。(3) **公開済み**バージョンで`status:
        "published"`を指定した場合→同じ`workflow_id`の下に新しい公開済みバージョンが作成されて返され（新しい`uuid`、`version`
        + 1）、グループ内の既存の下書きは削除されます。(4) `status:
        "draft"`は下書きを下書きのまま保持します（自動保存）が、公開済みバージョンでは400で拒否されます（`"Cannot revert a
        published version to
        draft."`）。ボディは作成時と同じ厳格なフィールドのホワイトリストを受け付け、不明なキーは400で拒否されます。
      operationId: update_workflow
      parameters:
        - name: settings_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 更新するワークフローのバージョンごとのUUIDです。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleWorkflowUpdateRequest'
            examples:
              Replace features:
                summary: 希望する機能の順序をすべて送信します
                value:
                  features:
                    - feature: OCR
                    - feature: AML
              Rename:
                summary: ワークフローの名前を変更する
                value:
                  workflow_label: Premium KYC
              Set as default:
                summary: このワークフローをアプリケーションのデフォルトにする
                value:
                  is_default: true
              Update config:
                summary: 機能設定を変更
                value:
                  features:
                    - feature: OCR
                    - feature: LIVENESS
                      config:
                        face_liveness_method: passive
              Publish a draft:
                summary: 下書きを公開済みに昇格
                value:
                  status: published
      responses:
        '200':
          description: >-
            ワークフローが更新されました。本文は、結果として得られたバージョンの完全な設定です（`GET
            /v3/workflows/{settings_uuid}/`と同じ生の`VerificationSettings`形式）。更新によって新しいバージョンが作成された場合（公開済みの行に`status:
            "published"`を送信した場合）、返される`uuid`と`version`はパッチを適用したものとは異なります。以降の呼び出しには返された`uuid`を使用してください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowDetail'
        '400':
          description: >-
            検証エラー：許可リスト外のトップレベルキー、不明な機能、無効な順序、範囲外のしきい値、存在しないアンケートの参照、署名する書類がないまま公開される`SIGNATURE`機能、Advanced
            (AES)が利用できない状態での`signature_level:
            "aes"`の新しい`SIGNATURE`機能（`aes_not_available`。ワークフローの`signature_availability`を参照。すでに`aes`を保存しているステップはそのまま維持されます）、または公開済みバージョンに対して送信された`status:
            "draft"`（`"Cannot revert a published version to
            draft."`）。レスポンスボディは、フィールド名をキーとするDRFの検証エラーです。
        '403':
          description: APIキーがないか、無効です。
          content:
            application/json:
              examples:
                Invalid token:
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: この`settings_uuid`のワークフローが、認証されたアプリケーションに存在しません。
        '415':
          description: 'サポートされていないメディアタイプです。`Content-Type: application/json`を設定してください。'
        '429':
          description: レート制限を超過しました。指数バックオフで再試行してください。
        '500':
          description: 予期しないサーバーエラーです。安全に再試行できます。
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            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"}'
        - lang: python
          label: Python
          source: |-
            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)
        - lang: javascript
          label: Node.js
          source: >-
            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);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Workflows.Update(ctx, \"11111111-2222-3333-4444-555555555555\", didit.SimpleWorkflowUpdateRequest{\n\tFeatures: didit.Some([]didit.SimpleWorkflowFeature{{\n\t\tFeature: \"OCR\",\n\t}, {\n\t\tFeature: \"AML\",\n\t}}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            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);
        - lang: php
          label: PHP
          source: >-
            <?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());
        - lang: ruby
          label: Ruby
          source: |-
            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_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.Workflows.UpdateAsync("11111111-2222-3333-4444-555555555555",
            new SimpleWorkflowUpdateRequest

            {
                Features = new SimpleWorkflowFeature[]
                {
                    new()
                    {
                        Feature = "OCR",
                    },
                    new()
                    {
                        Feature = "AML",
                    },
                },
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    SimpleWorkflowUpdateRequest:
      type: object
      description: >-
        ワークフローのメタデータを更新するか、線形の機能リスト全体を置き換えます。厳格なフィールドホワイトリストが適用され、ここに記載されていないキーは400で拒否されます。
      properties:
        workflow_label:
          type: string
          maxLength: 50
          description: ワークフローの表示名です（最大50文字）。
        is_default:
          type: boolean
          description: このワークフローを新しいセッションのデフォルトに設定します。
        status:
          type: string
          enum:
            - draft
            - published
          description: >-
            バージョン管理を制御します。省略すると現在のバージョンがその場で更新されます（下書きは自動的に公開されます）。公開済みのバージョンに`published`を指定すると、新しいバージョンが作成されて返されます。`draft`はバージョンがまだ下書きの間のみ有効です。
        features:
          type: array
          minItems: 1
          description: 指定した場合、機能の順序と設定の全体がこの値で置き換えられます。
          items:
            $ref: '#/components/schemas/SimpleWorkflowFeature'
        is_white_label_enabled:
          type: boolean
          description: このワークフローで作成されたセッションのホワイトラベルカスタマイズを有効にします。
        is_desktop_allowed:
          type: boolean
          description: デスクトップブラウザでの認証フローの実行を許可します。
        max_retry_attempts:
          type: integer
          minimum: 0
          maximum: 10
          description: 認証が却下された後に許可される最大再試行回数です。`0`の場合、最初の却下でユーザーはブロックされます。
        retry_window_days:
          type: integer
          minimum: 1
          maximum: 365
          nullable: true
          description: 再試行回数のカウントに使用する日単位のローリングウィンドウ。`null`の場合は期間無制限の上限が適用されます。
        face_liveness_max_attempts:
          type: integer
          minimum: 1
          maximum: 3
          description: >-
            セッション1件あたりのライブネス検知の最大送信回数です。機能レベルの設定で上書きされない限り、この値は生成されるライブネス検知および年齢推定のワークフローノードにもコピーされます。
        face_match_max_attempts:
          type: integer
          minimum: 1
          maximum: 3
          description: >-
            セッション1件あたりの顔照合の最大送信回数です。機能レベルの設定で上書きされない限り、この値は生成される顔照合のワークフローノードにもコピーされます。
        session_expiration_time:
          type: integer
          minimum: 3600
          maximum: 2419200
          description: 未完了のセッションが期限切れになるまでの秒数。最小1時間（3600）、最大4週間（2419200）。
    WorkflowDetail:
      type: object
      description: >-
        以下のフィールドには型が定義されています。このオブジェクトには、ワークフロー設定のその他すべての列（機能の切り替え、しきい値、警告アクション、許可される書類、コールバック）も追加プロパティとして含まれます。`workflow_type`に該当しないフィールドは`null`です。
      properties:
        uuid:
          type: string
          format: uuid
          description: バージョンごとの識別子（`settings_uuid`）です。ワークフローの各バージョンがそれぞれ固有の値を持ちます。
        workflow_id:
          type: string
          format: uuid
          description: ワークフローのすべてのバージョンで共有される不変の識別子。これを使って作成したセッションでは、公開済みの最新バージョンが使用されます。
        workflow_label:
          type: string
          description: ワークフローの表示名。
        workflow_type:
          type: string
          nullable: true
          enum:
            - kyc
            - kyb
            - adaptive_age_verification
            - biometric_authentication
            - address_verification
            - questionnaire_verification
            - email_verification
            - phone_verification
            - null
          description: ワークフローテンプレート。テンプレートなしで作成されたグラフワークフローでは`null`です。
        is_default:
          type: boolean
          description: アプリケーションのデフォルトのワークフローかどうか。
        is_archived:
          type: boolean
          description: アーカイブ済みのワークフローでは新しいセッションを開始できません。
        version:
          type: integer
          description: ワークフロー内のバージョン番号。
        status:
          type: string
          enum:
            - draft
            - published
          description: ドラフトバージョンは編集できます。公開済みバージョンは変更できず、新しいセッションで使用されます。
        published_at:
          type: string
          format: date-time
          nullable: true
          description: このバージョンが公開された日時。下書きの場合は`null`です。
        is_simple_workflow:
          type: boolean
          description: ワークフローにカスタムの`workflow_graph`がない場合は`true`です。
        is_editable:
          type: boolean
          description: '`draft`バージョンの場合のみ`true`です。'
        workflow_url:
          type: string
          format: uri
          description: このワークフローでセッションを開始する公開URLです。
        workflow_graph:
          type: object
          nullable: true
          additionalProperties: true
          description: ワークフローのグラフ構造(ノードとエッジ)。シンプルなワークフローでは`null`です。
        features:
          type: string
          description: '有効な機能を`" + "`で連結したものです。例: `"OCR + LIVENESS"`。'
        total_price:
          type: number
          nullable: true
          description: セッション1件あたりの料金。グラフ型ワークフローでは最も高い経路の料金です。
        min_price:
          type: number
          nullable: true
          description: ワークフロー内で最も安い経路の料金。
        max_price:
          type: number
          nullable: true
          description: ワークフロー内で最も高い経路の料金。
        special_add_on_prices:
          type: object
          nullable: true
          additionalProperties: true
          description: 組織固有のアドオン料金です。設定されていない場合は`null`です。
        max_retry_attempts:
          type: integer
          description: 認証が却下された後に許可される再試行回数。
        retry_window_days:
          type: integer
          nullable: true
          description: 再試行が許可される日数。
        session_expiration_time:
          type: integer
          description: 未完了のセッションが期限切れになるまでの秒数。
        questionnaire:
          type: object
          nullable: true
          additionalProperties: true
          description: ワークフローに紐づくアンケート、または`null`です。
        kyb_role_settings:
          type: array
          items:
            type: object
            additionalProperties: true
          description: KYBの主要人物に対する役割ごとの検証設定です。
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        signature_availability:
          type: object
          description: >-
            現在署名に使用できる電子署名のレベル。`signature_level`を設定する前に確認してください。`kyc`、`kyb`、グラフワークフローで返されます。
          properties:
            simple:
              type: boolean
              description: Simpleは常に利用できます。
            aes:
              type: boolean
              description: >-
                Advanced（AES）で現在署名できるかどうかです。`false`の間は、`signature_level:
                "aes"`の新しいステップを保存しようとすると`aes_not_available`で拒否されます。
            qes:
              type: boolean
              description: Qualified（QES）で現在署名できるかどうかです。適格プロバイダーが接続されるまでは`false`です。
        is_bank_verification_enabled:
          type: boolean
          description: >-
            シンプルなKYCまたはKYBワークフローで銀行認証を実行するかどうかです。連絡先ステップ（および位置情報認証）の後、データベース検証、AML、IP分析の前に実行されます。銀行認証はまだ一般提供されていません。有効化されていない場合、オンにしようとしても拒否されます。
        bank_verification_config:
          type: object
          additionalProperties: true
          description: >-
            シンプルなワークフローの銀行口座認証設定です。`BANK_VERIFICATION`ノードと同じキー（例:
            `bank_countries`、`bank_method_order`）を受け付けます。不明なキーは破棄されます。すべてのキーは任意で、指定しないキーはデフォルト値のままとなるため、`{}`はすべてデフォルト値であることを意味します。詳細は[銀行口座認証の設定](/ja/management-api/workflows/feature-configs#銀行口座認証)を参照してください。
          example: {}
        is_geolocation_enabled:
          type: boolean
          description: >-
            シンプルなKYCワークフローで位置情報認証を実行するかどうかです。連絡先ステップの後、銀行認証とデータベース検証の前に実行されます。企業（KYB）ワークフローでは実行できません。
        geolocation_config:
          type: object
          additionalProperties: true
          description: >-
            シンプルなワークフローの位置情報検証設定で、`GEOLOCATION`ノードと同じキー（例:
            `is_geolocation_geofencing_enabled`や`geolocation_max_attempts`）を受け付けます。不明なキーは破棄されます。すべてのキーは任意で、指定しないキーはデフォルト値のままとなるため、`{}`はすべてデフォルト値を意味します。
          example: {}
      additionalProperties: true
    SimpleWorkflowFeature:
      type: object
      required:
        - feature
      properties:
        feature:
          type: string
          description: 実行する機能。ここに示す大文字の値を使用してください。
          enum:
            - OCR
            - NFC
            - LIVENESS
            - FACE_MATCH
            - PROOF_OF_ADDRESS
            - QUESTIONNAIRE
            - DOCUMENT_AI
            - PHONE_VERIFICATION
            - EMAIL_VERIFICATION
            - DATABASE_VALIDATION
            - AML
            - IP_ANALYSIS
            - AGE_ESTIMATION
            - KYB_REGISTRY
            - KYB_DOCUMENTS
            - KYB_KEY_PEOPLE
            - SIGNATURE
        config:
          type: object
          description: >-
            機能固有の設定です。`QUESTIONNAIRE`では、アンケート作成エンドポイントが返す`questionnaire_id`を`questionnaire_uuid`に指定します。`SIGNATURE`では、本番公開するワークフローに署名対象の書類が必要です。各セッションが独自の書類を持ち込めるよう`signature_documents_source`を`session`または`both`に設定するか、`status:
            "draft"`を送信して公開前に書類を追加してください。ワークフローの`signature_availability.aes`が`false`の間は、`signature_level:
            "aes"`は`aes_not_available`で拒否されます。`OCR`では、`methods`で各国が利用できる本人確認の方式（書類撮影、政府機関などの信頼できる情報源に対する書類不要の照会、デジタルIDウォレット）を選択します。省略すると、すべての国で書類撮影のみとなります。`SIGNATURE`については[電子署名の設定](/ja/management-api/workflows/feature-configs#電子署名)を参照してください。`signature_level`は現時点で`simple`（デフォルト。本人確認、メールアドレス、電話番号のいずれも不要）と`aes`を受け付けます。ワークフローの書類とそのフィールドはコンソールで管理されるため、APIでは`signature_documents_source:
            "session"`を指定してセッションごとに書類とフィールドを送信してください。
          additionalProperties: true
        label:
          type: string
          description: このワークフローノードの任意の内部ラベルです。
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        お客様のアプリケーションのAPIキーです。Business ConsoleのDevelopers -> API
        keysで取得できます。プライマリキーはフルアクセス権を持ちます。名前付きキーにはスコープを設定できます。リソースごとのアクセス権（なし、読み取り、書き込み）、一部のワークフローまたは承認済みセッションへの限定、IPアドレスのリストへの限定、有効期限の設定です。401は、キーが誤っている、失効している、または期限切れであることを意味します。403は、キーが送信されていない、キーにこのリソースやアクションへのアクセス権がない、またはIPリスト外のアドレスからリクエストが送信されたことを意味します。セッションのルートでの404は、セッションがキーのワークフローまたはステータスの対象外であることを意味します。メディアへのアクセス権がないキーでは、画像、動画、PDFのURLがnullで返されます。セッションの書き込み権限がないキーでは、セッションのリンクとトークンがnullで返されます。詳細は次を参照してください:
        https://docs.didit.me/console/api-keys

````

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