{
  "openapi": "3.0.0",
  "paths": {
    "/api/v1/screening/hits": {
      "get": {
        "description": "Retrieve screening hits for an application, optionally filtered by individual or business",
        "operationId": "getScreeningHitsByEntity",
        "parameters": [
          {
            "name": "applicationId",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "individualId",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "businessId",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningResults"
                },
                "example": {
                  "adverseMedia": [],
                  "sanctions": [],
                  "warning": [],
                  "pep": [],
                  "adverseMediaStories": []
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get screening hits by entity",
        "tags": ["Screening"],
        "x-public-api": true
      },
      "post": {
        "operationId": "createManualScreeningHit",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateManualScreeningHitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningHit"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "entityId": "507f1f77bcf86cd799439012",
                  "type": "ADVERSE_MEDIA",
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z",
                  "status": "IN_REVIEW",
                  "source": "comply-advantage",
                  "details": {},
                  "updatedBy": "60d5ecb54b24003a7c8e92b2",
                  "enriched": true,
                  "matchResult": {
                    "isMatch": true,
                    "confidence": 0.85,
                    "reviewNote": "Name and date of birth match the screening profile",
                    "incidentSummary": "Individual listed on OFAC SDN list since 2020 for involvement in money laundering activities",
                    "riskLevel": "HIGH",
                    "severity": "string",
                    "categories": []
                  },
                  "individualId": "507f1f77bcf86cd799439013",
                  "storyId": "string",
                  "notes": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "entityType": "APPLICATION",
                      "entityId": "507f1f77bcf86cd799439012",
                      "content": "Applicant confirmed ownership structure during call",
                      "createdBy": "60d5ecb54b24003a7c8e92b2",
                      "createdAt": "2026-03-30T12:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z",
                      "deleted": false
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Create a manual screening hit",
        "tags": ["Screening"],
        "x-public-api": true
      }
    },
    "/api/v1/screening/hits/{hitId}": {
      "patch": {
        "description": "Update the status of a screening hit (e.g., mark as Match/Dismiss)",
        "operationId": "updateScreeningHitStatus",
        "parameters": [
          {
            "name": "hitId",
            "required": true,
            "in": "path",
            "description": "Screening hit ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScreeningStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningHit"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "entityId": "507f1f77bcf86cd799439012",
                  "type": "ADVERSE_MEDIA",
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z",
                  "status": "IN_REVIEW",
                  "source": "comply-advantage",
                  "details": {},
                  "updatedBy": "60d5ecb54b24003a7c8e92b2",
                  "enriched": true,
                  "matchResult": {
                    "isMatch": true,
                    "confidence": 0.85,
                    "reviewNote": "Name and date of birth match the screening profile",
                    "incidentSummary": "Individual listed on OFAC SDN list since 2020 for involvement in money laundering activities",
                    "riskLevel": "HIGH",
                    "severity": "string",
                    "categories": []
                  },
                  "individualId": "507f1f77bcf86cd799439013",
                  "storyId": "string",
                  "notes": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "entityType": "APPLICATION",
                      "entityId": "507f1f77bcf86cd799439012",
                      "content": "Applicant confirmed ownership structure during call",
                      "createdBy": "60d5ecb54b24003a7c8e92b2",
                      "createdAt": "2026-03-30T12:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z",
                      "deleted": false
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update screening hit status",
        "tags": ["Screening"],
        "x-public-api": true
      }
    },
    "/api/v1/screening/stories/{storyId}": {
      "patch": {
        "description": "Set a verdict (and one rationale) on a whole adverse-media story — applies to every source hit grouped under it",
        "operationId": "updateScreeningStoryStatus",
        "parameters": [
          {
            "name": "storyId",
            "required": true,
            "in": "path",
            "description": "Screening story ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScreeningStoryStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningStory"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "type": "ADVERSE_MEDIA",
                  "headline": "Mexico antitrust case against seven banks closed with minor fines",
                  "summary": "One event tracked from a Dec 2019 collusion probe to its Jan 2021 resolution with minor fines.",
                  "aiDescription": "string",
                  "primaryHitId": "507f1f77bcf86cd799439012",
                  "memberHitIds": ["string"],
                  "category": {
                    "label": "Financial Crime",
                    "description": "string"
                  },
                  "severity": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update an adverse-media story verdict",
        "tags": ["Screening"],
        "x-public-api": true
      }
    },
    "/api/v1/screening/individuals/{individualId}": {
      "patch": {
        "operationId": "updateIndividualScreeningInfo",
        "parameters": [
          {
            "name": "individualId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateIndividualScreeningInfoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update individual screening info",
        "tags": ["Screening"],
        "x-public-api": true
      }
    },
    "/api/v1/screening/businesses/{businessId}": {
      "patch": {
        "operationId": "updateBusinessScreeningInfo",
        "parameters": [
          {
            "name": "businessId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBusinessScreeningInfoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update business screening info",
        "tags": ["Screening"],
        "x-public-api": true
      }
    },
    "/api/v1/screening/individuals/{individualId}/summary": {
      "patch": {
        "operationId": "updateIndividualScreeningSummary",
        "parameters": [
          {
            "name": "individualId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScreeningSummaryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update individual screening summary text",
        "tags": ["Screening"],
        "x-public-api": true
      }
    },
    "/api/v1/screening/businesses/{businessId}/summary": {
      "patch": {
        "operationId": "updateBusinessScreeningSummary",
        "parameters": [
          {
            "name": "businessId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScreeningSummaryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update business screening summary text",
        "tags": ["Screening"],
        "x-public-api": true
      }
    },
    "/api/v1/audit-logs": {
      "get": {
        "operationId": "getApplicationAuditLogs",
        "parameters": [
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor from a previous response's nextCursor. Omit on the first page. Cursors are tied to a sort direction — changing `order` mid-pagination is rejected.",
            "schema": {
              "example": "ZGVzY3x1cGRhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (1-100). Default 50.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "order",
            "required": false,
            "in": "query",
            "description": "Sort direction (with `id` as tiebreaker). Default `desc` (newest first). The column being sorted is endpoint-specific — see the individual endpoint docs.",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": ["asc", "desc"]
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "query",
            "description": "Application ID whose audit log entries (and document audit log entries) you want to list",
            "schema": {
              "example": "507f1f77bcf86cd799439011",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedAuditLogsResponseDto"
                },
                "example": {
                  "items": [
                    {
                      "id": "string",
                      "event": {},
                      "createdAt": "string",
                      "performedByName": "string",
                      "note": "string",
                      "hidden": false
                    }
                  ],
                  "nextCursor": "ZGVzY3xjcmVhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List audit log entries for an application",
        "tags": ["Audit Log"],
        "x-public-api": true
      }
    },
    "/api/v1/tasks": {
      "get": {
        "operationId": "getTasks",
        "parameters": [
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor from a previous response's nextCursor. Omit on the first page. Cursors are tied to a sort direction — changing `order` mid-pagination is rejected.",
            "schema": {
              "example": "ZGVzY3x1cGRhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (1-100). Default 50.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "order",
            "required": false,
            "in": "query",
            "description": "Sort direction (with `id` as tiebreaker). Default `desc` (newest first). The column being sorted is endpoint-specific — see the individual endpoint docs.",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": ["asc", "desc"]
            }
          },
          {
            "name": "applicationId",
            "required": false,
            "in": "query",
            "description": "Filter by application ID",
            "schema": {
              "example": "507f1f77bcf86cd799439011",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tasks retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedTasksResponseDto"
                },
                "example": {
                  "items": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "applicationId": "507f1f77bcf86cd799439011",
                      "status": {},
                      "type": {},
                      "title": "Review proof of address document",
                      "description": "Verify the uploaded utility bill matches the applicant address",
                      "entityType": {},
                      "entityId": "507f1f77bcf86cd799439012",
                      "document": {},
                      "screeningHit": {},
                      "assigneeId": "60d5ecb54b24003a7c8e92b2",
                      "reviewerId": "60d5ecb54b24003a7c8e92b2",
                      "createdAt": "2026-03-30T12:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z"
                    }
                  ],
                  "nextCursor": "ZGVzY3xjcmVhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List tasks",
        "tags": ["Tasks"],
        "x-public-api": true
      }
    },
    "/api/v1/tasks/{taskId}": {
      "get": {
        "operationId": "getTask",
        "parameters": [
          {
            "name": "taskId",
            "required": true,
            "in": "path",
            "description": "Task ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "applicationId": "507f1f77bcf86cd799439011",
                  "status": "PENDING",
                  "type": "MISSING_DOCUMENT",
                  "title": "Review proof of address document",
                  "description": "Verify the uploaded utility bill matches the applicant address",
                  "entityType": "DOCUMENT",
                  "entityId": "507f1f77bcf86cd799439012",
                  "document": {
                    "id": "507f1f77bcf86cd799439011",
                    "type": "PROOF_OF_ADDRESS",
                    "subType": {},
                    "title": "Proof of Address",
                    "fileName": "utility_bill.pdf",
                    "url": "https://storage.example.com/documents/utility_bill.pdf",
                    "validations": [],
                    "metadata": {},
                    "hidden": false,
                    "createdAt": "2026-03-30T12:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "notes": []
                  },
                  "screeningHit": {
                    "id": "507f1f77bcf86cd799439011",
                    "entityId": "507f1f77bcf86cd799439012",
                    "type": {},
                    "createdAt": "2026-03-30T12:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "status": {},
                    "source": "comply-advantage",
                    "details": {},
                    "updatedBy": "60d5ecb54b24003a7c8e92b2",
                    "enriched": true,
                    "individualId": "507f1f77bcf86cd799439013",
                    "storyId": "string",
                    "notes": []
                  },
                  "assigneeId": "60d5ecb54b24003a7c8e92b2",
                  "reviewerId": "60d5ecb54b24003a7c8e92b2",
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z"
                }
              }
            }
          },
          "404": {
            "description": "Task not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get a specific task by ID",
        "tags": ["Tasks"],
        "x-public-api": true
      },
      "patch": {
        "operationId": "updateTask",
        "parameters": [
          {
            "name": "taskId",
            "required": true,
            "in": "path",
            "description": "Task ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTaskDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "applicationId": "507f1f77bcf86cd799439011",
                  "status": "PENDING",
                  "type": "MISSING_DOCUMENT",
                  "title": "Review proof of address document",
                  "description": "Verify the uploaded utility bill matches the applicant address",
                  "entityType": "DOCUMENT",
                  "entityId": "507f1f77bcf86cd799439012",
                  "document": {
                    "id": "507f1f77bcf86cd799439011",
                    "type": "PROOF_OF_ADDRESS",
                    "subType": {},
                    "title": "Proof of Address",
                    "fileName": "utility_bill.pdf",
                    "url": "https://storage.example.com/documents/utility_bill.pdf",
                    "validations": [],
                    "metadata": {},
                    "hidden": false,
                    "createdAt": "2026-03-30T12:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "notes": []
                  },
                  "screeningHit": {
                    "id": "507f1f77bcf86cd799439011",
                    "entityId": "507f1f77bcf86cd799439012",
                    "type": {},
                    "createdAt": "2026-03-30T12:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "status": {},
                    "source": "comply-advantage",
                    "details": {},
                    "updatedBy": "60d5ecb54b24003a7c8e92b2",
                    "enriched": true,
                    "individualId": "507f1f77bcf86cd799439013",
                    "storyId": "string",
                    "notes": []
                  },
                  "assigneeId": "60d5ecb54b24003a7c8e92b2",
                  "reviewerId": "60d5ecb54b24003a7c8e92b2",
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z"
                }
              }
            }
          },
          "404": {
            "description": "Task not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update a task",
        "tags": ["Tasks"],
        "x-public-api": true
      }
    },
    "/api/v1/applications/{id}/export/crs-xml": {
      "get": {
        "description": "Demo CRS XML export. Reads investor-side data from the application (entity + controlling persons, or individual) and emits a well-formed OECD CRS v2.0 fragment. Slots marked «TOKEN» are fund-admin-supplied or not yet collected. Single-click download — no server-side persistence.",
        "operationId": "publicExportApplicationCrsXml",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Application ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CRS XML fragment as an attachment"
          },
          "404": {
            "description": "Application not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Export application data as an OECD CRS v2.0 XML fragment",
        "tags": ["CRS XML Export"],
        "x-public-api": true
      }
    },
    "/api/v1/applications": {
      "get": {
        "operationId": "publicGetApplications",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by application status",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["PENDING", "SUBMITTED", "APPROVED", "REJECTED"]
              }
            }
          },
          {
            "name": "types",
            "required": false,
            "in": "query",
            "description": "Filter by application view type (Live = all non-manual/hidden, Manual = manual applications, Hidden = hidden applications)",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["live", "manual", "hidden"]
              }
            }
          },
          {
            "name": "entityTypes",
            "required": false,
            "in": "query",
            "description": "Filter by multiple entity types (BUSINESS or INDIVIDUAL)",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["BUSINESS", "INDIVIDUAL"]
              }
            }
          },
          {
            "name": "accountId",
            "required": false,
            "in": "query",
            "description": "Filter by account ID",
            "schema": {
              "example": "507f1f77bcf86cd799439011",
              "type": "string"
            }
          },
          {
            "name": "manual",
            "required": false,
            "in": "query",
            "description": "Filter by manual flag",
            "schema": {
              "example": false,
              "type": "boolean"
            }
          },
          {
            "name": "hidden",
            "required": false,
            "in": "query",
            "description": "Filter by hidden flag",
            "schema": {
              "example": false,
              "type": "boolean"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Filter by creation date (from)",
            "schema": {
              "example": "2024-01-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Filter by creation date (to)",
            "schema": {
              "example": "2024-12-31T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "name": "riskScoreMin",
            "required": false,
            "in": "query",
            "description": "Filter by minimum risk score",
            "schema": {
              "example": 0,
              "type": "number"
            }
          },
          {
            "name": "riskScoreMax",
            "required": false,
            "in": "query",
            "description": "Filter by maximum risk score",
            "schema": {
              "example": 100,
              "type": "number"
            }
          },
          {
            "name": "riskLevels",
            "required": false,
            "in": "query",
            "description": "Filter by risk levels (LOW, MEDIUM, HIGH, PROHIBITED). Takes precedence over riskScoreMin/riskScoreMax if provided.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["PROHIBITED", "HIGH", "MEDIUM", "LOW"]
              }
            }
          },
          {
            "name": "assignees",
            "required": false,
            "in": "query",
            "description": "Filter by assignee user IDs",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Search keyword for application name, email, or account name",
            "schema": {
              "example": "john",
              "type": "string"
            }
          },
          {
            "name": "labelIds",
            "required": false,
            "in": "query",
            "description": "Filter by label IDs",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor from a previous response's nextCursor. Omit on the first page. Cursors are tied to a sort direction — changing `order` mid-pagination is rejected.",
            "schema": {
              "example": "ZGVzY3x1cGRhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (1-100). Default 50.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "order",
            "required": false,
            "in": "query",
            "description": "Sort direction (with `id` as tiebreaker). Default `desc` (newest first). The column being sorted is endpoint-specific — see the individual endpoint docs.",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": ["asc", "desc"]
            }
          },
          {
            "name": "orderBy",
            "required": false,
            "in": "query",
            "description": "Sort field. `createdAt` orders by when the application was created; `updatedAt` orders by most recent activity. Default `updatedAt`.",
            "schema": {
              "default": "updatedAt",
              "type": "string",
              "enum": ["createdAt", "updatedAt"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paginated applications response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedApplicationsResponseDto"
                },
                "example": {
                  "items": [
                    {
                      "name": "Acme Corporation",
                      "id": "507f1f77bcf86cd799439011",
                      "createdAt": "2026-03-01T10:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z",
                      "manual": false,
                      "customerType": {},
                      "status": "SUBMITTED",
                      "reviewers": [],
                      "keyPeople": [],
                      "labelIds": ["507f1f77bcf86cd799439011"],
                      "childApplications": [],
                      "openTasksCount": 3
                    }
                  ],
                  "nextCursor": "ZGVzY3x1cGRhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List applications",
        "tags": ["Applications"],
        "x-public-api": true
      },
      "post": {
        "operationId": "publicCreateApplication",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApplicationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApplicationResponse"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439012"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Create an application",
        "tags": ["Applications"],
        "x-public-api": true
      }
    },
    "/api/v1/applications/{id}": {
      "get": {
        "operationId": "publicGetApplication",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hidden",
            "required": false,
            "in": "query",
            "description": "Include hidden documents",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Application details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApplicationResponse"
                },
                "example": {
                  "businessApplication": {
                    "name": "Acme Corporation",
                    "id": "507f1f77bcf86cd799439011",
                    "createdAt": "2026-03-01T10:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "verified": false,
                    "manual": false,
                    "customerType": {},
                    "accountType": {},
                    "stageEnteredAt": "2026-03-20T09:00:00.000Z",
                    "status": "SUBMITTED",
                    "metadata": {
                      "externalRef": "abc-123",
                      "plan": "enterprise"
                    },
                    "verifications": [],
                    "reviewers": [],
                    "keyPeople": [],
                    "labelIds": ["507f1f77bcf86cd799439011"],
                    "skip2FA": false,
                    "accountId": "60d5ecb54b24003a7c8e92a1",
                    "unmappedResponses": [],
                    "registrationNumber": "12345678",
                    "taxIdentificationNumber": "GB123456789",
                    "entityType": "BUSINESS",
                    "jurisdiction": "GB",
                    "incorporationDate": "2020-01-15",
                    "establishmentDate": "2020-01-15",
                    "registrationDate": "2020-01-15",
                    "trustType": "Discretionary Trust",
                    "legalForm": "Limited Company",
                    "purpose": "Investment management and advisory services",
                    "businessActivity": "Financial services",
                    "industry": "Financial Services",
                    "subIndustry": "Investment Management",
                    "website": "https://www.acmecorp.com",
                    "sicCode": "64110",
                    "vatNumber": "GB123456789",
                    "taxId": "A02951077",
                    "referrer": "Partner Bank",
                    "referrerNote": "Referred by relationship manager",
                    "companyTurnover": "1000000-5000000",
                    "annualFlow": "500000-1000000",
                    "estimatedNumberOfPayments": 50,
                    "expectedFxRequirement": "100000-500000",
                    "currenciesRequired": ["GBP", "EUR", "USD"],
                    "countriesSentTo": ["GB", "DE", "US"],
                    "countriesReceivedFrom": ["GB", "FR"],
                    "paymentPurpose": "Supplier payments",
                    "fundingSource": "Revenue from operations",
                    "investmentAmount": 250000,
                    "investmentAmountCurrency": "GBP",
                    "refreshedAt": "2026-03-30T12:00:00.000Z",
                    "isAudited": true,
                    "hasPep": false,
                    "ownershipLayers": 1,
                    "legalEntityType": "Limited Company",
                    "regulatoryAuthority": "FCA",
                    "regulatoryNumber": "123456",
                    "parentApplicationId": "507f1f77bcf86cd799439011",
                    "parentRoles": ["UBO", "SHAREHOLDER"],
                    "displayConfiguration": {
                      "hiddenFields": ["businessActivity"],
                      "hiddenSections": ["step-1"]
                    },
                    "screening": []
                  },
                  "individualApplication": {
                    "name": "Acme Corporation",
                    "id": "507f1f77bcf86cd799439011",
                    "createdAt": "2026-03-01T10:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "verified": false,
                    "manual": false,
                    "customerType": {},
                    "accountType": {},
                    "stageEnteredAt": "2026-03-20T09:00:00.000Z",
                    "status": "SUBMITTED",
                    "metadata": {
                      "externalRef": "abc-123",
                      "plan": "enterprise"
                    },
                    "verifications": [],
                    "reviewers": [],
                    "keyPeople": [],
                    "labelIds": ["507f1f77bcf86cd799439011"],
                    "skip2FA": false,
                    "accountId": "60d5ecb54b24003a7c8e92a1",
                    "unmappedResponses": [],
                    "firstName": "John",
                    "middleName": "David",
                    "lastName": "Smith",
                    "dateOfBirth": "1990-05-15",
                    "yearOfBirth": 1990,
                    "monthOfBirth": 5,
                    "countryOfBirth": "GB",
                    "nationality": "GB",
                    "otherNationality": "IE",
                    "taxResidency": "GB",
                    "secondaryTaxResidency": "IE",
                    "taxIdentificationNumber": "AB123456C",
                    "email": "john.smith@example.com",
                    "amountToBeInvested": 50000,
                    "amountToBeInvestedCurrency": "GBP",
                    "usCitizen": false,
                    "isPEP": false,
                    "roles": [],
                    "onboarding": true,
                    "employmentStatus": "EMPLOYED",
                    "occupation": "Software Engineer",
                    "stewardProfile": false,
                    "screening": [],
                    "accountTurnover": "50000-100000",
                    "annualFlow": "100000-500000",
                    "estimatedNumberOfPayments": 20,
                    "expectedFxRequirement": "10000-50000",
                    "currenciesRequired": ["GBP", "EUR"],
                    "countriesSentTo": ["GB", "DE"],
                    "countriesReceivedFrom": ["GB", "US"],
                    "paymentPurpose": "Personal expenses",
                    "fundingSource": "Salary",
                    "parentApplicationId": "507f1f77bcf86cd799439011",
                    "parentRoles": ["UBO", "DIRECTOR"],
                    "displayConfiguration": {
                      "hiddenFields": ["phoneNumber"],
                      "hiddenSections": ["step-1"]
                    }
                  },
                  "submitter": {
                    "firstName": "Michael",
                    "lastName": "Chen",
                    "email": "michael.chen@acme-corp.com"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get application details",
        "tags": ["Applications"],
        "x-public-api": true
      },
      "patch": {
        "operationId": "publicUpdateApplication",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApplicationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Application updated successfully"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update an application",
        "tags": ["Applications"],
        "x-public-api": true
      }
    },
    "/api/v1/applications/{id}/submitter": {
      "patch": {
        "operationId": "publicUpdateSubmitterDetails",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubmitterDetailsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submitter details updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitterDetailsItem"
                },
                "example": {
                  "firstName": "Michael",
                  "lastName": "Chen",
                  "email": "michael.chen@acme-corp.com"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update an application's submitter details",
        "tags": ["Applications"],
        "x-public-api": true
      }
    },
    "/api/v1/applications/{id}/approve": {
      "post": {
        "operationId": "publicApproveApplication",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Application details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApplicationResponse"
                },
                "example": {
                  "businessApplication": {
                    "name": "Acme Corporation",
                    "id": "507f1f77bcf86cd799439011",
                    "createdAt": "2026-03-01T10:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "verified": false,
                    "manual": false,
                    "customerType": {},
                    "accountType": {},
                    "stageEnteredAt": "2026-03-20T09:00:00.000Z",
                    "status": "SUBMITTED",
                    "metadata": {
                      "externalRef": "abc-123",
                      "plan": "enterprise"
                    },
                    "verifications": [],
                    "reviewers": [],
                    "keyPeople": [],
                    "labelIds": ["507f1f77bcf86cd799439011"],
                    "skip2FA": false,
                    "accountId": "60d5ecb54b24003a7c8e92a1",
                    "unmappedResponses": [],
                    "registrationNumber": "12345678",
                    "taxIdentificationNumber": "GB123456789",
                    "entityType": "BUSINESS",
                    "jurisdiction": "GB",
                    "incorporationDate": "2020-01-15",
                    "establishmentDate": "2020-01-15",
                    "registrationDate": "2020-01-15",
                    "trustType": "Discretionary Trust",
                    "legalForm": "Limited Company",
                    "purpose": "Investment management and advisory services",
                    "businessActivity": "Financial services",
                    "industry": "Financial Services",
                    "subIndustry": "Investment Management",
                    "website": "https://www.acmecorp.com",
                    "sicCode": "64110",
                    "vatNumber": "GB123456789",
                    "taxId": "A02951077",
                    "referrer": "Partner Bank",
                    "referrerNote": "Referred by relationship manager",
                    "companyTurnover": "1000000-5000000",
                    "annualFlow": "500000-1000000",
                    "estimatedNumberOfPayments": 50,
                    "expectedFxRequirement": "100000-500000",
                    "currenciesRequired": ["GBP", "EUR", "USD"],
                    "countriesSentTo": ["GB", "DE", "US"],
                    "countriesReceivedFrom": ["GB", "FR"],
                    "paymentPurpose": "Supplier payments",
                    "fundingSource": "Revenue from operations",
                    "investmentAmount": 250000,
                    "investmentAmountCurrency": "GBP",
                    "refreshedAt": "2026-03-30T12:00:00.000Z",
                    "isAudited": true,
                    "hasPep": false,
                    "ownershipLayers": 1,
                    "legalEntityType": "Limited Company",
                    "regulatoryAuthority": "FCA",
                    "regulatoryNumber": "123456",
                    "parentApplicationId": "507f1f77bcf86cd799439011",
                    "parentRoles": ["UBO", "SHAREHOLDER"],
                    "displayConfiguration": {
                      "hiddenFields": ["businessActivity"],
                      "hiddenSections": ["step-1"]
                    },
                    "screening": []
                  },
                  "individualApplication": {
                    "name": "Acme Corporation",
                    "id": "507f1f77bcf86cd799439011",
                    "createdAt": "2026-03-01T10:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "verified": false,
                    "manual": false,
                    "customerType": {},
                    "accountType": {},
                    "stageEnteredAt": "2026-03-20T09:00:00.000Z",
                    "status": "SUBMITTED",
                    "metadata": {
                      "externalRef": "abc-123",
                      "plan": "enterprise"
                    },
                    "verifications": [],
                    "reviewers": [],
                    "keyPeople": [],
                    "labelIds": ["507f1f77bcf86cd799439011"],
                    "skip2FA": false,
                    "accountId": "60d5ecb54b24003a7c8e92a1",
                    "unmappedResponses": [],
                    "firstName": "John",
                    "middleName": "David",
                    "lastName": "Smith",
                    "dateOfBirth": "1990-05-15",
                    "yearOfBirth": 1990,
                    "monthOfBirth": 5,
                    "countryOfBirth": "GB",
                    "nationality": "GB",
                    "otherNationality": "IE",
                    "taxResidency": "GB",
                    "secondaryTaxResidency": "IE",
                    "taxIdentificationNumber": "AB123456C",
                    "email": "john.smith@example.com",
                    "amountToBeInvested": 50000,
                    "amountToBeInvestedCurrency": "GBP",
                    "usCitizen": false,
                    "isPEP": false,
                    "roles": [],
                    "onboarding": true,
                    "employmentStatus": "EMPLOYED",
                    "occupation": "Software Engineer",
                    "stewardProfile": false,
                    "screening": [],
                    "accountTurnover": "50000-100000",
                    "annualFlow": "100000-500000",
                    "estimatedNumberOfPayments": 20,
                    "expectedFxRequirement": "10000-50000",
                    "currenciesRequired": ["GBP", "EUR"],
                    "countriesSentTo": ["GB", "DE"],
                    "countriesReceivedFrom": ["GB", "US"],
                    "paymentPurpose": "Personal expenses",
                    "fundingSource": "Salary",
                    "parentApplicationId": "507f1f77bcf86cd799439011",
                    "parentRoles": ["UBO", "DIRECTOR"],
                    "displayConfiguration": {
                      "hiddenFields": ["phoneNumber"],
                      "hiddenSections": ["step-1"]
                    }
                  },
                  "submitter": {
                    "firstName": "Michael",
                    "lastName": "Chen",
                    "email": "michael.chen@acme-corp.com"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Approve an application",
        "tags": ["Applications"],
        "x-public-api": true
      }
    },
    "/api/v1/applications/{id}/submit": {
      "post": {
        "operationId": "publicSubmitApplication",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Application submitted"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Submit an application for review",
        "tags": ["Applications"],
        "x-public-api": true
      }
    },
    "/api/v1/applications/{id}/reject": {
      "post": {
        "operationId": "publicRejectApplication",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Application rejected"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Reject an application",
        "tags": ["Applications"],
        "x-public-api": true
      }
    },
    "/api/v1/account": {
      "get": {
        "operationId": "accountControllerGetAccount",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Account details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponseDto"
                },
                "example": {
                  "id": "60d5ecb54b24003a7c8e92a1",
                  "name": "Acme Corporation",
                  "riskScoreStrategy": "CUMULATIVE",
                  "idvProvider": "ONFIDO",
                  "createdAt": "2026-01-15T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get account details",
        "tags": ["Accounts"],
        "x-public-api": true
      },
      "patch": {
        "operationId": "accountControllerUpdateAccount",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponseDto"
                },
                "example": {
                  "id": "60d5ecb54b24003a7c8e92a1",
                  "name": "Acme Corporation",
                  "riskScoreStrategy": "CUMULATIVE",
                  "idvProvider": "ONFIDO",
                  "createdAt": "2026-01-15T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update account settings",
        "tags": ["Accounts"],
        "x-public-api": true
      }
    },
    "/api/v1/account/{accountId}/risk-settings": {
      "get": {
        "operationId": "accountControllerGetRiskSettings",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiskSettingsResponse"
                },
                "example": {
                  "factors": [],
                  "screeningTaxonomy": {
                    "sources": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get risk score configuration",
        "tags": ["Accounts"],
        "x-public-api": true
      },
      "patch": {
        "operationId": "accountControllerUpdateRiskSettings",
        "parameters": [
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRiskSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Risk score settings updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiskSettingsResponse"
                },
                "example": {
                  "factors": [],
                  "screeningTaxonomy": {
                    "sources": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update risk score configuration",
        "tags": ["Accounts"],
        "x-public-api": true
      }
    },
    "/api/v1/account/users": {
      "get": {
        "operationId": "accountControllerListUsers",
        "parameters": [],
        "responses": {
          "200": {
            "description": "List of users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserResponseDto"
                  }
                },
                "example": [
                  {
                    "id": "60d5ecb54b24003a7c8e92b2",
                    "externalId": "auth0|507f1f77bcf86cd799439011",
                    "firstName": "John",
                    "lastName": "Doe",
                    "email": "john.doe@example.com",
                    "title": "Software Engineer",
                    "activeAccountId": "507f1f77bcf86cd799439011",
                    "accounts": [{}],
                    "createdAt": "2026-03-30T12:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z",
                    "deactivatedAt": null,
                    "status": "ACTIVE",
                    "roles": ["read-only"],
                    "metadata": {
                      "requireMFA": true
                    }
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List users in the account",
        "tags": ["Accounts"],
        "x-public-api": true
      },
      "post": {
        "description": "Creates a new user. If roles are not provided, the user is assigned the read-only role by default.",
        "operationId": "accountControllerCreateUser",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCreateUserDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUserResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "email": "john.doe@example.com",
                  "firstName": "John",
                  "lastName": "Doe",
                  "title": "Compliance Officer",
                  "roles": ["read-only"]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Create a user",
        "tags": ["Accounts"],
        "x-public-api": true
      }
    },
    "/api/v1/account/users/{id}": {
      "patch": {
        "description": "Updates user details. Roles can be updated to any valid public role.",
        "operationId": "accountControllerUpdateUser",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountUpdateUserDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                },
                "example": {
                  "id": "60d5ecb54b24003a7c8e92b2",
                  "externalId": "auth0|507f1f77bcf86cd799439011",
                  "firstName": "John",
                  "lastName": "Doe",
                  "email": "john.doe@example.com",
                  "title": "Software Engineer",
                  "activeAccountId": "507f1f77bcf86cd799439011",
                  "accounts": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "name": "Acme Corp",
                      "deactivatedAt": null,
                      "logoUrl": null
                    }
                  ],
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z",
                  "deactivatedAt": null,
                  "status": "ACTIVE",
                  "roles": ["read-only"],
                  "metadata": {
                    "requireMFA": true
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update a user",
        "tags": ["Accounts"],
        "x-public-api": true
      },
      "delete": {
        "operationId": "accountControllerDeleteUser",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User deactivated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                },
                "example": {
                  "id": "60d5ecb54b24003a7c8e92b2",
                  "externalId": "auth0|507f1f77bcf86cd799439011",
                  "firstName": "John",
                  "lastName": "Doe",
                  "email": "john.doe@example.com",
                  "title": "Software Engineer",
                  "activeAccountId": "507f1f77bcf86cd799439011",
                  "accounts": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "name": "Acme Corp",
                      "deactivatedAt": null,
                      "logoUrl": null
                    }
                  ],
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z",
                  "deactivatedAt": null,
                  "status": "ACTIVE",
                  "roles": ["read-only"],
                  "metadata": {
                    "requireMFA": true
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Remove a user",
        "tags": ["Accounts"],
        "x-public-api": true
      }
    },
    "/api/v1/notes": {
      "post": {
        "operationId": "publicCreateNote",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCreateNoteDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Note created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "content": "Applicant confirmed ownership structure during call",
                  "attachments": [
                    {
                      "key": "uploads/uuid_document.pdf",
                      "fileName": "document.pdf",
                      "contentType": "application/pdf",
                      "fileUrl": "https://bucket.s3.amazonaws.com/uploads/uuid_document.pdf"
                    }
                  ],
                  "createdBy": "60d5ecb54b24003a7c8e92b2",
                  "updatedBy": "60d5ecb54b24003a7c8e92b2",
                  "createdByUser": {
                    "firstName": "John",
                    "lastName": "Smith",
                    "email": "john.smith@example.com"
                  },
                  "updatedByUser": {
                    "firstName": "John",
                    "lastName": "Smith",
                    "email": "john.smith@example.com"
                  },
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z"
                }
              }
            }
          },
          "404": {
            "description": "Parent entity not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Create a note",
        "tags": ["Notes"],
        "x-public-api": true
      },
      "get": {
        "operationId": "publicListNotes",
        "parameters": [
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor from a previous response's nextCursor. Omit on the first page. Cursors are tied to a sort direction — changing `order` mid-pagination is rejected.",
            "schema": {
              "example": "ZGVzY3x1cGRhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (1-100). Default 50.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "order",
            "required": false,
            "in": "query",
            "description": "Sort direction (with `id` as tiebreaker). Default `desc` (newest first). The column being sorted is endpoint-specific — see the individual endpoint docs.",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": ["asc", "desc"]
            }
          },
          {
            "name": "entityType",
            "required": true,
            "in": "query",
            "description": "Type of parent entity whose notes you want to list",
            "schema": {
              "$ref": "#/components/schemas/EntityTypeForNotes"
            }
          },
          {
            "name": "entityId",
            "required": true,
            "in": "query",
            "description": "ID of the parent entity",
            "schema": {
              "example": "507f1f77bcf86cd799439011",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notes retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedNotesResponseDto"
                },
                "example": {
                  "items": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "content": "Applicant confirmed ownership structure during call",
                      "attachments": [],
                      "createdBy": "60d5ecb54b24003a7c8e92b2",
                      "updatedBy": "60d5ecb54b24003a7c8e92b2",
                      "createdByUser": {},
                      "updatedByUser": {},
                      "createdAt": "2026-03-30T12:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z"
                    }
                  ],
                  "nextCursor": "ZGVzY3xjcmVhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
                }
              }
            }
          },
          "404": {
            "description": "Parent entity not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List notes for a parent entity",
        "tags": ["Notes"],
        "x-public-api": true
      }
    },
    "/api/v1/notes/{noteId}": {
      "patch": {
        "operationId": "publicUpdateNote",
        "parameters": [
          {
            "name": "noteId",
            "required": true,
            "in": "path",
            "description": "Note ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNoteDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Note updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "content": "Applicant confirmed ownership structure during call",
                  "attachments": [
                    {
                      "key": "uploads/uuid_document.pdf",
                      "fileName": "document.pdf",
                      "contentType": "application/pdf",
                      "fileUrl": "https://bucket.s3.amazonaws.com/uploads/uuid_document.pdf"
                    }
                  ],
                  "createdBy": "60d5ecb54b24003a7c8e92b2",
                  "updatedBy": "60d5ecb54b24003a7c8e92b2",
                  "createdByUser": {
                    "firstName": "John",
                    "lastName": "Smith",
                    "email": "john.smith@example.com"
                  },
                  "updatedByUser": {
                    "firstName": "John",
                    "lastName": "Smith",
                    "email": "john.smith@example.com"
                  },
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Note is deleted"
          },
          "404": {
            "description": "Note not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update a note",
        "tags": ["Notes"],
        "x-public-api": true
      },
      "delete": {
        "operationId": "publicDeleteNote",
        "parameters": [
          {
            "name": "noteId",
            "required": true,
            "in": "path",
            "description": "Note ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Note deleted successfully"
          },
          "404": {
            "description": "Note not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Delete a note",
        "tags": ["Notes"],
        "x-public-api": true
      }
    },
    "/api/v1/documents": {
      "get": {
        "operationId": "publicListDocuments",
        "parameters": [
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor from a previous response's nextCursor. Omit on the first page. Cursors are tied to a sort direction — changing `order` mid-pagination is rejected.",
            "schema": {
              "example": "ZGVzY3x1cGRhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (1-100). Default 50.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "order",
            "required": false,
            "in": "query",
            "description": "Sort direction (with `id` as tiebreaker). Default `desc` (newest first). The column being sorted is endpoint-specific — see the individual endpoint docs.",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": ["asc", "desc"]
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "query",
            "description": "ID of the application whose documents you want to list",
            "schema": {
              "example": "507f1f77bcf86cd799439011",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Documents retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedDocumentsResponseDto"
                },
                "example": {
                  "items": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "type": {},
                      "subType": {},
                      "title": "Proof of Address",
                      "fileName": "passport.pdf",
                      "key": "documents/passport.pdf",
                      "contentType": "application/pdf",
                      "url": "https://storage.example.com/documents/passport.pdf",
                      "hidden": false,
                      "applicationId": "507f1f77bcf86cd799439012",
                      "validations": [],
                      "metadata": {},
                      "createdAt": "2026-03-30T12:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z",
                      "notes": []
                    }
                  ],
                  "nextCursor": "ZGVzY3xjcmVhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
                }
              }
            }
          },
          "404": {
            "description": "Application not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List documents for an application",
        "tags": ["Documents"],
        "x-public-api": true
      },
      "post": {
        "operationId": "uploadDocument",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadDocumentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDocumentDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "type": "COMPANY_PROFILE",
                  "subType": "PASSPORT",
                  "title": "Proof of Address",
                  "fileName": "passport.pdf",
                  "key": "documents/passport.pdf",
                  "contentType": "application/pdf",
                  "url": "https://storage.example.com/documents/passport.pdf",
                  "hidden": false,
                  "applicationId": "507f1f77bcf86cd799439012",
                  "validations": [
                    {
                      "type": "VALID_PROOF_OF_ADDRESS",
                      "results": [],
                      "validationAttempts": 2,
                      "jobId": "string"
                    }
                  ],
                  "metadata": {},
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z",
                  "notes": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "content": "Applicant confirmed ownership structure during call",
                      "attachments": [],
                      "createdBy": "60d5ecb54b24003a7c8e92b2",
                      "updatedBy": "60d5ecb54b24003a7c8e92b2",
                      "createdByUser": {},
                      "updatedByUser": {},
                      "createdAt": "2026-03-30T12:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Application not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Upload a document",
        "tags": ["Documents"],
        "x-public-api": true
      }
    },
    "/api/v1/documents/download-all": {
      "get": {
        "operationId": "publicDownloadAllDocuments",
        "parameters": [
          {
            "name": "applicationId",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Zip archive of the application documents"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Download all documents for an application as a single zip",
        "tags": ["Documents"],
        "x-public-api": true
      }
    },
    "/api/v1/documents/{documentId}": {
      "get": {
        "description": "Get document details and validation status",
        "operationId": "getDocument",
        "parameters": [
          {
            "name": "documentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document details with validation status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDocumentDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "type": "COMPANY_PROFILE",
                  "subType": "PASSPORT",
                  "title": "Proof of Address",
                  "fileName": "passport.pdf",
                  "key": "documents/passport.pdf",
                  "contentType": "application/pdf",
                  "url": "https://storage.example.com/documents/passport.pdf",
                  "hidden": false,
                  "applicationId": "507f1f77bcf86cd799439012",
                  "validations": [
                    {
                      "type": "VALID_PROOF_OF_ADDRESS",
                      "results": [],
                      "validationAttempts": 2,
                      "jobId": "string"
                    }
                  ],
                  "metadata": {},
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z",
                  "notes": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "content": "Applicant confirmed ownership structure during call",
                      "attachments": [],
                      "createdBy": "60d5ecb54b24003a7c8e92b2",
                      "updatedBy": "60d5ecb54b24003a7c8e92b2",
                      "createdByUser": {},
                      "updatedByUser": {},
                      "createdAt": "2026-03-30T12:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Document not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get document",
        "tags": ["Documents"],
        "x-public-api": true
      },
      "delete": {
        "operationId": "deleteDocument",
        "parameters": [
          {
            "name": "documentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document deleted (hidden)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDocumentDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "type": "COMPANY_PROFILE",
                  "subType": "PASSPORT",
                  "title": "Proof of Address",
                  "fileName": "passport.pdf",
                  "key": "documents/passport.pdf",
                  "contentType": "application/pdf",
                  "url": "https://storage.example.com/documents/passport.pdf",
                  "hidden": false,
                  "applicationId": "507f1f77bcf86cd799439012",
                  "validations": [
                    {
                      "type": "VALID_PROOF_OF_ADDRESS",
                      "results": [],
                      "validationAttempts": 2,
                      "jobId": "string"
                    }
                  ],
                  "metadata": {},
                  "createdAt": "2026-03-30T12:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z",
                  "notes": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "content": "Applicant confirmed ownership structure during call",
                      "attachments": [],
                      "createdBy": "60d5ecb54b24003a7c8e92b2",
                      "updatedBy": "60d5ecb54b24003a7c8e92b2",
                      "createdByUser": {},
                      "updatedByUser": {},
                      "createdAt": "2026-03-30T12:00:00.000Z",
                      "updatedAt": "2026-03-30T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Document not found"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Delete a document",
        "tags": ["Documents"],
        "x-public-api": true
      }
    },
    "/api/v1/documents/{documentId}/classification": {
      "get": {
        "operationId": "publicGetDocumentClassification",
        "parameters": [
          {
            "name": "documentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentClassificationResponseDto"
                },
                "example": {
                  "status": "PENDING",
                  "classifiedType": "PASSPORT",
                  "requiresBack": true,
                  "isGovernmentId": false,
                  "invalid": false,
                  "invalidReason": "string",
                  "mismatchedFront": false
                }
              }
            }
          },
          "404": {
            "description": "Document or classification not found"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {}
        ],
        "summary": "Get the latest ID-document classification job for this document",
        "tags": ["Documents"],
        "x-public-api": true
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "operationId": "publicListWebhooks",
        "parameters": [],
        "responses": {
          "200": {
            "description": "List of webhooks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookResponseDto"
                  }
                },
                "example": [
                  {
                    "id": "507f1f77bcf86cd799439011",
                    "url": "https://your-app.com/webhooks/steward",
                    "events": ["application.submitted", "application.approved"],
                    "status": "ACTIVE",
                    "createdAt": "2026-03-01T10:00:00.000Z",
                    "updatedAt": "2026-03-30T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List webhooks",
        "tags": ["Webhooks"],
        "x-public-api": true
      },
      "post": {
        "operationId": "publicCreateWebhook",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook created. Secret returned only once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreatedResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "url": "https://your-app.com/webhooks/steward",
                  "events": ["application.submitted", "application.approved"],
                  "status": "ACTIVE",
                  "createdAt": "2026-03-01T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z",
                  "secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Create a webhook",
        "tags": ["Webhooks"],
        "x-public-api": true
      }
    },
    "/api/v1/webhooks/{id}": {
      "patch": {
        "operationId": "publicUpdateWebhook",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "url": "https://your-app.com/webhooks/steward",
                  "events": ["application.submitted", "application.approved"],
                  "status": "ACTIVE",
                  "createdAt": "2026-03-01T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update a webhook",
        "tags": ["Webhooks"],
        "x-public-api": true
      },
      "delete": {
        "operationId": "publicDeleteWebhook",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook deleted"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Delete a webhook",
        "tags": ["Webhooks"],
        "x-public-api": true
      }
    },
    "/api/v1/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "publicListWebhookDeliveries",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery log",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookDeliveryResponseDto"
                  }
                },
                "example": [
                  {
                    "id": "507f1f77bcf86cd799439011",
                    "event": "application.submitted",
                    "status": "delivered",
                    "httpStatus": 200,
                    "attempts": 1,
                    "lastAttemptAt": "2026-03-30T12:00:00.000Z",
                    "createdAt": "2026-03-30T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List webhook deliveries",
        "tags": ["Webhooks"],
        "x-public-api": true
      }
    },
    "/api/v1/platform/search": {
      "get": {
        "operationId": "platformSearch",
        "parameters": [
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Search query (min 2 chars)",
            "schema": {
              "example": "sarah",
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/SearchType"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Per-category result limit",
            "schema": {
              "minimum": 1,
              "maximum": 50,
              "type": "number"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "Per-category offset for pagination (single-tab mode only)",
            "schema": {
              "minimum": 0,
              "type": "number"
            }
          },
          {
            "name": "includeDismissed",
            "required": false,
            "in": "query",
            "description": "Include DISMISSED screening hits in screening results",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "name": "sortOrder",
            "required": false,
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/SearchSortOrder"
            }
          },
          {
            "name": "applicationStatus",
            "required": false,
            "in": "query",
            "description": "Filter applications by status",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "screeningType",
            "required": false,
            "in": "query",
            "description": "Filter screening hits by type",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "documentEntityType",
            "required": false,
            "in": "query",
            "description": "Filter documents by owning entity type",
            "schema": {
              "type": "string",
              "enum": ["individual", "business"]
            }
          },
          {
            "name": "taskState",
            "required": false,
            "in": "query",
            "description": "Filter tasks by resolution state",
            "schema": {
              "type": "string",
              "enum": ["RESOLVED", "INCOMPLETE"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grouped search results scoped to the caller account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponseDto"
                },
                "example": {
                  "applications": {
                    "items": [],
                    "total": 0
                  },
                  "screening": {
                    "items": [],
                    "total": 0
                  },
                  "documents": {
                    "items": [],
                    "total": 0
                  },
                  "tasks": {
                    "items": [],
                    "total": 0
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Global search across applications, screening, documents, and tasks",
        "tags": ["Search"],
        "x-public-api": true
      }
    },
    "/api/v1/applications/{id}/export/csv": {
      "get": {
        "operationId": "publicExportApplicationCsv",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "screening",
            "required": false,
            "in": "query",
            "description": "Include screening results section",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "name": "risk",
            "required": false,
            "in": "query",
            "description": "Include risk score section",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "name": "documents",
            "required": false,
            "in": "query",
            "description": "Include documents section",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "name": "audit",
            "required": false,
            "in": "query",
            "description": "Include audit log section",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Export a KYC/KYB application as a flat CSV",
        "tags": ["Applications"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations": {
      "post": {
        "operationId": "platformCreateMigration",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMigrationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "accountId": "507f1f77bcf86cd799439011",
                  "workflowId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "labels": ["string"],
                  "sourceType": "UPLOAD",
                  "status": "UPLOADING",
                  "isPreparing": false,
                  "bulkStage": "string",
                  "discoveredApplicationCount": 0,
                  "discoveredFileCount": 0,
                  "discoveredByteCount": 0,
                  "extractedFileCount": 0,
                  "extractedByteCount": 0,
                  "recentExtractedFileNames": ["string"],
                  "complianceChecks": {
                    "screening": false,
                    "idVerification": false,
                    "kycDataVerification": false,
                    "kybDataVerification": false
                  },
                  "createdById": "507f1f77bcf86cd799439011",
                  "itemCounts": {
                    "total": 0,
                    "queued": 0,
                    "inProgress": 0,
                    "completed": 0,
                    "missingData": 0,
                    "failed": 0,
                    "cancelled": 0
                  },
                  "taskCount": 0,
                  "fileCount": 0,
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:05:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:05:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Create a migration batch",
        "tags": ["Migrations"],
        "x-public-api": true
      },
      "get": {
        "operationId": "platformListMigrations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMigrationsResponseDto"
                },
                "example": {
                  "items": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "accountId": "507f1f77bcf86cd799439011",
                      "workflowId": "507f1f77bcf86cd799439011",
                      "name": "string",
                      "labels": [],
                      "sourceType": {},
                      "status": {},
                      "isPreparing": false,
                      "bulkStage": "string",
                      "discoveredApplicationCount": 0,
                      "discoveredFileCount": 0,
                      "discoveredByteCount": 0,
                      "extractedFileCount": 0,
                      "extractedByteCount": 0,
                      "recentExtractedFileNames": [],
                      "complianceChecks": {},
                      "createdById": "507f1f77bcf86cd799439011",
                      "itemCounts": {},
                      "taskCount": 0,
                      "fileCount": 0,
                      "startedAt": "2026-03-30T12:00:00.000Z",
                      "completedAt": "2026-03-30T12:05:00.000Z",
                      "createdAt": "2026-03-30T10:00:00.000Z",
                      "updatedAt": "2026-03-30T12:05:00.000Z"
                    }
                  ],
                  "stats": {
                    "totalMigrations": 0,
                    "activeMigrations": 0,
                    "applicationsProcessed": 0,
                    "filesMigrated": 0,
                    "needsReview": 0,
                    "timeSavedMinutes": 0
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List migrations for the active account",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/items": {
      "post": {
        "operationId": "platformCreateMigrationItem",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "Source documents for one item (one detected application group) in this migration."
                  },
                  "name": {
                    "type": "string",
                    "description": "Optional display name for the item. Defaults to the first file name."
                  }
                },
                "required": ["files"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationItemResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "migrationId": "507f1f77bcf86cd799439011",
                  "applicationId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "entityType": "BUSINESS",
                  "status": "QUEUED",
                  "stage": "PENDING",
                  "files": [
                    {
                      "fileName": "string",
                      "mimeType": "string",
                      "size": 0
                    }
                  ],
                  "fileCount": 0,
                  "progress": {
                    "classified": 0,
                    "summarized": 0,
                    "validated": 0
                  },
                  "activeFile": "string",
                  "onboardingPercent": 0,
                  "validateTotal": 0,
                  "outstanding": {
                    "missingFields": []
                  },
                  "error": "string",
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:01:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:01:00.000Z",
                  "retryable": false
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Stage a migration item from uploaded files",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/upload/sign": {
      "post": {
        "operationId": "platformCreateMigrationUpload",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUploadDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUploadResponseDto"
                },
                "example": {
                  "strategy": "put",
                  "key": "string",
                  "putUrl": "string",
                  "uploadId": "string",
                  "partSize": 0,
                  "partCount": 0
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Presign a direct-to-S3 upload for one migration file",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/upload/sign-parts": {
      "post": {
        "operationId": "platformSignMigrationUploadParts",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignUploadPartsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignUploadPartsResponseDto"
                },
                "example": {
                  "parts": [
                    {
                      "partNumber": 0,
                      "url": "string"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Presign multipart part urls for a migration upload",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/upload/complete": {
      "post": {
        "operationId": "platformCompleteMigrationUpload",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteUploadDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Complete a multipart migration upload",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/upload/abort": {
      "post": {
        "operationId": "platformAbortMigrationUpload",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AbortUploadDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Abort a multipart migration upload",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/items/register": {
      "post": {
        "operationId": "platformRegisterMigrationItem",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterMigrationItemDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationItemResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "migrationId": "507f1f77bcf86cd799439011",
                  "applicationId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "entityType": "BUSINESS",
                  "status": "QUEUED",
                  "stage": "PENDING",
                  "files": [
                    {
                      "fileName": "string",
                      "mimeType": "string",
                      "size": 0
                    }
                  ],
                  "fileCount": 0,
                  "progress": {
                    "classified": 0,
                    "summarized": 0,
                    "validated": 0
                  },
                  "activeFile": "string",
                  "onboardingPercent": 0,
                  "validateTotal": 0,
                  "outstanding": {
                    "missingFields": []
                  },
                  "error": "string",
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:01:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:01:00.000Z",
                  "retryable": false
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Register a migration item from already-uploaded S3 keys",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/items/{itemId}": {
      "delete": {
        "operationId": "platformDeleteMigrationItem",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "required": true,
            "in": "path",
            "description": "Migration item ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Remove a staged migration item",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/items/{itemId}/retry": {
      "post": {
        "operationId": "platformRetryMigrationItem",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "required": true,
            "in": "path",
            "description": "Migration item ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationItemResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "migrationId": "507f1f77bcf86cd799439011",
                  "applicationId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "entityType": "BUSINESS",
                  "status": "QUEUED",
                  "stage": "PENDING",
                  "files": [
                    {
                      "fileName": "string",
                      "mimeType": "string",
                      "size": 0
                    }
                  ],
                  "fileCount": 0,
                  "progress": {
                    "classified": 0,
                    "summarized": 0,
                    "validated": 0
                  },
                  "activeFile": "string",
                  "onboardingPercent": 0,
                  "validateTotal": 0,
                  "outstanding": {
                    "missingFields": []
                  },
                  "error": "string",
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:01:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:01:00.000Z",
                  "retryable": false
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Re-run a settled migration item that needs attention",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/start": {
      "post": {
        "operationId": "platformStartMigration",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "accountId": "507f1f77bcf86cd799439011",
                  "workflowId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "labels": ["string"],
                  "sourceType": "UPLOAD",
                  "status": "UPLOADING",
                  "isPreparing": false,
                  "bulkStage": "string",
                  "discoveredApplicationCount": 0,
                  "discoveredFileCount": 0,
                  "discoveredByteCount": 0,
                  "extractedFileCount": 0,
                  "extractedByteCount": 0,
                  "recentExtractedFileNames": ["string"],
                  "complianceChecks": {
                    "screening": false,
                    "idVerification": false,
                    "kycDataVerification": false,
                    "kybDataVerification": false
                  },
                  "createdById": "507f1f77bcf86cd799439011",
                  "itemCounts": {
                    "total": 0,
                    "queued": 0,
                    "inProgress": 0,
                    "completed": 0,
                    "missingData": 0,
                    "failed": 0,
                    "cancelled": 0
                  },
                  "taskCount": 0,
                  "fileCount": 0,
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:05:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:05:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Start processing a migration",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/cancel": {
      "post": {
        "operationId": "platformCancelMigration",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "accountId": "507f1f77bcf86cd799439011",
                  "workflowId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "labels": ["string"],
                  "sourceType": "UPLOAD",
                  "status": "UPLOADING",
                  "isPreparing": false,
                  "bulkStage": "string",
                  "discoveredApplicationCount": 0,
                  "discoveredFileCount": 0,
                  "discoveredByteCount": 0,
                  "extractedFileCount": 0,
                  "extractedByteCount": 0,
                  "recentExtractedFileNames": ["string"],
                  "complianceChecks": {
                    "screening": false,
                    "idVerification": false,
                    "kycDataVerification": false,
                    "kybDataVerification": false
                  },
                  "createdById": "507f1f77bcf86cd799439011",
                  "itemCounts": {
                    "total": 0,
                    "queued": 0,
                    "inProgress": 0,
                    "completed": 0,
                    "missingData": 0,
                    "failed": 0,
                    "cancelled": 0
                  },
                  "taskCount": 0,
                  "fileCount": 0,
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:05:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:05:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Cancel a running migration",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/pause": {
      "post": {
        "operationId": "platformPauseMigration",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "accountId": "507f1f77bcf86cd799439011",
                  "workflowId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "labels": ["string"],
                  "sourceType": "UPLOAD",
                  "status": "UPLOADING",
                  "isPreparing": false,
                  "bulkStage": "string",
                  "discoveredApplicationCount": 0,
                  "discoveredFileCount": 0,
                  "discoveredByteCount": 0,
                  "extractedFileCount": 0,
                  "extractedByteCount": 0,
                  "recentExtractedFileNames": ["string"],
                  "complianceChecks": {
                    "screening": false,
                    "idVerification": false,
                    "kycDataVerification": false,
                    "kybDataVerification": false
                  },
                  "createdById": "507f1f77bcf86cd799439011",
                  "itemCounts": {
                    "total": 0,
                    "queued": 0,
                    "inProgress": 0,
                    "completed": 0,
                    "missingData": 0,
                    "failed": 0,
                    "cancelled": 0
                  },
                  "taskCount": 0,
                  "fileCount": 0,
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:05:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:05:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Pause a running migration",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}/resume": {
      "post": {
        "operationId": "platformResumeMigration",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "accountId": "507f1f77bcf86cd799439011",
                  "workflowId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "labels": ["string"],
                  "sourceType": "UPLOAD",
                  "status": "UPLOADING",
                  "isPreparing": false,
                  "bulkStage": "string",
                  "discoveredApplicationCount": 0,
                  "discoveredFileCount": 0,
                  "discoveredByteCount": 0,
                  "extractedFileCount": 0,
                  "extractedByteCount": 0,
                  "recentExtractedFileNames": ["string"],
                  "complianceChecks": {
                    "screening": false,
                    "idVerification": false,
                    "kycDataVerification": false,
                    "kybDataVerification": false
                  },
                  "createdById": "507f1f77bcf86cd799439011",
                  "itemCounts": {
                    "total": 0,
                    "queued": 0,
                    "inProgress": 0,
                    "completed": 0,
                    "missingData": 0,
                    "failed": 0,
                    "cancelled": 0
                  },
                  "taskCount": 0,
                  "fileCount": 0,
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:05:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:05:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Resume/kick a stalled or paused migration",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    },
    "/api/v1/migrations/{migrationId}": {
      "get": {
        "operationId": "platformGetMigration",
        "parameters": [
          {
            "name": "migrationId",
            "required": true,
            "in": "path",
            "description": "Migration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrationDetailResponseDto"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011",
                  "accountId": "507f1f77bcf86cd799439011",
                  "workflowId": "507f1f77bcf86cd799439011",
                  "name": "string",
                  "labels": ["string"],
                  "sourceType": "UPLOAD",
                  "status": "UPLOADING",
                  "isPreparing": false,
                  "bulkStage": "string",
                  "discoveredApplicationCount": 0,
                  "discoveredFileCount": 0,
                  "discoveredByteCount": 0,
                  "extractedFileCount": 0,
                  "extractedByteCount": 0,
                  "recentExtractedFileNames": ["string"],
                  "complianceChecks": {
                    "screening": false,
                    "idVerification": false,
                    "kycDataVerification": false,
                    "kybDataVerification": false
                  },
                  "createdById": "507f1f77bcf86cd799439011",
                  "itemCounts": {
                    "total": 0,
                    "queued": 0,
                    "inProgress": 0,
                    "completed": 0,
                    "missingData": 0,
                    "failed": 0,
                    "cancelled": 0
                  },
                  "taskCount": 0,
                  "fileCount": 0,
                  "startedAt": "2026-03-30T12:00:00.000Z",
                  "completedAt": "2026-03-30T12:05:00.000Z",
                  "createdAt": "2026-03-30T10:00:00.000Z",
                  "updatedAt": "2026-03-30T12:05:00.000Z",
                  "items": [
                    {
                      "id": "507f1f77bcf86cd799439011",
                      "migrationId": "507f1f77bcf86cd799439011",
                      "applicationId": "507f1f77bcf86cd799439011",
                      "name": "string",
                      "entityType": {},
                      "status": {},
                      "stage": {},
                      "files": [],
                      "fileCount": 0,
                      "progress": {},
                      "activeFile": "string",
                      "onboardingPercent": 0,
                      "validateTotal": 0,
                      "outstanding": {},
                      "error": "string",
                      "startedAt": "2026-03-30T12:00:00.000Z",
                      "completedAt": "2026-03-30T12:01:00.000Z",
                      "createdAt": "2026-03-30T10:00:00.000Z",
                      "updatedAt": "2026-03-30T12:01:00.000Z",
                      "retryable": false
                    }
                  ],
                  "runBreakdown": {
                    "bulkMode": false,
                    "batchStages": [],
                    "liveCalls": 0,
                    "liveInputTokens": 0,
                    "liveOutputTokens": 0,
                    "liveCostUsd": 0,
                    "liveBatchableInputTokens": 0,
                    "liveBatchableOutputTokens": 0,
                    "liveBatchableCostUsd": 0,
                    "liveCacheHits": 0,
                    "currentStageSince": "string",
                    "phaseTimes": {}
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get a migration and its items",
        "tags": ["Migrations"],
        "x-public-api": true
      }
    }
  },
  "info": {
    "title": "Steward Public API",
    "description": "Reference documentation for the Steward Public API.",
    "version": "1.0",
    "contact": {}
  },
  "tags": [
    {
      "name": "Applications",
      "x-steward-docs-title": "Applications",
      "x-steward-docs-description": "Work with Steward business and individual applications through their review lifecycle."
    },
    {
      "name": "Screening",
      "x-steward-docs-title": "Screening",
      "x-steward-docs-description": "Review sanctions, PEP, adverse-media, and watchlist screening hits through the Steward API."
    },
    {
      "name": "Documents",
      "x-steward-docs-title": "Documents",
      "x-steward-docs-description": "Register, retrieve, classify, and manage documents attached to Steward applications."
    },
    {
      "name": "Tasks",
      "x-steward-docs-title": "Tasks",
      "x-steward-docs-description": "List and manage compliance and onboarding tasks raised on Steward applications."
    },
    {
      "name": "Notes",
      "x-steward-docs-title": "Notes",
      "x-steward-docs-description": "Create and manage commentary and attachments scoped to Steward API entities."
    },
    {
      "name": "Accounts",
      "x-steward-docs-title": "Accounts",
      "x-steward-docs-description": "Understand the Steward account configuration, risk settings, and user membership exposed by the API."
    },
    {
      "name": "Webhooks",
      "description": "Webhooks API operations."
    },
    {
      "name": "Audit Log",
      "description": "Audit Log API operations."
    },
    {
      "name": "CRS XML Export",
      "description": "CRS XML Export API operations."
    },
    {
      "name": "Migrations",
      "description": "Migrations API operations."
    },
    {
      "name": "Search",
      "description": "Search API operations."
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "scheme": "bearer",
        "bearerFormat": "Steward API key",
        "type": "http",
        "description": "Paste the raw stw_test_… or stw_live_… API key. The client adds the Bearer prefix."
      }
    },
    "schemas": {
      "UserAccountSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Account ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Account name",
            "example": "Acme Corp"
          },
          "deactivatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Date when account was deactivated. Null if active.",
            "example": null,
            "nullable": true
          },
          "logoUrl": {
            "type": "string",
            "description": "Signed URL for the account logo image. Null if no logo has been uploaded.",
            "example": null,
            "nullable": true
          }
        },
        "required": ["id", "name", "deactivatedAt"]
      },
      "UserStatus": {
        "type": "string",
        "enum": ["PENDING", "ACTIVE", "INACTIVE"],
        "description": "User status"
      },
      "UserResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the user",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "externalId": {
            "type": "string",
            "description": "External ID from authentication provider",
            "example": "auth0|507f1f77bcf86cd799439011"
          },
          "firstName": {
            "type": "string",
            "description": "First name of the user",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "Last name of the user",
            "example": "Doe"
          },
          "email": {
            "type": "string",
            "description": "Email address of the user",
            "example": "john.doe@example.com"
          },
          "title": {
            "type": "string",
            "description": "Job title of the user",
            "example": "Software Engineer"
          },
          "activeAccountId": {
            "type": "string",
            "description": "ID of the active account this user is currently scoped to",
            "example": "507f1f77bcf86cd799439011"
          },
          "accounts": {
            "description": "All account memberships for the user",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserAccountSummaryDto"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "User creation date",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "User last update date",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "deactivatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Date when user was deactivated. Null if user is active.",
            "example": null,
            "nullable": true
          },
          "status": {
            "description": "User status",
            "example": "ACTIVE",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserStatus"
              }
            ]
          },
          "roles": {
            "type": "array",
            "description": "Roles of the user",
            "example": ["read-only"],
            "items": {
              "type": "string",
              "enum": ["backoffice", "demo", "dev", "read-only"]
            }
          },
          "metadata": {
            "type": "object",
            "description": "Auth0 user metadata",
            "example": {
              "requireMFA": true
            }
          }
        },
        "required": [
          "id",
          "externalId",
          "firstName",
          "lastName",
          "email",
          "title",
          "activeAccountId",
          "accounts",
          "createdAt",
          "updatedAt",
          "status",
          "roles"
        ]
      },
      "OnboardingMode": {
        "type": "string",
        "enum": ["CLASSIC", "DYNAMIC"],
        "description": "Default onboarding experience for new applications on this account (CLASSIC wizard or DYNAMIC onboarding agent)"
      },
      "RiskScoreStrategy": {
        "type": "string",
        "enum": ["CUMULATIVE", "MAXIMUM"],
        "description": "Risk score calculation strategy"
      },
      "IdvProvider": {
        "type": "string",
        "enum": ["ONFIDO", "TRULIOO"],
        "description": "IDV provider override for this account"
      },
      "DocumentType": {
        "type": "string",
        "enum": [
          "COMPANY_PROFILE",
          "ARTICLES_OF_INCORPORATION",
          "ARTICLES_OF_ASSOCIATION",
          "MEM_AND_ARTS",
          "STATUTS",
          "REGISTER_OF_DIRECTORS",
          "REGISTER_OF_SHAREHOLDERS",
          "LISTE_DES_ASSOCIES",
          "REGISTER_OF_BENEFICIARIES",
          "SOURCE_OF_WEALTH",
          "SOURCE_OF_FUNDS",
          "SIGNATURE",
          "IDENTITY_VERIFICATION",
          "ID_CARD",
          "ID_CARD_FRONT",
          "ID_CARD_BACK",
          "PROOF_OF_ADDRESS",
          "STRUCTURE_CHART",
          "PARTNERSHIP_AGREEMENT",
          "REGISTER_OF_MEMBERS",
          "TRUST_DEED",
          "CERTIFICATE_OF_TRUST",
          "COUNCIL_REGISTER",
          "FOUNDATION_CHARTER",
          "FOUNDATION_STATUTES",
          "REGISTER_OF_BOARD_MEMBERS",
          "REGISTER_OF_BOARD_COUNCIL_MEMBERS",
          "CAP_TABLE",
          "ORG_CHART",
          "PERIODIC_REVIEW_FORM",
          "CDD_FORM",
          "SHAREHOLDERS_AGREEMENT",
          "FINANCIAL_STATEMENTS",
          "BUDGET_USE_OF_FUNDS",
          "AUTHORISED_SIGNATORY_LIST",
          "POWERS_OF_ATTORNEY",
          "INVESTMENT_MEMO",
          "COMPANY_DECK",
          "UBO_REGISTER_EXTRACT",
          "RBE",
          "CERTIFICATE_OF_REGISTRATION",
          "CERTIFICATE_OF_FORMATION",
          "CERTIFICATE_OF_LIMITED_PARTNERSHIP",
          "REGISTER_OF_PARTNERS",
          "REGISTER_OF_MANAGERS",
          "OPERATING_AGREEMENT",
          "CORPORATE_BYLAWS",
          "SERIES_DESIGNATION_SCHEDULE",
          "REGISTER_OF_TRUSTEES",
          "CONSTITUTION",
          "COMPANY_REGISTRY_EXTRACT",
          "K_BIS_EXTRACT",
          "CELL_REGISTER",
          "SEGREGATED_PORTFOLIO_REGISTER",
          "SUB_FUND_REGISTER",
          "PROSPECTUS",
          "AIFM_APPOINTMENT_PROOF",
          "CONSTITUTIONAL_DOCUMENT",
          "AML_REPRESENTATION",
          "UBO_LETTER",
          "W_8",
          "W_8_BEN_E",
          "W_9",
          "SUBSCRIPTION_AGREEMENT",
          "INVESTOR_INFORMATION_FORM",
          "CORPORATE_RESOLUTION",
          "INVESTMENT_MANAGEMENT_AGREEMENT",
          "CERTIFICATE_OF_INCUMBENCY",
          "SIGNED_DIRECTOR_REGISTER",
          "FINANCIAL_FORECAST",
          "CHANGE_OF_NAME",
          "SOURCE_OF_FUNDS_WEALTH_DECLARATION",
          "FATCA_CRS_DECLARATION",
          "PROOF_OF_REGULATION",
          "SPECIMEN_SIGNATURES",
          "OWNERSHIP_CHART",
          "TRANSACTION_AUTHORISATION_LETTER",
          "AUTHORISED_TO_ACT_RESOLUTION",
          "PROOF_OF_GUARDIANSHIP_CUSTODIAN",
          "PROOF_OF_PLAN",
          "PROOF_OF_LISTING",
          "PROOF_OF_OWNERSHIP_BY_LISTED_COMPANY",
          "TEN_K_EXHIBIT_21",
          "OFFERING_DOCUMENT",
          "AML_LETTER",
          "OFFICIAL_WEBSITE_EXTRACT_PURPOSE",
          "WILL_OR_LETTER_OF_ADMINISTRATION",
          "DEATH_CERTIFICATE",
          "GRANT_OF_PROBATE",
          "PENSION_PLAN",
          "COUNCIL_APPROVAL_TO_INVEST",
          "PROOF_OF_NON_PROFIT_STATUS",
          "OWNERSHIP_REGISTER",
          "SCREENING_REPORT",
          "BANK_STATEMENT",
          "AUTHORITY_TO_INVESTMENT",
          "LIVENESS",
          "STEWSIGN_DOCUMENT",
          "VERIFICATION_LETTER",
          "PROOF_OF_LICENSE",
          "ONGOING_SCREENING_RECORD",
          "AUDIT_LOG",
          "COMPLIANCE_APPROVAL",
          "RISK_ASSESSMENT",
          "PAYMENT_INSTRUCTION",
          "CAPITAL_CALL_NOTICE",
          "CONTACT_LIST",
          "CORRESPONDENCE",
          "COVER_PAGE",
          "NOMINEE_DECLARATION",
          "OTHER"
        ],
        "description": "The supported document types"
      },
      "TaskType": {
        "type": "string",
        "enum": [
          "MISSING_DOCUMENT",
          "DOCUMENT_VALIDATION_FAILED",
          "SCREENING_MATCH",
          "PENDING_ONBOARDING",
          "PERIODIC_REVIEW",
          "ONBOARDING_ORG_CHART_REVIEW",
          "MISSING_FIELD"
        ]
      },
      "ScreeningType": {
        "type": "string",
        "enum": ["ADVERSE_MEDIA", "SANCTIONS", "WARNING", "PEP"]
      },
      "ScreeningStatus": {
        "type": "string",
        "enum": ["IN_REVIEW", "CONFIRMED", "DISMISSED", "NOT_REVIEWED", "TRUE_MATCH", "FALSE_POSITIVE"]
      },
      "ScreeningMatchCategoryDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "example": "Financial Crime"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Concise (≤12 word) description of the risk type shown on the (i) hover"
          }
        },
        "required": ["label"]
      },
      "MatchResult": {
        "type": "object",
        "properties": {
          "isMatch": {
            "type": "boolean",
            "example": true
          },
          "confidence": {
            "type": "number",
            "example": 0.85
          },
          "reviewNote": {
            "type": "string",
            "example": "Name and date of birth match the screening profile"
          },
          "incidentSummary": {
            "type": "string",
            "example": "Individual listed on OFAC SDN list since 2020 for involvement in money laundering activities"
          },
          "riskLevel": {
            "type": "string",
            "example": "HIGH"
          },
          "severity": {
            "type": "string",
            "nullable": true
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningMatchCategoryDto"
            }
          }
        },
        "required": ["isMatch", "confidence", "reviewNote", "incidentSummary", "riskLevel", "categories"]
      },
      "EntityTypeForNotes": {
        "type": "string",
        "enum": ["APPLICATION", "SCREENING_HIT", "DOCUMENT", "WORKFLOW_VERSION"]
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "externalId": {
            "type": "string",
            "example": "auth0|507f1f77bcf86cd799439011"
          },
          "firstName": {
            "type": "string",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "email": {
            "type": "string",
            "example": "john.smith@example.com"
          },
          "title": {
            "type": "string",
            "example": "Compliance Officer"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          }
        },
        "required": ["id", "externalId", "firstName", "lastName", "email", "title", "createdAt", "updatedAt"]
      },
      "Note": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "entityType": {
            "example": "APPLICATION",
            "allOf": [
              {
                "$ref": "#/components/schemas/EntityTypeForNotes"
              }
            ]
          },
          "entityId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439012"
          },
          "content": {
            "type": "string",
            "example": "Applicant confirmed ownership structure during call"
          },
          "createdBy": {
            "type": "string",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "deleted": {
            "type": "boolean",
            "example": false
          },
          "createdByUser": {
            "$ref": "#/components/schemas/User"
          },
          "updatedByUser": {
            "$ref": "#/components/schemas/User"
          }
        },
        "required": ["id", "entityType", "entityId", "content", "createdBy", "createdAt", "updatedAt", "deleted", "createdByUser", "updatedByUser"]
      },
      "ScreeningHit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "entityId": {
            "type": "string",
            "description": "Entity ID (individualId or businessId)",
            "example": "507f1f77bcf86cd799439012"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningType"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningStatus"
              }
            ]
          },
          "source": {
            "type": "string",
            "example": "comply-advantage"
          },
          "details": {
            "type": "object",
            "description": "Raw screening hit details from the provider"
          },
          "updatedBy": {
            "type": "string",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "enriched": {
            "type": "boolean",
            "example": true
          },
          "matchResult": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "individualId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439013"
          },
          "storyId": {
            "type": "string",
            "nullable": true,
            "description": "Id of the adverse-media story this hit belongs to."
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          }
        },
        "required": ["id", "type", "createdAt", "updatedAt", "status", "source", "details", "enriched"]
      },
      "ScreeningStory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningType"
              }
            ]
          },
          "headline": {
            "type": "string",
            "example": "Mexico antitrust case against seven banks closed with minor fines"
          },
          "summary": {
            "type": "string",
            "example": "One event tracked from a Dec 2019 collusion probe to its Jan 2021 resolution with minor fines."
          },
          "aiDescription": {
            "type": "string",
            "description": "One reviewer-facing AI description standing in for the per-source rationales."
          },
          "primaryHitId": {
            "type": "string",
            "description": "The primary (most credible, latest-development) source's hit id.",
            "example": "507f1f77bcf86cd799439012"
          },
          "memberHitIds": {
            "description": "Member hit ids, ordered newest-development-first (primary leads).",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "nullable": true,
            "description": "Story-level category (latest state).",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningMatchCategoryDto"
              }
            ]
          },
          "severity": {
            "type": "string",
            "nullable": true,
            "description": "Story-level severity tier label (latest state)."
          }
        },
        "required": ["id", "type", "headline", "summary", "aiDescription", "primaryHitId", "memberHitIds"]
      },
      "ScreeningResults": {
        "type": "object",
        "properties": {
          "adverseMedia": {
            "example": [],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningHit"
            }
          },
          "sanctions": {
            "example": [],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningHit"
            }
          },
          "warning": {
            "example": [],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningHit"
            }
          },
          "pep": {
            "example": [],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningHit"
            }
          },
          "adverseMediaStories": {
            "example": [],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningStory"
            }
          }
        },
        "required": ["adverseMedia", "sanctions", "warning", "pep", "adverseMediaStories"]
      },
      "UpdateScreeningStatusRequest": {
        "type": "object",
        "properties": {
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningStatus"
              }
            ]
          },
          "note": {
            "type": "string",
            "example": "Confirmed false positive after manual review"
          },
          "severity": {
            "type": "string",
            "nullable": true,
            "description": "Reviewer-overridden severity tier label for this hit. Defaults per type are PEP 'Class 1'-'Class 4' and Adverse Media/Sanctions/Warning 'High'/'Medium'/'Low', but tiers are workspace-configurable and renameable, so the valid set depends on the account's taxonomy. Pass null to clear."
          }
        },
        "required": ["status"]
      },
      "UpdateScreeningStoryStatusRequest": {
        "type": "object",
        "properties": {
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningStatus"
              }
            ]
          },
          "note": {
            "type": "string",
            "example": "Same antitrust matter across all sources — resolved to minor fines. False positive."
          },
          "severity": {
            "type": "string",
            "nullable": true,
            "description": "Reviewer-overridden severity tier label for this story — applied to every member hit's matchResult.severity, not just the primary source. Defaults per type are PEP 'Class 1'-'Class 4' and Adverse Media/Sanctions/Warning 'High'/'Medium'/'Low', but tiers are workspace-configurable and renameable, so the valid set depends on the account's taxonomy. Pass null to clear."
          }
        },
        "required": ["status"]
      },
      "CreateManualScreeningHitRequest": {
        "type": "object",
        "properties": {
          "applicationId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "individualId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439012"
          },
          "businessId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439013"
          },
          "title": {
            "type": "string",
            "example": "Adverse media article"
          },
          "description": {
            "type": "string",
            "example": "Subject mentioned in connection with financial fraud investigation"
          },
          "url": {
            "type": "string",
            "example": "https://example.com/article"
          },
          "publishingDate": {
            "type": "string",
            "example": "2022-03-17"
          },
          "summary": {
            "type": "string",
            "example": "Subject linked to money laundering investigation"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningType"
              }
            ]
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningStatus"
              }
            ]
          }
        },
        "required": ["applicationId", "title", "type", "status"]
      },
      "Address": {
        "type": "object",
        "properties": {
          "street": {
            "type": "string",
            "example": "123 Main Street"
          },
          "apartment": {
            "type": "string",
            "example": "Apt 4B"
          },
          "city": {
            "type": "string",
            "example": "London"
          },
          "state": {
            "type": "string",
            "example": "England"
          },
          "country": {
            "type": "string",
            "example": "GB"
          },
          "postalCode": {
            "type": "string",
            "example": "EC1A 1BB"
          }
        }
      },
      "UpdateIndividualScreeningInfoRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Doe"
          },
          "dateOfBirth": {
            "type": "string",
            "format": "date-time",
            "example": "1990-05-15"
          },
          "address": {
            "description": "Entity address",
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ]
          },
          "applicationId": {
            "type": "string",
            "description": "Application ID (required for role updates)",
            "example": "507f1f77bcf86cd799439011"
          },
          "roles": {
            "type": "array",
            "description": "Roles for the individual",
            "example": ["DIRECTOR", "SHAREHOLDER"],
            "items": {
              "type": "string",
              "enum": [
                "DIRECTOR",
                "SHAREHOLDER",
                "UBO",
                "GENERAL_PARTNER",
                "LIMITED_PARTNER",
                "INVESTMENT_MANAGER",
                "FOUNDER",
                "COUNCIL_MEMBER",
                "TRUSTEE",
                "SETTLOR",
                "BENEFICIARY",
                "PROTECTOR",
                "INTERMEDIARY",
                "CONTROLLING_PERSON",
                "AUTHORIZED_SIGNATORY",
                "RELATED_PARTY",
                "PARENT",
                "PLAN_SPONSOR",
                "SENIOR_MANAGING_OFFICIAL",
                "EXECUTOR_ADMINISTRATOR",
                "DECEASED_PERSON",
                "JOINT_ACCOUNT",
                "MANAGER",
                "SIGNER"
              ]
            }
          }
        }
      },
      "UpdateBusinessScreeningInfoRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corp"
          },
          "address": {
            "description": "Business address",
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ]
          },
          "jurisdiction": {
            "type": "string",
            "example": "GB",
            "description": "Jurisdiction country code"
          }
        }
      },
      "UpdateScreeningSummaryRequest": {
        "type": "object",
        "properties": {
          "summaryText": {
            "type": "string",
            "example": "No significant adverse media found after manual review"
          }
        },
        "required": ["summaryText"]
      },
      "EntityTypeCategory": {
        "type": "string",
        "enum": ["individual", "business"]
      },
      "AuditEventType": {
        "type": "string",
        "enum": [
          "CREATED",
          "ONBOARDING_STARTED",
          "SUBMITTED",
          "APPROVED",
          "REJECTED",
          "REVIEWER_ASSIGNED",
          "REVIEWER_UNASSIGNED",
          "NOTE_CREATED",
          "NOTE_UPDATED",
          "NOTE_DELETED",
          "SCREENING_HIT_UPDATED",
          "DOCUMENT_UPLOADED",
          "DOCUMENT_UPDATED",
          "RISK_SCORE_CREATED",
          "RISK_SCORE_UPDATED",
          "APPLICATION_UPDATED",
          "KEY_PERSON_LINKED",
          "KEY_PERSON_ROLES_UPDATED",
          "KEY_PERSON_UNLINKED",
          "ONBOARDING_EMAIL_SENT",
          "SUBMITTER_DETAILS_UPDATED",
          "APPLICATION_EXPORTED"
        ]
      },
      "AuditLogItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "event": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AuditEventType"
              }
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "performedByName": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean",
            "description": "Whether the audit log is hidden from the UI"
          }
        },
        "required": ["id", "event", "createdAt", "hidden"]
      },
      "PaginatedAuditLogsResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditLogItemDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "example": "ZGVzY3xjcmVhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
          }
        },
        "required": ["items", "nextCursor"]
      },
      "CreateUserResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the user",
            "example": "507f1f77bcf86cd799439011"
          },
          "email": {
            "type": "string",
            "description": "Email address of the new user",
            "example": "john.doe@example.com"
          },
          "firstName": {
            "type": "string",
            "description": "First name of the new user",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "Last name of the new user",
            "example": "Doe"
          },
          "title": {
            "type": "string",
            "description": "Job title of the new user",
            "example": "Compliance Officer"
          },
          "roles": {
            "description": "Roles assigned to the new user",
            "example": ["read-only"],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": ["id", "email", "firstName", "lastName", "title", "roles"]
      },
      "NoteAttachmentDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "S3 key of the attachment",
            "example": "uploads/uuid_document.pdf"
          },
          "fileName": {
            "type": "string",
            "description": "Original file name",
            "example": "document.pdf"
          },
          "contentType": {
            "type": "string",
            "description": "MIME type of the file",
            "example": "application/pdf"
          },
          "fileUrl": {
            "type": "string",
            "description": "URL to access the file",
            "example": "https://bucket.s3.amazonaws.com/uploads/uuid_document.pdf"
          }
        },
        "required": ["key", "fileName", "contentType", "fileUrl"]
      },
      "NoteUserDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "description": "First name of the user",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "Last name of the user",
            "example": "Smith"
          },
          "email": {
            "type": "string",
            "description": "Email address of the user",
            "example": "john.smith@example.com"
          }
        },
        "required": ["firstName", "lastName", "email"]
      },
      "NoteResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Note ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "content": {
            "type": "string",
            "description": "Content of the note",
            "example": "Applicant confirmed ownership structure during call"
          },
          "attachments": {
            "description": "File attachments",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoteAttachmentDto"
            }
          },
          "createdBy": {
            "type": "string",
            "description": "ID of the user who created the note",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "updatedBy": {
            "type": "string",
            "description": "ID of the user who last updated the note",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "createdByUser": {
            "description": "User who created the note",
            "allOf": [
              {
                "$ref": "#/components/schemas/NoteUserDto"
              }
            ]
          },
          "updatedByUser": {
            "description": "User who last updated the note",
            "allOf": [
              {
                "$ref": "#/components/schemas/NoteUserDto"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "Date the note was created",
            "format": "date-time",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Date the note was last updated",
            "format": "date-time",
            "example": "2026-03-30T12:00:00.000Z"
          }
        },
        "required": ["id", "content", "attachments", "createdBy", "createdByUser", "createdAt", "updatedAt"]
      },
      "UpdateNoteDto": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string",
            "description": "Updated content of the note",
            "example": "Applicant confirmed ownership structure during call on 10/29",
            "minLength": 1
          },
          "attachments": {
            "description": "File attachments",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoteAttachmentDto"
            }
          }
        },
        "required": ["content"]
      },
      "BusinessIndividualRole": {
        "type": "string",
        "enum": [
          "DIRECTOR",
          "SHAREHOLDER",
          "UBO",
          "GENERAL_PARTNER",
          "LIMITED_PARTNER",
          "INVESTMENT_MANAGER",
          "FOUNDER",
          "COUNCIL_MEMBER",
          "TRUSTEE",
          "SETTLOR",
          "BENEFICIARY",
          "PROTECTOR",
          "INTERMEDIARY",
          "CONTROLLING_PERSON",
          "AUTHORIZED_SIGNATORY",
          "RELATED_PARTY",
          "PARENT",
          "PLAN_SPONSOR",
          "SENIOR_MANAGING_OFFICIAL",
          "EXECUTOR_ADMINISTRATOR",
          "DECEASED_PERSON",
          "JOINT_ACCOUNT",
          "MANAGER",
          "SIGNER"
        ]
      },
      "KeyPersonItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "joinId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439099",
            "description": "Join row id (business_individuals.id or business_companies.id) — used for unlink/edit operations"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EntityTypeCategory"
              }
            ]
          },
          "applicationId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439012"
          },
          "status": {
            "type": "string",
            "example": "SUBMITTED"
          },
          "stewardProfile": {
            "type": "boolean",
            "example": true
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "firstName": {
            "type": "string",
            "example": "John"
          },
          "middleName": {
            "type": "string",
            "example": "David"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessIndividualRole"
            }
          },
          "riskScore": {
            "type": "number",
            "example": 45
          },
          "screeningSummary": {
            "type": "array",
            "description": "Which screening types to include",
            "items": {
              "$ref": "#/components/schemas/ScreeningType"
            }
          }
        },
        "required": ["id", "type", "applicationId", "status", "firstName", "lastName", "roles", "screeningSummary"]
      },
      "TaskStatus": {
        "type": "string",
        "enum": ["PENDING", "MISSING_DATA", "RESOLVED"],
        "description": "Current status of the task"
      },
      "TaskEntityType": {
        "type": "string",
        "enum": ["DOCUMENT", "SCREENING_HIT", "APPLICATION", "PROFILE_FIELD"],
        "description": "Entity type the task relates to"
      },
      "DocumentSubType": {
        "type": "string",
        "enum": ["PASSPORT", "DRIVING_LICENSE", "ID_CARD"]
      },
      "DocumentValidation": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The key of the validation check",
            "example": "ENTITY_NAME_MATCHES_USER_INPUT"
          },
          "isValid": {
            "type": "boolean",
            "description": "Boolean indicating if the validation check passed",
            "example": true
          },
          "label": {
            "type": "string",
            "description": "Human-readable description of the validation check",
            "example": "Contains Balance Sheet"
          },
          "value": {
            "description": "The extracted data from the validation check (can be string, number, boolean, object, or array)",
            "example": "John Doe",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {}
              }
            ],
            "nullable": true
          },
          "explanation": {
            "type": "string",
            "description": "Optional explanation providing context for the validation result (e.g., why it passed despite minor differences)",
            "example": "Company name matches (minor formatting difference: \"TechGrowth Inc\" vs \"TechGrowth\")",
            "nullable": true
          }
        },
        "required": ["key", "isValid", "label", "value"]
      },
      "DocumentValidationDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of document validation",
            "enum": [
              "VALID_PROOF_OF_ADDRESS",
              "USER_PROVIDED_DATA_MATCH_ARTICLES_OF_INCORPORATION",
              "USER_PROVIDED_DATA_MATCH_ARTICLES_OF_ASSOCIATION",
              "USER_PROVIDED_DATA_MATCH_MEMORANDUM_ARTICLES_OF_ASSOCIATION",
              "USER_PROVIDED_DATA_MATCH_PROOF_OF_ADDRESS",
              "USER_PROVIDED_DATA_MATCH_REGISTER_OF_DIRECTORS",
              "USER_PROVIDED_DATA_MATCH_REGISTER_OF_SHAREHOLDERS",
              "USER_PROVIDED_DATA_MATCH_CAP_TABLE",
              "USER_PROVIDED_DATA_MATCH_REGISTER_OF_MEMBERS",
              "USER_PROVIDED_DATA_MATCH_PARTNERSHIP_AGREEMENT",
              "SOURCE_OF_FUNDS",
              "USER_PROVIDED_DATA_MATCH_SOURCE_OF_FUNDS",
              "SOURCE_OF_WEALTH",
              "USER_PROVIDED_DATA_MATCH_SOURCE_OF_WEALTH",
              "ONFIDO_DOCUMENT_VALIDATION",
              "TRULIOO_DOCUMENT_VALIDATION",
              "USER_PROVIDED_DATA_MATCH_TRUST_DEED",
              "USER_PROVIDED_DATA_MATCH_TRUST_REGISTER_OF_BENEFICIARIES",
              "USER_PROVIDED_DATA_MATCH_FOUNDATION_CHARTER",
              "USER_PROVIDED_DATA_MATCH_FOUNDATION_STATUTES",
              "USER_PROVIDED_DATA_MATCH_REGISTER_OF_BOARD_COUNCIL_MEMBERS",
              "USER_PROVIDED_DATA_MATCH_ORG_CHART",
              "USER_PROVIDED_DATA_PRELIMINARY_ORG_CHART",
              "ORG_CHART_CERTIFIED_ALPHA",
              "TRUST_DEED_SIGNED",
              "USER_PROVIDED_DATA_MATCH_PROOF_OF_ADDRESS_IDENTITY",
              "USER_PROVIDED_DATA_MATCH_SHAREHOLDERS_AGREEMENT",
              "USER_PROVIDED_DATA_MATCH_FINANCIAL_STATEMENTS",
              "USER_PROVIDED_DATA_MATCH_UBO_REGISTER_EXTRACT",
              "USER_PROVIDED_DATA_MATCH_COMPANY_REGISTRY_EXTRACT",
              "USER_PROVIDED_DATA_MATCH_W8",
              "USER_PROVIDED_DATA_MATCH_W8_BEN_E",
              "USER_PROVIDED_DATA_MATCH_W9",
              "USER_PROVIDED_DATA_MATCH_SUBSCRIPTION_AGREEMENT",
              "USER_PROVIDED_DATA_MATCH_INVESTOR_INFORMATION_FORM",
              "USER_PROVIDED_DATA_MATCH_CORPORATE_RESOLUTION",
              "USER_PROVIDED_DATA_MATCH_INVESTMENT_MANAGEMENT_AGREEMENT",
              "USER_PROVIDED_DATA_MATCH_CERTIFICATE_OF_INCUMBENCY",
              "USER_PROVIDED_DATA_MATCH_SIGNED_DIRECTOR_REGISTER",
              "USER_PROVIDED_DATA_MATCH_CHANGE_OF_NAME",
              "USER_PROVIDED_DATA_MATCH_SOURCE_OF_FUNDS_WEALTH_DECLARATION",
              "USER_PROVIDED_DATA_MATCH_FATCA_CRS_DECLARATION",
              "USER_PROVIDED_DATA_MATCH_CRS_SELF_CERT_ENTITY",
              "USER_PROVIDED_DATA_MATCH_AUTHORISED_SIGNATORY_LIST",
              "USER_PROVIDED_DATA_MATCH_PROOF_OF_REGULATION",
              "ID_CARD_ATTRIBUTE_VALIDATION",
              "USER_PROVIDED_DATA_MATCH_SPECIMEN_SIGNATURES",
              "USER_PROVIDED_DATA_MATCH_OWNERSHIP_CHART",
              "USER_PROVIDED_DATA_MATCH_TRANSACTION_AUTHORISATION_LETTER",
              "USER_PROVIDED_DATA_MATCH_AUTHORISED_TO_ACT_RESOLUTION",
              "USER_PROVIDED_DATA_MATCH_POWERS_OF_ATTORNEY",
              "USER_PROVIDED_DATA_MATCH_AIFM_APPOINTMENT_PROOF",
              "USER_PROVIDED_DATA_MATCH_CELL_REGISTER",
              "USER_PROVIDED_DATA_MATCH_CERTIFICATE_OF_FORMATION",
              "USER_PROVIDED_DATA_MATCH_CERTIFICATE_OF_LIMITED_PARTNERSHIP",
              "USER_PROVIDED_DATA_MATCH_CERTIFICATE_OF_REGISTRATION",
              "USER_PROVIDED_DATA_MATCH_CONSTITUTION",
              "USER_PROVIDED_DATA_MATCH_CONSTITUTIONAL_DOCUMENT",
              "USER_PROVIDED_DATA_MATCH_CORPORATE_BYLAWS",
              "USER_PROVIDED_DATA_MATCH_OPERATING_AGREEMENT",
              "USER_PROVIDED_DATA_MATCH_PROSPECTUS",
              "USER_PROVIDED_DATA_MATCH_REGISTER_OF_BOARD_MEMBERS",
              "USER_PROVIDED_DATA_MATCH_REGISTER_OF_MANAGERS",
              "USER_PROVIDED_DATA_MATCH_REGISTER_OF_PARTNERS",
              "USER_PROVIDED_DATA_MATCH_REGISTER_OF_TRUSTEES",
              "USER_PROVIDED_DATA_MATCH_SEGREGATED_PORTFOLIO_REGISTER",
              "USER_PROVIDED_DATA_MATCH_SERIES_DESIGNATION_SCHEDULE",
              "USER_PROVIDED_DATA_MATCH_SUB_FUND_REGISTER",
              "USER_PROVIDED_DATA_MATCH_OWNERSHIP_REGISTER",
              "USER_PROVIDED_DATA_MATCH_BANK_STATEMENT",
              "USER_PROVIDED_DATA_MATCH_AUTHORITY_TO_INVESTMENT",
              "USER_PROVIDED_DATA_MATCH_VERIFICATION_LETTER",
              "USER_PROVIDED_DATA_MATCH_PROOF_OF_LICENSE",
              "USER_PROVIDED_DATA_MATCH_AML_LETTER"
            ],
            "example": "VALID_PROOF_OF_ADDRESS"
          },
          "results": {
            "description": "Array of validation results for this validation type",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentValidation"
            }
          },
          "validationAttempts": {
            "type": "number",
            "description": "Number of validation attempts for this document type (starts at 1, increments on each upload)",
            "example": 2
          },
          "jobId": {
            "type": "string"
          }
        },
        "required": ["type", "results"]
      },
      "DocumentItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "type": "string",
            "example": "PROOF_OF_ADDRESS"
          },
          "subType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentSubType"
              }
            ]
          },
          "title": {
            "type": "string",
            "example": "Proof of Address"
          },
          "fileName": {
            "type": "string",
            "example": "utility_bill.pdf"
          },
          "url": {
            "type": "string",
            "example": "https://storage.example.com/documents/utility_bill.pdf"
          },
          "validations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentValidationDto"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Any JSON metadata associated with the document"
          },
          "hidden": {
            "type": "boolean",
            "description": "Whether the document is hidden",
            "example": false
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          }
        },
        "required": ["id", "type", "title", "fileName", "url", "validations", "hidden", "createdAt", "updatedAt"]
      },
      "TaskResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Task ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "applicationId": {
            "type": "string",
            "description": "ID of the application this task belongs to",
            "example": "507f1f77bcf86cd799439011"
          },
          "status": {
            "description": "Current status of the task",
            "allOf": [
              {
                "$ref": "#/components/schemas/TaskStatus"
              }
            ]
          },
          "type": {
            "description": "Type of task",
            "allOf": [
              {
                "$ref": "#/components/schemas/TaskType"
              }
            ]
          },
          "title": {
            "type": "string",
            "description": "Title of the task",
            "example": "Review proof of address document"
          },
          "description": {
            "type": "string",
            "description": "Detailed description of the task",
            "example": "Verify the uploaded utility bill matches the applicant address"
          },
          "entityType": {
            "description": "Entity type the task relates to",
            "allOf": [
              {
                "$ref": "#/components/schemas/TaskEntityType"
              }
            ]
          },
          "entityId": {
            "type": "string",
            "description": "ID of the related entity",
            "example": "507f1f77bcf86cd799439012"
          },
          "document": {
            "description": "Related document details",
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentItem"
              }
            ]
          },
          "screeningHit": {
            "description": "Related screening hit details",
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningHit"
              }
            ]
          },
          "assigneeId": {
            "type": "string",
            "description": "ID of the user assigned to this task",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "reviewerId": {
            "type": "string",
            "description": "ID of the user reviewing this task",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Date the task was created",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Date the task was last updated",
            "example": "2026-03-30T12:00:00.000Z"
          }
        },
        "required": ["id", "applicationId", "status", "type", "title", "createdAt"]
      },
      "PaginatedTasksResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaskResponseDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "example": "ZGVzY3xjcmVhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
          }
        },
        "required": ["items", "nextCursor"]
      },
      "UpdateTaskDto": {
        "type": "object",
        "properties": {
          "status": {
            "description": "New status for the task",
            "allOf": [
              {
                "$ref": "#/components/schemas/TaskStatus"
              }
            ]
          },
          "assigneeId": {
            "type": "string",
            "description": "ID of the user assigned to this task",
            "example": "60d5ecb54b24003a7c8e92b2"
          },
          "reviewerId": {
            "type": "string",
            "description": "ID of the reviewer for this task",
            "example": "60d5ecb54b24003a7c8e92b2"
          }
        }
      },
      "EntityType": {
        "type": "string",
        "enum": ["BUSINESS", "INDIVIDUAL"]
      },
      "AccountType": {
        "type": "string",
        "enum": ["individual", "joint", "entity"],
        "description": "Display-facing account classification for the Overview meta-field. \"entity\" = business application; \"joint\" = individual application linked to a second individual via a JOINT_ACCOUNT entity link; \"individual\" = single personal application."
      },
      "SignatureDocument": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Document ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "signerName": {
            "type": "string",
            "example": "John Smith"
          },
          "date": {
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "url": {
            "type": "string",
            "example": "https://storage.example.com/signatures/signed-agreement.pdf"
          },
          "hidden": {
            "type": "boolean",
            "description": "Whether the signature document is hidden",
            "example": false
          }
        },
        "required": ["id", "signerName", "date", "url", "hidden"]
      },
      "Verification": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "example": "companyName"
          },
          "source": {
            "type": "string",
            "example": "companies-house"
          },
          "verified": {
            "type": "boolean",
            "example": true
          },
          "details": {
            "type": "string",
            "example": "Company name matches registrar records"
          },
          "verifiedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          }
        },
        "required": ["field", "source", "verified"]
      },
      "RiskCategory": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "description": "Identifier for this risk factor. The available factors depend on the account risk scoring strategy, so this is an open string (e.g. \"Jurisdiction\", \"Country Risk\", \"PEP\"), not a fixed enum.",
            "example": "Jurisdiction"
          },
          "score": {
            "type": "number",
            "description": "This factor's contribution to the overall risk score.",
            "example": 30
          },
          "level": {
            "type": "string",
            "description": "Qualitative level for this factor: `low`, `medium`, `high`, `prohibited`, or `bonus` (a risk-reducing factor, e.g. a regulated entity). Lowercase — distinct from the uppercase overall risk band derived from RiskData.score.",
            "example": "medium"
          },
          "title": {
            "type": "string",
            "description": "Human-readable title for this risk factor.",
            "example": "Jurisdiction Risk"
          }
        },
        "required": ["category", "score", "level", "title"]
      },
      "RiskData": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "description": "Overall numeric risk score for the application. The band (LOW / MEDIUM / HIGH / PROHIBITED) is not stored — it is derived from this number using the account risk scoring strategy. See the Risk Scoring guide for the strategy-specific bands.",
            "example": 45
          },
          "data": {
            "description": "Per-factor breakdown. Each entry is one risk factor and its contribution to the overall score.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RiskCategory"
            }
          }
        },
        "required": ["score"]
      },
      "TradingExperienceInfo": {
        "type": "object",
        "properties": {
          "shares": {
            "type": "string"
          },
          "derivatives": {
            "type": "string"
          },
          "otcDerivatives": {
            "type": "string"
          },
          "tradingMethod": {
            "type": "string"
          },
          "hasOccupationalExperience": {
            "type": "boolean"
          },
          "hasFormalQualification": {
            "type": "boolean"
          }
        }
      },
      "OnboardingStep": {
        "type": "object",
        "properties": {
          "stepProgressPercentage": {
            "type": "number",
            "example": 75
          },
          "identifier": {
            "type": "string",
            "example": "DOCUMENT_UPLOAD"
          },
          "title": {
            "type": "string",
            "example": "Document Upload"
          }
        }
      },
      "UnmappedResponseValue": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "value": {
            "type": "object"
          }
        },
        "required": ["id", "label"]
      },
      "UnmappedResponses": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "stepId": {
            "type": "string"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnmappedResponseValue"
            }
          }
        },
        "required": ["label", "stepId", "values"]
      },
      "FatcaCrsData": {
        "type": "object",
        "properties": {
          "tin": {
            "type": "string"
          },
          "noTinExplanation": {
            "type": "string"
          },
          "isUsPerson": {
            "type": "string"
          },
          "isSpecifiedUsPerson": {
            "type": "string"
          },
          "specifiedUsPersonExplanation": {
            "type": "string"
          },
          "fatcaClassification": {
            "type": "string"
          },
          "institutionalClassification": {
            "type": "string"
          },
          "giin": {
            "type": "string"
          },
          "noGiinReason": {
            "type": "string"
          },
          "noGiinExplanation": {
            "type": "string"
          },
          "crsEntityClassification": {
            "type": "string"
          }
        }
      },
      "Regulator": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "FCA"
          },
          "number": {
            "type": "string",
            "example": "123456"
          }
        },
        "required": ["name", "number"]
      },
      "PhoneNumberDto": {
        "type": "object",
        "properties": {
          "countryCode": {
            "type": "string",
            "example": "+1"
          },
          "phoneNumber": {
            "type": "string",
            "example": "4143319681"
          }
        },
        "required": ["countryCode", "phoneNumber"]
      },
      "BusinessCompanyRole": {
        "type": "string",
        "enum": [
          "DIRECTOR",
          "SHAREHOLDER",
          "UBO",
          "GENERAL_PARTNER",
          "LIMITED_PARTNER",
          "INVESTMENT_MANAGER",
          "FOUNDER",
          "COUNCIL_MEMBER",
          "TRUSTEE",
          "SETTLOR",
          "BENEFICIARY",
          "PROTECTOR",
          "INTERMEDIARY",
          "AUTHORIZED_SIGNATORY",
          "CONTROLLING_PERSON",
          "RELATED_PARTY",
          "PARENT",
          "PLAN_SPONSOR",
          "SENIOR_MANAGING_OFFICIAL",
          "EXECUTOR_ADMINISTRATOR",
          "DECEASED_PERSON"
        ],
        "description": "Roles this business holds in the parent business application. Only present when parentApplicationId is set."
      },
      "BusinessIndividualScreening": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EntityTypeCategory"
              }
            ]
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningStatus"
              }
            ]
          },
          "suggestedStatus": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningStatus"
              }
            ]
          },
          "summary": {
            "type": "array",
            "description": "Which screening types to include",
            "items": {
              "$ref": "#/components/schemas/ScreeningType"
            }
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "firstName": {
            "type": "string",
            "example": "John"
          },
          "middleName": {
            "type": "string",
            "example": "David"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessIndividualRole"
            }
          },
          "dateOfBirth": {
            "type": "string",
            "format": "date",
            "example": "1990-05-15"
          },
          "yearOfBirth": {
            "type": "number",
            "example": 1990
          },
          "monthOfBirth": {
            "type": "number",
            "example": 5
          },
          "hasNotReviewed": {
            "type": "boolean",
            "example": false
          },
          "hasDismissed": {
            "type": "boolean",
            "example": false
          },
          "confirmedMatchesCount": {
            "type": "number",
            "example": 2
          },
          "summaryText": {
            "type": "string",
            "example": "No matches confirmed after review"
          },
          "jurisdiction": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "GB"
          }
        },
        "required": ["id", "type", "summary", "firstName", "lastName"]
      },
      "BusinessApplicationItem": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corporation"
          },
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-01T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "verified": {
            "type": "boolean",
            "example": false
          },
          "manual": {
            "type": "boolean",
            "description": "Whether this is a manual application",
            "example": false
          },
          "customerType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EntityType"
              }
            ]
          },
          "accountType": {
            "description": "Display-facing account classification for the Overview meta-field. \"entity\" = business application; \"joint\" = individual application linked to a second individual via a JOINT_ACCOUNT entity link; \"individual\" = single personal application.",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountType"
              }
            ]
          },
          "stageEnteredAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-03-20T09:00:00.000Z",
            "description": "When the application entered its current stage. Drives the \"pending for N days\" meta-field for non-approved applications. Null for legacy rows created before stage tracking — callers fall back to createdAt."
          },
          "signatureDocument": {
            "$ref": "#/components/schemas/SignatureDocument"
          },
          "status": {
            "type": "string",
            "example": "SUBMITTED"
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary key-value metadata attached to the application. Null when no metadata is set.",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "example": {
              "externalRef": "abc-123",
              "plan": "enterprise"
            }
          },
          "verifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Verification"
            }
          },
          "reviewers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/User"
            }
          },
          "risk": {
            "$ref": "#/components/schemas/RiskData"
          },
          "keyPeople": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyPersonItem"
            }
          },
          "tradingExperience": {
            "$ref": "#/components/schemas/TradingExperienceInfo"
          },
          "labelIds": {
            "type": "array",
            "description": "Label IDs assigned to this application",
            "items": {
              "type": "string"
            },
            "example": ["507f1f77bcf86cd799439011"]
          },
          "skip2FA": {
            "type": "boolean"
          },
          "onboardingStep": {
            "$ref": "#/components/schemas/OnboardingStep"
          },
          "accountId": {
            "type": "string",
            "example": "60d5ecb54b24003a7c8e92a1"
          },
          "unmappedResponses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnmappedResponses"
            }
          },
          "fatcaCrs": {
            "$ref": "#/components/schemas/FatcaCrsData"
          },
          "registrationNumber": {
            "type": "string",
            "example": "12345678"
          },
          "taxIdentificationNumber": {
            "type": "string",
            "example": "GB123456789"
          },
          "entityType": {
            "type": "string",
            "example": "BUSINESS"
          },
          "regulator": {
            "$ref": "#/components/schemas/Regulator"
          },
          "jurisdiction": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "GB"
          },
          "incorporationDate": {
            "type": "string",
            "format": "date",
            "example": "2020-01-15"
          },
          "establishmentDate": {
            "type": "string",
            "format": "date",
            "example": "2020-01-15"
          },
          "registrationDate": {
            "type": "string",
            "format": "date",
            "example": "2020-01-15"
          },
          "trustType": {
            "type": "string",
            "example": "Discretionary Trust"
          },
          "legalForm": {
            "type": "string",
            "example": "Limited Company"
          },
          "purpose": {
            "type": "string",
            "example": "Investment management and advisory services"
          },
          "businessActivity": {
            "type": "string",
            "example": "Financial services"
          },
          "industry": {
            "type": "string",
            "example": "Financial Services"
          },
          "subIndustry": {
            "type": "string",
            "example": "Investment Management"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "registeredAddress": {
            "$ref": "#/components/schemas/Address"
          },
          "tradingAddress": {
            "$ref": "#/components/schemas/Address"
          },
          "phoneNumber": {
            "$ref": "#/components/schemas/PhoneNumberDto"
          },
          "website": {
            "type": "string",
            "example": "https://www.acmecorp.com"
          },
          "sicCode": {
            "type": "string",
            "example": "64110"
          },
          "vatNumber": {
            "type": "string",
            "example": "GB123456789"
          },
          "taxId": {
            "type": "string",
            "example": "A02951077"
          },
          "referrer": {
            "type": "string",
            "example": "Partner Bank"
          },
          "referrerNote": {
            "type": "string",
            "example": "Referred by relationship manager"
          },
          "companyTurnover": {
            "type": "string",
            "example": "1000000-5000000"
          },
          "annualFlow": {
            "type": "string",
            "example": "500000-1000000"
          },
          "estimatedNumberOfPayments": {
            "type": "number",
            "example": 50
          },
          "expectedFxRequirement": {
            "type": "string",
            "example": "100000-500000"
          },
          "currenciesRequired": {
            "example": ["GBP", "EUR", "USD"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "countriesSentTo": {
            "example": ["GB", "DE", "US"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "countriesReceivedFrom": {
            "example": ["GB", "FR"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentPurpose": {
            "type": "string",
            "example": "Supplier payments"
          },
          "fundingSource": {
            "type": "string",
            "example": "Revenue from operations"
          },
          "investmentAmount": {
            "type": "number",
            "example": 250000
          },
          "investmentAmountCurrency": {
            "type": "string",
            "example": "GBP"
          },
          "refreshedAt": {
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "isAudited": {
            "type": "boolean",
            "example": true
          },
          "hasPep": {
            "type": "boolean",
            "example": false
          },
          "ownershipLayers": {
            "type": "number",
            "minimum": 1,
            "maximum": 3
          },
          "legalEntityType": {
            "type": "string",
            "example": "Limited Company"
          },
          "regulatoryAuthority": {
            "type": "string",
            "example": "FCA"
          },
          "regulatoryNumber": {
            "type": "string",
            "example": "123456"
          },
          "parentApplicationId": {
            "type": "string",
            "description": "ID of the parent business application that spawned this business application as a related corporate party (e.g. corporate UBO, holding company). Absent when the business application is a standalone primary onboarding.",
            "example": "507f1f77bcf86cd799439011"
          },
          "parentRoles": {
            "type": "array",
            "description": "Roles this business holds in the parent business application. Only present when parentApplicationId is set.",
            "example": ["UBO", "SHAREHOLDER"],
            "items": {
              "$ref": "#/components/schemas/BusinessCompanyRole"
            }
          },
          "displayConfiguration": {
            "type": "object",
            "properties": {
              "hiddenFields": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "hiddenSections": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "example": {
              "hiddenFields": ["businessActivity"],
              "hiddenSections": ["step-1"]
            }
          },
          "screening": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessIndividualScreening"
            }
          }
        },
        "required": ["name", "id", "createdAt", "updatedAt", "verified", "manual", "customerType", "accountType", "verifications", "reviewers"]
      },
      "IndividualDocumentVerification": {
        "type": "object",
        "properties": {
          "documentType": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "fileUrl": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "providerId": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "required": ["verified"]
      },
      "IndividualApplicationItem": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corporation"
          },
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-01T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "verified": {
            "type": "boolean",
            "example": false
          },
          "manual": {
            "type": "boolean",
            "description": "Whether this is a manual application",
            "example": false
          },
          "customerType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EntityType"
              }
            ]
          },
          "accountType": {
            "description": "Display-facing account classification for the Overview meta-field. \"entity\" = business application; \"joint\" = individual application linked to a second individual via a JOINT_ACCOUNT entity link; \"individual\" = single personal application.",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountType"
              }
            ]
          },
          "stageEnteredAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-03-20T09:00:00.000Z",
            "description": "When the application entered its current stage. Drives the \"pending for N days\" meta-field for non-approved applications. Null for legacy rows created before stage tracking — callers fall back to createdAt."
          },
          "signatureDocument": {
            "$ref": "#/components/schemas/SignatureDocument"
          },
          "status": {
            "type": "string",
            "example": "SUBMITTED"
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary key-value metadata attached to the application. Null when no metadata is set.",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "example": {
              "externalRef": "abc-123",
              "plan": "enterprise"
            }
          },
          "verifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Verification"
            }
          },
          "reviewers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/User"
            }
          },
          "risk": {
            "$ref": "#/components/schemas/RiskData"
          },
          "keyPeople": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyPersonItem"
            }
          },
          "tradingExperience": {
            "$ref": "#/components/schemas/TradingExperienceInfo"
          },
          "labelIds": {
            "type": "array",
            "description": "Label IDs assigned to this application",
            "items": {
              "type": "string"
            },
            "example": ["507f1f77bcf86cd799439011"]
          },
          "skip2FA": {
            "type": "boolean"
          },
          "onboardingStep": {
            "$ref": "#/components/schemas/OnboardingStep"
          },
          "accountId": {
            "type": "string",
            "example": "60d5ecb54b24003a7c8e92a1"
          },
          "unmappedResponses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnmappedResponses"
            }
          },
          "firstName": {
            "type": "string",
            "example": "John"
          },
          "middleName": {
            "type": "string",
            "example": "David"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "dateOfBirth": {
            "type": "string",
            "format": "date",
            "example": "1990-05-15"
          },
          "yearOfBirth": {
            "type": "number",
            "example": 1990
          },
          "monthOfBirth": {
            "type": "number",
            "example": 5
          },
          "countryOfBirth": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "GB"
          },
          "nationality": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "GB"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "phoneNumber": {
            "$ref": "#/components/schemas/PhoneNumberDto"
          },
          "otherNationality": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "IE"
          },
          "taxResidency": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "GB"
          },
          "secondaryTaxResidency": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "IE"
          },
          "taxIdentificationNumber": {
            "type": "string",
            "example": "AB123456C"
          },
          "email": {
            "type": "string",
            "example": "john.smith@example.com"
          },
          "amountToBeInvested": {
            "type": "number",
            "example": 50000
          },
          "amountToBeInvestedCurrency": {
            "type": "string",
            "example": "GBP"
          },
          "usCitizen": {
            "type": "boolean",
            "example": false
          },
          "isPEP": {
            "type": "boolean",
            "example": false
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessIndividualRole"
            }
          },
          "onboarding": {
            "type": "boolean",
            "example": true
          },
          "employmentStatus": {
            "type": "string",
            "example": "EMPLOYED"
          },
          "occupation": {
            "type": "string",
            "example": "Software Engineer"
          },
          "idVerification": {
            "$ref": "#/components/schemas/IndividualDocumentVerification"
          },
          "stewardProfile": {
            "type": "boolean"
          },
          "screening": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessIndividualScreening"
            }
          },
          "accountTurnover": {
            "type": "string",
            "example": "50000-100000"
          },
          "annualFlow": {
            "type": "string",
            "example": "100000-500000"
          },
          "estimatedNumberOfPayments": {
            "type": "number",
            "example": 20
          },
          "expectedFxRequirement": {
            "type": "string",
            "example": "10000-50000"
          },
          "currenciesRequired": {
            "example": ["GBP", "EUR"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "countriesSentTo": {
            "example": ["GB", "DE"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "countriesReceivedFrom": {
            "example": ["GB", "US"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentPurpose": {
            "type": "string",
            "example": "Personal expenses"
          },
          "fundingSource": {
            "type": "string",
            "example": "Salary"
          },
          "parentApplicationId": {
            "type": "string",
            "description": "ID of the parent business application that spawned this individual application as a key person (e.g. UBO, director, shareholder). Absent when the individual application is a standalone primary onboarding.",
            "example": "507f1f77bcf86cd799439011"
          },
          "parentRoles": {
            "type": "array",
            "description": "Roles this individual holds in the parent business application. Only present when parentApplicationId is set.",
            "example": ["UBO", "DIRECTOR"],
            "items": {
              "$ref": "#/components/schemas/BusinessIndividualRole"
            }
          },
          "displayConfiguration": {
            "type": "object",
            "properties": {
              "hiddenFields": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "hiddenSections": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "example": {
              "hiddenFields": ["phoneNumber"],
              "hiddenSections": ["step-1"]
            }
          }
        },
        "required": ["name", "id", "createdAt", "updatedAt", "verified", "manual", "customerType", "accountType", "reviewers"]
      },
      "MissionControlApplicationItem": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corporation"
          },
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-01T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "manual": {
            "type": "boolean",
            "description": "Whether this is a manual application",
            "example": false
          },
          "customerType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EntityType"
              }
            ]
          },
          "status": {
            "type": "string",
            "example": "SUBMITTED"
          },
          "reviewers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/User"
            }
          },
          "risk": {
            "$ref": "#/components/schemas/RiskData"
          },
          "keyPeople": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyPersonItem"
            }
          },
          "labelIds": {
            "type": "array",
            "description": "Label IDs assigned to this application",
            "items": {
              "type": "string"
            },
            "example": ["507f1f77bcf86cd799439011"]
          },
          "childApplications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MissionControlApplicationItem"
            }
          },
          "openTasksCount": {
            "type": "number",
            "description": "Count of open tasks for this application",
            "example": 3
          }
        },
        "required": ["name", "id", "createdAt", "updatedAt", "manual", "customerType", "reviewers"]
      },
      "PaginatedApplicationsResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MissionControlApplicationItem"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "example": "ZGVzY3x1cGRhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
          }
        },
        "required": ["items", "nextCursor"]
      },
      "ApplicationType": {
        "type": "string",
        "enum": ["individual", "business"]
      },
      "CreateApplicationRequest": {
        "type": "object",
        "properties": {
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ApplicationType"
              }
            ]
          },
          "firstName": {
            "type": "string",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "example": "Doe"
          },
          "email": {
            "type": "string",
            "example": "john.doe@example.com"
          },
          "sendEmail": {
            "type": "boolean",
            "example": false
          },
          "manual": {
            "type": "boolean",
            "description": "Skips external data sources (ID verification, KYC/KYB checks, and screening). Set at creation only; not editable afterward.",
            "default": false,
            "example": false
          },
          "businessName": {
            "type": "string",
            "description": "Name of the business (optional, can be provided for any application type)",
            "example": "Acme Corporation"
          },
          "workflowId": {
            "type": "string",
            "description": "ID of the workflow to use for this application",
            "example": "507f1f77bcf86cd799439011"
          },
          "prefillApplicationId": {
            "type": "string",
            "description": "ID of an existing application to pre-fill default values from",
            "example": "507f1f77bcf86cd799439011"
          },
          "onboardingMode": {
            "description": "Onboarding experience mode (CLASSIC wizard or DYNAMIC chat). Defaults to CLASSIC.",
            "allOf": [
              {
                "$ref": "#/components/schemas/OnboardingMode"
              }
            ]
          },
          "reviewPrefilledSteps": {
            "type": "boolean",
            "description": "Dynamic onboarding: present steps already fully completed by document prefill once, prefilled, for the applicant to review. When false they are backfilled into the transcript as completed history cards. Defaults to true, matching the account-level default.",
            "default": true,
            "example": true
          },
          "skipPrefilledSteps": {
            "type": "boolean",
            "deprecated": true,
            "description": "Deprecated — use `reviewPrefilledSteps` (this field is its inverse). Ignored when `reviewPrefilledSteps` is supplied.",
            "example": false
          },
          "skipOnboardingWelcome": {
            "type": "boolean",
            "description": "Dynamic onboarding: begin the chat automatically instead of presenting the welcome screen. Not surfaced in any UI — intended for programmatic creation flows whose profiles arrive prefilled (application migration). Defaults to false.",
            "default": false,
            "example": false
          },
          "deferRequirements": {
            "type": "boolean",
            "description": "Dynamic onboarding: when true, every required field is treated as optional — the applicant can complete onboarding with whatever information is available and submit with fields left blank. Each skipped field becomes a self-clearing follow-up Review. Defaults to false.",
            "default": false,
            "example": false
          },
          "hasSubscriptionDocument": {
            "type": "boolean",
            "description": "Whether a subscription document was attached at creation to prefill the application. Recorded on the creation audit-log entry; the document itself is uploaded separately after the application is created.",
            "default": false,
            "example": false
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary key-value metadata. Up to 50 key-value pairs. Keys: 1-40 chars, letters/digits/hyphens/underscores only. Values: strings up to 500 chars.",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "externalRef": "abc-123",
              "plan": "enterprise"
            }
          }
        },
        "required": ["type", "firstName", "lastName", "email", "sendEmail"]
      },
      "CreateApplicationResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439012"
          }
        },
        "required": ["id"]
      },
      "SubmitterDetailsItem": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Michael"
          },
          "lastName": {
            "type": "string",
            "example": "Chen"
          },
          "email": {
            "type": "string",
            "example": "michael.chen@acme-corp.com"
          }
        },
        "required": ["firstName", "lastName", "email"]
      },
      "GetApplicationResponse": {
        "type": "object",
        "properties": {
          "businessApplication": {
            "description": "Business application details (present for business type applications)",
            "allOf": [
              {
                "$ref": "#/components/schemas/BusinessApplicationItem"
              }
            ]
          },
          "individualApplication": {
            "description": "Individual application details (present for individual type applications)",
            "allOf": [
              {
                "$ref": "#/components/schemas/IndividualApplicationItem"
              }
            ]
          },
          "submitter": {
            "description": "The submitter (person filling out the application) — name and email",
            "allOf": [
              {
                "$ref": "#/components/schemas/SubmitterDetailsItem"
              }
            ]
          }
        }
      },
      "IndividualTaxResidency": {
        "type": "object",
        "properties": {
          "principalResidence": {
            "type": "string",
            "example": "GB"
          },
          "secondaryResidence": {
            "type": "string",
            "example": "IE"
          },
          "taxIdentificationNumber": {
            "type": "string",
            "example": "AB123456C"
          }
        }
      },
      "UpdateIndividualDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "John"
          },
          "middleName": {
            "type": "string",
            "example": "David"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "countryOfBirth": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "GB"
          },
          "nationality": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "GB"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "phoneNumber": {
            "$ref": "#/components/schemas/PhoneNumberDto"
          },
          "otherNationality": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "IE"
          },
          "email": {
            "type": "string",
            "example": "john.smith@example.com"
          },
          "amountToBeInvested": {
            "type": "number",
            "example": 50000
          },
          "amountToBeInvestedCurrency": {
            "type": "string",
            "example": "GBP"
          },
          "usCitizen": {
            "type": "boolean",
            "example": false
          },
          "isPEP": {
            "type": "boolean",
            "example": false
          },
          "employmentStatus": {
            "type": "string",
            "example": "EMPLOYED"
          },
          "occupation": {
            "type": "string",
            "example": "Software Engineer"
          },
          "accountTurnover": {
            "type": "string",
            "example": "50000-100000"
          },
          "annualFlow": {
            "type": "string",
            "example": "100000-500000"
          },
          "estimatedNumberOfPayments": {
            "type": "number",
            "example": 20
          },
          "expectedFxRequirement": {
            "type": "string",
            "example": "10000-50000"
          },
          "currenciesRequired": {
            "example": ["GBP", "EUR"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "countriesSentTo": {
            "example": ["GB", "DE"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "countriesReceivedFrom": {
            "example": ["GB", "US"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentPurpose": {
            "type": "string",
            "example": "Personal expenses"
          },
          "fundingSource": {
            "type": "string",
            "example": "Salary"
          },
          "dateOfBirth": {
            "type": "string",
            "format": "date-time",
            "example": "1990-05-15"
          },
          "taxResidency": {
            "$ref": "#/components/schemas/IndividualTaxResidency"
          },
          "tradingExperience": {
            "$ref": "#/components/schemas/TradingExperienceInfo"
          }
        }
      },
      "UpdateBusinessDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Corporation"
          },
          "registrationNumber": {
            "type": "string",
            "example": "12345678"
          },
          "jurisdiction": {
            "type": "string",
            "format": "iso-3166-1-alpha-2",
            "description": "ISO 3166-1 alpha-2 country code",
            "example": "GB"
          },
          "trustType": {
            "type": "string",
            "example": "Discretionary Trust"
          },
          "legalForm": {
            "type": "string",
            "example": "Limited Company"
          },
          "purpose": {
            "type": "string",
            "example": "Investment management and advisory services"
          },
          "businessActivity": {
            "type": "string",
            "example": "Financial services"
          },
          "industry": {
            "type": "string",
            "example": "Financial Services"
          },
          "subIndustry": {
            "type": "string",
            "example": "Investment Management"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "registeredAddress": {
            "$ref": "#/components/schemas/Address"
          },
          "tradingAddress": {
            "$ref": "#/components/schemas/Address"
          },
          "phoneNumber": {
            "$ref": "#/components/schemas/PhoneNumberDto"
          },
          "website": {
            "type": "string",
            "example": "https://www.acmecorp.com"
          },
          "sicCode": {
            "type": "string",
            "example": "64110"
          },
          "vatNumber": {
            "type": "string",
            "example": "GB123456789"
          },
          "taxId": {
            "type": "string",
            "example": "A02951077"
          },
          "referrer": {
            "type": "string",
            "example": "Partner Bank"
          },
          "referrerNote": {
            "type": "string",
            "example": "Referred by relationship manager"
          },
          "companyTurnover": {
            "type": "string",
            "example": "1000000-5000000"
          },
          "annualFlow": {
            "type": "string",
            "example": "500000-1000000"
          },
          "estimatedNumberOfPayments": {
            "type": "number",
            "example": 50
          },
          "expectedFxRequirement": {
            "type": "string",
            "example": "100000-500000"
          },
          "currenciesRequired": {
            "example": ["GBP", "EUR", "USD"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "countriesSentTo": {
            "example": ["GB", "DE", "US"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "countriesReceivedFrom": {
            "example": ["GB", "FR"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paymentPurpose": {
            "type": "string",
            "example": "Supplier payments"
          },
          "fundingSource": {
            "type": "string",
            "example": "Revenue from operations"
          },
          "investmentAmount": {
            "type": "number",
            "example": 250000
          },
          "investmentAmountCurrency": {
            "type": "string",
            "example": "GBP"
          },
          "isAudited": {
            "type": "boolean",
            "example": true
          },
          "hasPep": {
            "type": "boolean",
            "example": false
          },
          "ownershipLayers": {
            "type": "number",
            "minimum": 1,
            "maximum": 3
          },
          "legalEntityType": {
            "type": "string",
            "example": "Limited Company"
          },
          "regulatoryAuthority": {
            "type": "string",
            "example": "FCA"
          },
          "regulatoryNumber": {
            "type": "string",
            "example": "123456"
          },
          "incorporationDate": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-15"
          },
          "establishmentDate": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-15"
          },
          "registrationDate": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-15"
          },
          "tradingExperience": {
            "$ref": "#/components/schemas/TradingExperienceInfo"
          }
        }
      },
      "UpdateApplicationRequest": {
        "type": "object",
        "properties": {
          "labelIds": {
            "type": "array",
            "description": "Label IDs to assign to the application",
            "items": {
              "type": "string"
            },
            "example": ["507f1f77bcf86cd799439011", "507f1f77bcf86cd799439012"]
          },
          "displayConfiguration": {
            "type": "object",
            "description": "Display configuration for hiding fields and sections",
            "properties": {
              "hiddenFields": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "hiddenSections": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "unmappedResponseUpdates": {
            "type": "object",
            "description": "Key-value pairs to update in unmappedResponses. Key format: stepId.valueId for regular fields, or fatcaCrs.fieldKey for FATCA fields.",
            "additionalProperties": true,
            "example": {
              "step1.item1": "new value",
              "fatcaCrs.tin": "123-45-6789"
            }
          },
          "individualApplication": {
            "$ref": "#/components/schemas/UpdateIndividualDto"
          },
          "businessApplication": {
            "$ref": "#/components/schemas/UpdateBusinessDto"
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary key-value metadata. Up to 50 key-value pairs. Keys: 1-40 chars, letters/digits/hyphens/underscores only. Values: strings up to 500 chars. On update, send `null` as a value to delete a key; send `{}` to clear all metadata.",
            "additionalProperties": {
              "type": ["string", "null"]
            },
            "example": {
              "externalRef": "abc-123",
              "plan": "enterprise"
            }
          }
        }
      },
      "UpdateSubmitterDetailsRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Michael"
          },
          "lastName": {
            "type": "string",
            "example": "Chen"
          },
          "email": {
            "type": "string",
            "example": "michael.chen@personal.com"
          },
          "resend": {
            "type": "boolean",
            "description": "Re-send the onboarding link to the updated email after saving. Works regardless of application status.",
            "example": false
          }
        },
        "required": ["firstName", "lastName", "email"]
      },
      "AccountResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Account ID",
            "example": "60d5ecb54b24003a7c8e92a1"
          },
          "name": {
            "type": "string",
            "description": "Account name",
            "example": "Acme Corporation"
          },
          "riskScoreStrategy": {
            "description": "Risk score calculation strategy",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/RiskScoreStrategy"
              }
            ]
          },
          "idvProvider": {
            "description": "IDV provider override for this account",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/IdvProvider"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Account creation date",
            "example": "2026-01-15T10:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Account last update date",
            "example": "2026-03-30T12:00:00.000Z"
          }
        },
        "required": ["id", "name", "createdAt", "updatedAt"]
      },
      "UpdateAccountDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Account name",
            "example": "Acme Corporation"
          },
          "riskScoreStrategy": {
            "description": "Risk score calculation strategy",
            "allOf": [
              {
                "$ref": "#/components/schemas/RiskScoreStrategy"
              }
            ]
          }
        }
      },
      "RiskFactorName": {
        "type": "string",
        "enum": [
          "JURISDICTION",
          "OWNERSHIP",
          "INDUSTRY",
          "ENTITY_AGE",
          "LEGAL_ENTITY_TYPE",
          "PEP",
          "WATCHLIST",
          "SANCTIONS",
          "ADVERSE_MEDIA",
          "REGULATED",
          "SOURCE_OF_WEALTH"
        ],
        "description": "Name of the risk factor (section)"
      },
      "RiskFactorOption": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the risk factor option. Can be a RiskFactorOptionName enum value or a custom string.",
            "enum": [
              "JURISDICTION_VERY_LOW",
              "JURISDICTION_LOW",
              "JURISDICTION_MEDIUM",
              "JURISDICTION_MEDIUM_HIGH",
              "JURISDICTION_HIGH",
              "JURISDICTION_PROHIBITED",
              "OWNERSHIP_SIMPLE",
              "OWNERSHIP_LAYERED",
              "OWNERSHIP_COMPLEX",
              "gambling",
              "lottery",
              "adultServices",
              "cryptocurrency",
              "paydayLending",
              "moneyServices",
              "nonBankFinance",
              "oil",
              "gas",
              "mining",
              "defenceAerospace",
              "pharmaceuticals",
              "healthcare",
              "realEstate",
              "technology",
              "banking",
              "investment",
              "military",
              "preciousMetals",
              "tobacco",
              "other",
              "ENTITY_AGE_LESS_THAN_1_YEAR",
              "ENTITY_AGE_1_TO_3_YEARS",
              "ENTITY_AGE_3_PLUS_YEARS",
              "LEGAL_ENTITY_TYPE_LIMITED_COMPANY",
              "LEGAL_ENTITY_TYPE_TRUST",
              "LEGAL_ENTITY_TYPE_FOUNDATION",
              "LEGAL_ENTITY_TYPE_PARTNERSHIP",
              "LEGAL_ENTITY_TYPE_FUNDS_VEHICLE",
              "LEGAL_ENTITY_TYPE_OTHER",
              "SCREENING_ADVERSE_MEDIA_DETECTED",
              "SCREENING_PEP_DETECTED",
              "SCREENING_SANCTIONS_DETECTED",
              "SCREENING_WATCHLIST_DETECTED",
              "REGULATED_VERY_LOW_RISK",
              "REGULATED_LOW_RISK",
              "REGULATED_MEDIUM_LOW_RISK",
              "REGULATED_MEDIUM_HIGH_RISK",
              "REGULATED_HIGH_RISK",
              "REGULATED_PROHIBITED_RISK"
            ]
          },
          "score": {
            "type": "number",
            "description": "Score for the risk factor option",
            "example": 10
          },
          "group": {
            "type": "string",
            "description": "Group the option belongs to",
            "example": "Ownership Risk",
            "nullable": true
          }
        },
        "required": ["name", "score"]
      },
      "RiskFactor": {
        "type": "object",
        "properties": {
          "name": {
            "description": "Name of the risk factor (section)",
            "example": "OWNERSHIP",
            "allOf": [
              {
                "$ref": "#/components/schemas/RiskFactorName"
              }
            ]
          },
          "options": {
            "description": "Options within this risk factor",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RiskFactorOption"
            }
          },
          "weight": {
            "type": "number",
            "description": "Weight percentage for the risk factor",
            "example": 80
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata for the factor",
            "nullable": true
          }
        },
        "required": ["name", "options", "weight"]
      },
      "ScreeningRiskCategoryDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "example": "Narcotics"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Editable explanatory text shown on the (i) hover for this category"
          }
        },
        "required": ["label"]
      },
      "ScreeningRiskTierDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "example": "Tier 1"
          },
          "weight": {
            "type": "number",
            "example": 10
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Editable explanatory text shown on the (i) hover for this tier"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningRiskCategoryDto"
            }
          }
        },
        "required": ["label", "weight", "categories"]
      },
      "ScreeningRiskSourceDto": {
        "type": "object",
        "properties": {
          "sourceType": {
            "type": "string",
            "example": "ADVERSE_MEDIA"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningRiskTierDto"
            }
          }
        },
        "required": ["sourceType", "tiers"]
      },
      "ScreeningTaxonomyDto": {
        "type": "object",
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningRiskSourceDto"
            }
          }
        },
        "required": ["sources"]
      },
      "RiskSettingsResponse": {
        "type": "object",
        "properties": {
          "factors": {
            "description": "Risk factors with their options and weights",
            "example": [],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RiskFactor"
            }
          },
          "screeningTaxonomy": {
            "nullable": true,
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningTaxonomyDto"
              }
            ]
          }
        },
        "required": ["factors"]
      },
      "UpdateRiskSettingsRequest": {
        "type": "object",
        "properties": {
          "factors": {
            "description": "Risk factors with their options and weights",
            "example": [],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RiskFactor"
            }
          },
          "screeningTaxonomy": {
            "nullable": true,
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/ScreeningTaxonomyDto"
              }
            ]
          }
        }
      },
      "AccountCreateUserDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address of the new user",
            "example": "john.doe@example.com"
          },
          "firstName": {
            "type": "string",
            "description": "First name of the new user",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "Last name of the new user",
            "example": "Doe"
          },
          "title": {
            "type": "string",
            "description": "Job title of the new user",
            "example": "Compliance Officer"
          },
          "roles": {
            "type": "array",
            "description": "Roles to assign to the user. Defaults to read-only if not provided.",
            "example": ["read-only"],
            "items": {
              "type": "string",
              "enum": ["read-only"]
            }
          },
          "mfaEnabled": {
            "type": "boolean",
            "description": "Whether MFA should be enabled for the user",
            "example": false
          }
        },
        "required": ["email", "firstName", "lastName", "title"]
      },
      "AccountUpdateUserDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "description": "First name of the user",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "Last name of the user",
            "example": "Doe"
          },
          "email": {
            "type": "string",
            "description": "Email address of the user",
            "example": "john.doe@example.com"
          },
          "title": {
            "type": "string",
            "description": "Job title of the user",
            "example": "Compliance Officer"
          },
          "roles": {
            "type": "array",
            "description": "Roles to assign to the user. Defaults to read-only if not provided.",
            "example": ["read-only"],
            "items": {
              "type": "string",
              "enum": ["read-only"]
            }
          }
        }
      },
      "PublicCreateNoteDto": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string",
            "description": "Content of the note",
            "example": "Applicant confirmed ownership structure during call",
            "minLength": 1
          },
          "attachments": {
            "description": "File attachments",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoteAttachmentDto"
            }
          },
          "entityType": {
            "description": "Type of parent entity this note is attached to",
            "example": "APPLICATION",
            "allOf": [
              {
                "$ref": "#/components/schemas/EntityTypeForNotes"
              }
            ]
          },
          "entityId": {
            "type": "string",
            "description": "ID of the parent entity",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": ["content", "entityType", "entityId"]
      },
      "PaginatedNotesResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoteResponseDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "example": "ZGVzY3xjcmVhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
          }
        },
        "required": ["items", "nextCursor"]
      },
      "PublicDocumentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ]
          },
          "subType": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentSubType"
              }
            ]
          },
          "title": {
            "type": "string",
            "example": "Proof of Address",
            "description": "Human-readable label for the document type"
          },
          "fileName": {
            "type": "string",
            "example": "passport.pdf"
          },
          "key": {
            "type": "string",
            "example": "documents/passport.pdf"
          },
          "contentType": {
            "type": "string",
            "example": "application/pdf"
          },
          "url": {
            "type": "string",
            "nullable": true,
            "example": "https://storage.example.com/documents/passport.pdf",
            "description": "Freshly signed S3 URL (re-signed on every read, ~7-day TTL). Null when the document has no underlying S3 object."
          },
          "hidden": {
            "type": "boolean",
            "example": false
          },
          "applicationId": {
            "type": "string",
            "example": "507f1f77bcf86cd799439012",
            "nullable": true
          },
          "validations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentValidationDto"
            }
          },
          "metadata": {
            "type": "object",
            "description": "JSON metadata associated with the document"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "notes": {
            "description": "Notes attached to the document",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoteResponseDto"
            }
          }
        },
        "required": ["id", "type", "title", "fileName", "key", "contentType", "url", "hidden", "validations", "createdAt", "updatedAt", "notes"]
      },
      "PaginatedDocumentsResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicDocumentDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "example": "ZGVzY3xjcmVhdGVkQXR8MjAyNi0wNS0xM1QxNjowOToxMi4wMDBafDUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMQ"
          }
        },
        "required": ["items", "nextCursor"]
      },
      "DocumentValidationJobStatus": {
        "type": "string",
        "enum": ["PENDING", "PROCESSING", "COMPLETED", "FAILED"]
      },
      "DocumentClassificationResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentValidationJobStatus"
              }
            ]
          },
          "classifiedType": {
            "description": "Classified document subtype. Null if classification was inconclusive or not yet complete.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentSubType"
              }
            ]
          },
          "requiresBack": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether this document type requires a back image upload (true for driving licence and national ID)",
            "example": true
          },
          "isGovernmentId": {
            "type": "boolean",
            "nullable": true,
            "description": "True iff the validator classified the document as one of the accepted subtypes (passport, driving licence, national ID). Equivalent to `classifiedType !== null`. Null while classification is still in flight."
          },
          "invalid": {
            "type": "boolean",
            "nullable": true,
            "description": "True when the validator clearly identified the document as a government-issued document of a TYPE WE DO NOT ACCEPT (e.g. residence permit, work permit, birth certificate). False when accepted or when the type is unclear. Null while classification is still in flight. Drives an upload-time hard rejection (the user must re-upload)."
          },
          "invalidReason": {
            "type": "string",
            "nullable": true,
            "description": "Short name of the unaccepted document type, when `invalid` is true. Used for the rejection copy (e.g. \"residence permit\"). Null otherwise."
          },
          "mismatchedFront": {
            "type": "boolean",
            "nullable": true,
            "description": "For back-of-ID documents (parentDocumentId set): true when the back's classified type doesn't match the front's. Null for fronts or when comparison isn't possible (front still classifying, no parent, etc.)."
          }
        },
        "required": ["status"]
      },
      "UploadDocumentDto": {
        "type": "object",
        "properties": {
          "applicationId": {
            "type": "string",
            "description": "ID of the application this document belongs to",
            "example": "507f1f77bcf86cd799439011"
          },
          "type": {
            "description": "Type of document",
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ]
          },
          "fileName": {
            "type": "string",
            "description": "Original file name",
            "example": "passport.pdf"
          },
          "key": {
            "type": "string",
            "description": "S3 object key for the uploaded file",
            "example": "documents/507f1f77bcf86cd799439011/passport.pdf"
          },
          "contentType": {
            "type": "string",
            "description": "MIME content type of the file",
            "example": "application/pdf"
          }
        },
        "required": ["applicationId", "type", "fileName", "key", "contentType"]
      },
      "WebhookStatus": {
        "type": "string",
        "enum": ["ACTIVE", "PAUSED"],
        "description": "Webhook status"
      },
      "WebhookResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Webhook ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "url": {
            "type": "string",
            "description": "URL where webhook payloads are delivered",
            "example": "https://your-app.com/webhooks/steward"
          },
          "events": {
            "description": "Events the webhook is subscribed to",
            "example": ["application.submitted", "application.approved"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "description": "Webhook status",
            "example": "ACTIVE",
            "allOf": [
              {
                "$ref": "#/components/schemas/WebhookStatus"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "Date the webhook was created",
            "example": "2026-03-01T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Date the webhook was last updated",
            "example": "2026-03-30T12:00:00.000Z"
          }
        },
        "required": ["id", "url", "events", "status", "createdAt", "updatedAt"]
      },
      "CreateWebhookDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL to deliver webhook payloads to",
            "example": "https://your-app.com/webhooks/steward"
          },
          "events": {
            "type": "array",
            "description": "Events to subscribe to",
            "example": ["application.submitted", "application.approved"],
            "items": {
              "type": "string",
              "enum": [
                "application.created",
                "application.onboarding_started",
                "application.submitted",
                "application.updated",
                "application.approved",
                "application.rejected",
                "screening.hits_created",
                "screening.enrichment_completed",
                "screening.hit_updated",
                "document.uploaded",
                "risk_score.created",
                "risk_score.updated",
                "reviewer.assigned",
                "reviewer.unassigned",
                "note.created",
                "note.updated",
                "note.deleted"
              ]
            }
          }
        },
        "required": ["url", "events"]
      },
      "WebhookCreatedResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Webhook ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "url": {
            "type": "string",
            "description": "URL where webhook payloads are delivered",
            "example": "https://your-app.com/webhooks/steward"
          },
          "events": {
            "description": "Events the webhook is subscribed to",
            "example": ["application.submitted", "application.approved"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "description": "Webhook status",
            "example": "ACTIVE",
            "allOf": [
              {
                "$ref": "#/components/schemas/WebhookStatus"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "Date the webhook was created",
            "example": "2026-03-01T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Date the webhook was last updated",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "secret": {
            "type": "string",
            "description": "Webhook signing secret - shown only once at creation",
            "example": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
          }
        },
        "required": ["id", "url", "events", "status", "createdAt", "updatedAt", "secret"]
      },
      "UpdateWebhookDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL to deliver webhook payloads to",
            "example": "https://your-app.com/webhooks/steward"
          },
          "events": {
            "type": "array",
            "description": "Events to subscribe to",
            "example": ["application.submitted", "application.approved"],
            "items": {
              "type": "string",
              "enum": [
                "application.created",
                "application.onboarding_started",
                "application.submitted",
                "application.updated",
                "application.approved",
                "application.rejected",
                "screening.hits_created",
                "screening.enrichment_completed",
                "screening.hit_updated",
                "document.uploaded",
                "risk_score.created",
                "risk_score.updated",
                "reviewer.assigned",
                "reviewer.unassigned",
                "note.created",
                "note.updated",
                "note.deleted"
              ]
            }
          },
          "status": {
            "description": "Webhook status",
            "example": "ACTIVE",
            "allOf": [
              {
                "$ref": "#/components/schemas/WebhookStatus"
              }
            ]
          }
        }
      },
      "WebhookDeliveryResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Delivery ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "event": {
            "type": "string",
            "description": "Event that triggered the delivery",
            "example": "application.submitted"
          },
          "status": {
            "type": "string",
            "description": "Delivery status",
            "example": "delivered"
          },
          "httpStatus": {
            "type": "number",
            "description": "HTTP status code from the receiving server",
            "example": 200
          },
          "attempts": {
            "type": "number",
            "description": "Number of delivery attempts",
            "example": 1
          },
          "lastAttemptAt": {
            "type": "string",
            "description": "Time of the last delivery attempt",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "createdAt": {
            "type": "string",
            "description": "Date the delivery was created",
            "example": "2026-03-30T12:00:00.000Z"
          }
        },
        "required": ["id", "event", "status", "attempts", "createdAt"]
      },
      "SearchType": {
        "type": "string",
        "enum": ["all", "applications", "screening", "documents", "tasks"]
      },
      "SearchSortOrder": {
        "type": "string",
        "enum": ["newest", "oldest"]
      },
      "ApplicationSearchHit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Display name (submitter or business name)"
          },
          "entityType": {
            "type": "string",
            "enum": ["individual", "business"]
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": ["id", "name", "status", "createdAt"]
      },
      "ApplicationSearchSection": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationSearchHit"
            }
          },
          "total": {
            "type": "number",
            "description": "Total matches in this section, ignoring pagination"
          }
        },
        "required": ["items", "total"]
      },
      "ScreeningSearchHit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Matched name on the screening hit"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "applicationName": {
            "type": "string"
          },
          "keyPersonId": {
            "type": "string",
            "description": "Individual or business id this hit belongs to (used as keyPersonId in the screening route)"
          }
        },
        "required": ["id", "title", "type", "status", "applicationId"]
      },
      "ScreeningSearchSection": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreeningSearchHit"
            }
          },
          "total": {
            "type": "number"
          }
        },
        "required": ["items", "total"]
      },
      "DocumentSearchHit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "subType": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "applicationName": {
            "type": "string"
          }
        },
        "required": ["id", "fileName", "type"]
      },
      "DocumentSearchSection": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentSearchHit"
            }
          },
          "total": {
            "type": "number"
          }
        },
        "required": ["items", "total"]
      },
      "TaskSearchHit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "applicationName": {
            "type": "string"
          }
        },
        "required": ["id", "title", "type", "status", "applicationId"]
      },
      "TaskSearchSection": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaskSearchHit"
            }
          },
          "total": {
            "type": "number"
          }
        },
        "required": ["items", "total"]
      },
      "SearchResponseDto": {
        "type": "object",
        "properties": {
          "applications": {
            "$ref": "#/components/schemas/ApplicationSearchSection"
          },
          "screening": {
            "$ref": "#/components/schemas/ScreeningSearchSection"
          },
          "documents": {
            "$ref": "#/components/schemas/DocumentSearchSection"
          },
          "tasks": {
            "$ref": "#/components/schemas/TaskSearchSection"
          }
        },
        "required": ["applications", "screening", "documents", "tasks"]
      },
      "MigrationComplianceChecksDto": {
        "type": "object",
        "properties": {
          "screening": {
            "type": "boolean",
            "description": "Run sanctions/PEP/adverse-media screening for each created application"
          },
          "idVerification": {
            "type": "boolean",
            "description": "Run ID verification for each created application"
          },
          "kycDataVerification": {
            "type": "boolean",
            "description": "Run KYC (individual) data verification for each created application"
          },
          "kybDataVerification": {
            "type": "boolean",
            "description": "Run KYB (business) data verification for each created application"
          }
        },
        "required": ["screening", "idVerification", "kycDataVerification", "kybDataVerification"]
      },
      "CreateMigrationDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name for the migration batch",
            "example": "Q1 legacy client import"
          },
          "labels": {
            "description": "Free-text labels for organizing migrations",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "workflowId": {
            "type": "string",
            "description": "Workflow each item is onboarded through. Defaults to the account default workflow when omitted."
          },
          "complianceChecks": {
            "description": "Compliance checks selected for the run",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationComplianceChecksDto"
              }
            ]
          },
          "useBatchLlm": {
            "type": "boolean",
            "description": "Route this run's file-stage LLM calls through the OpenAI Batch API (~50% cheaper, slower — minutes to hours). Omit to inherit the account default."
          }
        },
        "required": ["name"]
      },
      "MigrationSourceType": {
        "type": "string",
        "enum": ["UPLOAD", "API", "FTP"]
      },
      "MigrationStatus": {
        "type": "string",
        "enum": ["UPLOADING", "MIGRATING", "PAUSED", "COMPLETED", "FAILED", "CANCELLED"]
      },
      "MigrationItemCountsDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "description": "Total number of items in this migration"
          },
          "queued": {
            "type": "number",
            "description": "Items queued and not yet started"
          },
          "inProgress": {
            "type": "number",
            "description": "Items currently being processed"
          },
          "completed": {
            "type": "number",
            "description": "Items that completed successfully"
          },
          "missingData": {
            "type": "number",
            "description": "Items that completed with missing required data"
          },
          "failed": {
            "type": "number",
            "description": "Items that failed processing"
          },
          "cancelled": {
            "type": "number",
            "description": "Items cancelled before they finished processing"
          }
        },
        "required": ["total", "queued", "inProgress", "completed", "missingData", "failed", "cancelled"]
      },
      "MigrationResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Migration ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "accountId": {
            "type": "string",
            "description": "Owning account ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "workflowId": {
            "type": "string",
            "nullable": true,
            "description": "Workflow each item is onboarded through",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Display name for the migration batch"
          },
          "labels": {
            "description": "Free-text labels for organizing migrations",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sourceType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationSourceType"
              }
            ]
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationStatus"
              }
            ]
          },
          "isPreparing": {
            "type": "boolean",
            "description": "True while the run is still unpacking staged archives (MIGRATING with a zip file still staged on a non-terminal item)"
          },
          "bulkStage": {
            "type": "string",
            "nullable": true,
            "description": "Which bulk pipeline stage (CLASSIFY / SUMMARIZE / VALIDATE) is currently processing, for bulk-mode runs — items parked awaiting the batch should read as in progress, not queued. Null when not bulk-processing."
          },
          "discoveredApplicationCount": {
            "type": "number",
            "nullable": true,
            "description": "Applications discovered from the archive directory during unpack (null until an archive is read)"
          },
          "discoveredFileCount": {
            "type": "number",
            "nullable": true,
            "description": "Files discovered from the archive directory during unpack (null until an archive is read)"
          },
          "discoveredByteCount": {
            "type": "number",
            "nullable": true,
            "description": "Total uncompressed bytes of the discovered files, so progress can be shown by data size (null until an archive is read)"
          },
          "extractedFileCount": {
            "type": "number",
            "nullable": true,
            "description": "Archive entries streamed out to S3 so far in the current unpack pass (drives the live progress bar; null until a pass begins)"
          },
          "extractedByteCount": {
            "type": "number",
            "nullable": true,
            "description": "Bytes streamed out to S3 so far in the current unpack pass (drives the data-size progress bar; null until a pass begins)"
          },
          "recentExtractedFileNames": {
            "description": "Most-recently-extracted file names (rolling window, newest last) for the live \"Extracting <file>…\" line and its hover list",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "complianceChecks": {
            "nullable": true,
            "description": "Compliance checks selected for the run",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationComplianceChecksDto"
              }
            ]
          },
          "createdById": {
            "type": "string",
            "nullable": true,
            "description": "User who created the migration",
            "example": "507f1f77bcf86cd799439011"
          },
          "itemCounts": {
            "description": "Item counts by status for this migration",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationItemCountsDto"
              }
            ]
          },
          "taskCount": {
            "type": "number",
            "description": "Total outstanding tasks across the batch — the missing required fields summed over every item, not the number of items needing attention (one item can carry several tasks)"
          },
          "fileCount": {
            "type": "number",
            "description": "Total number of staged source files across all items in this migration"
          },
          "startedAt": {
            "type": "string",
            "nullable": true,
            "description": "When the run started",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "completedAt": {
            "type": "string",
            "nullable": true,
            "description": "When the run finished",
            "example": "2026-03-30T12:05:00.000Z"
          },
          "createdAt": {
            "type": "string",
            "description": "Date the migration was created",
            "example": "2026-03-30T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Date the migration was last updated",
            "example": "2026-03-30T12:05:00.000Z"
          }
        },
        "required": [
          "id",
          "accountId",
          "workflowId",
          "name",
          "labels",
          "sourceType",
          "status",
          "isPreparing",
          "bulkStage",
          "discoveredApplicationCount",
          "discoveredFileCount",
          "discoveredByteCount",
          "extractedFileCount",
          "extractedByteCount",
          "recentExtractedFileNames",
          "complianceChecks",
          "createdById",
          "itemCounts",
          "taskCount",
          "fileCount",
          "startedAt",
          "completedAt",
          "createdAt",
          "updatedAt"
        ]
      },
      "MigrationItemStatus": {
        "type": "string",
        "enum": ["QUEUED", "IN_PROGRESS", "COMPLETED", "MISSING_DATA", "FAILED", "CANCELLED"]
      },
      "MigrationItemStage": {
        "type": "string",
        "enum": ["PENDING", "APP_READY", "CLASSIFIED", "EXTRACTED"],
        "description": "Pipeline checkpoint. IN_PROGRESS + APP_READY means seeded but still waiting behind the queue (shown as Queued in the UI)"
      },
      "MigrationItemFileDto": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "description": "Original uploaded file name"
          },
          "mimeType": {
            "type": "string",
            "description": "Uploaded file MIME type"
          },
          "size": {
            "type": "number",
            "description": "Uploaded file size in bytes"
          }
        },
        "required": ["fileName", "mimeType", "size"]
      },
      "MigrationItemProgressDto": {
        "type": "object",
        "properties": {
          "classified": {
            "type": "number",
            "description": "Files whose content classification has finished"
          },
          "summarized": {
            "type": "number",
            "description": "Files summarized during the extraction stage"
          },
          "validated": {
            "type": "number",
            "description": "Per-document validations completed (can exceed fileCount — one file fans out to several document types)"
          }
        },
        "required": ["classified", "summarized", "validated"]
      },
      "MigrationOutstandingDto": {
        "type": "object",
        "properties": {
          "missingFields": {
            "description": "Labels of required profile fields still unfilled once document extraction settled",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": ["missingFields"]
      },
      "MigrationItemResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Migration item ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "migrationId": {
            "type": "string",
            "description": "Owning migration ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "applicationId": {
            "type": "string",
            "nullable": true,
            "description": "Application created from this item once the run processes it",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Display name for the item: the created application's current name when it has one (mirrors the application page, DEV-2729), else the operator-typed item label"
          },
          "entityType": {
            "nullable": true,
            "description": "Applicant entity type (BUSINESS/INDIVIDUAL); null defaults to business",
            "allOf": [
              {
                "$ref": "#/components/schemas/EntityType"
              }
            ]
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationItemStatus"
              }
            ]
          },
          "stage": {
            "description": "Pipeline checkpoint. IN_PROGRESS + APP_READY means seeded but still waiting behind the queue (shown as Queued in the UI)",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationItemStage"
              }
            ]
          },
          "files": {
            "description": "Staged source files",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MigrationItemFileDto"
            }
          },
          "fileCount": {
            "type": "number",
            "description": "Number of staged source files"
          },
          "progress": {
            "description": "Per-file pipeline progress counts",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationItemProgressDto"
              }
            ]
          },
          "activeFile": {
            "type": "string",
            "nullable": true,
            "description": "File currently being processed in the active pipeline stage"
          },
          "onboardingPercent": {
            "type": "number",
            "nullable": true,
            "description": "Onboarding completion percent (0-100) during the finalize stage"
          },
          "validateTotal": {
            "type": "number",
            "nullable": true,
            "description": "Total documents queued for the validate stage — the denominator for \"validated / N documents\" (null before validate)"
          },
          "outstanding": {
            "nullable": true,
            "description": "Post-run gap summary",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationOutstandingDto"
              }
            ]
          },
          "error": {
            "type": "string",
            "nullable": true,
            "description": "Truncated error message when the item failed"
          },
          "startedAt": {
            "type": "string",
            "nullable": true,
            "description": "When this item started processing",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "completedAt": {
            "type": "string",
            "nullable": true,
            "description": "When this item finished processing",
            "example": "2026-03-30T12:01:00.000Z"
          },
          "createdAt": {
            "type": "string",
            "description": "Date the item was created",
            "example": "2026-03-30T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Date the item was last updated",
            "example": "2026-03-30T12:01:00.000Z"
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether an operator may re-run this item: a settled status (MISSING_DATA / FAILED / CANCELLED) whose application (if any) is still PENDING. False once the app has SUBMITTED/APPROVED — re-running would re-extract and overwrite reviewed data."
          }
        },
        "required": [
          "id",
          "migrationId",
          "applicationId",
          "name",
          "entityType",
          "status",
          "stage",
          "files",
          "fileCount",
          "progress",
          "activeFile",
          "onboardingPercent",
          "validateTotal",
          "outstanding",
          "error",
          "startedAt",
          "completedAt",
          "createdAt",
          "updatedAt",
          "retryable"
        ]
      },
      "CreateUploadDto": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "description": "Original file name (used for the staging key + display)."
          },
          "contentType": {
            "type": "string",
            "description": "MIME content type the client will PUT with."
          },
          "size": {
            "type": "number",
            "description": "Total file size in bytes — decides single-PUT vs multipart."
          }
        },
        "required": ["fileName", "contentType", "size"]
      },
      "UploadStrategy": {
        "type": "string",
        "enum": ["put", "multipart"],
        "description": "Single presigned PUT (small) or S3 multipart (large)."
      },
      "CreateUploadResponseDto": {
        "type": "object",
        "properties": {
          "strategy": {
            "description": "Single presigned PUT (small) or S3 multipart (large).",
            "allOf": [
              {
                "$ref": "#/components/schemas/UploadStrategy"
              }
            ]
          },
          "key": {
            "type": "string",
            "description": "The staging S3 key the object will live at."
          },
          "putUrl": {
            "type": "string",
            "nullable": true,
            "description": "Presigned PUT url. Present only when strategy = put."
          },
          "uploadId": {
            "type": "string",
            "nullable": true,
            "description": "S3 multipart upload id. Present only when strategy = multipart."
          },
          "partSize": {
            "type": "number",
            "nullable": true,
            "description": "Byte size of each part (except the last). Present only when strategy = multipart."
          },
          "partCount": {
            "type": "number",
            "nullable": true,
            "description": "Total number of parts to upload. Present only when strategy = multipart."
          }
        },
        "required": ["strategy", "key", "putUrl", "uploadId", "partSize", "partCount"]
      },
      "SignUploadPartsDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The staging key returned by createUpload."
          },
          "uploadId": {
            "type": "string",
            "description": "The multipart upload id returned by createUpload."
          },
          "partNumbers": {
            "description": "The part numbers (1-based) to presign urls for.",
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "required": ["key", "uploadId", "partNumbers"]
      },
      "SignedUploadPartDto": {
        "type": "object",
        "properties": {
          "partNumber": {
            "type": "number"
          },
          "url": {
            "type": "string"
          }
        },
        "required": ["partNumber", "url"]
      },
      "SignUploadPartsResponseDto": {
        "type": "object",
        "properties": {
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignedUploadPartDto"
            }
          }
        },
        "required": ["parts"]
      },
      "CompletedPartDto": {
        "type": "object",
        "properties": {
          "partNumber": {
            "type": "number"
          },
          "etag": {
            "type": "string",
            "description": "The ETag S3 returned for this uploaded part."
          }
        },
        "required": ["partNumber", "etag"]
      },
      "CompleteUploadDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "uploadId": {
            "type": "string"
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompletedPartDto"
            }
          }
        },
        "required": ["key", "uploadId", "parts"]
      },
      "AbortUploadDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "uploadId": {
            "type": "string"
          }
        },
        "required": ["key", "uploadId"]
      },
      "RegisterItemFileDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The staging key the file was uploaded to (must be under this migration prefix)."
          },
          "fileName": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "size": {
            "type": "number"
          }
        },
        "required": ["key", "fileName", "mimeType", "size"]
      },
      "RegisterMigrationItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Application/group display name (the source folder — the item context)."
          },
          "files": {
            "description": "The already-uploaded files that make up this item.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RegisterItemFileDto"
            }
          }
        },
        "required": ["name", "files"]
      },
      "MigrationStatsDto": {
        "type": "object",
        "properties": {
          "totalMigrations": {
            "type": "number",
            "description": "Total number of migrations on the account"
          },
          "activeMigrations": {
            "type": "number",
            "description": "Migrations currently running (status MIGRATING)"
          },
          "applicationsProcessed": {
            "type": "number",
            "description": "Items with status COMPLETED or MISSING_DATA, across all of the account’s migrations"
          },
          "filesMigrated": {
            "type": "number",
            "description": "Total staged files across items with status COMPLETED or MISSING_DATA"
          },
          "needsReview": {
            "type": "number",
            "description": "Items with status MISSING_DATA or FAILED, across all of the account’s migrations"
          },
          "timeSavedMinutes": {
            "type": "number",
            "description": "Estimated minutes saved, derived as applicationsProcessed * 10"
          }
        },
        "required": ["totalMigrations", "activeMigrations", "applicationsProcessed", "filesMigrated", "needsReview", "timeSavedMinutes"]
      },
      "ListMigrationsResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MigrationResponseDto"
            }
          },
          "stats": {
            "$ref": "#/components/schemas/MigrationStatsDto"
          }
        },
        "required": ["items", "stats"]
      },
      "MigrationBatchStageStatsDto": {
        "type": "object",
        "properties": {
          "stage": {
            "type": "string",
            "description": "Pipeline stage (CLASSIFY / SUMMARIZE / VALIDATE)"
          },
          "submittedAt": {
            "type": "string",
            "nullable": true,
            "description": "When the stage batches were submitted to OpenAI (ISO)"
          },
          "completedAt": {
            "type": "string",
            "description": "When the stage batches settled (ISO)"
          },
          "waitedMs": {
            "type": "number",
            "nullable": true,
            "description": "Milliseconds waited on OpenAI for this stage"
          },
          "requested": {
            "type": "number",
            "nullable": true,
            "description": "Requests the stage wanted covered (pre-dedup)"
          },
          "deduplicated": {
            "type": "number",
            "nullable": true,
            "description": "Duplicate-content requests collapsed before submission"
          },
          "submitted": {
            "type": "number",
            "nullable": true,
            "description": "Requests actually sent to OpenAI"
          },
          "cached": {
            "type": "number",
            "description": "Results ingested into the cache"
          },
          "failed": {
            "type": "number",
            "description": "Requests that failed (per-line errors + whole-batch failures)"
          },
          "inputTokens": {
            "type": "number",
            "nullable": true,
            "description": "Input tokens billed for the stage batches"
          },
          "outputTokens": {
            "type": "number",
            "nullable": true,
            "description": "Output tokens billed for the stage batches"
          },
          "estimatedCostUsd": {
            "type": "number",
            "nullable": true,
            "description": "Estimated USD at the batch rate (live-equivalent is 2×)"
          },
          "outcome": {
            "type": "string",
            "description": "How the stage's batch phase ended ('completed' | 'timeout')"
          }
        },
        "required": [
          "stage",
          "submittedAt",
          "completedAt",
          "waitedMs",
          "requested",
          "deduplicated",
          "submitted",
          "cached",
          "failed",
          "inputTokens",
          "outputTokens",
          "estimatedCostUsd",
          "outcome"
        ]
      },
      "MigrationRunPhaseTimesDto": {
        "type": "object",
        "properties": {
          "itemsCounted": {
            "type": "number",
            "description": "Items whose timestamps contributed to the sums"
          },
          "classifyMs": {
            "type": "number",
            "nullable": true,
            "description": "Classify + store (item start → classified), summed ms"
          },
          "extractMs": {
            "type": "number",
            "nullable": true,
            "description": "Summarize + extract (classified → extracted), summed ms"
          },
          "validateMs": {
            "type": "number",
            "nullable": true,
            "description": "Validate (extracted → finalize start), summed ms"
          },
          "buildMs": {
            "type": "number",
            "nullable": true,
            "description": "Build application (finalize start → item settled), summed ms"
          }
        },
        "required": ["itemsCounted", "classifyMs", "extractMs", "validateMs", "buildMs"]
      },
      "MigrationRunBreakdownDto": {
        "type": "object",
        "properties": {
          "bulkMode": {
            "type": "boolean",
            "description": "Whether this run executed in bulk mode (resolved per-migration override → account default)"
          },
          "batchStages": {
            "description": "Per-stage Batch API records for bulk runs (empty for live runs)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MigrationBatchStageStatsDto"
            }
          },
          "liveCalls": {
            "type": "number",
            "description": "Live (non-batch) OpenAI calls attributed to this run"
          },
          "liveInputTokens": {
            "type": "number",
            "description": "Input tokens across attributed live calls"
          },
          "liveOutputTokens": {
            "type": "number",
            "description": "Output tokens across attributed live calls"
          },
          "liveCostUsd": {
            "type": "number",
            "description": "Estimated USD across attributed live calls, standard rates"
          },
          "liveBatchableInputTokens": {
            "type": "number",
            "description": "Subset of live input tokens from batchable file-stage calls"
          },
          "liveBatchableOutputTokens": {
            "type": "number",
            "description": "Subset of live output tokens from batchable file-stage calls"
          },
          "liveBatchableCostUsd": {
            "type": "number",
            "description": "Subset of live cost from batchable file-stage calls — what bulk mode would have halved"
          },
          "liveCacheHits": {
            "type": "number",
            "description": "Live calls served from the OpenAI cache — real activity at $0 spend (tokens unknown)"
          },
          "currentStageSince": {
            "type": "string",
            "nullable": true,
            "description": "When the currently in-flight bulk stage (bulkStage) was submitted — drives a live wait ticker pre-settlement"
          },
          "phaseTimes": {
            "nullable": true,
            "description": "Per-phase processing time summed across items",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationRunPhaseTimesDto"
              }
            ]
          }
        },
        "required": [
          "bulkMode",
          "batchStages",
          "liveCalls",
          "liveInputTokens",
          "liveOutputTokens",
          "liveCostUsd",
          "liveBatchableInputTokens",
          "liveBatchableOutputTokens",
          "liveBatchableCostUsd",
          "liveCacheHits",
          "currentStageSince",
          "phaseTimes"
        ]
      },
      "MigrationDetailResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Migration ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "accountId": {
            "type": "string",
            "description": "Owning account ID",
            "example": "507f1f77bcf86cd799439011"
          },
          "workflowId": {
            "type": "string",
            "nullable": true,
            "description": "Workflow each item is onboarded through",
            "example": "507f1f77bcf86cd799439011"
          },
          "name": {
            "type": "string",
            "description": "Display name for the migration batch"
          },
          "labels": {
            "description": "Free-text labels for organizing migrations",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sourceType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationSourceType"
              }
            ]
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationStatus"
              }
            ]
          },
          "isPreparing": {
            "type": "boolean",
            "description": "True while the run is still unpacking staged archives (MIGRATING with a zip file still staged on a non-terminal item)"
          },
          "bulkStage": {
            "type": "string",
            "nullable": true,
            "description": "Which bulk pipeline stage (CLASSIFY / SUMMARIZE / VALIDATE) is currently processing, for bulk-mode runs — items parked awaiting the batch should read as in progress, not queued. Null when not bulk-processing."
          },
          "discoveredApplicationCount": {
            "type": "number",
            "nullable": true,
            "description": "Applications discovered from the archive directory during unpack (null until an archive is read)"
          },
          "discoveredFileCount": {
            "type": "number",
            "nullable": true,
            "description": "Files discovered from the archive directory during unpack (null until an archive is read)"
          },
          "discoveredByteCount": {
            "type": "number",
            "nullable": true,
            "description": "Total uncompressed bytes of the discovered files, so progress can be shown by data size (null until an archive is read)"
          },
          "extractedFileCount": {
            "type": "number",
            "nullable": true,
            "description": "Archive entries streamed out to S3 so far in the current unpack pass (drives the live progress bar; null until a pass begins)"
          },
          "extractedByteCount": {
            "type": "number",
            "nullable": true,
            "description": "Bytes streamed out to S3 so far in the current unpack pass (drives the data-size progress bar; null until a pass begins)"
          },
          "recentExtractedFileNames": {
            "description": "Most-recently-extracted file names (rolling window, newest last) for the live \"Extracting <file>…\" line and its hover list",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "complianceChecks": {
            "nullable": true,
            "description": "Compliance checks selected for the run",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationComplianceChecksDto"
              }
            ]
          },
          "createdById": {
            "type": "string",
            "nullable": true,
            "description": "User who created the migration",
            "example": "507f1f77bcf86cd799439011"
          },
          "itemCounts": {
            "description": "Item counts by status for this migration",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationItemCountsDto"
              }
            ]
          },
          "taskCount": {
            "type": "number",
            "description": "Total outstanding tasks across the batch — the missing required fields summed over every item, not the number of items needing attention (one item can carry several tasks)"
          },
          "fileCount": {
            "type": "number",
            "description": "Total number of staged source files across all items in this migration"
          },
          "startedAt": {
            "type": "string",
            "nullable": true,
            "description": "When the run started",
            "example": "2026-03-30T12:00:00.000Z"
          },
          "completedAt": {
            "type": "string",
            "nullable": true,
            "description": "When the run finished",
            "example": "2026-03-30T12:05:00.000Z"
          },
          "createdAt": {
            "type": "string",
            "description": "Date the migration was created",
            "example": "2026-03-30T10:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Date the migration was last updated",
            "example": "2026-03-30T12:05:00.000Z"
          },
          "items": {
            "description": "Items in this migration, oldest first",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MigrationItemResponseDto"
            }
          },
          "runBreakdown": {
            "nullable": true,
            "description": "Run time/cost breakdown — present only for BACKOFFICE callers, null otherwise",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/MigrationRunBreakdownDto"
              }
            ]
          }
        },
        "required": [
          "id",
          "accountId",
          "workflowId",
          "name",
          "labels",
          "sourceType",
          "status",
          "isPreparing",
          "bulkStage",
          "discoveredApplicationCount",
          "discoveredFileCount",
          "discoveredByteCount",
          "extractedFileCount",
          "extractedByteCount",
          "recentExtractedFileNames",
          "complianceChecks",
          "createdById",
          "itemCounts",
          "taskCount",
          "fileCount",
          "startedAt",
          "completedAt",
          "createdAt",
          "updatedAt",
          "items",
          "runBreakdown"
        ]
      }
    }
  }
}
