{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zyphe-com/json-schema/zyphe-com-kyb-result-schema.json",
  "title": "KybResult",
  "description": "The legacy KYB result: a KYB case in the format used before KYB cases existed.\n\n**Deprecated.** Still returned by the flow-result, verification-request and KYB endpoints and\nby `LEGACY_V1` webhooks, unchanged. Its `id` is the id of its KYB case: to migrate, read the case\nat `/sdk/organizations/{organizationId}/kyb-cases/{id}`, or use the `kybCase` field of a `V2`\nwebhook.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zyphe-com-openapi.json#/components/schemas/KybResult",
  "type": "object",
  "required": [
    "id",
    "status",
    "pepAndSanctionsStatus"
  ],
  "properties": {
    "assignedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "assignedToIdentityId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "businessInfoRequiredFields": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/BusinessInfoField"
      },
      "description": "The business information the case must have: the keys its KYB step's business-details form\nrequired. `None` when not recorded, or not loaded: every field. Set by callers that read\nthe case, like `document_checks`."
    },
    "businessInformation": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/BusinessInformation"
        }
      ]
    },
    "businessInformationVerification": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "$ref": "#/$defs/BusinessInfoFieldVerification"
      },
      "propertyNames": {
        "type": "string"
      }
    },
    "createdAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "directorDefinitions": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/DirectorDefinition"
      }
    },
    "documentChecks": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/KybDocumentCheckSummary"
      },
      "description": "One entry per uploaded document of the latest cross-check, with the status of every\ndocument check (acceptance rules first among them). Populated on the same reviewer-facing\nreads as `effective_required_documents`; `None` elsewhere and before any cross-check ran."
    },
    "documentUploads": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/DocumentUpload"
      }
    },
    "effectiveRequiredDocuments": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/KybCountryDocument"
      },
      "description": "The effective list of required KYB documents for this result's country.\n\nResolved by `KybDocumentCatalog::resolve_for_country` using the full\npriority chain: platform DB definitions → org-admin `custom_country_documents`\n→ global legacy fields. `None` until explicitly set by a caller with DB access\n(e.g. the MCP `get_kyb_result` tool). Not computed in the `From` conversion."
    },
    "flowStep": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/FlowStep"
        }
      ]
    },
    "flowStepId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "formAnswers": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/KybFormAnswer"
      },
      "description": "The answers to the organization's own business-details questions, in the order its form\nasks them: fields of the case like the business information, compared and clarified under\ntheir key (`form.<name>`). `None` when not loaded; set by callers that read the case, like\n`document_checks`."
    },
    "fundedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "metadata": {
      "type": "object",
      "description": "Admin-curated metadata. Organizations read it; only admins write it.\nEmpty (`{}`) when nothing has been recorded."
    },
    "nextAction": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/NextAction"
        }
      ]
    },
    "pepAndSanctionsStatus": {
      "$ref": "#/$defs/PepAndSanctionsStatus"
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "report": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "$ref": "#/$defs/ModerationResultStatus"
    },
    "uboDefinitions": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/UboDefinition"
      }
    },
    "updatedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "verificationRequestId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    }
  },
  "deprecated": true,
  "$defs": {
    "ActionConfig": {
      "oneOf": [
        {
          "type": "object",
          "description": "Set the status of a verification result.\nThe target step is automatically inferred from the most recent DV/Liveness result.",
          "required": [
            "value",
            "actionType"
          ],
          "properties": {
            "actionType": {
              "type": "string",
              "enum": [
                "setStatus"
              ]
            },
            "value": {
              "$ref": "#/$defs/ActionStatus",
              "description": "The new status value."
            }
          }
        },
        {
          "type": "object",
          "description": "Route execution to another flow based on conditions.",
          "required": [
            "target_flow_id",
            "actionType"
          ],
          "properties": {
            "actionType": {
              "type": "string",
              "enum": [
                "flowRouter"
              ]
            },
            "target_flow_id": {
              "type": "string",
              "format": "uuid",
              "description": "The target flow ID to route to."
            }
          }
        },
        {
          "type": "object",
          "description": "Assign custom risk tags to the current flow result.\nTags are stored on the FlowResult and included in the next risk score computation.",
          "required": [
            "tag_ids",
            "actionType"
          ],
          "properties": {
            "actionType": {
              "type": "string",
              "enum": [
                "assignRiskTags"
              ]
            },
            "tag_ids": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              },
              "description": "IDs of the RiskTagWeight rows (must belong to this org or be global)."
            }
          }
        }
      ],
      "description": "Configuration for an action node.\n\nEach variant represents a different action type with its specific configuration."
    },
    "ActionStatus": {
      "type": "string",
      "description": "Status values that can be set via workflow actions.\n\nThis enum represents the possible status values that can be set\nvia the SetStatus action in workflow nodes.",
      "enum": [
        "REQUIRES_MANUAL_REVIEW"
      ]
    },
    "AgentResearchTerms": {
      "type": "object",
      "description": "What an organization allows the reviewer to research, per flow.\n\nOff until an organization turns it on, under a platform ceiling read at each run and never\npinned into a manifest — a limit an organization lowers takes effect on the next run, not on the\nnext case.",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "`false` — the default — means no research is attempted at all, whatever the limits say."
        },
        "maxSearches": {
          "type": "integer",
          "format": "int32",
          "description": "The most hosted searches one run may issue. `0` turns the web search off while leaving the\npurchased tools on.",
          "minimum": 0
        },
        "spendLimit": {
          "type": "integer",
          "format": "int32",
          "description": "The most, in CREDITS, one run may spend buying answers. `0` is a real setting: research\nthat adopts what the organization already holds and buys nothing.",
          "minimum": 0
        }
      }
    },
    "AutoOneClickKycConfig": {
      "type": "object",
      "required": [
        "partnerConfigs"
      ],
      "properties": {
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "partnerConfigs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AutoOneClickPartnerConfig"
          },
          "description": "Partner flow configurations with step type hints"
        },
        "partnerFlows": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Flow"
          },
          "description": "Full partner flow objects (populated by rehydrate_flow_step)"
        }
      }
    },
    "AutoOneClickPartnerConfig": {
      "type": "object",
      "description": "Configuration for a single partner flow in auto one-click",
      "required": [
        "flowId"
      ],
      "properties": {
        "flowId": {
          "type": "string",
          "format": "uuid",
          "description": "The partner flow ID"
        },
        "targetStepTypes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FlowStepType"
          },
          "description": "Which step types to attempt one-click for in this partner flow\nIf empty, defaults to [Dv]"
        }
      }
    },
    "BranchCondition": {
      "type": "object",
      "description": "A condition branch for switch operators.",
      "required": [
        "condition",
        "label"
      ],
      "properties": {
        "condition": {
          "$ref": "#/$defs/Condition",
          "description": "The condition to evaluate."
        },
        "label": {
          "type": "string",
          "description": "The label of the edge to follow if this condition matches."
        }
      }
    },
    "BusinessInfoDisagreementSource": {
      "type": "string",
      "description": "Source that can participate in a business information field disagreement.",
      "enum": [
        "submitted",
        "document",
        "catalog"
      ]
    },
    "BusinessInfoField": {
      "type": "string",
      "description": "A business-information key a form field answers.\n\nThe country (and the US state) come from the company lookup, and the contact email from the\napplicant's own email, so no field is bound to them. The address is one place field, which\nyields the street address, the city and the postcode.",
      "enum": [
        "companyName",
        "registrationNumber",
        "companyType",
        "address",
        "incorporationDate",
        "businessActivity"
      ]
    },
    "BusinessInfoFieldVerification": {
      "type": "object",
      "description": "Per-field verification result comparing submitted business info against document-extracted values.",
      "required": [
        "matchType"
      ],
      "properties": {
        "agentReasoning": {
          "type": [
            "string",
            "null"
          ],
          "description": "The AI agent's one-sentence explanation of why this match classification was chosen.\nPresent only when the agent was invoked (i.e. an LLM cross-check was performed)."
        },
        "catalogSource": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/RegisterFieldSource",
              "description": "Where the register read `catalogValue`; present whenever `catalogValue` is."
            }
          ]
        },
        "catalogValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "The value extracted from the company catalog API."
        },
        "disagreementSources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BusinessInfoDisagreementSource"
          },
          "description": "Sources that disagree with one another for this field."
        },
        "documentSources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DocumentFieldSource"
          },
          "description": "Every persisted observation used for this field, including conflicting documents."
        },
        "documentValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "The value extracted from the uploaded document(s)."
        },
        "matchType": {
          "$ref": "#/$defs/BusinessInfoMatchType",
          "description": "Whether the submitted value matches the document value."
        },
        "reviewerVerdict": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/ReviewerFieldVerdict",
              "description": "The verdict a reviewer gave this field by hand. While the field still holds the value they\njudged, a new comparison keeps it as `matchType`; once the value changes, the comparison's own\nverdict replaces it."
            }
          ]
        },
        "submittedValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user-submitted value for this field."
        },
        "suggestedValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "The canonical corrected value recommended by the AI agent.\nWhen a suggested value is safely applied, `run_business_info_cross_check` stores the field\nas `AutoCorrect`. `Mismatch` and `NotFound` suggestions are surfaced for manual review\nwithout mutating the stored record."
        }
      }
    },
    "BusinessInfoMatchType": {
      "type": "string",
      "description": "Match type for a single business information field against document-extracted values.",
      "enum": [
        "match",
        "autoCorrect",
        "fuzzy",
        "mismatch",
        "notFound"
      ]
    },
    "BusinessInformation": {
      "type": "object",
      "required": [
        "contactEmail",
        "companyName",
        "registrationNumber",
        "companyType",
        "country",
        "address",
        "city",
        "postZipCode",
        "businessActivity",
        "incorporationDate"
      ],
      "properties": {
        "address": {
          "type": "string"
        },
        "businessActivity": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "companyName": {
          "type": "string"
        },
        "companyType": {
          "type": "string"
        },
        "contactEmail": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "incorporationDate": {
          "type": "string"
        },
        "postZipCode": {
          "type": "string"
        },
        "registrationNumber": {
          "type": "string"
        },
        "subdivision": {
          "type": [
            "string",
            "null"
          ],
          "description": "The state or region the company is registered in, as the subdivision part of its ISO\n3166-2 code without the country prefix (for example `\"DE\"` for Delaware or `\"NY\"` for New\nYork), read together with `country`. Required only where company registers are regional\nrather than national (currently the US); absent for every other country."
        }
      }
    },
    "ClientOutreachMode": {
      "type": "string",
      "description": "Whether the agent may ask the customer for missing documents or information itself.\n\n- `OFF`: the agent never prepares a request; a review that needs one escalates to a person,\n  with what is missing in its rationale.\n- `DRAFT`: the agent prepares the request (what to ask for, and the message) and leaves it for a\n  person, who sends it from the Inbox.\n- `AUTO`: the agent sends the request itself, within the number of requests the organization\n  allows per alert or case (`maxClarificationRounds`).",
      "enum": [
        "OFF",
        "DRAFT",
        "AUTO"
      ]
    },
    "Condition": {
      "type": "object",
      "title": "Condition",
      "description": "A workflow condition expression (internal workflow-engine structure)."
    },
    "CountriesFilter": {
      "type": "object",
      "required": [
        "accepted",
        "blocked"
      ],
      "properties": {
        "accepted": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "blocked": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "DirectorDefinition": {
      "type": "object",
      "required": [
        "firstName",
        "lastName"
      ],
      "properties": {
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "Nationality of the director. Absent when the company register reported none."
        },
        "dateOfBirth": {
          "type": [
            "string",
            "null"
          ],
          "description": "Date of birth of the director. Often absent for a director taken from a company register,\nsince registers list officers without identity details; such a director is screened on name\nalone."
        },
        "emailAddress": {
          "type": [
            "string",
            "null"
          ],
          "description": "Email of the director. `None` for a name-only director added without an email."
        },
        "firstName": {
          "type": "string"
        },
        "gender": {
          "type": [
            "string",
            "null"
          ],
          "description": "Gender of the director. Absent for any director taken from a company register (registers do\nnot publish gender); collected only when the director is entered by hand."
        },
        "id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Stable identifier for this director within the KYB result, used to address the director\n(for example to remove or screen them). Absent only on directors recorded before identifiers\nwere introduced."
        },
        "lastName": {
          "type": "string"
        }
      }
    },
    "DocauthCheck": {
      "type": "string",
      "description": "A document-authenticity check that can be enabled on a document-verification step. Each check\nis enabled independently; see each value for what it detects and how a failure affects the\nresult.",
      "enum": [
        "SCREEN_REPLAY",
        "PORTRAIT_GENDER",
        "PORTRAIT_AGE"
      ]
    },
    "DocscanLlmModel": {
      "type": "string",
      "description": "AI vision model used to extract data from scanned documents on a document-verification step.\nSelectable by Zyphe administrators.",
      "enum": [
        "KIMI_K2_5",
        "QWEN3_VL",
        "UNKNOWN"
      ]
    },
    "DocumentFieldSource": {
      "type": "object",
      "description": "A document observation used by a cross-check. Legacy observations have no extraction ID.",
      "required": [
        "value"
      ],
      "properties": {
        "extractionId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "fieldPath": {
          "type": [
            "string",
            "null"
          ],
          "description": "Where the value sits in the extraction's data, as a JSON pointer (`/companyName`,\n`/formAnswers/<name>`): the evidence quoting it carries the same path. Absent for a legacy\nobservation and for one recorded before the platform kept it."
        },
        "value": {
          "type": "string"
        }
      }
    },
    "DocumentSelectionConfig": {
      "type": "object",
      "required": [
        "countriesFilter",
        "documentTypesFilter",
        "enabledGovernmentProviders"
      ],
      "properties": {
        "allowedDocumentsPerCountry": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "countriesFilter": {
          "$ref": "#/$defs/CountriesFilter"
        },
        "documentTypesFilter": {
          "$ref": "#/$defs/DocumentTypeFilter"
        },
        "documentTypesFilterPerCountry": {
          "type": [
            "object",
            "null"
          ],
          "description": "Optional per-country overrides for the document-type filter.\n\nKeys are ISO 3166-1 alpha-2 country codes. When a country is present here, its\n`DocumentTypeFilter` fully overrides `document_types_filter` for that country\n(no union/intersection). An explicit empty entry rejects the country entirely\n(the country gate fails, not just the document-type gate).\n\nThe custom deserializer validates each key via `CountryInfo::from_any_country_code`\nand normalises the stored key to its `iso_alpha_2` upper-case form.",
          "additionalProperties": {
            "$ref": "#/$defs/DocumentTypeFilter"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "enabledGovernmentProviders": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/SpidDocumentType"
            }
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        }
      }
    },
    "DocumentTypeFilter": {
      "type": "object",
      "required": [
        "types"
      ],
      "properties": {
        "types": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "DocumentUpload": {
      "type": "object",
      "required": [
        "filename"
      ],
      "properties": {
        "documentType": {
          "type": [
            "string",
            "null"
          ]
        },
        "filename": {
          "type": "string"
        },
        "presignedUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "s3Key": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "DvCapture": {
      "type": "object",
      "description": "What a document-capture session can do. `capture` is the capture mode; `usesProxy` is `true`\nwhen the capture surface talks to the identity-verification provider through Zyphe's proxy;\n`providesLiveness` and `providesAuthenticity` are `true` when the session itself performs the\nliveness check and the document-authenticity check. When `false`, the session does not: a check\nruns only if the flow has one of its own, a liveness step or the step's `docauthChecks`, which\nare empty by default.\n\n`acceptedCaptures` lists every submission `process-dv-document` takes for this attempt: the\ncapture mode above, plus `DIRECT` whenever the provider can process an uploaded image. The\ncapture mode is what Zyphe's own web app renders; `acceptedCaptures` is what a backend-only\nintegrator reads to learn it may post `images` against a `SESSION` attempt. The two flags\nabove describe the capture mode, not an upload: a `DIRECT` submission to a `SESSION` attempt\nskips whatever selfie and capture-time checks that session performs (`providesLiveness`), so\nthe flow's own liveness step is the one that counts.",
      "required": [
        "capture",
        "usesProxy",
        "providesLiveness",
        "providesAuthenticity"
      ],
      "properties": {
        "acceptedCaptures": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DvCaptureMode"
          }
        },
        "capture": {
          "$ref": "#/$defs/DvCaptureMode"
        },
        "providesAuthenticity": {
          "type": "boolean"
        },
        "providesLiveness": {
          "type": "boolean"
        },
        "usesProxy": {
          "type": "boolean"
        }
      }
    },
    "DvCaptureMode": {
      "type": "string",
      "description": "How a provider is driven for one attempt.",
      "enum": [
        "DIRECT",
        "SESSION"
      ]
    },
    "DvConfig": {
      "type": "object",
      "required": [
        "minimumAge"
      ],
      "properties": {
        "amlAgenticMode": {
          "oneOf": [
            {
              "$ref": "#/$defs/KybAgenticMode",
              "description": "Agentic AML-review mode for the person AML screening this DV step triggers\n(`DISABLED` | `SUGGEST` | `AUTO_PILOT`). Per-flow, mirroring `KybConfig.agentic_mode`:\nthe AML review dispatcher resolves the mode from the screening's originating step, so\neach flow controls its own AML autonomy rather than a deployment-wide switch."
            }
          ],
          "default": "DISABLED"
        },
        "capture": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/DvCapture",
              "description": "This attempt's resolved capability descriptor — capture mode, proxy, liveness, authenticity\n— so the frontend knows which capture path to render without ever seeing which provider\nproduced it.\n\nA per-attempt value, not a per-flow one: it is derived from the verification request's\nresolved ladder rung, so it is injected only into the VR-scoped `next-step` response, never\npersisted on this config, and never present on the cached full-flow response — a per-attempt\nvalue cannot live in a per-flow cache."
            }
          ]
        },
        "docauthChecks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DocauthCheck"
          },
          "description": "Additional document-authenticity checks to run on this step's scans. Empty by default\n(no additional checks). `SCREEN_REPLAY` fails the scan on a replay verdict; the portrait\nchecks only lower the document score. Configured by Zyphe administrators; ignored when the\nidentity-verification provider in use supplies its own authenticity checks or none."
        },
        "documentSelectionStepId": {
          "type": "string",
          "format": "uuid"
        },
        "incodeConfigurationId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Provider configuration ID the frontend must use when creating the document-capture session\nwith the identity-verification provider. Set by the server when the step is served; absent\nwhen the provider in use does not need one. Do not set it yourself."
        },
        "kycValiditySeconds": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64",
          "description": "How long (in seconds) a successful DV result remains valid before\nre-KYC is required. `None` = never expires (existing behaviour)."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "llmModel": {
          "$ref": "#/$defs/DocscanLlmModel",
          "description": "AI vision model used to extract data from scanned documents. Uses the default model when\nomitted."
        },
        "maxAttempts": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "minimum": 0
        },
        "minimumAge": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "poaFromGovcheck": {
          "type": "boolean",
          "description": "When true, the scanned driver's license is validated against government records and, after\nthe document scan, a proof-of-address result is produced from the validated address.\nDefaults to `false`. Only supported by some identity-verification providers; ignored\notherwise."
        },
        "processImagesOverrides": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/ProcessImagesOverrides"
            }
          ]
        },
        "requiredDocumentFields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RequiredDocumentField"
          }
        },
        "reverificationLeadSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64",
          "description": "How long (in seconds) *before* a result's expiry to begin re-verification: the flow is\nreopened and a reminder email is sent, so the holder can renew while their current result is\nstill valid. Defaults to one week (604800) when omitted. Ignored when\n`kycValiditySeconds` is not set; capped at the validity period."
        },
        "thresholds": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": "number",
            "format": "float"
          },
          "propertyNames": {
            "type": "string",
            "enum": [
              "documentScorePercent"
            ]
          }
        }
      }
    },
    "FactorKey": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "value",
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "fixed"
              ]
            },
            "value": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "answerValue"
              ]
            }
          }
        }
      ],
      "description": "A FORM factor key: a fixed string, or the submitted answer value itself (so each distinct\nanswer maps to its own FORM factor — e.g. a country select).\n\n`AnswerValue` on a `Select` field authors one `ScoreFactor` row per enumerated\n`SelectOptions.values` entry at form-sync time (`form_risk_sync::DesiredRisk::from_sections`),\nsharing the factor's multiplier, so any of those answers resolves to a real multiplier at\nscore time.\n\n**Remaining gap (D-13):** a field has no enumerable option set to author against when it is\nnot a `Select` (e.g. free-text `Text`), or when it is a `Select` with `isOtherAllowed: true`\nand the submitted answer is the free-text \"Other\" value. In those cases the emitted\n`AnswerValue` key in `FormResult.riskFactorKeys` has no matching `ScoreFactor` row, the score-time\nlookup returns `None`, and the factor's multiplier is silently skipped (undercounting the\ncontextual multiplier). Form-sync logs a warning when this applies to a saved field."
    },
    "FieldRiskConfig": {
      "type": "object",
      "description": "Risk authoring attached to a single form field (compiled to Forms-source score rows on save).",
      "properties": {
        "factors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FieldRiskFactor"
          }
        },
        "tags": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FieldRiskTag"
          }
        }
      }
    },
    "FieldRiskFactor": {
      "type": "object",
      "required": [
        "key",
        "multiplier"
      ],
      "properties": {
        "definitionKey": {
          "type": [
            "string",
            "null"
          ],
          "description": "Target ScoreDefinition key. None = \"forms\" (100% backward compatible)."
        },
        "key": {
          "$ref": "#/$defs/FactorKey"
        },
        "multiplier": {
          "type": "number",
          "format": "double"
        },
        "when": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Condition"
            }
          ]
        }
      }
    },
    "FieldRiskTag": {
      "type": "object",
      "required": [
        "tag",
        "weight"
      ],
      "properties": {
        "definitionKey": {
          "type": [
            "string",
            "null"
          ],
          "description": "Target ScoreDefinition key. None = \"forms\" (100% backward compatible)."
        },
        "tag": {
          "type": "string"
        },
        "weight": {
          "type": "number",
          "format": "double"
        },
        "when": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Condition",
              "description": "Gate on this field's answer; `None` = emit whenever the field is answered."
            }
          ]
        }
      }
    },
    "FileOptions": {
      "type": "object",
      "required": [
        "accept",
        "expectedDocumentType"
      ],
      "properties": {
        "accept": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "expectedDocumentType": {
          "type": "string"
        },
        "maxCountUploads": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    },
    "Flow": {
      "type": "object",
      "required": [
        "id",
        "name",
        "slug",
        "successUrl",
        "steps",
        "jdm",
        "aiChatbotEnabled",
        "isTemplate"
      ],
      "properties": {
        "aiChatbotEnabled": {
          "type": "boolean",
          "description": "Whether the verification failure screen offers the AI support chatbot."
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "failureUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "isTemplate": {
          "type": "boolean",
          "description": "The flow backs a flow template: it is edited in the builder but never published, started or\nlisted, only copied. The dashboard shows it as a template and hides what only applies to a\nlive flow."
        },
        "jdm": {
          "$ref": "#/$defs/WorkflowGraph"
        },
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "steps": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FlowStep"
          }
        },
        "successUrl": {
          "type": "string"
        },
        "themeId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The theme this flow renders with; `None` means use the org default theme."
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "FlowStep": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/DvConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "DV"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/FormConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "FORM"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/PoaConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "POA"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/KybConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "KYB"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/SpidConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "SPID"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/PhoneConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "PHONE"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/WalletConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "WALLET"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/LivenessConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "LIVENESS"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/AutoOneClickKycConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "AUTO_ONE_CLICK_KYC"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/DocumentSelectionConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "DOCUMENT_SELECTION"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/GeolocationConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "GEOLOCATION"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/KybDocumentsConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "KYB_DOCUMENTS"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/KybUbosConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "KYB_UBOS"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "slug",
            "config",
            "flowId",
            "order",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/KybDirectorsConfig"
            },
            "createdAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failureUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "flowId": {
              "type": "string",
              "format": "uuid"
            },
            "gotoStepId": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string"
            },
            "order": {
              "type": "integer",
              "format": "int32"
            },
            "slug": {
              "type": "string"
            },
            "successUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "KYB_DIRECTORS"
              ]
            },
            "updatedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        }
      ]
    },
    "FlowStepType": {
      "type": "string",
      "enum": [
        "DV",
        "FORM",
        "POA",
        "KYB",
        "SPID",
        "PHONE",
        "WALLET",
        "LIVENESS",
        "AUTO_ONE_CLICK_KYC",
        "DOCUMENT_SELECTION",
        "GEOLOCATION",
        "KYB_DOCUMENTS",
        "KYB_UBOS",
        "KYB_DIRECTORS"
      ]
    },
    "ForensicsSignalCode": {
      "type": "string",
      "description": "What a pixel-forensics signal is evidence of.",
      "enum": [
        "SCREEN_RECAPTURE",
        "PRINT_RECAPTURE",
        "RECAPTURE",
        "SECOND_GENERATION",
        "ELA_CLUSTERED_REGION"
      ]
    },
    "Form": {
      "type": "object",
      "required": [
        "id",
        "organizationId",
        "name",
        "sections"
      ],
      "properties": {
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "organizationId": {
          "type": "string",
          "format": "uuid"
        },
        "sections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormSection"
          }
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "FormConfig": {
      "type": "object",
      "required": [
        "formId"
      ],
      "properties": {
        "form": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Form"
            }
          ]
        },
        "formId": {
          "type": "string",
          "format": "uuid"
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "oneClickMaxAgeSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64"
        }
      }
    },
    "FormItem": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "content",
            "type"
          ],
          "properties": {
            "content": {
              "$ref": "#/$defs/InputField"
            },
            "type": {
              "type": "string",
              "enum": [
                "InputField"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "content",
            "type"
          ],
          "properties": {
            "content": {
              "$ref": "#/$defs/Plaintext"
            },
            "type": {
              "type": "string",
              "enum": [
                "Plaintext"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "Separator"
              ]
            }
          }
        }
      ]
    },
    "FormSection": {
      "type": "object",
      "required": [
        "name",
        "label",
        "items"
      ],
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormItem"
          }
        },
        "label": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "name": {
          "type": "string"
        }
      }
    },
    "GeolocationConfig": {
      "type": "object",
      "properties": {
        "ipValidation": {
          "type": "boolean"
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "locationCrossCheck": {
          "type": "boolean"
        },
        "vpnDetection": {
          "type": "boolean"
        }
      }
    },
    "InputField": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "label",
            "name",
            "options",
            "type"
          ],
          "properties": {
            "binding": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/BusinessInfoField",
                  "description": "The business-information key this field answers, in a KYB step's business-details\nform. Meaningless in any other form."
                }
              ]
            },
            "label": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "name": {
              "type": "string"
            },
            "options": {},
            "requiredWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition",
                  "description": "Condition that determines whether this field is required.\nWhen absent, the field is not required.\nMust be a valid Condition JSON object (see workflow engine Condition schema)."
                }
              ]
            },
            "risk": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/FieldRiskConfig"
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "date"
              ]
            },
            "value": {},
            "visibleWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition",
                  "description": "Condition that determines whether this field is visible.\nWhen absent, the field is always visible."
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "label",
            "name",
            "options",
            "type"
          ],
          "properties": {
            "binding": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/BusinessInfoField",
                  "description": "The business-information key this field answers, in a KYB step's business-details\nform. Meaningless in any other form."
                }
              ]
            },
            "label": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "name": {
              "type": "string"
            },
            "options": {},
            "requiredWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            },
            "risk": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/FieldRiskConfig"
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "text"
              ]
            },
            "validationRegex": {
              "type": [
                "string",
                "null"
              ],
              "description": "Optional regex pattern validated against the submitted value.\nWritten by the platform admin at form-build time; both frontend and\nbackend validate against it on submission."
            },
            "value": {},
            "visibleWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "label",
            "name",
            "options",
            "type"
          ],
          "properties": {
            "binding": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/BusinessInfoField",
                  "description": "The business-information key this field answers, in a KYB step's business-details\nform. Meaningless in any other form."
                }
              ]
            },
            "label": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "name": {
              "type": "string"
            },
            "options": {},
            "requiredWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            },
            "risk": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/FieldRiskConfig"
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "number"
              ]
            },
            "validationRegex": {
              "type": [
                "string",
                "null"
              ],
              "description": "Optional regex pattern validated against the stringified submitted number."
            },
            "value": {},
            "visibleWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "label",
            "name",
            "options",
            "type"
          ],
          "properties": {
            "binding": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/BusinessInfoField",
                  "description": "The business-information key this field answers, in a KYB step's business-details\nform. Meaningless in any other form."
                }
              ]
            },
            "label": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "name": {
              "type": "string"
            },
            "options": {},
            "requiredWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            },
            "risk": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/FieldRiskConfig"
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "textarea"
              ]
            },
            "validationRegex": {
              "type": [
                "string",
                "null"
              ],
              "description": "Optional regex pattern validated against the submitted value."
            },
            "value": {},
            "visibleWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "label",
            "name",
            "options",
            "type"
          ],
          "properties": {
            "binding": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/BusinessInfoField",
                  "description": "The business-information key this field answers, in a KYB step's business-details\nform. Meaningless in any other form."
                }
              ]
            },
            "label": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "name": {
              "type": "string"
            },
            "options": {},
            "requiredWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            },
            "risk": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/FieldRiskConfig"
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "checkbox"
              ]
            },
            "value": {},
            "visibleWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "label",
            "name",
            "options",
            "type"
          ],
          "properties": {
            "binding": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/BusinessInfoField",
                  "description": "The business-information key this field answers, in a KYB step's business-details\nform. Meaningless in any other form."
                }
              ]
            },
            "label": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "name": {
              "type": "string"
            },
            "options": {
              "$ref": "#/$defs/FileOptions"
            },
            "requiredWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            },
            "risk": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/FieldRiskConfig"
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "file"
              ]
            },
            "value": {},
            "visibleWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "label",
            "name",
            "options",
            "optionLabels",
            "type"
          ],
          "properties": {
            "binding": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/BusinessInfoField",
                  "description": "The business-information key this field answers, in a KYB step's business-details\nform. Meaningless in any other form."
                }
              ]
            },
            "label": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "name": {
              "type": "string"
            },
            "optionLabels": {
              "type": "object",
              "description": "Option labels for select fields: maps option value/UUID to localized labels",
              "additionalProperties": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "options": {
              "$ref": "#/$defs/SelectOptions"
            },
            "requiredWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            },
            "risk": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/FieldRiskConfig"
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "select"
              ]
            },
            "value": {},
            "visibleWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "label",
            "name",
            "options",
            "type"
          ],
          "properties": {
            "binding": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/BusinessInfoField",
                  "description": "The business-information key this field answers, in a KYB step's business-details\nform. Meaningless in any other form."
                }
              ]
            },
            "label": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "name": {
              "type": "string"
            },
            "options": {},
            "requiredWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            },
            "risk": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/FieldRiskConfig"
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "place"
              ]
            },
            "value": {},
            "visibleWhen": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition"
                }
              ]
            }
          }
        }
      ]
    },
    "KybAgenticMode": {
      "type": "string",
      "description": "How much the automated compliance review agent may do on its own (used for KYB and AML reviews).\n`DISABLED` (default): the agent does not run. `SUGGEST`: the agent reviews and records its\nrecommended approve/clear action as a suggestion for a human to act on. `AUTO_PILOT`: the agent\nmay take that action itself, subject to the platform's safety checks.",
      "enum": [
        "DISABLED",
        "SUGGEST",
        "AUTO_PILOT"
      ]
    },
    "KybCaseOrchestratorKind": {
      "type": "string",
      "description": "Which planner a manifest pins (OrchestrationSpec.kind). Mirrors the `kyb_case_orchestration_decision_kind_check` DB CHECK vocabulary.",
      "enum": [
        "LINEAR",
        "JDM",
        "LLM"
      ]
    },
    "KybCasePlannerMode": {
      "type": "string",
      "description": "How a planner runs.\n\nFor the AI planner, which never orders runs, the mode says what becomes of what it proposes:\nnothing (`DISABLED`, it is not asked), a reviewer's decision (`SUGGEST`), or acceptance by the\nengine itself (`AUTO_PILOT`). Autopilot applies only changes that make the case stricter — the\nsame \"stricter only\" check a reviewer's acceptance goes through — and never orders, waives,\nlowers or decides anything. The linear and rules planners do not read the mode.",
      "enum": [
        "DISABLED",
        "SUGGEST",
        "AUTO_PILOT"
      ]
    },
    "KybConfig": {
      "type": "object",
      "description": "The KYB anchor step's configuration.\n\n**Deprecated document inputs.** `certificateOfIncorporation`, `articlesOfAssociation`,\n`organizationalStructureChart`, `proofOfAttorney` and `customDocuments` are still accepted on\ninput and folded into `customCountryDocuments[\"**\"]` (see\n`KybDocumentCatalog::fold_legacy_documents`); they are never serialized.",
      "properties": {
        "agentResearch": {
          "$ref": "#/$defs/AgentResearchTerms",
          "description": "What the KYB reviewer may look up by itself on this flow's cases, and what that may cost.\n\n**Off unless you turn it on.** With `enabled: true` the reviewer, after reading the case,\ntries to close the gaps it could not close from the case alone: the company's **registry\nrecord** and its **ownership graph**, **adverse media** on the company and its officers,\nand a **hosted web search**. Nothing is decided from it — what it finds is recorded on the\nrun and shown beside the recommendation.\n\n**What it costs.** Answers your organization already holds and that are still valid are\nadopted for free. Anything bought is bought through the same services the rest of the\nplatform buys through and is **metered at your usual prices**, inside `spendLimit`\n(in credits, per run) — a purchase that would exceed it is not made. The hosted search is\nabsorbed by the platform and bounded by `maxSearches`. Both sit under a platform ceiling;\nterms above it are refused when the flow is saved.\n\n**What leaves the platform.** The hosted search receives the company's four public\nidentifiers and nothing else: its legal name, its registration number, its country and its\nwebsite. No person's name, no document, no case text. The other tools are the ones your\ncases already use."
        },
        "agenticMode": {
          "oneOf": [
            {
              "$ref": "#/$defs/KybAgenticMode"
            }
          ],
          "default": "DISABLED"
        },
        "allowIndividualSubject": {
          "type": "boolean",
          "description": "Offer the applicant an individual-vs-business choice at the start of the step.\n\n**Frontend marker only** — the backend persists and serves it but takes no behaviour from it,\nso nothing downstream branches on this flag. When `false` (the default) the widget skips the\nchoice and treats the subject as a **business**, which is the pre-existing behaviour for every\nflow assembled before this field existed. Default-off is what makes adding it a no-op for\nlive flows.",
          "default": "false"
        },
        "amlAgenticMode": {
          "oneOf": [
            {
              "$ref": "#/$defs/KybAgenticMode",
              "description": "Agentic AML-review mode for the company + UBO AML screenings this KYB step triggers\n(`DISABLED` | `SUGGEST` | `AUTO_PILOT`), independent of `agentic_mode` (which governs the\nKYB document review). The AML review dispatcher resolves it from the screening's step."
            }
          ],
          "default": "DISABLED"
        },
        "autoSendUboKycEmail": {
          "type": "boolean",
          "description": "When `false`, the KYC invitation email is NOT automatically sent to UBOs on KYB\nsubmission; a reviewer instead triggers it on demand via the UBO reminder endpoint\n(which sends the initial invitation for un-onboarded UBOs). Defaults to `true`\n(auto-send), preserving existing behavior.",
          "default": "true"
        },
        "businessInfoForm": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Form",
              "description": "The business-details form the step asks: the one `businessInfoFormId` names, or the\nstandard one. Filled in when the flow is read, over whatever the config carried."
            }
          ]
        },
        "businessInfoFormId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The form the company answers about itself, from the organization's form library. Its\nfields bound to a business-information key are the company's business information; the\nothers are the organization's own questions. Omitted: the platform's standard form."
        },
        "clientOutreach": {
          "oneOf": [
            {
              "$ref": "#/$defs/ClientOutreachMode",
              "description": "Whether the KYB review agent asks the company for the documents or business information it\nfound missing: `AUTO` (the default, as before this setting existed) sends the\nclarification request itself, under `SUGGEST` and `AUTO_PILOT` alike; `DRAFT` leaves it as\nthe agent's suggestion for a reviewer to send; `OFF` escalates the case to a reviewer instead."
            }
          ],
          "default": "AUTO"
        },
        "collectDirectors": {
          "type": "boolean",
          "default": "false"
        },
        "customCountryDocuments": {
          "type": "object",
          "description": "Your organization's KYB document configuration: overrides of platform catalog documents\nand documents of your own. Keyed by ISO 3166-1 alpha-2 country code (other ISO formats are\naccepted and normalized), or by `\"**\"` for every country without a list of its own. A\ncountry's list replaces the `\"**\"` list for that country; neither replaces the platform\ncatalog.",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/KybCountryDocument"
            }
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "discoveryBudgetCredits": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "Per-verification cap (in credits) on ownership-discovery spend. `None` = platform default.\nOnly consulted when `discovery_enabled` is set. See `discovery_enabled` above for why this\nmoved here from `KybUbosConfig::discovery_budget_credits`.",
          "minimum": 0
        },
        "discoveryEnabled": {
          "type": "boolean",
          "description": "Whether submitting the business information automatically starts ownership discovery:\nlooking up the company's ownership structure in company registers. Discovery spends your\norganization's credits. Defaults to `false`.",
          "default": "false"
        },
        "documentsPerCountry": {
          "type": [
            "object",
            "null"
          ],
          "description": "Read-only. The documents the applicant must upload up front, per country, as served to\nclients. One entry per country with a configured list, plus a `\"**\"` entry that is always\npresent: look up `documentsPerCountry[country] ?? documentsPerCountry[\"**\"]`. On-demand and\ndisabled documents are left out, and `validationSchema` is empty.",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/KybCountryDocument"
            }
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "kycFlowId": {
          "type": "string",
          "format": "uuid",
          "description": "Deprecated: set `kycFlowId` on the UBOs and directors steps instead, which lets each use its\nown KYC flow. May be omitted; will be removed in a future version."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "maxDirectors": {
          "type": "integer",
          "format": "int32",
          "default": "10",
          "minimum": 0
        },
        "maxFileUploads": {
          "type": "integer",
          "format": "int32",
          "default": "10",
          "minimum": 0
        },
        "maxUbos": {
          "type": "integer",
          "format": "int32",
          "default": "10",
          "minimum": 0
        },
        "orchestrator": {
          "oneOf": [
            {
              "$ref": "#/$defs/KybCaseOrchestratorKind",
              "description": "Which planner the cases this flow opens are planned by: `LINEAR` (the default) presents the\nsteps in a fixed order, `JDM` applies the organization's orchestration rules\n(`/kyb-case-rules`) on top of it, and `LLM` has a model read each case against the\norganization's compliance policy and propose changes that make it stricter.\n\nPinned on each case when it opens, so changing it moves the cases opened afterwards and none\nalready open. A `JDM` flow whose organization has no enabled rule plans exactly as `LINEAR`\ndoes, with `NO_RULES` on the plan row. An `LLM` case runs in the fixed order, and what the\nmodel proposes — the owners' or directors' identity verification, a step made required, a\nhigher due-diligence level, a wider screening — waits on the case's proposals until a\nreviewer accepts or declines it."
            }
          ],
          "default": "LINEAR"
        },
        "plannerMode": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/KybCasePlannerMode",
              "description": "What becomes of the AI planner's proposals, read only when `orchestrator` is `LLM`:\n`DISABLED` (the planner is not asked), `SUGGEST` (each waits for a reviewer — the default) or\n`AUTO_PILOT` (the engine accepts each itself, while it still makes the case stricter; a KYC\nstep for a role this flow names no KYC flow for still waits for a reviewer)."
            }
          ]
        },
        "tinCheckEnabled": {
          "type": "boolean",
          "description": "Ask a US business for its EIN and match it, with the company name, against IRS records\nwhen the business information is submitted (a TIN check).\n\nOnly US businesses are asked: an EIN is a US identifier, and the check is a US one. A\nsubmission whose EIN and name do not match is refused, so the applicant can correct it.\nEach check that returns a verdict is billed to the organization as a TIN check\n(`creditCosts.tinCheck`), and needs the `TIN_CHECK` product. Defaults to `false`.",
          "default": "false"
        }
      }
    },
    "KybCountryDocument": {
      "type": "object",
      "description": "One KYB document, either as a platform catalog row, as an organisation override in\n`customCountryDocuments`, or as an entry of a resolved (effective) list.\n\nIn an organisation's `customCountryDocuments` an entry whose `key` matches a platform row is a\nper-key **override** of that row: the organisation owns `required`, `onDemand`, `enabled` and a\nnon-blank `label`, while `validationSchema`, `groupKey` and `source` always come from the\nplatform row. An entry with any other key is an organisation-only document.",
      "required": [
        "key"
      ],
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "`false` removes the document: it is not offered, not required and not requestable. This is\nhow an organisation drops a platform document, for one country or for every country at\nonce. Resolved lists never contain a disabled entry. Defaults to `true`."
        },
        "groupKey": {
          "type": [
            "string",
            "null"
          ],
          "description": "Groups this document with the others carrying the same value into a set of\nmutually-satisfying **alternatives**: the group counts as one requirement, and a single\nupload of any member satisfies it. Models the KYB spec's \"submit one of: Certificate of\nIncumbency | Company Register Extract | Certified Registers\". `None` (the common case)\nmeans the document stands alone and must be uploaded on its own. Platform-owned."
        },
        "key": {
          "type": "string",
          "description": "Machine-readable key used as the document type identifier (e.g.\n`\"visura_camerale\"`, `\"certificate_of_incorporation\"`).\nUnique within (scope, country)."
        },
        "label": {
          "type": "string",
          "description": "Human-readable label shown to the user during the KYB flow. On an organisation override a\nblank label keeps the platform's own label, which is why a bare `{ key, enabled: false }`\nentry is a valid override."
        },
        "onDemand": {
          "type": "boolean",
          "description": "When `true`, the document is NOT demanded upfront (excluded from the required-document\ngate) and is instead requested on demand by a reviewer during review. Defaults to\n`false`."
        },
        "required": {
          "type": "boolean",
          "description": "Whether upload of this document is mandatory for KYB approval.\nDefaults to `true`."
        },
        "source": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/KybDocumentSource",
              "description": "Whether the document comes from the platform catalog (`platform`) or was added by your\norganization (`organization`). Set by the server on resolved document lists; ignored on\ninput."
            }
          ]
        },
        "validationSchema": {
          "description": "JSON Schema of extracted facts. `properties` defines fields, `x-schemaVersion` versions\nthe contract, and `x-validationRules` carries acceptance criteria outside the output data.\nPlatform-owned, and emptied (`{}`) in every map served to a client."
        }
      }
    },
    "KybDirectorsConfig": {
      "type": "object",
      "description": "Configuration for the `KYB_DIRECTORS` satellite step.\n\nCarries the director declaration settings previously bundled into the monolithic\n`KybConfig` (gated there by `collect_directors: bool`). The existence of this step\nreplaces that boolean. `kyb_step_id` points at the anchor `KYB` step.\n\n`kyc_flow_id` is a copy independent from `KybUbosConfig.kyc_flow_id` — this enables\na *different* KYC flow for directors than for UBOs, a new capability.",
      "properties": {
        "kybStepId": {
          "type": "string",
          "format": "uuid",
          "description": "The anchor KYB step this directors satellite belongs to. See `KybDocumentsConfig::kyb_step_id`."
        },
        "kycFlowId": {
          "type": "string",
          "format": "uuid",
          "description": "The KYC flow directors are invited into to verify their identity. Only used when\n`requireKyc` is `true`; may be omitted otherwise."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "maxDirectors": {
          "type": "integer",
          "format": "int32",
          "default": "10",
          "minimum": 0
        },
        "requireKyc": {
          "type": "boolean",
          "description": "Whether each declared director must complete a KYC flow (`true`, the default) or is only\nscreened by name. When `true`, an email address is required for each director and they are\ninvited into `kycFlowId`. Independent of the UBOs setting: a flow may verify its UBOs while\nscreening its directors by name only, or the reverse.",
          "default": "true"
        }
      }
    },
    "KybDocumentCheckOverride": {
      "type": "object",
      "description": "A reviewer's correction of one document check verdict.",
      "required": [
        "overriddenBy",
        "overriddenAt"
      ],
      "properties": {
        "modelStatus": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/KybDocumentCheckStatus",
              "description": "What the latest comparison's model verdict is; `None` when it gave none (a failed\nextraction's document type)."
            }
          ]
        },
        "overriddenAt": {
          "type": "string",
          "format": "date-time"
        },
        "overriddenBy": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "KybDocumentCheckStatus": {
      "type": "string",
      "description": "Verdict of one supplementary document check (a non-business extracted field, or the\ndocument's `acceptanceRules`). Reasons are never exposed; they stay in the S3 history payload.",
      "enum": [
        "match",
        "mismatch",
        "notFound",
        "notCheckable"
      ]
    },
    "KybDocumentCheckSummary": {
      "type": "object",
      "description": "Reviewer-facing summary of one uploaded document in the latest cross-check: what it was\nclassified as, whether extraction succeeded, and the status of every document check.",
      "required": [
        "extractionId",
        "sourceS3Key",
        "status",
        "checks"
      ],
      "properties": {
        "authenticity": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/KybDocumentCheckStatus",
              "description": "The agent's authenticity verdict on the file: `match` (no anomalies found), `mismatch`\n(anomalies found, the document is flagged for review) or `notCheckable` (not verifiable).\n`null` when the file has not been assessed yet. Never proof either way: the check looks for\nanomalies, it cannot show a document genuine."
            }
          ]
        },
        "checks": {
          "type": "object",
          "description": "Check name (`acceptanceRules`, `directors`, …) → verdict. Empty for a failed extraction.",
          "additionalProperties": {
            "$ref": "#/$defs/KybDocumentCheckStatus"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "definitionKey": {
          "type": [
            "string",
            "null"
          ],
          "description": "The catalog key the upload was classified as; `None` for an unclassified upload."
        },
        "definitionLabel": {
          "type": [
            "string",
            "null"
          ]
        },
        "documentType": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/KybDocumentCheckStatus",
              "description": "Whether the document is the kind of document it was submitted as: `match`, `mismatch`\n(clearly another kind of document) or `notCheckable`. `None` when nothing judged it — an\nunclassified upload, a failed extraction, or one extracted before this verdict existed."
            }
          ]
        },
        "errorCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Stable failure code (`UNSUPPORTED_MEDIA`, `INVALID_EXTRACTION`, …) when `status` is `FAILED`."
        },
        "extractionId": {
          "type": "string",
          "format": "uuid"
        },
        "forensicsSeverity": {
          "type": [
            "string",
            "null"
          ],
          "description": "The highest severity of the file's pixel-forensics signals (images only), likewise."
        },
        "forensicsSignals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ForensicsSignalCode"
          },
          "description": "The pixel-forensics signals the analysis recorded, each once. Flags too, never a verdict."
        },
        "overrides": {
          "type": "object",
          "description": "The checks a reviewer corrected, by name (`@documentType` for the document-type verdict,\n`@authenticity` for the authenticity one). `documentType`, `authenticity` and `checks`\nalready carry the corrected status; this says what the model said and who changed it.",
          "additionalProperties": {
            "$ref": "#/$defs/KybDocumentCheckOverride"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "provenanceSeverity": {
          "type": [
            "string",
            "null"
          ],
          "description": "The highest severity of the file's provenance signals (`low`, `medium`, `high`, `critical`),\nread from its document analysis (ENG-945); `None` when none was recorded or nothing was\nfound, which is not a statement of authenticity."
        },
        "provenanceSignals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProvenanceSignalCode"
          },
          "description": "The provenance signals the analysis recorded, each once. Flags with their evidence in the\nanalysis, never a verdict."
        },
        "sourceS3Key": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/KybDocumentExtractionStatus"
        }
      }
    },
    "KybDocumentExtractionStatus": {
      "type": "string",
      "description": "Outcome of one per-document extraction (`KybDocumentExtraction.status`).",
      "enum": [
        "COMPLETED",
        "FAILED"
      ]
    },
    "KybDocumentSource": {
      "type": "string",
      "description": "Where an effective KYB document entry comes from.\n\nSet by resolution (`KybDocumentCatalog::resolve_for_country`), never trusted from a stored\nconfig: an entry whose `key` matches a platform `DocumentDefinitions` row is `platform`, however\nthe organisation overrode it, and every other entry is `organization`.",
      "enum": [
        "platform",
        "organization"
      ]
    },
    "KybDocumentsConfig": {
      "type": "object",
      "description": "Configuration for the `KYB_DOCUMENTS` satellite step.\n\nCarries the document requirements previously bundled into the monolithic `KybConfig`.\n`kyb_step_id` points at the anchor `KYB` step (same pattern as `LivenessConfig.document_step_id`).\n\n**Deprecated document inputs.** `certificateOfIncorporation`, `articlesOfAssociation`,\n`organizationalStructureChart`, `proofOfAttorney` and `customDocuments` are still accepted on\ninput and folded into `customCountryDocuments[\"**\"]` (see\n`KybDocumentCatalog::fold_legacy_documents`); they are never serialized.",
      "properties": {
        "acceptanceRulesEngine": {
          "type": "boolean",
          "description": "The requirement-check engine's verdict on each document's acceptance rules replaces the\nmodel's in this flow (Document AI WP8), where the platform switch\n`KYB_ACCEPTANCE_RULES_ENGINE_ENABLED` is on too. Default off; never serialized when off, so\na stored config is unchanged until a flow opts in."
        },
        "customCountryDocuments": {
          "type": "object",
          "description": "The organisation's document configuration. See `KybConfig::custom_country_documents`, whose\nsemantics this mirrors.",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/KybCountryDocument"
            }
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "documentsPerCountry": {
          "type": [
            "object",
            "null"
          ],
          "description": "The effective upfront documents per country, populated at rehydration time (see\n`KybConfig::documents_per_country`, whose semantics this mirrors).",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/KybCountryDocument"
            }
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "kybStepId": {
          "type": "string",
          "format": "uuid",
          "description": "The anchor KYB step this documents satellite belongs to. May be omitted where the anchor\ndoesn't exist yet (a flow setup draft); a step can't be saved without one."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "maxFileUploads": {
          "type": "integer",
          "format": "int32",
          "default": "10",
          "minimum": 0
        },
        "provisionalFeedback": {
          "type": "boolean",
          "description": "Applicant-facing provisional document feedback (ENG-1655, Document AI WP10): the applicant\nmay have a candidate document observed before it joins the case, while the platform switch\n`KYB_PROVISIONAL_FEEDBACK_ENABLED` is on; sandbox only. Default off; never serialized when\noff, so a stored config is unchanged until a flow opts in."
        }
      }
    },
    "KybFormAnswer": {
      "type": "object",
      "description": "The answer the case holds to one of the organization's own business-details questions.",
      "required": [
        "key",
        "field"
      ],
      "properties": {
        "field": {
          "$ref": "#/$defs/InputField",
          "description": "The question as the form asks it: its labels, type and choices. Its own value is left\nout: the answer is `value`."
        },
        "key": {
          "type": "string",
          "description": "The key the cross-check, the clarifications and the edits name it by: `form.<name>`."
        },
        "text": {
          "type": [
            "string",
            "null"
          ],
          "description": "The answer as text, as the cross-check compares it: a select's choice by its label, a date\nby its day."
        },
        "value": {
          "description": "The answer as the case holds it now, an analyst's correction included; `None` unanswered."
        }
      }
    },
    "KybUbosConfig": {
      "type": "object",
      "description": "Configuration for the `KYB_UBOS` satellite step.\n\nCarries the UBO declaration + child-KYC invitation settings previously bundled\ninto the monolithic `KybConfig`. `kyb_step_id` points at the anchor `KYB` step.",
      "properties": {
        "autoSendUboKycEmail": {
          "type": "boolean",
          "description": "When `false`, the KYC invitation email is NOT automatically sent to UBOs on\nsubmission; a reviewer instead triggers it on demand via the UBO reminder\nendpoint (which sends the initial invitation for un-onboarded UBOs). Defaults to\n`true` (auto-send), preserving existing behavior.",
          "default": "true"
        },
        "kybStepId": {
          "type": "string",
          "format": "uuid",
          "description": "The anchor KYB step this UBOs satellite belongs to. See `KybDocumentsConfig::kyb_step_id`."
        },
        "kycFlowId": {
          "type": "string",
          "format": "uuid",
          "description": "The KYC flow UBOs are invited into to verify their identity. Only used when `requireKyc`\nis `true`; may be omitted otherwise."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "maxUbos": {
          "type": "integer",
          "format": "int32",
          "default": "10",
          "minimum": 0
        },
        "requireKyc": {
          "type": "boolean",
          "description": "Whether a declared UBO must go through child KYC, or is collected for AML name screening\nonly.\n\n`true` (the default, and the behaviour of every flow built before this field existed): the\nwidget demands an email address for each UBO — an email is what a KYC invitation is\naddressed to — and the backend resolves `kyc_flow_id` to send and schedule those\ninvitations.\n\n`false`: the widget collects a UBO by name alone and asks for no email; `kyc_flow_id` is\nthen meaningless and may be omitted. The backend must NOT resolve a KYC entry point in that\ncase — `resolve_kyc_flow_entry_point` is a hard error when the flow does not exist, so an\nunguarded resolution would fail the entire UBO submission of a flow that legitimately has\nno KYC flow at all.\n\nNothing downstream of submission needs to branch on this: the readiness gate\n(`KybService::are_all_ubos_verified`, `check_kyb_result_approval_readiness`) already keys\noff each UBO's *own* email presence — email-bearing UBOs need a completed child KYC,\nname-only UBOs need a clean name-AML screening — so an entirely email-less declaration set\nresolves through the name-only branch without consulting any config.",
          "default": "true"
        }
      }
    },
    "LivenessConfig": {
      "type": "object",
      "required": [
        "documentStepId"
      ],
      "properties": {
        "biometricCheckEnabled": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When `true` the liveness step also performs a biometric match against the stored portrait.\nSet to `false` to keep the liveness UX but skip biometric verification."
        },
        "documentStepId": {
          "type": "string",
          "format": "uuid"
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "maxAttempts": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "minimum": 0
        },
        "passiveLiveness": {
          "type": "boolean",
          "description": "When `true`, passive liveness (selfie-only, no head movements) is used instead\nof active challenge-based liveness. Configured by admin only. Defaults to `false`."
        },
        "performAntispoof": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "skipIfPreviousLivenessPassed": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When enabled (the default when unset), the liveness step is skipped during a\none-click KYC reuse if the reused document verification result already carries a\nsuccessful liveness outcome (`processAdditionalData.rawLivenessData`).\n\nThe reused liveness must originate from a flow of the same organization, unless\nthe one-click was authenticated via passkey — in which case cross-organization\nreuse is allowed. Set to `false` to always require a fresh liveness."
        },
        "thresholds": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": "number",
            "format": "float"
          },
          "propertyNames": {
            "type": "string",
            "enum": [
              "portraitMatchPercent",
              "biometricMatchPercent"
            ]
          }
        }
      }
    },
    "LogicalOperator": {
      "type": "string",
      "description": "Logical operators for workflow branching.",
      "enum": [
        "BRANCH",
        "SWITCH",
        "MERGE",
        "PARALLEL_SPLIT",
        "PARALLEL_JOIN"
      ]
    },
    "ModerationResultStatus": {
      "type": "string",
      "enum": [
        "ACQUIRING",
        "ENRICHING",
        "PENDING_MODERATION",
        "REVIEW_REQUIRED",
        "SUCCESS",
        "FAILED"
      ]
    },
    "NextAction": {
      "type": "string",
      "enum": [
        "CLIENT",
        "RM",
        "COMPLIANCE",
        "SUPPORT",
        "FUNDED",
        "DENIED"
      ]
    },
    "NodePosition": {
      "type": "object",
      "description": "Position of a node in the visual editor.",
      "required": [
        "x",
        "y"
      ],
      "properties": {
        "x": {
          "type": "number",
          "format": "double",
          "description": "X coordinate"
        },
        "y": {
          "type": "number",
          "format": "double",
          "description": "Y coordinate"
        }
      }
    },
    "PepAndSanctionsStatus": {
      "type": "string",
      "enum": [
        "REVIEW",
        "PENDING",
        "SUCCESS",
        "FAILED",
        "IN_PROGRESS"
      ]
    },
    "PhoneConfig": {
      "type": "object",
      "properties": {
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        }
      }
    },
    "Plaintext": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "visibleWhen": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Condition"
            }
          ]
        }
      }
    },
    "PoaConfig": {
      "type": "object",
      "required": [
        "documentFilter"
      ],
      "properties": {
        "documentFilter": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PoaDocumentType"
          }
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "maxAgeDays": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    },
    "PoaDocumentType": {
      "type": "string",
      "enum": [
        "PAY_SLIP",
        "UTILITY_BILL",
        "FINANCIAL_DOCUMENT",
        "RECEIPT",
        "INVOICE",
        "BANK_DOCUMENT",
        "TAX_CLEARANCE_CERTIFICATE",
        "HOUSEHOLD_REGISTER",
        "CERTIFICATE_OF_RESIDENCE",
        "DLDV",
        "OTHER"
      ]
    },
    "ProcessImagesOverrides": {
      "type": "object",
      "properties": {
        "authParams": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {},
          "propertyNames": {
            "type": "string"
          }
        },
        "checkAuth": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "scenario": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "ProvenanceSignalCode": {
      "type": "string",
      "enum": [
        "EDITING_SOFTWARE",
        "AI_SOFTWARE",
        "AI_GENERATION_PARAMETERS",
        "AI_DIGITAL_SOURCE_TYPE",
        "PHOTOSHOP_RESOURCES",
        "EDIT_HISTORY",
        "MODIFIED_AFTER_CREATION",
        "PDF_INCREMENTAL_UPDATE",
        "PDF_MODIFIED_AFTER_SIGNATURE",
        "C2PA_AI_GENERATED",
        "C2PA_AI_EDITED",
        "C2PA_EDITED",
        "C2PA_TAMPERED",
        "C2PA_INVALID",
        "C2PA_UNTRUSTED_SIGNER",
        "C2PA_TRUSTED_CAPTURE"
      ]
    },
    "RegisterFieldSource": {
      "type": "object",
      "description": "Where a register lookup read one business field: the register, how and when.",
      "properties": {
        "aiAnalysis": {
          "type": "boolean",
          "description": "Whether the value was read by an AI out of the register's filings rather than from the\nregister's own record: a weaker assurance than a register read."
        },
        "register": {
          "type": [
            "string",
            "null"
          ],
          "description": "The register, by its provider code (`infocamere`, `companies_house`, `prh`); absent when the\nprovider did not name one."
        },
        "registerName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The register's name, as it goes by (`InfoCamere`); absent when the provider named no register."
        },
        "retrievedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the register was read; absent for a lookup made before the platform kept it."
        }
      }
    },
    "RequiredDocumentField": {
      "type": "string",
      "enum": [
        "firstName",
        "middleName",
        "lastName",
        "dateOfBirth",
        "phone",
        "email",
        "street",
        "city",
        "state",
        "postcode",
        "country",
        "socialSecurityNumber",
        "expirationDate",
        "documentNumber"
      ]
    },
    "ReviewerFieldVerdict": {
      "type": "object",
      "description": "A reviewer's verdict on a business field, and the value they gave it on.",
      "required": [
        "matchType"
      ],
      "properties": {
        "matchType": {
          "$ref": "#/$defs/BusinessInfoMatchType"
        },
        "value": {
          "type": [
            "string",
            "null"
          ],
          "description": "The field's value when they judged it, as the cross-check compares it; `null` for a field\nthat held none."
        }
      }
    },
    "SelectOptions": {
      "type": "object",
      "required": [
        "values",
        "isOtherAllowed"
      ],
      "properties": {
        "isOtherAllowed": {
          "type": "boolean"
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "SiwxChain": {
      "type": "string",
      "enum": [
        "ETHEREUM",
        "ETHEREUM_TESTNET",
        "SOLANA",
        "SOLANA_TESTNET"
      ]
    },
    "SpidConfig": {
      "type": "object",
      "properties": {
        "documentSelectionStepId": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the document-selection step that precedes this SPID step in the flow."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        }
      }
    },
    "SpidDocumentType": {
      "type": "string",
      "enum": [
        "ITALIAN_SPID",
        "AADHAAR"
      ]
    },
    "UboDefinition": {
      "type": "object",
      "required": [
        "firstName",
        "lastName"
      ],
      "properties": {
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "Nationality of the UBO. Absent when the company register reported none."
        },
        "dateOfBirth": {
          "type": [
            "string",
            "null"
          ],
          "description": "`None` for a UBO taken from a company register as reported. Registers publish ownership,\nnot identity dossiers: a birth date is frequently absent, and demanding one would force the\napplicant to invent or look up data the register itself does not hold. Such a UBO is\nAML-screened on name alone, which the review panel is expected to treat as a thin identity."
        },
        "emailAddress": {
          "type": [
            "string",
            "null"
          ],
          "description": "Email of the UBO. `None` for a name-only UBO added without an email: such a UBO is\nAML-screened by name and is never sent a KYC invitation."
        },
        "firstName": {
          "type": "string"
        },
        "gender": {
          "type": [
            "string",
            "null"
          ],
          "description": "`None` for any register-sourced UBO — no company register publishes gender. Collected only\nwhen a person enters the UBO by hand."
        },
        "id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Stable identifier for this UBO within the KYB result. Assigned on creation\n(submission or post-submission add) and used to address the UBO for removal /\nname-screening instead of a positional index. `None` only for legacy entries\ncreated before this field existed."
        },
        "lastName": {
          "type": "string"
        }
      }
    },
    "WalletConfig": {
      "type": "object",
      "required": [
        "chains"
      ],
      "properties": {
        "chains": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SiwxChain"
          }
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        }
      }
    },
    "WorkflowEdge": {
      "type": "object",
      "description": "An edge connecting two nodes in the workflow graph.\n\nEdges represent the flow of control between nodes.\nFor conditional branching (from Operator nodes), edges can have labels\nlike \"true\" or \"false\" to indicate which path to take.",
      "required": [
        "id",
        "sourceId",
        "targetId"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for this edge."
        },
        "label": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional label for conditional edges.\n\nFor edges from Branch operator nodes:\n- \"true\": taken when condition evaluates to true\n- \"false\": taken when condition evaluates to false"
        },
        "sourceId": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the source node (where this edge starts)."
        },
        "targetId": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the target node (where this edge ends)."
        }
      }
    },
    "WorkflowGraph": {
      "type": "object",
      "description": "A workflow graph consisting of nodes and edges.\n\nThe graph defines the structure of a workflow:\n- One Start node where execution begins\n- One or more End nodes where execution terminates\n- Step nodes representing actual workflow steps\n- Operator nodes for conditional branching\n- Edges connecting nodes together",
      "properties": {
        "edges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowEdge"
          },
          "description": "All edges connecting nodes."
        },
        "nodes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowNode"
          },
          "description": "All nodes in the graph."
        }
      }
    },
    "WorkflowNode": {
      "oneOf": [
        {
          "type": "object",
          "description": "The start node - entry point of the workflow.",
          "required": [
            "id",
            "type"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for this node."
            },
            "metadata": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/WorkflowNodeMetadata",
                  "description": "Optional metadata for UI layout."
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "START"
              ]
            }
          }
        },
        {
          "type": "object",
          "description": "An end node - terminal point of the workflow.",
          "required": [
            "id",
            "type"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for this node."
            },
            "metadata": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/WorkflowNodeMetadata",
                  "description": "Optional metadata for UI layout."
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "END"
              ]
            }
          }
        },
        {
          "type": "object",
          "description": "A step node representing a workflow step.",
          "required": [
            "id",
            "stepSlug",
            "type"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for this node."
            },
            "metadata": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/WorkflowNodeMetadata",
                  "description": "Optional metadata for UI layout."
                }
              ]
            },
            "stepSlug": {
              "type": "string",
              "description": "The slug of the flow step this node represents."
            },
            "type": {
              "type": "string",
              "enum": [
                "STEP"
              ]
            }
          }
        },
        {
          "type": "object",
          "description": "An operator node for conditional branching.",
          "required": [
            "id",
            "operator",
            "type"
          ],
          "properties": {
            "branches": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/$defs/BranchCondition"
              },
              "description": "The branches to evaluate (required for Switch operator)."
            },
            "condition": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/Condition",
                  "description": "The condition to evaluate (required for Branch operator)."
                }
              ]
            },
            "id": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for this node."
            },
            "metadata": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/WorkflowNodeMetadata",
                  "description": "Optional metadata for UI layout."
                }
              ]
            },
            "operator": {
              "$ref": "#/$defs/LogicalOperator",
              "description": "The type of logical operator."
            },
            "type": {
              "type": "string",
              "enum": [
                "OPERATOR"
              ]
            }
          }
        },
        {
          "type": "object",
          "description": "An action node for database operations.",
          "required": [
            "id",
            "config",
            "type"
          ],
          "properties": {
            "config": {
              "$ref": "#/$defs/ActionConfig",
              "description": "The configuration for this action."
            },
            "id": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for this node."
            },
            "metadata": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/$defs/WorkflowNodeMetadata",
                  "description": "Optional metadata for UI layout."
                }
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "ACTION"
              ]
            }
          }
        }
      ],
      "description": "A node in the workflow graph.\n\nNodes represent different types of elements in a workflow:\n- `Start`: The entry point of the workflow\n- `End`: A terminal point where the workflow completes\n- `Step`: A workflow step that executes some action\n- `Operator`: A conditional branching point"
    },
    "WorkflowNodeMetadata": {
      "type": "object",
      "description": "Metadata for a workflow node.\n\nContains UI-specific information like position that doesn't affect execution logic.",
      "properties": {
        "position": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/NodePosition",
              "description": "Position of the node in the canvas."
            }
          ]
        }
      },
      "additionalProperties": {
        "description": "Additional metadata fields."
      }
    }
  }
}