{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zyphe-com/json-schema/zyphe-com-flow-result-schema.json",
  "title": "FlowResult",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zyphe-com-openapi.json#/components/schemas/FlowResult",
  "type": "object",
  "required": [
    "id",
    "organizationId",
    "flowSlug",
    "status",
    "dvResults",
    "poaResults",
    "amlResults",
    "formResults",
    "kybResults",
    "spidResults",
    "phoneResults",
    "walletResults",
    "jdmData",
    "customData"
  ],
  "properties": {
    "amlResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AmlResult"
      }
    },
    "assignedRiskTags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AssignedRiskTag"
      },
      "description": "Custom risk tags conditionally assigned by the flow builder's AssignRiskTags action."
    },
    "createdAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "customData": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {},
      "propertyNames": {
        "type": "string"
      }
    },
    "dvResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DvResult"
      }
    },
    "flow": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/Flow"
        }
      ]
    },
    "flowSlug": {
      "type": "string"
    },
    "formResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FormResult"
      }
    },
    "geolocationResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GeolocationResult"
      }
    },
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "identity": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/Identity"
        }
      ]
    },
    "jdmData": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/FlowStepOutput"
      }
    },
    "kybResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/KybResult"
      }
    },
    "organization": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/Organization"
        }
      ]
    },
    "organizationId": {
      "type": "string",
      "format": "uuid"
    },
    "phoneResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PhoneResult"
      }
    },
    "poaResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PoaResult"
      }
    },
    "reviewSuggestion": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/ReviewSuggestion"
        }
      ]
    },
    "riskScorePercent": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "Composed global risk score for the flow (0–100). `None` if not yet scored."
    },
    "spidResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SpidResult"
      }
    },
    "status": {
      "$ref": "#/$defs/VerificationRequestStatus"
    },
    "updatedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "walletResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WalletResult"
      }
    }
  },
  "$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"
      ]
    },
    "ActionStepOutput": {
      "type": "object",
      "description": "Action step output for tracking action node execution in workflow.",
      "required": [
        "executed",
        "timestamp"
      ],
      "properties": {
        "executed": {
          "type": "boolean"
        },
        "redirectUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional redirect information for flow router actions"
        },
        "targetFlowId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Optional target flow ID for flow router actions"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "token": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional token for the target flow"
        }
      }
    },
    "AdverseMediaAbsence": {
      "type": "string",
      "description": "Why a screening carries no adverse media.",
      "enum": [
        "NO_PROVIDER",
        "PROVIDER_UNAVAILABLE",
        "NOT_PERFORMED"
      ]
    },
    "AdverseMediaProviderKind": {
      "type": "string",
      "description": "The adverse-media screening source used for a screening. Your organization's own selection\napplies when set, otherwise the platform default. `NONE`, the default, means no adverse-media\nscreening is performed: it is an opt-in feature.",
      "enum": [
        "NONE",
        "VERIFY",
        "ONE_MEDIA_CHECK",
        "GROK",
        "DILISENSE"
      ]
    },
    "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
        }
      }
    },
    "AmlAdverseMediaArticle": {
      "type": "object",
      "description": "A news article found by adverse-media screening for the subject of an AML result, with its\nsource, publication details, topics and, when available, a relevance score.",
      "required": [
        "title",
        "snippet",
        "url",
        "source",
        "language"
      ],
      "properties": {
        "eventGroup": {
          "type": [
            "string",
            "null"
          ]
        },
        "language": {
          "type": "string"
        },
        "locations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "publishedDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "relevanceScore": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "snippet": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "url": {
          "type": "string"
        }
      }
    },
    "AmlAdverseMediaCategoryCount": {
      "type": "object",
      "description": "Number of adverse-media articles the screening provider filed under one of its topic\ncategories (for example `financial_crime` or `terrorism`). Labels are provider-specific and\nmay change, so show them to reviewers rather than building logic on them.",
      "required": [
        "label",
        "count"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "label": {
          "type": "string"
        }
      }
    },
    "AmlAdverseMediaResult": {
      "type": "object",
      "description": "Adverse-media screening outcome attached to an AML result.",
      "required": [
        "provider",
        "checkedAt",
        "hasHit",
        "totalArticleCount",
        "totalEventCount"
      ],
      "properties": {
        "articles": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlAdverseMediaArticle"
          }
        },
        "categoryCounts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlAdverseMediaCategoryCount"
          },
          "description": "Per-category article counts as the provider reported them, when it reports any.\n\nEmpty for providers that return no category breakdown, and on every result persisted\nbefore this field existed."
        },
        "checkedAt": {
          "type": "string",
          "format": "date-time"
        },
        "hasHit": {
          "type": "boolean",
          "description": "Whether the screening returned any adverse-media articles (the gating signal)."
        },
        "provider": {
          "$ref": "#/$defs/AdverseMediaProviderKind",
          "description": "Provider that produced the result."
        },
        "totalArticleCount": {
          "type": "integer",
          "minimum": 0
        },
        "totalEventCount": {
          "type": "integer",
          "minimum": 0
        },
        "windowStart": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The earliest publication date the check considered. `None` means the whole index was\nsearched.\n\nStored because it is half the question: \"no financial-crime coverage\" over three years\nand over all history are different answers, and a count read back without the window it\nwas taken in is a number with no claim attached."
        }
      }
    },
    "AmlAgentReview": {
      "type": "object",
      "description": "Outcome of the latest automated AI review of this screening: the verdict, the action actually\ntaken, the rationale and the remaining risk score. When `suggested` is `true` the verdict is\nonly a suggestion for a human reviewer. It applies to the current screening only and no longer\ncounts once the subject is re-screened.",
      "required": [
        "reviewedAt",
        "verdictAction",
        "enactedAction",
        "rationale",
        "residualRiskScore",
        "suggested"
      ],
      "properties": {
        "enactedAction": {
          "$ref": "#/$defs/AmlAgentReviewAction",
          "description": "The action actually enacted, post-guard and post-normalization."
        },
        "policyVersion": {
          "type": [
            "string",
            "null"
          ],
          "description": "Version of the review policy used, on older reviews only. Newer reviews report\n`promptVersions` instead."
        },
        "promptVersions": {
          "type": "object",
          "description": "Version of each prompt used to reach the verdict, keyed by prompt type, so the review can be\ntraced. Empty on older reviews, which report `policyVersion` instead.",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "rationale": {
          "type": "string"
        },
        "residualRiskScore": {
          "type": "number",
          "format": "float"
        },
        "reviewedAt": {
          "type": "string",
          "format": "date-time"
        },
        "suggested": {
          "type": "boolean",
          "description": "True when the agentic mode gated the action out (Suggest): the verdict is a suggestion\nfor a human reviewer, nothing was enacted."
        },
        "verdictAction": {
          "$ref": "#/$defs/AmlAgentReviewAction",
          "description": "The Judge's verdict action."
        }
      }
    },
    "AmlAgentReviewAction": {
      "type": "string",
      "description": "The action an automated review decided on: `approve`, `requestClarification` or `escalate`\n(hand over to a human reviewer).",
      "enum": [
        "approve",
        "requestClarification",
        "escalate"
      ]
    },
    "AmlCheckSummary": {
      "type": "object",
      "required": [
        "totalEntities",
        "highestRiskScore",
        "highestRiskLevel",
        "hasPep",
        "hasSanctions",
        "highRiskEntitiesCount"
      ],
      "properties": {
        "hasAdverseMedia": {
          "type": "boolean",
          "description": "Whether the adverse-media screening for this subject returned any articles. `false` when no\narticles were found or adverse media was not screened."
        },
        "hasPep": {
          "type": "boolean"
        },
        "hasSanctions": {
          "type": "boolean"
        },
        "highRiskEntitiesCount": {
          "type": "integer",
          "minimum": 0
        },
        "highestRiskLevel": {
          "$ref": "#/$defs/RiskLevel"
        },
        "highestRiskScore": {
          "type": "integer",
          "format": "int32"
        },
        "totalEntities": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "AmlCompanyQueryMetadata": {
      "type": "object",
      "required": [
        "companyName"
      ],
      "properties": {
        "companyName": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "registrationNumber": {
          "type": "string"
        }
      }
    },
    "AmlEntityResponse": {
      "type": "object",
      "properties": {
        "address": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "birthCountry": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "birthDate": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "birthPlace": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "country": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "email": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "fatherName": {
          "$ref": "#/$defs/FieldWithControl",
          "description": "The listed person's patronymic: their father's name, as lists that identify people by it\n(Pakistan's NACTA list, Russian and Central Asian lists) record it."
        },
        "firstName": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "gender": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "idNumber": {
          "$ref": "#/$defs/FieldWithControl",
          "description": "The national identity numbers the listing names (a Pakistani CNIC, a tax code, ...)."
        },
        "lastName": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "match": {
          "type": "boolean"
        },
        "matchFeatures": {
          "type": "object",
          "description": "What the screening provider's matcher found in common between the query and the listing,\nfeature by feature (a literal name match, a phonetic name match, ...), each with its weight in\nthe score. Empty when the provider does not explain its score.",
          "additionalProperties": {
            "type": "number",
            "format": "double"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "middleName": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "name": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "nationality": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "occupancies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlOccupancy"
          }
        },
        "passportNumber": {
          "$ref": "#/$defs/FieldWithControl",
          "description": "The passport numbers the listing names."
        },
        "phone": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "position": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "relatedPeps": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlRelatedPep"
          },
          "description": "The PEPs this record is tied to as a relative or close associate, as the provider names them.\nAbsent when the provider named none."
        },
        "sanctions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlSanction"
          }
        },
        "score": {
          "type": "number",
          "format": "double"
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlSource"
          }
        },
        "title": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "topics": {
          "$ref": "#/$defs/FieldWithControl"
        }
      }
    },
    "AmlEntityResult": {
      "type": "object",
      "required": [
        "entity",
        "matchScore",
        "match",
        "riskScore",
        "isPep",
        "hasSanctions",
        "riskTopics",
        "riskCountries",
        "riskPositions",
        "riskRelationships"
      ],
      "properties": {
        "assessment": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AmlMatchAssessment",
              "description": "How far the hit is known to be the screened person beyond the name: graded against the\napplicant's date of birth and identity numbers. When present, `match` and `matchScore` are the\ngraded values and the provider's own are kept here. Absent on a result screened before the\ngrading existed, and on a company screening."
            }
          ]
        },
        "entity": {
          "$ref": "#/$defs/AmlEntityResponse"
        },
        "hasSanctions": {
          "type": "boolean"
        },
        "isPep": {
          "type": "boolean",
          "description": "A PEP match: the record is a politically exposed person, or a relative or close associate\nof one."
        },
        "match": {
          "type": "boolean"
        },
        "matchScore": {
          "type": "number",
          "format": "double"
        },
        "riskCountries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "riskPositions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "riskRelationships": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "riskScore": {
          "$ref": "#/$defs/RiskScore"
        },
        "riskTopics": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "AmlIdentityAttribute": {
      "type": "string",
      "description": "An identifying detail compared between the applicant and a list entry.",
      "enum": [
        "dateOfBirth",
        "idNumber"
      ]
    },
    "AmlIdentityComparison": {
      "type": "object",
      "description": "One identifying detail compared between the applicant and a list entry.",
      "required": [
        "attribute",
        "outcome",
        "listed"
      ],
      "properties": {
        "attribute": {
          "$ref": "#/$defs/AmlIdentityAttribute"
        },
        "listed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list entry's values that were compared, as the provider gave them."
        },
        "outcome": {
          "$ref": "#/$defs/AmlIdentityOutcome"
        }
      }
    },
    "AmlIdentityOutcome": {
      "type": "string",
      "description": "Whether an identifying detail is the same on both sides.",
      "enum": [
        "agrees",
        "disagrees"
      ]
    },
    "AmlMatchAssessment": {
      "type": "object",
      "description": "How a hit was graded against the screened person's identifying details, and why.",
      "required": [
        "strength",
        "listingHasIdentifiers",
        "providerScore",
        "providerMatch",
        "reason"
      ],
      "properties": {
        "comparisons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlIdentityComparison"
          },
          "description": "The identifying details that could be compared, and how each came out."
        },
        "listingHasIdentifiers": {
          "type": "boolean",
          "description": "Whether the list entry names anything that tells people apart beyond the name: a date of\nbirth, an identity or a passport number."
        },
        "providerMatch": {
          "type": "boolean",
          "description": "Whether the provider itself called the entry a match."
        },
        "providerScore": {
          "type": "number",
          "format": "double",
          "description": "The provider's own score, before the grading discounted it."
        },
        "reason": {
          "type": "string",
          "description": "Why the hit was graded so, in a sentence a reviewer can read."
        },
        "strength": {
          "$ref": "#/$defs/AmlMatchStrength"
        }
      }
    },
    "AmlMatchStrength": {
      "type": "string",
      "description": "How far a hit is known to be the screened person.",
      "enum": [
        "corroborated",
        "nameOnly",
        "contradicted"
      ]
    },
    "AmlModerationStatus": {
      "type": "string",
      "enum": [
        "approved",
        "rejected",
        "escalated"
      ]
    },
    "AmlOccupancy": {
      "type": "object",
      "properties": {
        "endDate": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "post": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlPosition"
          }
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlSource"
          }
        },
        "startDate": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "status": {
          "$ref": "#/$defs/FieldWithControl"
        }
      }
    },
    "AmlOrganization": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "description": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "name": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "summary": {
          "$ref": "#/$defs/FieldWithControl"
        }
      }
    },
    "AmlPepRelationKind": {
      "type": "string",
      "description": "How a record reaches a PEP it is related to.",
      "enum": [
        "family",
        "associate"
      ]
    },
    "AmlPosition": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "description": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "dissolutionDate": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "inceptionDate": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "name": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "numberOfSeats": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "organization": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlOrganization"
          }
        },
        "subnationalArea": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "summary": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "topics": {
          "$ref": "#/$defs/FieldWithControl"
        }
      }
    },
    "AmlQueryMetadata": {
      "type": "object",
      "required": [
        "firstName",
        "lastName"
      ],
      "properties": {
        "dateOfBirth": {
          "type": [
            "string",
            "null"
          ],
          "description": "`None` when the subject was screened on name alone. This records what was actually queried,\nso a reviewer can tell a name-only screening from one that matched on a birth date too."
        },
        "firstName": {
          "type": "string"
        },
        "gender": {
          "type": [
            "string",
            "null"
          ],
          "description": "The gender actually used in the screening query, after normalization. Absent when no gender\nwas declared, or when the declared value could not be mapped and was left out of the query."
        },
        "idNumbers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The identity numbers on the applicant's document (its personal number and document number)\nthat each hit was compared against. Not sent to the provider. Empty when the subject has no\ndocument, as a company officer screened by name."
        },
        "lastName": {
          "type": "string"
        }
      }
    },
    "AmlRelatedPep": {
      "type": "object",
      "description": "A PEP that a relative or close associate is related to.",
      "required": [
        "kind",
        "entityId",
        "names"
      ],
      "properties": {
        "entityId": {
          "type": "string",
          "description": "The provider's id of the PEP's record."
        },
        "kind": {
          "$ref": "#/$defs/AmlPepRelationKind"
        },
        "names": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The PEP's names, as the provider lists them."
        },
        "relationship": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The nature of the relationship, worded by the provider from the PEP's side (\"spouse\",\n\"business partner\"): the record is the PEP's spouse."
        }
      }
    },
    "AmlResult": {
      "type": "object",
      "required": [
        "id",
        "pep",
        "sanctions",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "adverseMedia": {
          "type": "boolean",
          "description": "Whether adverse-media screening for this subject returned a hit. `false` when there was no\nhit or adverse media was not screened."
        },
        "caseId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The KYB case the screening was ordered for, when it names one."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "data": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AmlRiskResult"
            }
          ]
        },
        "flowResultId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The flow result the screening belongs to. Absent for a screening of an operator-opened case\nthat has none."
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "namedPersonRef": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "For a name-only (email-less) UBO/director screening, the screened person's stable id\n(the `UboDefinition`/`DirectorDefinition` `id`); lets consumers correlate this AML row to\nits named person. `None` for verification-request-backed rows (person/company screenings)."
        },
        "pep": {
          "type": "boolean"
        },
        "sanctions": {
          "type": "boolean"
        },
        "subjectType": {
          "$ref": "#/$defs/AmlSubjectType",
          "description": "Whether the screened subject is a person (`PERSON`) or a company (`COMPANY`)."
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "verificationRequestId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        }
      }
    },
    "AmlRiskMetadata": {
      "type": "object",
      "required": [
        "summary",
        "checkedAt",
        "controls"
      ],
      "properties": {
        "adverseMedia": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AmlAdverseMediaResult",
              "description": "Adverse-media screening outcome for this subject, when screening ran.\n`None` for results produced before adverse-media screening was wired."
            }
          ]
        },
        "adverseMediaRequested": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "What the screening's ORDER asked for, recorded verbatim: `Some(true)` when a KYB case asked\nfor adverse media, `Some(false)` when it explicitly declined, `None` when nobody asked and\nthe path's own default applied.\n\nA refresh re-screens under the order the original screening ran under, and the order is the\nonly thing that can say what that was. Inferring it from the OUTCOME — \"it carries adverse\nmedia, so somebody must have asked\" — reads a legacy company screening, which always\nattaches, as case-ordered, and cannot tell a case that declined from a case that never\nasked at all.\n\n`None` on every row written before this field existed, which is the same thing it means on\na new one: nobody asked, so the path's default applies, exactly as it did."
        },
        "adverseMediaUnavailable": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AdverseMediaAbsence",
              "description": "Why adverse-media results are missing: `PROVIDER_UNAVAILABLE` when the screening's provider\ncould not answer (any screening that ran adverse media, a person or company screening\nincluded), `NO_PROVIDER` when a KYB case requested adverse media and no screening is\nconfigured. Absent when adverse media was returned, or not requested and not attempted."
            }
          ]
        },
        "agentReview": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AmlAgentReview",
              "description": "Latest agentic review of this screening, when the AML review pipeline ran.\n`None` on results the agent never reviewed (and on all pre-existing rows)."
            }
          ]
        },
        "checkedAt": {
          "type": "string",
          "format": "date-time"
        },
        "companyQuery": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AmlCompanyQueryMetadata"
            }
          ]
        },
        "controls": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ResultControlOperation"
          }
        },
        "moderation": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AmlModerationStatus",
              "description": "The manual moderation decision currently applied to this screening result. Absent when the\nresult has not been moderated; it is cleared when the subject is re-screened. The full\nhistory of moderation actions is in `controls`."
            }
          ]
        },
        "query": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AmlQueryMetadata"
            }
          ]
        },
        "summary": {
          "$ref": "#/$defs/AmlCheckSummary"
        }
      }
    },
    "AmlRiskResult": {
      "type": "object",
      "required": [
        "entities",
        "metadata"
      ],
      "properties": {
        "entities": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlEntityResult"
          }
        },
        "metadata": {
          "$ref": "#/$defs/AmlRiskMetadata"
        }
      }
    },
    "AmlSanction": {
      "type": "object",
      "properties": {
        "authority": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "authorityId": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "country": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "date": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "duration": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "endDate": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "listingDate": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "program": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "reason": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AmlSource"
          }
        },
        "startDate": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "status": {
          "$ref": "#/$defs/FieldWithControl"
        },
        "unscId": {
          "$ref": "#/$defs/FieldWithControl"
        }
      }
    },
    "AmlSource": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AmlSubjectType": {
      "type": "string",
      "description": "The screened subject of an AML result. DTO mirror of the DB `AmlSubjectType` entity enum\n(converted via `From<entities::AmlSubjectType>`); lets consumers tell a company AML result\nfrom a person one. Defaults to `Person` (every result predating this field was a person).",
      "enum": [
        "PERSON",
        "COMPANY"
      ]
    },
    "AssignedRiskTag": {
      "type": "object",
      "description": "A single custom risk tag that was assigned to a flow result by the flow builder.",
      "required": [
        "id",
        "tag",
        "weight"
      ],
      "properties": {
        "addedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When this derivation last became active. Informational; `None` for legacy rows."
        },
        "definitionKey": {
          "type": [
            "string",
            "null"
          ],
          "description": "Stable key of the score definition the matched `ScoreTag` row belongs to (e.g. `risk`,\n`aml`, or a custom key). `None` on rows persisted before this field existed — consumers\ntreat that as unknown (the frontend falls back to the default `risk` definition)."
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "removedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Tombstone. `None` == active. This is the active predicate."
        },
        "source": {
          "$ref": "#/$defs/RiskTagSource",
          "description": "Provenance / reference key. Absent in legacy rows → `Legacy` (sticky)."
        },
        "tag": {
          "type": "string"
        },
        "weight": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "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)"
        }
      }
    },
    "AutoOneClickKycData": {
      "type": "object",
      "description": "Data for tracking auto one-click KYC flow.",
      "required": [
        "flowId",
        "flowStepId"
      ],
      "properties": {
        "flowId": {
          "type": "string",
          "format": "uuid"
        },
        "flowStepId": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "AutoOneClickKycStepOutput": {
      "type": "object",
      "description": "Auto One-Click KYC step output for workflow decisions.",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "$ref": "#/$defs/ResultStatus"
        }
      }
    },
    "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."
        }
      }
    },
    "CheckStatus": {
      "type": "string",
      "description": "Provider-agnostic check status.\n\nThis enum represents the canonical outcome of any verification check,\nabstracting away provider-specific status codes.\n\n# Deserialization\n\nSupports both string format (\"passed\", \"failed\", etc.) and legacy integer codes:\n- 0 = Passed\n- 1 = Failed\n- 2 = NotPerformed",
      "enum": [
        "passed",
        "failed",
        "not_performed",
        "unknown"
      ]
    },
    "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"
          }
        }
      }
    },
    "CreationSource": {
      "type": "string",
      "description": "How an organization was created. Lets the frontend tell self-serve signups\napart from admin- or partner-provisioned orgs (e.g. to force self-serve orgs\nto pick a real plan instead of the custom plan).\n\n- `SelfServe` — public signup with no invite.\n- `Admin` — created by platform staff; also the default for pre-existing orgs.\n- `Partner` — created through a validated partner invite.",
      "enum": [
        "SELF_SERVE",
        "ADMIN",
        "PARTNER"
      ]
    },
    "DashboardColorMode": {
      "type": "string",
      "description": "Light, dark, or the device's setting: the mode a member keeps for themselves on the dashboard.",
      "enum": [
        "LIGHT",
        "DARK",
        "SYSTEM"
      ]
    },
    "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"
      ]
    },
    "DocscanExtractionProvenance": {
      "type": "object",
      "description": "How the document data was extracted when an AI model read the document: which prompt version\nand model were used, the model's confidence and any warnings, which document sides had\nreadable text, and how long the extraction took. The document images and raw text are not\nincluded.",
      "required": [
        "promptVersion",
        "promptScope",
        "model",
        "confidence",
        "ocrSides",
        "usage",
        "processingTimeMs"
      ],
      "properties": {
        "confidence": {
          "type": "number",
          "format": "double",
          "description": "The model's confidence in the extraction, after the platform's own checks capped it."
        },
        "model": {
          "type": "string",
          "description": "Identifier of the AI model the extraction ran against."
        },
        "ocrSides": {
          "$ref": "#/$defs/OcrSides",
          "description": "Which sides of the document text was read from. A side without text is missing\ncorroboration, not a contradiction."
        },
        "processingTimeMs": {
          "type": "integer",
          "format": "int64",
          "description": "Wall-clock duration of the extraction, including OCR and any schema retry.",
          "minimum": 0
        },
        "promptScope": {
          "$ref": "#/$defs/ExtractionPromptScope",
          "description": "Whether the extraction instructions came from the organization's own override or the\nplatform default."
        },
        "promptVersion": {
          "type": "string",
          "description": "Version of the extraction instructions that produced this result."
        },
        "usage": {
          "$ref": "#/$defs/ExtractionUsage",
          "description": "AI model usage for the successful attempt."
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Why the confidence landed where it did. Without this, a score below the configured\nthreshold is unexplainable from the UI: the reason otherwise exists only inside\n`providerMetadata.responseJson`, which is reachable only by downloading the response log."
        }
      }
    },
    "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"
        }
      }
    },
    "DocumentScanStatus": {
      "type": "object",
      "description": "Status of various document scan checks.\n\n# Deserialization\n\nSupports both new abstract format and legacy format:\n\n**New format:**\n```json\n{ \"overall\": \"passed\", \"documentType\": \"passed\", \"expiry\": \"passed\", \"mrz\": \"passed\" }\n```\n\n**Legacy format:**\n```json\n{\n  \"overallStatus\": 0,\n  \"detailsOptical\": { \"docType\": 1, \"expiry\": 0, \"mrz\": 2, ... },\n  \"optical\": 0, \"portrait\": 1, \"rfid\": 2, ...\n}\n```",
      "required": [
        "overall",
        "documentType",
        "expiry",
        "mrz"
      ],
      "properties": {
        "documentType": {
          "$ref": "#/$defs/CheckStatus",
          "description": "Document type detection result"
        },
        "expiry": {
          "$ref": "#/$defs/CheckStatus",
          "description": "Expiry date validation result"
        },
        "mrz": {
          "$ref": "#/$defs/CheckStatus",
          "description": "MRZ validation result"
        },
        "overall": {
          "$ref": "#/$defs/CheckStatus",
          "description": "Overall verification result"
        }
      }
    },
    "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"
          }
        }
      }
    },
    "DocumentSelectionStepOutput": {
      "type": "object",
      "description": "Document selection step output for workflow decisions.",
      "properties": {
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "documentType": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64"
        }
      }
    },
    "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"
            ]
          }
        }
      }
    },
    "DvFaceMatch": {
      "type": "string",
      "description": "Whether the flow matches the person's face against the document.",
      "enum": [
        "CONFIGURED",
        "NOT_CONFIGURED"
      ]
    },
    "DvOperatorUpload": {
      "type": "object",
      "description": "Whether, and why not, the organization's reviewers can upload the person's identity document.\n\nThe upload is for a person whose own uploads failed for the picture alone: it opens once the\nresult is failed or partial and the person's attempts that failed on picture quality reach the\nplatform's threshold, and never after a fraud signal, in Zyphe's admin review, past the\nattempt cap or for an organization without operator upload. The upload route recomputes this\nand refuses the same way.",
      "required": [
        "unlocked",
        "qualityFailures",
        "threshold"
      ],
      "properties": {
        "blockedBy": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/DvOperatorUploadBlock",
              "description": "What closes the upload, when something named does. `null` when it is open, and when the\nonly thing missing is quality failures (or the result is not a failed or partial one)."
            }
          ]
        },
        "qualityFailures": {
          "type": "integer",
          "format": "int32",
          "description": "The person's attempts, graded or not, that failed for the picture alone.",
          "minimum": 0
        },
        "threshold": {
          "type": "integer",
          "format": "int32",
          "description": "How many of them open the upload.",
          "minimum": 0
        },
        "unlocked": {
          "type": "boolean",
          "description": "Whether the upload is open."
        }
      }
    },
    "DvOperatorUploadBlock": {
      "type": "string",
      "description": "Why a member of the platform staff cannot upload the person's identity document now.",
      "enum": [
        "FRAUD_FLAG",
        "ADMIN_REVIEW",
        "ATTEMPTS_EXHAUSTED",
        "FEATURE_OFF"
      ]
    },
    "DvReason": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "WRONG_DOCUMENT_TYPE",
        "COUNTRY_FILTER",
        "FACE_MATCH_CHECK",
        "FACE_MATCH_CHECK_ONE_CLICK",
        "OVERALL_STATUS",
        "DOCUMENT_COUNTRY_MISMATCH",
        "DOCUMENT_COUNTRY_MISSING",
        "DATE_OF_EXPIRY_NOT_VALID",
        "DATE_OF_EXPIRY_NOT_READABLE",
        "DATE_OF_EXPIRY_FIELD_MISSING",
        "DOCUMENT_ALREADY_USED_BY_ANOTHER_USER",
        "DOCUMENT_FINGERPRINT_COMPUTATION",
        "SECURITY_CHECK_FAILED",
        "CROSS_CHECK_FAILED",
        "DOCUMENT_ALTERATION_DETECTED",
        "DOCUMENT_TAMPERING_DETECTED",
        "FAKE_DOCUMENT_DETECTED",
        "SCREEN_REPLAY_ATTACK_DETECTED",
        "PAPER_COPY_DETECTED",
        "DOCUMENT_SCORE_BELOW_THRESHOLD",
        "DOCUMENT_TYPE_NOT_DEFINED",
        "DOCUMENT_NOT_FOUND",
        "DATE_OF_BIRTH_BELOW_MINIMUM_AGE",
        "DOCUMENT_TYPE_CHECK",
        "ELECTRONIC_DEVICE",
        "SECURITY_TEXT",
        "IMAGE_PATTERNS",
        "PHOTO_EMBEDDINGS",
        "BLACK_AND_WHITE_COPY",
        "UNIQUENESS_CHECK",
        "REQUIRED_FIELDS_MISMATCH",
        "LIVENESS_CHECK_FAILED",
        "LIVENESS_ANTISPOOF_FAILED",
        "LIVENESS_BRIGHTNESS_FAILED",
        "LIVENESS_EYES_CLOSED_FAILED",
        "LIVENESS_WEARING_SUNGLASSES_FAILED",
        "LIVENESS_FACE_OCCLUDED_FAILED",
        "LIVENESS_SHARPNESS_FAILED",
        "LIVENESS_FACE_CONSISTENCY_FAILED",
        "MISSING_FRONT_IMAGE",
        "DUPLICATE_IMAGE_SIDE",
        "INVALID_IMAGE_DATA",
        "IMAGE_TOO_LARGE",
        "UNSUPPORTED_IMAGE_FORMAT",
        "DOCUMENT_INCOMPLETE"
      ]
    },
    "DvResult": {
      "type": "object",
      "required": [
        "id",
        "status",
        "reasons",
        "data",
        "processAdditionalData",
        "authenticityChecks"
      ],
      "properties": {
        "adminComment": {
          "type": [
            "string",
            "null"
          ]
        },
        "authenticityChecks": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        },
        "browser": {
          "type": [
            "string",
            "null"
          ]
        },
        "class": {
          "type": [
            "string",
            "null"
          ]
        },
        "countryCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "data": {
          "type": "object",
          "additionalProperties": {},
          "propertyNames": {
            "type": "string"
          }
        },
        "documentClass": {
          "type": [
            "string",
            "null"
          ],
          "description": "The class of the document, the same whichever provider read it: `Passport`, `DriversLicense`,\n`IdentificationCard`, `ResidenceDocument`, `Visa`, `TravelDocument`, `TaxIdentification`,\n`MedicalCard`, `AlienId` (a foreign-national registration id) or `Unknown`. Derived from\n`documentType`, the type the result stores: for a failed result it can be the document the\nholder picked rather than the one read. A `documentType` the types above do not cover, or of\n0 (none read), reads `Unknown`. `null` when the result has no `documentType`."
        },
        "documentId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "documentScorePercent": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "documentType": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "faceMatch": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/DvFaceMatch",
              "description": "Whether the person's face is matched against this document in the flow. Only the result's\ndetails carry it."
            }
          ]
        },
        "flowStep": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FlowStep"
            }
          ]
        },
        "flowStepId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "manualReviewAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "manualReviewNote": {
          "type": [
            "string",
            "null"
          ]
        },
        "manualReviewerId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "manualReviewerZid": {
          "type": [
            "string",
            "null"
          ]
        },
        "operatorUpload": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/DvOperatorUpload",
              "description": "Whether the organization's reviewers can upload the person's identity document now. Only\nthe result's details carry it, and only for a caller that is not an API key."
            }
          ]
        },
        "originalVrHistoryId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "platform": {
          "type": [
            "string",
            "null"
          ]
        },
        "portraitMatchPercent": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "processAdditionalData": {
          "$ref": "#/$defs/ProcessAdditionalData"
        },
        "provinceCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "reasons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DvReason"
          }
        },
        "reviewReason": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/DvReviewReason",
              "description": "Why the verification was last sent for review by a rule. `null` when no rule did, and on\nresults sent for review before this was recorded."
            }
          ]
        },
        "sentBackAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When a reviewer sent this step back to the person, while it still waits for them: the\nperson has not touched the step since. `null` once they have, and for a step that was never\nsent back. Set on a flow result's details only."
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "uploadedBy": {
          "$ref": "#/$defs/ResultUploader",
          "description": "Who uploaded the document this result was produced from: the person being verified\n(`END_USER`) or a member of the platform staff acting for them (`OPERATOR`)."
        },
        "uploadedByIdentityId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The staff identity that uploaded the document; absent for an end user."
        },
        "uploadedByName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the staff member that uploaded the document, from their account. Never their\nemail. Absent for an end user, and for a caller that holds an API key."
        },
        "validUntil": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When this KYC result expires and re-verification is required (re-KYC validity).\n`null` means it never expires (no `kyc_validity_seconds` configured, or a legacy result)."
        },
        "verificationRequestId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        }
      }
    },
    "DvReviewReason": {
      "oneOf": [
        {
          "type": "object",
          "description": "The user failed every attempt the step allows.",
          "required": [
            "attempts",
            "maxAttempts",
            "kind"
          ],
          "properties": {
            "attempts": {
              "type": "integer",
              "format": "int32"
            },
            "kind": {
              "type": "string",
              "enum": [
                "ATTEMPTS_EXHAUSTED"
              ]
            },
            "maxAttempts": {
              "type": "integer",
              "format": "int32"
            }
          }
        },
        {
          "type": "object",
          "description": "A failed attempt matched a reason that ends the verification at once, whatever attempts\nare left. `reasons` are the matched ones.",
          "required": [
            "reasons",
            "kind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "BLOCKING_REASON"
              ]
            },
            "reasons": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/DvReason"
              }
            }
          }
        },
        {
          "type": "object",
          "description": "Too many captures in a row could not be graded at all (unreadable images, provider\nerrors). `attempts` is how many in a row.",
          "required": [
            "attempts",
            "kind"
          ],
          "properties": {
            "attempts": {
              "type": "integer",
              "format": "int32"
            },
            "kind": {
              "type": "string",
              "enum": [
                "UNUSABLE_CAPTURES"
              ]
            }
          }
        }
      ],
      "description": "Why a DV or liveness verification was taken out of the user's hands and sent for review.\n\nWritten by the attempt that ends the verification; the review that follows leaves it as it is.\nIt names the most recent escalation: a later escalation replaces it."
    },
    "DvStepOutput": {
      "type": "object",
      "required": [
        "status",
        "numberOfAttempts"
      ],
      "properties": {
        "amlAdverseMedia": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the subject's screening found adverse media — a routing signal beside `amlPep` and\n`amlSanctions`, so a flow can branch on it as it can on the other two. `None` until a\nscreening lands, and on outputs written before the signal existed."
        },
        "amlPep": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "amlRiskScorePercent": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "amlSanctions": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "dateOfExpiry": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "documentType": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "issuingCountry": {
          "type": [
            "string",
            "null"
          ]
        },
        "livenessStatus": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/ResultStatus"
            }
          ]
        },
        "numberOfAttempts": {
          "type": "integer",
          "format": "int32"
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        }
      },
      "additionalProperties": {
        "type": "boolean",
        "description": "Pre-compiled results of conditions that reference vault-derived personal data\n(name, surname, date of birth, age, etc.).\n\nEach entry maps a stable `condition_hash` (16-char hex, see\n`matcher::precompile::condition_hash`) to the boolean result of evaluating\nthat condition against the live in-memory `VaultDocument` at the moment the\nDV background job ran.\n\nFlattened into the serialized output so each hash becomes a top-level sibling\nof `status`, `issuingCountry`, etc. — referenceable as `\"dv_step.<hash>\"`.\n\nAt JDM evaluation time, `vault_condition::resolve_precompiled_graph` replaces\nany condition whose hash is present here with `Condition::Literal { value }`,\nso no vault PII ever needs to be stored in or read from the database."
      }
    },
    "EndUserEmails": {
      "type": "object",
      "description": "Which emails Zyphe sends to the people an organization verifies (ENG-1561), one switch per\nkind. A flow's switch wins over its organization's; a switch neither sets is on.\n\nEvery field serializes, `null` included: settings are saved as a JSON merge patch, where a\n`null` clears a flow's override so it follows the organization again.",
      "properties": {
        "incompleteReminder": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "officerInvites": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "retryRequest": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "reverificationReminder": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "reviewUpdates": {
          "type": [
            "boolean",
            "null"
          ]
        }
      }
    },
    "ExtractionPromptScope": {
      "type": "string",
      "enum": [
        "PLATFORM",
        "ORGANIZATION"
      ]
    },
    "ExtractionUsage": {
      "type": "object",
      "required": [
        "promptTokens",
        "completionTokens",
        "totalTokens"
      ],
      "properties": {
        "completionTokens": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "promptTokens": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "totalTokens": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    },
    "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."
    },
    "FieldControlOperation": {
      "type": "object",
      "required": [
        "timestamp",
        "identityId",
        "zid",
        "operation"
      ],
      "properties": {
        "identityId": {
          "type": "string",
          "format": "uuid"
        },
        "operation": {
          "$ref": "#/$defs/FieldControlOperationType"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "zid": {
          "type": "string"
        }
      }
    },
    "FieldControlOperationType": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "markAsFalsePositive"
          ],
          "properties": {
            "markAsFalsePositive": {
              "type": "object",
              "required": [
                "comment"
              ],
              "properties": {
                "comment": {
                  "type": "string"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "unmarkAsFalsePositive"
          ],
          "properties": {
            "unmarkAsFalsePositive": {
              "type": "object",
              "required": [
                "comment"
              ],
              "properties": {
                "comment": {
                  "type": "string"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "comment"
          ],
          "properties": {
            "comment": {
              "type": "object",
              "required": [
                "comment"
              ],
              "properties": {
                "comment": {
                  "type": "string"
                }
              }
            }
          }
        }
      ]
    },
    "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."
            }
          ]
        }
      }
    },
    "FieldWithControl": {
      "type": "object",
      "required": [
        "value",
        "controls"
      ],
      "properties": {
        "controls": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FieldControlOperation"
          }
        },
        "value": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "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"
        }
      }
    },
    "FlowAmlScreening": {
      "type": "object",
      "description": "A flow's AML screening of the people it verifies (ENG-1542). Each person's first screening in a\nflow result is charged at the organization's AML rate; ongoing monitoring re-screens them\nperiodically, billed per subject per year where the organization prices it. A company's KYB\nkeeps its case screening, which this does not govern.",
      "required": [
        "enabled"
      ],
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether the people the flow verifies are screened."
        },
        "ongoingMonitoring": {
          "type": "boolean",
          "description": "Whether they stay under ongoing monitoring."
        }
      }
    },
    "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"
            }
          }
        }
      ]
    },
    "FlowStepOutput": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/DvStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "DV"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/PoaStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "POA"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/SpidStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "SPID"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/WalletStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "WALLET"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/PhoneStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "PHONE"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/FormStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "FORM"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/KybStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "KYB"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/LivenessStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "LIVENESS"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/AutoOneClickKycStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "AUTO_ONE_CLICK_KYC"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/ActionStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "ACTION"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/DocumentSelectionStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "DOCUMENT_SELECTION"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/GeolocationStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "GEOLOCATION"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/KybDocumentsStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "KYB_DOCUMENTS"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/KybUbosStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "KYB_UBOS"
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "data",
            "type"
          ],
          "properties": {
            "data": {
              "$ref": "#/$defs/KybDirectorsStepOutput"
            },
            "type": {
              "type": "string",
              "enum": [
                "KYB_DIRECTORS"
              ]
            }
          }
        }
      ]
    },
    "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"
              ]
            }
          }
        }
      ]
    },
    "FormReason": {
      "type": "string",
      "enum": [
        "UNKNOWN"
      ]
    },
    "FormResult": {
      "type": "object",
      "required": [
        "id",
        "flowResultId",
        "status",
        "sections"
      ],
      "properties": {
        "assignedRiskTags": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/AssignedRiskTag"
          },
          "description": "Risk tags assigned during form scoring. `None` if not scored."
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "flowResultId": {
          "type": "string",
          "format": "uuid"
        },
        "flowStep": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FlowStep"
            }
          ]
        },
        "flowStepId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "form": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Form"
            }
          ]
        },
        "formId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "reason": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FormReason"
            }
          ]
        },
        "riskFactorKeys": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          },
          "description": "Risk factor keys matched during form scoring. `None` if not scored."
        },
        "sections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormSection"
          }
        },
        "sentBackAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When a reviewer sent this step back to the person, while it still waits for them: the\nperson has not touched the step since. `null` once they have, and for a step that was never\nsent back. Set on a flow result's details only."
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "verificationRequestId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        }
      }
    },
    "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"
        }
      }
    },
    "FormStepOutput": {
      "type": "object",
      "description": "Form step output for workflow decisions.\n\n# Field Name Restrictions\n\nThe `fields` HashMap is flattened during serialization. Form field names must not conflict\nwith the reserved field names \"status\" and \"riskScorePercent\", as this would create duplicate\nkeys in the serialized JSON output, resulting in invalid JSON.",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "$ref": "#/$defs/ResultStatus",
          "description": "Form submission status."
        }
      },
      "additionalProperties": {
        "description": "Dynamic form fields flattened into the output.\nNote: Field names must not conflict with \"status\" or \"riskScorePercent\" to avoid duplicate\nkeys during serialization."
      }
    },
    "GeolocationConfig": {
      "type": "object",
      "properties": {
        "ipValidation": {
          "type": "boolean"
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "locationCrossCheck": {
          "type": "boolean"
        },
        "vpnDetection": {
          "type": "boolean"
        }
      }
    },
    "GeolocationResult": {
      "type": "object",
      "required": [
        "id",
        "status",
        "vpn",
        "blacklistedIp",
        "flowResultId"
      ],
      "properties": {
        "blacklistedIp": {
          "type": "boolean"
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "deviceFingerprint": {
          "type": [
            "string",
            "null"
          ]
        },
        "flowResultId": {
          "type": "string",
          "format": "uuid"
        },
        "flowStep": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FlowStep"
            }
          ]
        },
        "flowStepId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "ipAddress": {
          "type": [
            "string",
            "null"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "verificationRequestId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "vpn": {
          "type": "boolean"
        }
      }
    },
    "GeolocationStepOutput": {
      "type": "object",
      "description": "Geolocation step output for workflow decisions.",
      "properties": {
        "blacklistedIp": {
          "type": "boolean"
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "deviceFingerprint": {
          "type": [
            "string",
            "null"
          ]
        },
        "ipAddress": {
          "type": [
            "string",
            "null"
          ]
        },
        "vpn": {
          "type": "boolean"
        }
      }
    },
    "Identity": {
      "type": "object",
      "required": [
        "id",
        "zid",
        "role",
        "emailVerified",
        "isActive",
        "settings"
      ],
      "properties": {
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "defaultOrganizationId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "emailVerified": {
          "type": "boolean"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "isActive": {
          "type": "boolean"
        },
        "role": {
          "$ref": "#/$defs/Role"
        },
        "settings": {
          "$ref": "#/$defs/IdentitySettings"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "zid": {
          "type": "string"
        }
      }
    },
    "IdentitySettings": {
      "type": "object",
      "required": [
        "locale"
      ],
      "properties": {
        "colorMode": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/DashboardColorMode",
              "description": "The dashboard mode this person chose for themselves. `None` follows the organization's\ndashboard theme (Appearance)."
            }
          ]
        },
        "firstName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's first name, as typed at registration. Only an account registered through\n`/auth/register` (organization staff) has one: never set for a GUEST, the person being\nverified."
        },
        "lastEnvironmentIsSandbox": {
          "type": "boolean"
        },
        "lastName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The person's last name, as typed at registration. Same scope as the first name."
        },
        "locale": {
          "$ref": "#/$defs/Locale"
        },
        "synthetic": {
          "type": "boolean",
          "description": "`true` when this identity is demo/synthetic data (for example generated sample data in a\nsandbox) rather than a real end user. Never set for a real verified identity."
        }
      }
    },
    "ImageQualityCheckResult": {
      "type": "object",
      "description": "Result of an image quality check.\n\n# Deserialization\n\nSupports both new abstract format and legacy format:\n\n**New format:**\n```json\n{ \"checkType\": \"focus\", \"result\": \"passed\", \"probability\": 97 }\n```\n\n**Legacy format (single item from 'list'):**\n```json\n{ \"type\": 1, \"result\": 0, \"probability\": 97, \"featureType\": 0, \"mean\": 0.0, \"stdDev\": 0.0 }\n```",
      "required": [
        "checkType",
        "result"
      ],
      "properties": {
        "advisory": {
          "type": "boolean",
          "description": "Reported to the holder, excluded from the document score. Set when the check means\n\"this capture could not be read\" rather than \"this document is poor\"."
        },
        "checkType": {
          "$ref": "#/$defs/ImageQualityCheckType"
        },
        "details": {
          "description": "Why the check landed where it did — the gate that tripped, the value measured and the\nbar it missed. A failed image-quality check is what turns a holder away and asks them\nto shoot again, so it is the one result that always has to be explainable."
        },
        "probability": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "result": {
          "$ref": "#/$defs/CheckStatus"
        }
      }
    },
    "ImageQualityCheckType": {
      "type": "string",
      "description": "Types of image quality checks.\n\n# Deserialization\n\nSupports both string format and legacy integer type codes:\n- 0 = Glare (ImageGlares)\n- 1 = Focus (ImageFocus)\n- 2 = Resolution (ImageResolution)\n- 3 = Colorness (ImageColorness)\n- 4 = Perspective (ImagePerspective)\n- 5 = Bounds (ImageBounds)\n- 6 = ScreenCapture (ImageScreenCapture)\n- 7 = Portrait (ImagePortrait)",
      "enum": [
        "glare",
        "focus",
        "resolution",
        "colorness",
        "perspective",
        "bounds",
        "screen_capture",
        "portrait",
        "image_quality",
        "unknown"
      ]
    },
    "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"
        }
      }
    },
    "KybDirectorsStepOutput": {
      "type": "object",
      "description": "KYB directors satellite step output for workflow decisions.",
      "required": [
        "directorCount",
        "allDirectorsVerified"
      ],
      "properties": {
        "allDirectorsVerified": {
          "type": "boolean"
        },
        "directorCount": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    },
    "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."
        }
      }
    },
    "KybDocumentsStepOutput": {
      "type": "object",
      "description": "KYB documents satellite step output for workflow decisions.\n\nThin output for the `KYB_DOCUMENTS` step (see `FlowStepOutput::Kyb` for the KYB\naggregate carried on the anchor step).",
      "required": [
        "uploadedCount",
        "requiredSatisfied"
      ],
      "properties": {
        "requiredSatisfied": {
          "type": "boolean"
        },
        "uploadedCount": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    },
    "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."
        }
      }
    },
    "KybResult": {
      "type": "object",
      "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.",
      "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
    },
    "KybStepOutput": {
      "type": "object",
      "description": "KYB (Know Your Business) step output for workflow decisions.",
      "required": [
        "status"
      ],
      "properties": {
        "amlAdverseMedia": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the company's screening found adverse media."
        },
        "amlPep": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "amlRiskScorePercent": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "amlSanctions": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "businessName": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "moderationStatus": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/ModerationResultStatus"
            }
          ]
        },
        "pepAndSanctionsStatus": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/PepAndSanctionsStatus"
            }
          ]
        },
        "registrationNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        }
      }
    },
    "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"
        }
      }
    },
    "KybUbosStepOutput": {
      "type": "object",
      "description": "KYB UBOs satellite step output for workflow decisions.",
      "required": [
        "uboCount",
        "allUbosVerified"
      ],
      "properties": {
        "allUbosVerified": {
          "type": "boolean"
        },
        "uboCount": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    },
    "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"
            ]
          }
        }
      }
    },
    "LivenessStepOutput": {
      "type": "object",
      "description": "Liveness check step output for workflow decisions.",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "$ref": "#/$defs/ResultStatus"
        }
      }
    },
    "Locale": {
      "type": "string",
      "description": "Locale identifier",
      "enum": [
        "en",
        "it",
        "de",
        "es",
        "fr",
        "hi",
        "id",
        "pt"
      ]
    },
    "LogicalOperator": {
      "type": "string",
      "description": "Logical operators for workflow branching.",
      "enum": [
        "BRANCH",
        "SWITCH",
        "MERGE",
        "PARALLEL_SPLIT",
        "PARALLEL_JOIN"
      ]
    },
    "ManualReviewResultStatus": {
      "type": "string",
      "enum": [
        "approved",
        "rejected",
        "failed"
      ]
    },
    "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"
        }
      }
    },
    "OcrSides": {
      "type": "object",
      "required": [
        "front",
        "back"
      ],
      "properties": {
        "back": {
          "type": "boolean"
        },
        "front": {
          "type": "boolean"
        }
      }
    },
    "Organization": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "name",
        "registrationNumber",
        "country",
        "address",
        "website",
        "email",
        "phone",
        "creationSource"
      ],
      "properties": {
        "address": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "creationSource": {
          "$ref": "#/$defs/CreationSource"
        },
        "email": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "industry": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "operatorUploadEnabled": {
          "type": "boolean",
          "description": "Whether the organization's reviewers can upload a person's documents from the dashboard: a\nproof of address, and an identity document once the person's own captures failed on picture\nquality. Set by a platform admin; off by default."
        },
        "phone": {
          "type": "string"
        },
        "postcode": {
          "type": [
            "string",
            "null"
          ]
        },
        "registrationNumber": {
          "type": "string"
        },
        "settings": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Settings"
            }
          ]
        },
        "slug": {
          "type": "string"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "website": {
          "type": "string"
        }
      }
    },
    "PepAndSanctionsStatus": {
      "type": "string",
      "enum": [
        "REVIEW",
        "PENDING",
        "SUCCESS",
        "FAILED",
        "IN_PROGRESS"
      ]
    },
    "PhoneConfig": {
      "type": "object",
      "properties": {
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        }
      }
    },
    "PhoneResult": {
      "type": "object",
      "required": [
        "id",
        "status",
        "phoneNumberLast4",
        "flowResultId"
      ],
      "properties": {
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "documentId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "flowResultId": {
          "type": "string",
          "format": "uuid"
        },
        "flowStep": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FlowStep"
            }
          ]
        },
        "flowStepId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "phoneNumberE164": {
          "type": [
            "string",
            "null"
          ]
        },
        "phoneNumberLast4": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "verificationRequestId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        }
      }
    },
    "PhoneStepOutput": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "$ref": "#/$defs/ResultStatus"
        }
      }
    },
    "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"
      ]
    },
    "PoaReason": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "DOCUMENT_TYPE_NOT_ALLOWED",
        "NAME_MISMATCH",
        "DATE_TOO_OLD",
        "INVALID_DOCUMENT",
        "UNRECOGNIZED_ADDRESS"
      ]
    },
    "PoaResult": {
      "type": "object",
      "required": [
        "id",
        "status",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "checkedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "documentId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "documentType": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/PoaDocumentType"
            }
          ]
        },
        "flowStep": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FlowStep"
            }
          ]
        },
        "flowStepId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "reason": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/PoaReason"
            }
          ]
        },
        "sentBackAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When a reviewer sent this step back to the person, while it still waits for them: the\nperson has not touched the step since. `null` once they have, and for a step that was never\nsent back. Set on a flow result's details only."
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "uploadedBy": {
          "$ref": "#/$defs/ResultUploader",
          "description": "Who uploaded the document this result was produced from: the person being verified\n(`END_USER`) or a member of the platform staff acting for them (`OPERATOR`)."
        },
        "uploadedByIdentityId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The staff identity that uploaded the document; absent for an end user."
        },
        "uploadedByName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the staff member that uploaded the document, from their account. Never their\nemail. Absent for an end user, and for a caller that holds an API key."
        },
        "verificationRequestId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        }
      }
    },
    "PoaStepOutput": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "documentAgeDays": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64"
        },
        "documentType": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        }
      }
    },
    "PortraitAgeRange": {
      "type": "object",
      "description": "An estimated age bracket, in whole years.",
      "required": [
        "low",
        "high"
      ],
      "properties": {
        "high": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "low": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    },
    "PortraitEstimate": {
      "type": "object",
      "description": "What face analysis estimated from the portrait printed on the identity document: whether it\nis a face, the apparent age range and the perceived gender. Recorded for every scan that\nfound a portrait, and used as the evidence behind the portrait-attribute security checks.",
      "required": [
        "faceConfidence"
      ],
      "properties": {
        "ageRange": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/PortraitAgeRange",
              "description": "Estimated age bracket in whole years, inclusive at both ends. An estimate of how old the\nperson *looks* in the photo — which is how old they were when it was taken, not today."
            }
          ]
        },
        "faceConfidence": {
          "type": "number",
          "format": "float",
          "description": "The service's confidence (0-100) that the selected crop is a face at all."
        },
        "gender": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/PortraitGenderEstimate",
              "description": "Perceived gender, as the service predicts it from appearance."
            }
          ]
        }
      }
    },
    "PortraitGenderEstimate": {
      "type": "object",
      "description": "A perceived-gender prediction with the service's confidence in it.",
      "required": [
        "value",
        "confidence"
      ],
      "properties": {
        "confidence": {
          "type": "number",
          "format": "float",
          "description": "0-100."
        },
        "value": {
          "type": "string",
          "description": "`M` or `F` — the two values the service can predict, in the same notation as the\ndocument's printed sex so the two read side by side."
        }
      }
    },
    "ProcessAdditionalData": {
      "type": "object",
      "description": "Typed representation of process_additional_data stored in DV results.\n\nThis struct captures all the additional data associated with document\nverification processing, including document scan status, image quality\nchecks, security checks, and liveness data.\n\n# Deserialization\n\nSupports both new abstract format and legacy format. The main difference\nis in the `imageQuality` field:\n\n**New format:**\n```json\n{\n  \"imageQuality\": [\n    { \"checkType\": \"focus\", \"result\": \"passed\", \"probability\": 97 }\n  ]\n}\n```\n\n**Legacy format:**\n```json\n{\n  \"imageQuality\": [\n    {\n      \"count\": 6,\n      \"list\": [\n        { \"type\": 1, \"result\": 0, \"probability\": 97, ... }\n      ],\n      \"result\": 0\n    }\n  ]\n}\n```",
      "properties": {
        "authenticityVerified": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether a document-authenticity assessment actually ran for this result.\n\n`Some(false)` means no tampering/forgery/replay check was performed — it is not a\nstatement that the document is genuine. Read this before treating an empty\n`security_checks` map as a pass. `None` on results written before the flag existed."
        },
        "autoOneClickKycData": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AutoOneClickKycData",
              "description": "Auto one-click KYC flow tracking data"
            }
          ]
        },
        "biometricCheckData": {
          "description": "Biometric check data (for face matching results)"
        },
        "documentExpiredWebhookSentAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Date on which the `DocumentExpired` webhook was sent for this document-verification result.\nAbsent until the document has expired and the webhook has gone out; the webhook is sent\nonly once per result."
        },
        "extraction": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/DocscanExtractionProvenance",
              "description": "How this result's extraction was produced. `None` for provider paths that do not\nextract with a model, and on results written before this field existed."
            }
          ]
        },
        "imageQuality": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/ImageQualityCheckResult"
          },
          "description": "Image quality check results"
        },
        "portrait": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/PortraitEstimate",
              "description": "What the face-analysis service read off the document portrait, when one was found.\n`None` when the document carried no detectable portrait, on provider paths that crop\ntheir own portrait, and on results written before this field existed."
            }
          ]
        },
        "rawLivenessData": {
          "description": "Raw liveness data from face verification"
        },
        "replay": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/ReplayAssessment",
              "description": "What the replay assessment measured, when one ran. `None` when it is switched off for\nthe step, when the client submitted no raw frames, and on results written before this\nfield existed.\n\n`security_checks` above records only the verdict as three pass/fail statuses, which is\nenough to explain a rejection but not enough to question one."
            }
          ]
        },
        "securityChecks": {
          "type": [
            "object",
            "null"
          ],
          "description": "Security check results (mapped by check type)",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "status": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/DocumentScanStatus",
              "description": "Document scan status from verification"
            }
          ]
        }
      }
    },
    "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."
        }
      }
    },
    "ReplayAssessment": {
      "type": "object",
      "description": "Result of the replay-attack check for one document: whether the capture looks like a live\ndocument or a reproduction of one (a photo of a screen or of a print), with the scores behind\nthat verdict for the document as a whole and for each side.",
      "required": [
        "verdict",
        "attackScore",
        "screenScore",
        "printScore",
        "secondgenScore",
        "confidence"
      ],
      "properties": {
        "attackScore": {
          "type": "number",
          "format": "double",
          "description": "Stage one: how strongly the capture reads as a reproduction of any medium, in [0, 1].\nThis is the score compared against the rejection threshold."
        },
        "confidence": {
          "type": "number",
          "format": "double",
          "description": "How far past the decision threshold the verdict landed, in [0, 1]. Zero for\n`INCONCLUSIVE`, where no decision was reached."
        },
        "flags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "printScore": {
          "type": "number",
          "format": "double"
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Why the verdict landed where it did, most significant first."
        },
        "screenScore": {
          "type": "number",
          "format": "double",
          "description": "Stage two: how strongly it reads as a display and as a print respectively. A medium is\nonly named when one leads the other by a margin *and* clears an absolute bar."
        },
        "secondgenScore": {
          "type": "number",
          "format": "double",
          "description": "Generation-loss evidence. Scored and reported but never part of the verdict: its\nabsolute distributions overlap too much to reject on, so it exists to raise\n`SECOND_GENERATION` in `flags` for step-up handling."
        },
        "sides": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReplaySideAssessment"
          },
          "description": "Per side, keyed by `front`/`back`."
        },
        "verdict": {
          "type": "string",
          "description": "`LIVE`, `SCREEN`, `PRINT`, `ATTACK` or `INCONCLUSIVE`, taken across both sides at their\nworst case. `INCONCLUSIVE` means the capture was too degraded to read — it asks for\nanother capture and is not an accusation."
        }
      }
    },
    "ReplaySideAssessment": {
      "type": "object",
      "description": "The replay-attack check's verdict and scores for one side (front or back) of the document.",
      "required": [
        "side",
        "verdict",
        "attackScore",
        "screenScore",
        "printScore"
      ],
      "properties": {
        "attackScore": {
          "type": "number",
          "format": "double"
        },
        "features": {
          "type": "object",
          "description": "Every raw feature the detector measured for this side. The calibration input.",
          "additionalProperties": {
            "type": "number",
            "format": "double"
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "printScore": {
          "type": "number",
          "format": "double"
        },
        "qualityFailures": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Quality-gate failures, when this side could not be read. Empty on a side that was\njudged."
        },
        "screenScore": {
          "type": "number",
          "format": "double"
        },
        "side": {
          "type": "string",
          "description": "`front` or `back`."
        },
        "verdict": {
          "type": "string"
        }
      }
    },
    "RequiredDocumentField": {
      "type": "string",
      "enum": [
        "firstName",
        "middleName",
        "lastName",
        "dateOfBirth",
        "phone",
        "email",
        "street",
        "city",
        "state",
        "postcode",
        "country",
        "socialSecurityNumber",
        "expirationDate",
        "documentNumber"
      ]
    },
    "ResultControlOperation": {
      "type": "object",
      "required": [
        "timestamp",
        "identityId",
        "zid",
        "operation"
      ],
      "properties": {
        "identityId": {
          "type": "string",
          "format": "uuid"
        },
        "operation": {
          "$ref": "#/$defs/ResultControlOperationType"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "zid": {
          "type": "string"
        }
      }
    },
    "ResultControlOperationType": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "approve"
          ],
          "properties": {
            "approve": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "reject"
          ],
          "properties": {
            "reject": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "escalate"
          ],
          "properties": {
            "escalate": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      ]
    },
    "ResultStatus": {
      "type": "string",
      "enum": [
        "PASSED",
        "FAILED",
        "PARTIAL",
        "REQUIRES_MANUAL_REVIEW"
      ]
    },
    "ResultUploader": {
      "type": "string",
      "description": "Who uploaded the document a result was produced from.\n\n`END_USER` is the person being verified, through the hosted flow or the SDK. `OPERATOR` is a\nmember of the platform staff (an organization's reviewer or Zyphe's own support) acting from the\ndashboard. An operator's upload is never an automatic pass: the checks are the same.",
      "enum": [
        "END_USER",
        "OPERATOR"
      ]
    },
    "ReviewSuggestion": {
      "type": "object",
      "required": [
        "suggestion",
        "confidence"
      ],
      "properties": {
        "confidence": {
          "type": "number",
          "format": "double"
        },
        "suggestion": {
          "$ref": "#/$defs/ManualReviewResultStatus"
        }
      }
    },
    "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."
        }
      }
    },
    "RiskLevel": {
      "type": "string",
      "enum": [
        "low",
        "medium",
        "high",
        "critical"
      ]
    },
    "RiskScore": {
      "type": "object",
      "required": [
        "riskScorePercent",
        "riskLevel",
        "sourcesCount"
      ],
      "properties": {
        "riskLevel": {
          "$ref": "#/$defs/RiskLevel"
        },
        "riskScorePercent": {
          "type": "integer",
          "format": "int32"
        },
        "sourcesCount": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "RiskTagSource": {
      "oneOf": [
        {
          "type": "object",
          "description": "Human-asserted; only a human clears it. Never auto-retracted.",
          "required": [
            "kind"
          ],
          "properties": {
            "by": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            },
            "kind": {
              "type": "string",
              "enum": [
                "manual"
              ]
            }
          }
        },
        {
          "type": "object",
          "description": "Answer-driven form emission; recomputed at form submit.",
          "required": [
            "field",
            "kind"
          ],
          "properties": {
            "field": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "formAnswer"
              ]
            }
          }
        },
        {
          "type": "object",
          "description": "`AssignRiskTags` action node; recomputed by forward re-derivation.",
          "required": [
            "node_id",
            "kind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "action"
              ]
            },
            "node_id": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        {
          "type": "object",
          "description": "A tag assigned before its source was recorded. It is not recomputed or removed\nautomatically.",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "legacy"
              ]
            }
          }
        }
      ],
      "description": "Provenance for an `AssignedRiskTag` derivation. Determines whether a machine-driven\nrecompute is allowed to retract it (`Manual`/`Legacy` are sticky; only a human clears them)."
    },
    "Role": {
      "type": "string",
      "enum": [
        "ANONYMOUS",
        "GUEST",
        "ORG_ADMIN",
        "ORG_OPERATOR",
        "ORG_DEVELOPER",
        "AML_OFFICER",
        "PARTNER_USER",
        "PLATFORM_OPERATOR",
        "PLATFORM_SALES",
        "PLATFORM_ADMIN",
        "SDK",
        "SYSTEM"
      ]
    },
    "SarHandoff": {
      "type": "string",
      "description": "What a member left out of an escalated case still reads of it: the organization's setting (ENG-1739).\n\nWhoever holds the SAR permission reads every case either way; the setting is about everybody else.",
      "enum": [
        "READABLE",
        "RESTRICTED"
      ]
    },
    "SelectOptions": {
      "type": "object",
      "required": [
        "values",
        "isOtherAllowed"
      ],
      "properties": {
        "isOtherAllowed": {
          "type": "boolean"
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Settings": {
      "type": "object",
      "properties": {
        "amlScreening": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FlowAmlScreening",
              "description": "The flow's AML screening and ongoing monitoring. `None` on a flow created before the\nsetting; see `SettingsData::V0::aml_screening`."
            }
          ]
        },
        "askPasskeyCreation": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When true (default), prompt users to create a passkey during the verification flow.\nWhen false, skip the passkey creation step.\nOptional so that patch requests only write this field when explicitly provided."
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "delayFlowResults": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "emailNotifications": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "endUserEmails": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/EndUserEmails",
              "description": "Which emails Zyphe sends to the people verified: all of them when nothing is set."
            }
          ]
        },
        "extendedWebhook": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "kybProvisionalFeedback": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the organization's KYB flows may offer applicants provisional document feedback\n(ENG-1655), beside the platform switch and each documents step's `provisionalFeedback`.\nOff when not set; sandbox only."
        },
        "oneClickAlwaysRequestUnlockVault": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When true (default), always require vault unlock for one-click KYC even if a grant already exists.\nWhen false, skip vault unlock if an active KYC grant already exists for the organization.\nOptional so that patch requests only write this field when explicitly provided."
        },
        "oneClickSkipDocumentSelection": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When true, a returning holder is not asked which vault document to reuse: a document\nthey already shared with this organization is reused directly. Documents only ever\nshared with other organizations still need the holder to pick them. Defaults to false.\nOptional so that patch requests only write this field when explicitly provided."
        },
        "published": {
          "type": "boolean"
        },
        "sarHandoff": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/SarHandoff",
              "description": "What a member left out of an escalated case still reads of it (ENG-1739): `READABLE` when not set."
            }
          ]
        },
        "sarWebhooks": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the organization's webhooks carry its SARs (ENG-1737): the `sar.decision.recorded` event, and\n`SAR_FILED` in `external.alert.resolved` (which reads `CLOSED_TRUE_POSITIVE` otherwise). Off when not set.\nWhoever runs a subscribed endpoint's system reads what it carries, SAR permission or not."
        },
        "skipSignedAccess": {
          "type": "boolean"
        },
        "slackNotifications": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "telegramNotifications": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "webhookSecret": {
          "type": [
            "string",
            "null"
          ]
        },
        "webhookWithLegacy": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "whiteLabel": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the people the organization verifies see its brand and not Zyphe's (ENG-1660).\nTakes effect only while the `WHITE_LABEL` product is active for the organization."
        }
      }
    },
    "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"
      ]
    },
    "SpidResult": {
      "type": "object",
      "required": [
        "id",
        "status",
        "path"
      ],
      "properties": {
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "flowStep": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FlowStep"
            }
          ]
        },
        "flowStepId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "path": {
          "type": "string"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "verificationRequestId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        }
      }
    },
    "SpidStepOutput": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "$ref": "#/$defs/ResultStatus"
        }
      }
    },
    "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"
        }
      }
    },
    "VerificationRequestStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "COMPLETED",
        "FAILED",
        "CANCELLED",
        "QUEUED",
        "PROCESSING",
        "REQUIRES_MANUAL_REVIEW",
        "REJECTED"
      ]
    },
    "WalletConfig": {
      "type": "object",
      "required": [
        "chains"
      ],
      "properties": {
        "chains": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SiwxChain"
          }
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "propertyNames": {
            "type": "string"
          }
        }
      }
    },
    "WalletResult": {
      "type": "object",
      "required": [
        "id",
        "status",
        "message",
        "signature",
        "walletAddress",
        "walletChain",
        "flowResultId"
      ],
      "properties": {
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "flowResultId": {
          "type": "string",
          "format": "uuid"
        },
        "flowStep": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/FlowStep"
            }
          ]
        },
        "flowStepId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "message": {
          "type": "string"
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "signature": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/ResultStatus"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "verificationRequestId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "walletAddress": {
          "type": "string"
        },
        "walletChain": {
          "type": "string"
        }
      }
    },
    "WalletStepOutput": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "$ref": "#/$defs/ResultStatus"
        }
      }
    },
    "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."
      }
    }
  }
}