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

# AIでケースブループリントを下書きするAPI

> プロンプトから未保存のDiditケースブループリント案を生成し、ステージとケースタイプを確認してから、選択したポリシー設定を別途保存できます。

Didit のブループリント AI ドラフト API は、ポリシーの説明を、保存されていないレビューポリシーの提案に変換します。
`x-api-key` を使用し、アプリケーションに `write:cases` 権限を付与して認証してください。

## 提案を生成して確認する

空ではない `prompt` を4000文字以内で送信してください。レスポンスは `200` で、`draft` オブジェクトを返します。保存済みのブループリントやUUIDは返されません。

```json theme={null}
{"prompt": "Draft an AML review policy with triage and evidence review stages."}
```

提案には `name`、`description`、`applies_to`、`content_config`、`require_resolution_note`、`assignment_method`、`max_active_cases`、`default_deadline_hours` が含まれる場合があります。フィールドは省略されることがあるため、使用する前にレスポンスを確認してください。最上位の提案には、担当者リスト、承認設定、ルーティング参照は含まれません。

保存する前に、担当者、チーム、承認、ルーティングはご自身で選択してください。生成されたステージに `worked_by` が含まれる場合、アプリケーション内でアクティブなレビューチームのUUIDとして検証されます。ただし、提案を承認済みの割り当てとして扱わないでください。

確認後に [Create case blueprint](https://docs.didit.me/ja/management-api/case-blueprints/create.md) を使用してください。必須の `name` と、空ではない `assignee_pool` が必要です。提案を生成しても、ポリシーの下書きは保存されず、ポリシーは公開されず、既存のケースも変更されません。[保存済みの下書きと公開のライフサイクル](https://docs.didit.me/ja/console/case-management/blueprints.md#ポリシーの変更を保存して公開する) は別に管理されます。

## エラー

| ステータス | 意味 |
| - | - |
| `400` | プロンプトが未入力、空白のみ、または長すぎる |
| `401` / `403` | 認証または権限がない |
| `404` | アプリケーションが見つからない |
| `503` | 生成に失敗したか、検証に合格しなかった提案が返された。後で再試行してください |

生成に失敗した場合は、次のレスポンスが返されます:

```json theme={null}
{"detail": "A blueprint draft could not be generated. Please try again."}
```

## 関連情報

* [ケースブループリントの一覧表示](https://docs.didit.me/ja/management-api/case-blueprints/list.md)
* [ブループリントの設定とレビューポリシー](https://docs.didit.me/ja/console/case-management/blueprints.md)


## OpenAPI

````yaml ja/openapi-25.json POST /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/ai-draft/
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/organization/{organization_id}/application/{application_id}/cases/blueprints/ai-draft/:
    post:
      tags:
        - Case Blueprints
      summary: AIでケースのブループリントを下書き
      description: >-
        保存されていないブループリントの提案を生成します。write:casesが必要です。ブループリントのUUIDではなく、下書きオブジェクトを返します。ブループリントや保存済みのポリシー下書きは作成されません。提案内容を確認し、担当者、必要に応じてチーム、承認、ルーティングを選択してから、別途ブループリントを作成または更新してください。生成された内容が無効な場合、または生成に失敗した場合は503を返します。[ブループリントのAIドラフト](/ja/management-api/case-blueprints/ai-draft)
        を参照してください。
      operationId: draft_case_blueprint
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 組織のUUIDです。
        - name: application_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: アプリケーションのUUID。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaseBlueprintAiDraftRequest'
            example:
              prompt: >-
                Draft an AML review policy with triage and evidence review
                stages.
      responses:
        '200':
          description: 未保存の提案です。状態は変更されていません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaseBlueprintAiDraftResponse'
              example:
                draft:
                  name: AML review
                  applies_to:
                    - AML
                  require_resolution_note: true
                  content_config:
                    stages:
                      items:
                        - key: triage
                          label: Triage
                          sla_hours: 24
        '400':
          description: promptが未入力、空白のみ、または4000文字を超える場合です。
        '401':
          description: 認証が必要です。
        '403':
          description: write:cases権限が必要です。
        '404':
          description: アプリケーションが見つかりません。
        '503':
          description: 生成に失敗したか、無効な提案が生成されました。後で再試行してください。
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    type: string
              example:
                detail: A blueprint draft could not be generated. Please try again.
      security:
        - ApiKeyAuth: []
      x-codeSamples: []
components:
  schemas:
    CaseBlueprintAiDraftRequest:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          minLength: 1
          maxLength: 4000
          description: 提案するレビューポリシーの説明（空欄不可）。
          example: Draft an AML review policy with triage and evidence review stages.
    CaseBlueprintAiDraftResponse:
      type: object
      required:
        - draft
      properties:
        draft:
          $ref: '#/components/schemas/CaseBlueprintAiDraft'
    CaseBlueprintAiDraft:
      type: object
      additionalProperties: false
      description: 未保存で検証済みの提案です。フィールドは任意です。結果を確認し、保存する前に担当者、チーム、ルーティングを選択してください。
      properties:
        name:
          type: string
          maxLength: 24
          description: '最大24文字。例: "AML調査"。'
        description:
          type: string
          nullable: true
        content_config:
          $ref: '#/components/schemas/CaseContentConfig'
        require_resolution_note:
          type: boolean
        assignment_method:
          type: string
          enum:
            - MANUAL
            - AUTOMATIC
        max_active_cases:
          type: integer
          nullable: true
          minimum: 1
          description: 自動モードのしきい値：「このブループリントのケースの割り当てがN件未満」。
        default_deadline_hours:
          type: integer
          nullable: true
          minimum: 1
          maximum: 8760
          description: 新たにオープンされたケースのデフォルトの期限。既存のケースの期限は変更されません。
        applies_to:
          $ref: '#/components/schemas/CaseBlueprintAppliesTo'
    CaseContentConfig:
      type: object
      description: >-
        ケースのコンテンツセクションと、任意のレビューステージです。不明なセクションまたはキーは拒否されます。ケースは、開いた時点で受け入れられたポリシーのスナップショットを保持します。その後のブループリントの編集によって書き換えられることはありません。
      properties:
        checklist:
          type: object
          properties:
            enabled:
              type: boolean
            optional:
              type: boolean
              description: trueの場合、チェックリストに未完了の項目があってもケースを解決できます。
            items:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                    maxLength: 255
                  order:
                    type: integer
        aml_control:
          type: object
          properties:
            enabled:
              type: boolean
            financial:
              type: boolean
            identity:
              type: boolean
        identity:
          type: object
          properties:
            enabled:
              type: boolean
            personal_information:
              type: boolean
            applicant_tags:
              type: boolean
            contact_information:
              type: boolean
            risk_overview:
              type: boolean
            poi_documents:
              type: boolean
            poa_documents:
              type: boolean
        verifications:
          type: object
          properties:
            enabled:
              type: boolean
            summary:
              type: boolean
        reporting:
          type: object
          properties:
            enabled:
              type: boolean
            fiu_reports:
              type: boolean
        financial:
          type: object
          properties:
            enabled:
              type: boolean
            payment_methods:
              type: boolean
            transactions:
              type: boolean
        stages:
          type: object
          additionalProperties: false
          description: >-
            順序付きのレビューステージ。省略された項目または空の項目には、既定のTriage、Evidence
            review、Decisionのステージを使用します。
          properties:
            items:
              type: array
              maxItems: 10
              items:
                $ref: '#/components/schemas/CaseBlueprintStage'
              description: キーが重複しないステージは最大10件です。ケースを解決するのはステータスの変更であり、ステージではありません。
    CaseBlueprintAppliesTo:
      type: array
      maxItems: 6
      items:
        type: string
        enum:
          - GENERAL
          - VERIFICATION_REVIEW
          - BUSINESS_REVIEW
          - AML
          - TRANSACTION_MONITORING
          - DUPLICATES
      description: >-
        このブループリントが対象とするケースタイプです。作成時と更新時は省略可能です。新しいブループリントでは、既定で空のリストになります。受け入れられたケースポリシーのスナップショットに保存されます。
      example:
        - AML
    CaseBlueprintStage:
      type: object
      additionalProperties: false
      required:
        - label
      properties:
        key:
          type: string
          pattern: ^[a-z0-9_]{1,64}$
          description: ポリシー内で一意である必要があります。省略するとラベルから生成されます。解決されたキーは予約済みです。
          example: triage
        label:
          type: string
          minLength: 1
          maxLength: 64
          description: 空欄不可のステージラベル。
          example: Triage
        sla_hours:
          type: integer
          minimum: 1
          maximum: 8760
          nullable: true
          description: ステージのSLA（時間）。SLAがない場合はnull。
          example: 24
        worked_by:
          type: string
          format: uuid
          nullable: true
          description: >-
            レビューチームのUUID（任意）。null以外の値は、このアプリケーション内の有効なチームを指す必要があります。ステージのチームを設定しない場合は、省略するかnullを使用してください。
          example: a0000000-0000-4000-8000-000000000001
  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.