{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daon/json-schema/daon-page-process-instance-schema.json",
  "title": "PageProcessInstance",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daon-process-instances-api-openapi.yml#/components/schemas/PageProcessInstance",
  "type": "object",
  "properties": {
    "totalElements": {
      "type": "integer",
      "format": "int64"
    },
    "totalPages": {
      "type": "integer",
      "format": "int32"
    },
    "first": {
      "type": "boolean"
    },
    "sort": {
      "$ref": "#/$defs/SortObject"
    },
    "number": {
      "type": "integer",
      "format": "int32"
    },
    "last": {
      "type": "boolean"
    },
    "numberOfElements": {
      "type": "integer",
      "format": "int32"
    },
    "pageable": {
      "$ref": "#/$defs/PageableObject"
    },
    "size": {
      "type": "integer",
      "format": "int32"
    },
    "content": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProcessInstance"
      }
    },
    "empty": {
      "type": "boolean"
    }
  },
  "$defs": {
    "DocumentUpload": {
      "type": "object",
      "properties": {
        "documentFormat": {
          "type": "string",
          "description": "Document Format",
          "enum": [
            "PDF"
          ],
          "minLength": 1,
          "readOnly": true
        },
        "documentCaptureKey": {
          "type": "string",
          "description": "The document capture key",
          "readOnly": true
        },
        "pageCaptureKey": {
          "type": "string",
          "description": "The document page capture key",
          "readOnly": true
        },
        "uploadUrl": {
          "type": "string",
          "description": "The location to which the document should be uploaded",
          "readOnly": true
        },
        "uploadHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The upload headers that must be set when uploading the document",
          "readOnly": true
        }
      },
      "required": [
        "documentFormat"
      ]
    },
    "ExternalSources": {
      "type": "object",
      "properties": {
        "faceUploads": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/Upload"
          },
          "description": "External Face Uploads. This is a map based on a face key and the upload.",
          "readOnly": true
        },
        "documentUploads": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/DocumentUpload"
          },
          "description": "External Document Uploads. This is a map based on a doc key and the upload.",
          "readOnly": true
        }
      }
    },
    "PageableObject": {
      "type": "object",
      "properties": {
        "sort": {
          "$ref": "#/$defs/SortObject"
        },
        "pageSize": {
          "type": "integer",
          "format": "int32"
        },
        "pageNumber": {
          "type": "integer",
          "format": "int32"
        },
        "paged": {
          "type": "boolean"
        },
        "unpaged": {
          "type": "boolean"
        },
        "offset": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "ProcessInstance": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "tenantId": {
          "type": "string",
          "description": "Tenant ID"
        },
        "processDefnId": {
          "type": "string",
          "description": "Process Definition ID"
        },
        "processDefnName": {
          "type": "string",
          "description": "Process Definition Name"
        },
        "processDefnVersion": {
          "type": "integer",
          "format": "int32",
          "description": "Process Definition Version"
        },
        "processDefinitionType": {
          "type": "string",
          "description": "Process Definition Type. This is used to determine the type of process, e.g., authentication, verification, etc.",
          "enum": [
            "AUTHENTICATION",
            "VERIFICATION",
            "OTHER"
          ]
        },
        "processTokenId": {
          "type": "string",
          "description": "The Process Token ID which was used to create this process instance"
        },
        "processTokenCounter": {
          "type": "integer",
          "format": "int32"
        },
        "status": {
          "type": "string",
          "description": "The status of the process instance, e.g., pending, active etc.",
          "enum": [
            "PENDING",
            "ACTIVE",
            "COMPLETED_TERMINATED",
            "COMPLETED_ENDED_ERROR",
            "COMPLETED_ENDED_SUCCESS",
            "REVIEW",
            "PAUSED",
            "COMPLETED_PROCESS_ERROR"
          ]
        },
        "processServerId": {
          "type": "string",
          "description": "The ID of the process server that is executing this process instance"
        },
        "createdDtm": {
          "type": "string",
          "format": "date-time",
          "description": "When the process instance was created"
        },
        "lastUpdatedDtm": {
          "type": "string",
          "format": "date-time",
          "description": "When the process instance was last updated"
        },
        "expiringDtm": {
          "type": "string",
          "format": "date-time",
          "description": "When the process instance will expire, after this time it will be deleted by retention policy"
        },
        "completedDtm": {
          "type": "string",
          "format": "date-time",
          "description": "When the process instance was completed"
        },
        "elapsedMilliseconds": {
          "type": "integer",
          "format": "int64"
        },
        "extId": {
          "type": "string",
          "deprecated": true,
          "description": "External ID (Deprecated use parameters map)"
        },
        "lastName": {
          "type": "string",
          "deprecated": true,
          "description": "Last name (Deprecated use parameters map)"
        },
        "firstName": {
          "type": "string",
          "deprecated": true,
          "description": "First name (Deprecated use parameters map)"
        },
        "dateOfBirth": {
          "type": "string",
          "format": "date",
          "deprecated": true,
          "description": "Date of birth (Deprecated use parameters map)"
        },
        "phoneNumber": {
          "type": "string",
          "deprecated": true,
          "description": "Phone number (Deprecated use parameters map)"
        },
        "email": {
          "type": "string",
          "deprecated": true,
          "description": "Email (Deprecated use parameters map)"
        },
        "nationality": {
          "type": "string",
          "deprecated": true,
          "description": "Nationality (Deprecated use parameters map)"
        },
        "forTest": {
          "type": "boolean",
          "deprecated": true,
          "description": "Denotes if this process instance is for testing purposes - i.e. was created as a test case from the backoffice. (Deprecated use parameters map)"
        },
        "parameters": {
          "type": "object",
          "additionalProperties": {}
        },
        "reviewedBy": {
          "type": "string"
        },
        "docNum1": {
          "type": "string"
        },
        "docNum2": {
          "type": "string"
        },
        "docNum3": {
          "type": "string"
        },
        "docNum4": {
          "type": "string"
        },
        "docNum5": {
          "type": "string"
        },
        "results": {
          "type": "object",
          "additionalProperties": {}
        },
        "externalSources": {
          "$ref": "#/$defs/ExternalSources",
          "description": "External sources used in the process instance, e.g., faces captures that were performed outside of TrustX."
        },
        "extendedSearchField": {
          "type": "string"
        },
        "processDefnS3Bucket": {
          "type": "string"
        },
        "processDefnS3Dir": {
          "type": "string"
        },
        "processTokenParameters": {
          "type": "object",
          "additionalProperties": {}
        },
        "extendedSearchTerms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "scheduledExpiry": {
          "type": "boolean",
          "description": "Indicates if the process instance is scheduled for expiry based on retention policy. If true, the process instance will be deleted after the retention period.",
          "readOnly": true
        },
        "retentionDays": {
          "type": "integer",
          "format": "int32",
          "description": "The number of days after which the process instance will be deleted by retention policy. This value is used to calculate the expiringDtm.",
          "readOnly": true
        },
        "fraudState": {
          "type": "string",
          "description": "Fraud review outcome recorded for this process instance. This field is returned only after a fraud state has been reported. Values: FRAUD_CONFIRMED, FRAUD_SUSPECTED, or NO_FRAUD_INDICATED. To change this value, use the fraud-state endpoint for the process instance.",
          "enum": [
            "FRAUD_CONFIRMED",
            "FRAUD_SUSPECTED",
            "NO_FRAUD_INDICATED"
          ],
          "readOnly": true
        },
        "fraudStateLastUpdatedBy": {
          "type": "string",
          "description": "Identifier of the authenticated caller that last reported or changed the fraud state. This field is returned only after a fraud state has been reported.",
          "readOnly": true
        },
        "fraudStateLastUpdated": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time, in UTC, when the fraud state was last reported or changed. This field is returned only after a fraud state has been reported.",
          "readOnly": true
        },
        "fraudStateNote": {
          "type": "string",
          "description": "Optional note supplied with the latest fraud-state report. This field is returned only when a note was provided. To change this value, use the fraud-state endpoint for the process instance.",
          "maxLength": 2000,
          "readOnly": true
        }
      }
    },
    "SortObject": {
      "type": "object",
      "properties": {
        "sorted": {
          "type": "boolean"
        },
        "unsorted": {
          "type": "boolean"
        },
        "empty": {
          "type": "boolean"
        }
      }
    },
    "Upload": {
      "type": "object",
      "properties": {
        "imageFormat": {
          "type": "string",
          "description": "Image Format",
          "enum": [
            "JPEG"
          ],
          "minLength": 1,
          "readOnly": true
        },
        "captureKey": {
          "type": "string",
          "description": "The image capture key",
          "readOnly": true
        },
        "uploadUrl": {
          "type": "string",
          "description": "The location to which the face image should be uploaded",
          "readOnly": true
        },
        "uploadHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The upload headers that must be set when uploading the images",
          "readOnly": true
        }
      },
      "required": [
        "imageFormat"
      ]
    }
  }
}