> ## 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.

# Document AI: カスタム書類のデータ抽出

> Didit の Document AI は最大3種類のカスタム書類を収集し、定義した項目を AI で抽出します。他のステップや独自のルールと照合して判定できます。

Document AI を使うと、決まったテンプレートに当てはまらない書類 (資金証明、給与明細、資産形成の源泉を示す書面、納税証明書など) を収集し、**あなたが** 定義した項目を正確に抽出できます。書類ごとに画面に表示するタイトルと説明 (すべての確認言語に自動で翻訳されます) と、読み取るデータ項目の一覧を設定します。Didit の AI がそれらの項目を抽出し、必要に応じて他の確認ステップと照合し、あなたのルールを適用してステータスを出します。

Document AI 連携プロンプト
        Copy prompt to clipboard



      
      

\<pre>

\`# Goal
Integrate Didit Document AI (configurable multi-document upload + AI field extraction + cross-checks) into your app.

\# Setup (Business Console or POST /v3/workflows/)
Add the DOCUMENT_AI feature to your workflow and configure:
\- document_ai_documents: up to 3 documents. Each has { document_key, title, description, fields[] }.
Each field is { key, name, instruction, type: "text" | "number" | "date", required, is_full_name }.
title and description are auto-translated into every verification language on save.
\- is_full_name: optional boolean on a field. Marks the field whose value is compared automatically against the
verified subject: on a person (KYC) workflow the document holder's full name (the ID-verification name, or the
session's expected details), and on a business (KYB) workflow the verified company name (the registry-matched
company, or the session's expected company name). A low match below document_ai_name_match_score_threshold
triggers document_ai_name_mismatch_action. At most one field per document may set it, and it is optional — a
document may mark none (no name check runs).
\- Basic rules (per-risk action DECLINE | REVIEW | NO_ACTION): document_ai_unreadable_document_action,
document_ai_missing_required_fields_action, document_ai_document_tampering_action,
document_ai_name_mismatch_action, document_ai_unsupported_file_action, document_ai_max_attempts_exceeded_action.
\- document_ai_name_match_score_threshold (0-100), document_ai_max_retry_attempts (2-5).
\- status_rules[]: custom rules on any extracted field. Reference an extracted field as document_ai.<field_key>
and cross-reference other steps with value_type:"field" (e.g. document_ai.account_holder equals kyc.full_name).

\# Flow
1\. Create a session — POST /v3/session/ with { workflow_id, vendor_data, callback }. See /sessions-api/create-session.
2\. Open session.url for the user (or mount the Web/Mobile SDK). The user uploads each configured document.
3\. The user uploads documents to POST /v3/document-ai/documents/ (handled by the hosted flow/SDK):
multipart/form-data with { document_key, document, locale? }, Session-Token auth.
Response: { valid?, next_step, document_ai_status, uploaded_document_keys[], required_document_keys[] }.
The step completes once every configured document_key is uploaded.
4\. Fetch the decision — GET /v3/session/{sessionId}/decision/ or subscribe to session.status.updated.

\# Decision surface
DOCUMENT_AI appears in the decision features[] array as { feature: "DOCUMENT_AI", node_id }.
Per-document statuses combine via precedence Declined > In Review > Approved.

\# See also
\- Report: /core-technology/document-ai/report-document-ai
\- Rules & warnings: /core-technology/document-ai/warnings-document-ai
\- Configure in the console: /console/workflows
\- Standalone API (server-to-server, no hosted UI): POST /v3/document-ai/ — /standalone-apis/document-ai`

\</pre>



      
      

Paste into

> [!NOTE]
>
> サーバー上にすでに書類がある場合は、[Document AI API](https://docs.didit.me/standalone-apis/document-ai.md) を直接呼び出してください。ファイルと項目の定義を1回の `POST /v3/document-ai/` リクエストで送信すると、抽出された項目、氏名の照合結果、ステータスが同期的に返ります。ホスト型フローは不要です。1書類あたり \$0.20。## 仕組み**1. 書類と項目を設定する**ワークフロービルダーで、最大 **3つの書類** を定義します。書類ごとに次の設定を行います。| 設定 | 説明 |
| - | - |
| **タイトルと説明** | アップロード画面でユーザーに表示されます。一度入力すれば、すべての確認言語に **自動で翻訳** されます。 |
| **抽出する項目** | 型付きの項目の一覧。各項目には、名前、AI への抽出指示、型 (`text`、`number`、`date`)、必須フラグ、任意の **氏名** マーカーを設定します。 |
| **氏名の項目** | 書類ごとに1つのテキスト項目を、照合対象の氏名として指定できます (任意)。個人 (KYC) のワークフローでは **氏名** で、確認済みの本人と照合されます。法人 (KYB) のワークフローでは **会社名** で、確認済みの会社と照合されます。不一致の場合の動作は `document_ai_name_mismatch_action` が決めます。任意項目のため、未設定のままにすると、その書類の氏名チェックは行われません。 |[テンプレート](#スターターテンプレート) から始めることも、ゼロから作成することもできます。**2. ユーザーが書類をアップロードする**ユーザーは、設定された書類ごとに1つのファイル (PDF または画像) をアップロードします。アップロードごとに独立して処理され、必須の書類がすべて提出された時点でこのステップが完了します。**3. AI による抽出**Didit は各書類を描画し、あなたの項目定義から組み立てたスキーマで視覚言語モデルを実行します。抽出された値は型付きで返され (数値は数値、日付は `YYYY-MM-DD`)、書類ごとに保存されます。PDF/EXIF のフォレンジックを実行して、改ざんを検知します。**4. 照合とルール**抽出された項目は、他のステップと照合できます。たとえば、書類の名義人の氏名を確認済みの身分証明書と照合したり、任意の項目をアンケートの回答と照合したりできます。また、**基本ルール** と **カスタムのステータスルール** にも照らされます。書類ごとの結果のステータスが組み合わされて、機能のステータスになります。## スターターテンプレートDocument AI のノードを追加するとき、タイトル、説明、型付きの項目があらかじめ入力されたテンプレートから始められます。あとから自由にカスタマイズできます。| テンプレート | 代表的な項目 |
| - | - |
| **資金証明** | 口座名義人、残高、通貨、明細の日付 |
| **収入証明 (給与明細)** | 雇用主、従業員名、総支給額/手取り額、支給期間 |
| **資産形成の源泉** | 源泉の種類、金額、日付、金融機関 |
| **税務書類** | 納税者名、課税年度、申告所得、納税者番号 |## 他のステップとの照合Document AI の項目は `document_ai.<field_key>` として参照でき、`value_type: "field"` を指定したカスタムのステータスルールを使って、完了済みの他のステップの項目と比較できます。たとえば次のようになります。- `document_ai.account_holder` が `kyc.full_name` と **equals** - 書類の名義人が確認済みの本人と一致します。
- `document_ai.balance` が `50000` より **greater\_than** - 残高が大きい場合に、レビュー対象としてフラグを立てます。一致するルールは、プラットフォームの優先順位 **Declined > In Review > Approved** に従って判定に反映されるため、ルールによって厳しさを引き上げることはできても、リスクに基づくより厳しいステータスを上書きすることはできません。[ルールと警告](https://docs.didit.me/core-technology/document-ai/warnings-document-ai.md) をご覧ください。## 書類の要件| 要件 | 詳細 |
| - | - |
| **ステップあたりの書類数** | 最大3つ。それぞれ独立して設定 |
| **対応フォーマット** | PDF、JPG、JPEG、PNG、TIFF、WebP |
| **ページ数** | 複数ページの PDF に対応 |
| **品質** | 原本または高品質のスキャン。デジタルでの編集や加工がないこと |> [!NOTE]
>
> Document AI は非構造化テキストの読み取りを行うため、書類ごとに数秒のレイテンシが発生します。Webhook はワークフローのステップ全体が完了したときにだけ送信されます。この間、判定のエンドポイントを5秒より短い間隔でポーリングしないでください。


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