{
  "swagger": "2.0",
  "info": {
    "title": "fraudapi",
    "description": "Easily and directly scan and block fraudulent security threats in input.",
    "version": "v1"
  },
  "paths": {
    "/fraud-ai/detection/document": {
      "post": {
        "tags": [
          "FraudDetection"
        ],
        "summary": "AI Fraud Detection for Documents",
        "description": "Perform fraud detection and classification on input document and user context.  Input document formats supported include PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, EML, MSG, PNG, JPG and WEBP.",
        "operationId": "DocumentDetectFraud",
        "consumes": [
          "multipart/form-data"
        ],
        "produces": [
          "text/plain",
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "in": "formData",
            "name": "InputFile",
            "description": "Input document, or photos of a document, to perform fraud detection on",
            "type": "file"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/FraudDetectionResult"
            }
          }
        }
      }
    },
    "/fraud-ai/detection/document/advanced": {
      "post": {
        "tags": [
          "FraudDetection"
        ],
        "summary": "Advanced AI Fraud Detection for Documents",
        "description": "Perform advanced fraud detection and classification on input document and user context.  Input document formats supported include PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, EML, MSG, PNG, JPG and WEBP.",
        "operationId": "DocumentDetectFraudAdvanced",
        "consumes": [
          "multipart/form-data"
        ],
        "produces": [
          "text/plain",
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "in": "header",
            "name": "preprocessing",
            "description": "Optional: Set the level of image pre-processing to enhance accuracy.  Possible values are 'Auto' and 'None'.  Default is Auto.",
            "type": "string"
          },
          {
            "in": "header",
            "name": "resultCrossCheck",
            "description": "Optional: Set the level of output accuracy cross-checking to perform on the input.  Possible values are 'None' and 'Advanced'.  Default is None.",
            "type": "string"
          },
          {
            "in": "header",
            "name": "UserEmailAddress",
            "description": "User email address for context (optional)",
            "type": "string"
          },
          {
            "in": "header",
            "name": "UserEmailAddressVerified",
            "description": "True if the user's email address was verified (optional)",
            "type": "boolean"
          },
          {
            "in": "header",
            "name": "CustomPolicyID",
            "type": "string"
          },
          {
            "in": "header",
            "name": "CountryCode",
            "description": "Optional: ISO 3166-1 alpha-2 code (two letters, e.g. AU) of the country that issued the document.  When set to a supported country (currently AU), the document is classified into that country's document types and analysed with a document-specific fraud prompt and official reference specimens.  When not set, behaviour is unchanged from previous versions.",
            "type": "string"
          },
          {
            "in": "header",
            "name": "DocumentClass",
            "description": "Optional: force the document class instead of detecting it, e.g. au_driver_licence_nsw.  Requires CountryCode to be set to the matching country.  If the document turns out to be a different type, the result is not clean and DocumentClassMatch is false.",
            "type": "string"
          },
          {
            "in": "header",
            "name": "allowExpiredDocuments",
            "description": "Optional: Set to true to skip expiration date checks and allow expired documents.  Default is false.",
            "type": "boolean",
            "default": false
          },
          {
            "in": "formData",
            "name": "InputFile",
            "description": "Input document, or photos of a document, to perform fraud detection on",
            "type": "file"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdvancedFraudDetectionResult"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "AdvancedFraudDetectionResult": {
      "description": "Result of performing an advanced document fraud analysis",
      "type": "object",
      "properties": {
        "Successful": {
          "description": "True if successful, false otherwise",
          "type": "boolean"
        },
        "CleanResult": {
          "description": "True if the document is clean, false if fraud threats were found",
          "type": "boolean"
        },
        "FraudRiskLevel": {
          "format": "double",
          "description": "Overall fraud risk level between 0.0 and 1.0",
          "type": "number"
        },
        "ContainsFinancialLiability": {
          "description": "True if the document contains financial liability",
          "type": "boolean"
        },
        "ContainsSensitiveInformationCollection": {
          "description": "True if the document contains sensitive data collection from the recipient",
          "type": "boolean"
        },
        "ContainsAssetTransfer": {
          "description": "True if the document contains an asset transfer",
          "type": "boolean"
        },
        "ContainsPurchaseAgreement": {
          "description": "True if the document contains a purchase agreement",
          "type": "boolean"
        },
        "ContainsEmploymentAgreement": {
          "description": "True if the document contains an employment agreement",
          "type": "boolean"
        },
        "ContainsExpiredDocument": {
          "description": "True if the document is expired",
          "type": "boolean"
        },
        "ContainsAiGeneratedContent": {
          "description": "True if the document contains AI generated content",
          "type": "boolean"
        },
        "AnalysisRationale": {
          "description": "Rationale on why the document was classified as such",
          "type": "string"
        },
        "DocumentClass": {
          "description": "Standardized class of the input document.  When CountryCode is set to a country with document classification support (currently AU), this is the fine-grained document class identifier (e.g. au_driver_licence_nsw); otherwise one of the legacy coarse values (Passport, DriversLicense, IDCard, Invoice, BankStatement, UtilityBill, Unknown).",
          "type": "string"
        },
        "CountryCode": {
          "description": "ISO 3166-1 alpha-2 country code supplied by the caller in the CountryCode header, upper-cased; null when not supplied",
          "type": "string"
        },
        "DocumentClassMatch": {
          "description": "Only set when the caller supplied the DocumentClass header: true if the document is that document class, false if the analysis concluded it is a different document (in which case CleanResult is false).  Null when the class was detected automatically.",
          "type": "boolean"
        },
        "DocumentPeriodEnd": {
          "description": "Tax and income documents only (CountryCode=AU): end date of the period the document covers, ISO 8601 (YYYY-MM-DD) - 30 June of the income year for returns, notices of assessment, payment summaries and income statements; the quarter or month end for activity statements; the pay period end for pay slips; the statement date for statements of account.  Null when not readable or for other documents.",
          "type": "string"
        },
        "ContainsStalePeriod": {
          "description": "Tax and income documents only (CountryCode=AU): true when the period the document covers ended longer ago than the usual recency window for that document type (e.g. 3 months for a pay slip, 24 months for a tax return).  Informational only; it never makes CleanResult false.  Null when the period could not be read or for other documents.",
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "FraudDetectionResult": {
      "description": "Result of performing fraud detection on a document",
      "type": "object",
      "properties": {
        "Successful": {
          "description": "True if successful, false otherwise",
          "type": "boolean"
        },
        "CleanResult": {
          "description": "True if the document is clean, false if fraud threats were found",
          "type": "boolean"
        },
        "FraudRiskLevel": {
          "format": "double",
          "description": "Overall fraud risk level between 0.0 and 1.0",
          "type": "number"
        },
        "ContainsFinancialLiability": {
          "description": "True if the document contains financial liability",
          "type": "boolean"
        },
        "ContainsSensitiveInformationCollection": {
          "description": "True if the document contains sensitive data collection from the recipient",
          "type": "boolean"
        },
        "ContainsAssetTransfer": {
          "description": "True if the document contains an asset transfer",
          "type": "boolean"
        },
        "ContainsPurchaseAgreement": {
          "description": "True if the document contains a purchase agreement",
          "type": "boolean"
        },
        "ContainsEmploymentAgreement": {
          "description": "True if the document contains an employment agreement",
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "securityDefinitions": {
    "Apikey": {
      "type": "apiKey",
      "name": "Apikey",
      "in": "header",
      "description": "Apikey"
    }
  },
  "security": [
    {
      "Apikey": [ ]
    }
  ]
}