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

# Draft case blueprint with AI API

> Generate an unsaved Didit case blueprint proposal from a prompt, review its stages and case types, then save your chosen policy settings separately.

Didit's blueprint AI-draft API turns a policy description into an unsaved review-policy proposal.
Authenticate with `x-api-key` and `write:cases` permission for the application.

## Generate and review a proposal

Send a nonblank `prompt` of at most 4000 characters. The response is `200` with a `draft` object, not a saved blueprint or UUID.

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

The proposal can contain `name`, `description`, `applies_to`, `content_config`, `require_resolution_note`, `assignment_method`, `max_active_cases` and `default_deadline_hours`. Fields may be absent, so review the response before using it. The top-level proposal excludes assignee lists, approval settings and routing references.

Select assignees, teams, approvals and routing yourself before saving. If a generated stage contains `worked_by`, it is validated as an active review-team UUID in the application; do not treat a proposal as an approved assignment.

Use [Create case blueprint](https://docs.didit.me/management-api/case-blueprints/create.md) after review, including its required `name` and nonempty `assignee_pool`. Generating a proposal does not save a policy draft, publish a policy, or change existing cases. The [saved draft and publish lifecycle](https://docs.didit.me/console/case-management/blueprints.md#save-and-publish-policy-changes) is separate.

## Errors

| Status | Meaning |
| - | - |
| `400` | Missing, blank or overlong prompt |
| `401` / `403` | Missing authentication or permission |
| `404` | Application not found |
| `503` | Generation failed or returned a proposal that did not pass validation; retry later |

A generation failure returns:

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

## Related

* [List case blueprints](https://docs.didit.me/management-api/case-blueprints/list.md)
* [Blueprint settings and review policies](https://docs.didit.me/console/case-management/blueprints.md)


## OpenAPI

````yaml 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: Identity verification API. Authenticate with x-api-key header.
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: Draft case blueprint with AI
      description: >-
        Generate an unsaved blueprint proposal. Requires write:cases. Returns a
        draft object, not a blueprint UUID; no blueprint or saved policy draft
        is created. Review the proposal, choose assignees and any teams,
        approvals or routing, then create or update a blueprint separately.
        Invalid generated content or generation failure returns 503. See
        [blueprint AI drafts](/management-api/case-blueprints/ai-draft).
      operationId: draft_case_blueprint
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Organization UUID.
        - name: application_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Application 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: Unsaved proposal. No state was changed.
          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 is missing, blank or longer than 4000 characters.
        '401':
          description: Authentication is required.
        '403':
          description: write:cases permission is required.
        '404':
          description: Application not found.
        '503':
          description: Generation failed or produced an invalid proposal. Retry later.
          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: Nonblank description of the review policy to propose.
          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: >-
        Unsaved, validated proposal. Fields are optional; review the result and
        select assignees, teams and routing before saving.
      properties:
        name:
          type: string
          maxLength: 24
          description: Max 24 characters, e.g. "AML investigation".
        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: >-
            Automatic-mode threshold: "fewer than N cases of this blueprint
            assigned".
        default_deadline_hours:
          type: integer
          nullable: true
          minimum: 1
          maximum: 8760
          description: >-
            Default deadline for newly opened cases. Existing case deadlines are
            unchanged.
        applies_to:
          $ref: '#/components/schemas/CaseBlueprintAppliesTo'
    CaseContentConfig:
      type: object
      description: >-
        Case content sections and optional review stages. Unknown sections or
        keys are rejected. Cases retain the policy snapshot accepted when
        opened; later blueprint edits do not rewrite it.
      properties:
        checklist:
          type: object
          properties:
            enabled:
              type: boolean
            optional:
              type: boolean
              description: >-
                When true, a case can be resolved with incomplete checklist
                items.
            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: >-
            Ordered review stages. Omitted or empty items use the default
            Triage, Evidence review and Decision stages.
          properties:
            items:
              type: array
              maxItems: 10
              items:
                $ref: '#/components/schemas/CaseBlueprintStage'
              description: >-
                At most ten stages with distinct keys. Resolving a case is a
                status change, not a stage.
    CaseBlueprintAppliesTo:
      type: array
      maxItems: 6
      items:
        type: string
        enum:
          - GENERAL
          - VERIFICATION_REVIEW
          - BUSINESS_REVIEW
          - AML
          - TRANSACTION_MONITORING
          - DUPLICATES
      description: >-
        Case types this blueprint describes. Optional on create and update; new
        blueprints default to an empty list. Stored in the accepted case policy
        snapshot.
      example:
        - AML
    CaseBlueprintStage:
      type: object
      additionalProperties: false
      required:
        - label
      properties:
        key:
          type: string
          pattern: ^[a-z0-9_]{1,64}$
          description: >-
            Unique within the policy. Omit to derive from the label. The key
            resolved is reserved.
          example: triage
        label:
          type: string
          minLength: 1
          maxLength: 64
          description: Nonblank stage label.
          example: Triage
        sla_hours:
          type: integer
          minimum: 1
          maximum: 8760
          nullable: true
          description: Stage SLA in hours, or null for no SLA.
          example: 24
        worked_by:
          type: string
          format: uuid
          nullable: true
          description: >-
            Optional review-team UUID. A non-null value must identify an active
            team in this application. Omit or use null for no stage team.
          example: a0000000-0000-4000-8000-000000000001
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is wrong, revoked or expired; 403 means no key was sent,
        the key has no access to this resource or action, or the request came
        from an address outside its IP list; 404 on a session route means the
        session is outside the key's workflows or statuses. A key without media
        access receives image, video and PDF URLs as null, and a key without
        sessions write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.

````

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