---
updatedAt: 2026-07-13T07:05:39.000Z
agentTools:
  projectIndex: https://docs.getsmileapi.com/llms.txt
---

# Classify Archive

Classify an archive.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Smile API",
    "version": "1.14.0",
    "description": "The Smile API provides employment and income data from a single API. ",
    "contact": {
      "name": "Smile Technology Pte Ltd",
      "url": "https://www.getsmileapi.com",
      "email": "info@getsmileapi.com"
    },
    "termsOfService": "https://www.getsmileapi.com/terms-and-conditions"
  },
  "servers": [
    {
      "url": "https://sandbox.smileapi.io/v1",
      "description": "Sandbox"
    },
    {
      "url": "https://open.smileapi.io/v1",
      "description": "Production"
    }
  ],
  "paths": {
    "/archives/classify": {
      "post": {
        "summary": "Classify Archive",
        "description": "Classify an archive.",
        "operationId": "create-and-classify-archive",
        "tags": [
          "Archives"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArchiveClassifyRequest"
              },
              "examples": {
                "Example": {
                  "value": {
                    "userId": "tenant-5c1a2e8678e3494eba303ad1afa54ee8",
                    "rawFiles": [
                      {
                        "fileExtensionType": "PDF",
                        "fileSubtype": null,
                        "fileName": "2021-04-14-17bbf36498de4d68a0d4f86c7b62f69f.pdf",
                        "fileContent": "base64 encoded file content"
                      }
                    ]
                  }
                }
              }
            }
          },
          "description": "request parameters"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveClassifyResponse"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": "OK",
                      "message": "Success",
                      "requestId": "5b79399a-6852-4234-bb0e-ad472648282d",
                      "data": {
                        "id": "u-17bbf36498de4d68a0d4f86c7b62f69f",
                        "createdAt": "2021-04-14T09:30:24Z",
                        "providerId": "user-provided",
                        "userId": "tenant-5c1a2e8678e3494eba303ad1afa54ee8",
                        "type": "SOCIAL_SECURITY",
                        "state": {
                          "status": "STARTED",
                          "errorCode": null,
                          "errorMessage": null,
                          "updatedAt": "2021-04-14T09:30:24Z"
                        },
                        "rawFiles": [
                          {
                            "id": "f-17bbf36498de4d68a0d4f86c7b62f69f",
                            "createdAt": "2021-04-14T09:30:24Z",
                            "name": "Screen Shot 2021-04-14 at 5.30.24 PM",
                            "subType": "PERSONAL_INFORMATION",
                            "size": 3048,
                            "format": "PNG",
                            "url": "https://file.smileapi.io/tenants/smileapi/users/smileapi-17bbf36498de4d68a0d4f86c7b62f69f/files/file-17bbf36498de4d68a0d4f86c7b62f69f.jpeg"
                          }
                        ],
                        "classification": {
                          "fileType": "PAYSLIP"
                        },
                        "analysis": null
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ObjectMetadataRefCode": {
        "type": "string",
        "title": "ObjectMetadataRefCode",
        "description": "Request status code",
        "enum": [
          "OK",
          "CREATED",
          "INVALID_CREDENTIALS",
          "INVALID_PARAMETERS",
          "INVALID_TOKEN",
          "UNAUTHORIZED_ACCESS",
          "MISSING_RESOURCE",
          "REQUEST_LIMIT_EXCEEDED",
          "SERVER_ERROR",
          "UNSUPPORTED_METHOD",
          "SERVER_UNAVAILABLE",
          "TIME_LIMIT_EXCEEDED"
        ],
        "example": "OK",
        "x-internal": false
      },
      "ObjectMetadataRefMessage": {
        "type": "string",
        "title": "ObjectMetadataRefMessage",
        "description": "Message response to the request",
        "example": "Success",
        "x-internal": false
      },
      "ObjectMetadataRefRequestID": {
        "type": "string",
        "title": "ObjectMetadataRefRequestID",
        "description": "Unique ID that is added to the body of every response for easy traceability of the request in our logs.",
        "x-internal": false,
        "example": "5b79399a-6852-4234-bb0e-ad472648282d"
      },
      "RefObjectID": {
        "type": "string",
        "title": "Object ID",
        "description": "Unique ID of this object",
        "example": "17bbf36498de4d68a0d4f86c7b62f69f"
      },
      "RefDateTime": {
        "type": "string",
        "title": "Date and Time string",
        "format": "date-time",
        "example": "2021-04-14T09:30:24Z",
        "description": "Date and time"
      },
      "RefGender": {
        "type": "string",
        "title": "GenderEnum",
        "enum": [
          "Male",
          "Female",
          "Non-binary",
          null
        ],
        "example": "Male",
        "description": "Gender"
      },
      "RefMaritalStatus": {
        "type": "string",
        "title": "RefMaritalStatus",
        "enum": [
          "Divorced",
          "Married",
          "Separated",
          "Single",
          "Widowed",
          "Lifetime Partner",
          null
        ],
        "example": "Married",
        "description": "Marital status"
      },
      "RefCurrency": {
        "type": "string",
        "title": "Currency ISO Codes",
        "description": "Currency in 3 character alpha ISO 4217",
        "enum": [
          "AFN",
          "DZD",
          "ARS",
          "AMD",
          "AWG",
          "AUD",
          "AZN",
          "BSD",
          "BHD",
          "THB",
          "PAB",
          "BBD",
          "BYN",
          "BZD",
          "BMD",
          "VES",
          "BOB",
          "BRL",
          "BND",
          "BGN",
          "BIF",
          "CAD",
          "CVE",
          "KYD",
          "GHS",
          "XOF",
          "XAF",
          "XPF",
          "CLP",
          "COP",
          "KMF",
          "CDF",
          "BAM",
          "NIO",
          "CRC",
          "HRK",
          "CZK",
          "GMD",
          "DKK",
          "MKD",
          "DJF",
          "STD",
          "DOP",
          "VND",
          "XCD",
          "EGP",
          "SVC",
          "ETB",
          "EUR",
          "FKP",
          "FJD",
          "HUF",
          "GIP",
          "HTG",
          "PYG",
          "GNF",
          "GYD",
          "HKD",
          "UAH",
          "ISK",
          "INR",
          "IRR",
          "IQD",
          "JMD",
          "JOD",
          "KES",
          "PGK",
          "LAK",
          "EEK",
          "KWD",
          "MWK",
          "AOA",
          "MMK",
          "GEL",
          "LVL",
          "LBP",
          "ALL",
          "HNL",
          "SLL",
          "LRD",
          "LYD",
          "SZL",
          "LTL",
          "LSL",
          "MGA",
          "MYR",
          "TMT",
          "MUR",
          "MZN",
          "MXN",
          "MDL",
          "MAD",
          "NGN",
          "ERN",
          "NAD",
          "NPR",
          "ANG",
          "ILS",
          "RON",
          "TWD",
          "NZD",
          "BTN",
          "KPW",
          "NOK",
          "PEN",
          "MRO",
          "TOP",
          "PKR",
          "MOP",
          "UYU",
          "PHP",
          "GBP",
          "BWP",
          "QAR",
          "GTQ",
          "ZAR",
          "OMR",
          "KHR",
          "MVR",
          "IDR",
          "RUB",
          "RWF",
          "SHP",
          "SAR",
          "RSD",
          "SCR",
          "SGD",
          "SBD",
          "KGS",
          "SOS",
          "TJS",
          "LKR",
          "SDG",
          "SRD",
          "SEK",
          "CHF",
          "SYP",
          "BDT",
          "WST",
          "TZS",
          "KZT",
          "TTD",
          "MNT",
          "TND",
          "TRY",
          "AED",
          "UGX",
          "CLF",
          "USD",
          "UZS",
          "VUV",
          "KRW",
          "YER",
          "JPY",
          "CNY",
          "ZMW",
          "ZWL",
          "PLN"
        ],
        "example": "PHP"
      },
      "FileTypeId": {
        "title": "FileTypeId",
        "type": "string",
        "description": "Upload file type. You can get all types from `/fileTypes` api",
        "example": "PAYSLIP"
      },
      "RawFile": {
        "title": "RawFile",
        "type": "object",
        "description": "Scanned or photographed document or form uploaded by the user to share hard copy employment and income information. File size limit is 15 MB.",
        "x-examples": {},
        "x-internal": false,
        "x-tags": [
          "Uploads"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/RefObjectID"
          },
          "createdAt": {
            "$ref": "#/components/schemas/RefDateTime"
          },
          "name": {
            "type": "string",
            "example": "Screen Shot 2021-04-14 at 5.30.24 PM",
            "description": "File name"
          },
          "subType": {
            "type": "string",
            "example": "PERSONAL_INFORMATION",
            "description": "Type of document uploaded",
            "nullable": true
          },
          "size": {
            "type": "integer",
            "description": "File size in kilobytes",
            "example": 3048
          },
          "format": {
            "type": "string",
            "enum": [
              "PDF",
              "PNG",
              "JPG",
              "JPEG"
            ],
            "example": "PNG",
            "description": "File type (only JPEG, PNG, PDF, or JPG formats are supported)"
          },
          "url": {
            "type": "string",
            "description": "URL to access the file. URL will expire after 60 days",
            "example": "https://file.smileapi.io/tenants/smileapi/users/smileapi-17bbf36498de4d68a0d4f86c7b62f69f/files/file-17bbf36498de4d68a0d4f86c7b62f69f.jpeg"
          }
        },
        "required": [
          "id",
          "createdAt",
          "name",
          "subType",
          "size",
          "format",
          "url"
        ]
      },
      "ArchiveClassification": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string",
            "enum": [
              "PAYSLIP",
              "TAX_DOCUMENT",
              "EMPLOYMENT_CERTIFICATE",
              "BANK_STATEMENT",
              "COMPANY_ID",
              "CLEARANCE_NBI",
              "GOVERNMENT_ID",
              "TELCO_BILL",
              "ELECTRICITY_BILL",
              "WATER_BILL",
              "OTHERS"
            ]
          }
        }
      },
      "RefDate": {
        "type": "string",
        "format": "date",
        "description": "The date, yyyy-MM-dd",
        "example": "2000-01-21"
      },
      "ArchivePayslipAnalysis": {
        "title": "Payslip Analysis",
        "type": "object",
        "properties": {
          "startDate": {
            "$ref": "#/components/schemas/RefDate"
          },
          "endDate": {
            "$ref": "#/components/schemas/RefDate"
          },
          "payDate": {
            "$ref": "#/components/schemas/RefDate"
          },
          "currency": {
            "$ref": "#/components/schemas/RefCurrency"
          },
          "grossAmount": {
            "type": "number",
            "description": "Gross amount"
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount"
          },
          "employerName": {
            "type": "string",
            "description": "Employer name"
          },
          "employeeName": {
            "type": "string",
            "description": "Employee name"
          },
          "ssNumber": {
            "type": "string",
            "description": "Employee's Social Security (SS) Number"
          },
          "philHealthNumber": {
            "type": "string",
            "description": "Employee's National Health Identification Number"
          },
          "taxNumber": {
            "type": "string",
            "description": "Employee's Tax Identification Number"
          },
          "pagIbigNumber": {
            "type": "string",
            "description": "Employee's National housing provident fund MID Number"
          }
        }
      },
      "ArchiveTaxDocumentAnalysis": {
        "title": "Tax Document Analysis",
        "type": "object",
        "properties": {
          "startDate": {
            "$ref": "#/components/schemas/RefDate"
          },
          "endDate": {
            "$ref": "#/components/schemas/RefDate"
          },
          "grossAmount": {
            "type": "number",
            "description": "Gross amount"
          },
          "baseAmount": {
            "type": "number",
            "description": "Base amount"
          },
          "employerName": {
            "type": "string"
          },
          "employeeName": {
            "type": "string",
            "description": "Employee name"
          },
          "taxNumber": {
            "type": "string",
            "description": "Employee's Tax Identification Number"
          }
        }
      },
      "ArchiveNbiClearanceDocumentAnalysis": {
        "title": "NBI clearance Document Analysis",
        "type": "object",
        "properties": {
          "expireDate": {
            "$ref": "#/components/schemas/RefDate"
          },
          "dateOfBirth": {
            "$ref": "#/components/schemas/RefDate"
          },
          "firstName": {
            "type": "string",
            "description": "First name"
          },
          "lastName": {
            "type": "string",
            "description": "Last name"
          },
          "middleName": {
            "type": "string",
            "description": "Middle name"
          },
          "nbiIdNumber": {
            "type": "string",
            "description": "NBI Clearance Document Number"
          },
          "address": {
            "type": "string",
            "description": "Address"
          },
          "maritalStatus": {
            "$ref": "#/components/schemas/RefMaritalStatus"
          },
          "gender": {
            "$ref": "#/components/schemas/RefGender"
          },
          "citizenship": {
            "type": "string",
            "description": "Citizenship"
          },
          "remark": {
            "type": "string",
            "description": "Remarks included in the document"
          }
        }
      },
      "ArchiveTelcoBillAnalysis": {
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string",
            "description": "Full name"
          },
          "firstName": {
            "type": "string",
            "description": "First name"
          },
          "lastName": {
            "type": "string",
            "description": "Last name"
          },
          "middleName": {
            "type": "string",
            "description": "Middle name"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number"
          },
          "address": {
            "type": "string",
            "description": "Address"
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Period start date, in YYYY-MM-DD format"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "description": "Period end date, in YYYY-MM-DD format"
          },
          "statementDate": {
            "type": "string",
            "format": "date",
            "description": "Statement date, in YYYY-MM-DD format"
          },
          "statementNumber": {
            "type": "string",
            "description": "Statement number"
          },
          "dueDate": {
            "type": "string",
            "format": "date",
            "description": "Due date, in YYYY-MM-DD format"
          },
          "paymentDate": {
            "type": "string",
            "format": "date",
            "description": "Payment date, in YYYY-MM-DD format"
          },
          "dueAmount": {
            "type": "number",
            "description": "Due amount"
          },
          "vatAmount": {
            "type": "number",
            "description": "Vat amount"
          },
          "adjustmentAmount": {
            "type": "number",
            "description": "Adjustment amount"
          },
          "currentBillAmount": {
            "type": "number",
            "description": "Current bill amount"
          },
          "balanceAmount": {
            "type": "number",
            "description": "Balance amount"
          },
          "previousDueAmount": {
            "type": "number",
            "description": "Previous due amount"
          },
          "currency": {
            "$ref": "#/components/schemas/RefCurrency"
          },
          "emailAddress": {
            "type": "string",
            "description": "Email address"
          },
          "phoneNumber": {
            "type": "string",
            "description": "Phone number"
          },
          "supplier": {
            "type": "string",
            "description": "Supplier name"
          }
        }
      },
      "ArchiveElectricityBillAnalysis": {
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string",
            "description": "Full name"
          },
          "firstName": {
            "type": "string",
            "description": "First name"
          },
          "lastName": {
            "type": "string",
            "description": "Last name"
          },
          "middleName": {
            "type": "string",
            "description": "Middle name"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number"
          },
          "address": {
            "type": "string",
            "description": "Address"
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Period start date, in YYYY-MM-DD format"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "description": "Period end date, in YYYY-MM-DD format"
          },
          "statementDate": {
            "type": "string",
            "format": "date",
            "description": "Statement date, in YYYY-MM-DD format"
          },
          "dueDate": {
            "type": "string",
            "format": "date",
            "description": "Due date, in YYYY-MM-DD format"
          },
          "paymentDate": {
            "type": "string",
            "format": "date",
            "description": "Payment date, in YYYY-MM-DD format"
          },
          "dueAmount": {
            "type": "number",
            "description": "Due amount"
          },
          "vatAmount": {
            "type": "number",
            "description": "Vat amount"
          },
          "currentBillAmount": {
            "type": "number",
            "description": "Current bill amount"
          },
          "balanceAmount": {
            "type": "number",
            "description": "Balance amount"
          },
          "previousDueAmount": {
            "type": "number",
            "description": "Previous due amount"
          },
          "currency": {
            "$ref": "#/components/schemas/RefCurrency"
          },
          "emailAddress": {
            "type": "string",
            "description": "Email address"
          },
          "phoneNumber": {
            "type": "string",
            "description": "Phone number"
          },
          "statementNumber": {
            "type": "string",
            "description": "Statement number"
          },
          "currentPeriodUsage": {
            "type": "number",
            "description": "Current period usage"
          },
          "previousReading": {
            "type": "number",
            "description": "Previous period usage"
          },
          "presentReading": {
            "type": "number",
            "description": "Present period usage"
          },
          "supplier": {
            "type": "string",
            "description": "Supplier name"
          }
        }
      },
      "ArchiveWaterBillAnalysis": {
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string",
            "description": "Full name"
          },
          "firstName": {
            "type": "string",
            "description": "First name"
          },
          "lastName": {
            "type": "string",
            "description": "Last name"
          },
          "middleName": {
            "type": "string",
            "description": "Middle name"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number"
          },
          "address": {
            "type": "string",
            "description": "Address"
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Period start date, in YYYY-MM-DD format"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "description": "Period end date, in YYYY-MM-DD format"
          },
          "statementDate": {
            "type": "string",
            "format": "date",
            "description": "Statement date, in YYYY-MM-DD format"
          },
          "dueDate": {
            "type": "string",
            "format": "date",
            "description": "Due date, in YYYY-MM-DD format"
          },
          "paymentDate": {
            "type": "string",
            "format": "date",
            "description": "Payment date, in YYYY-MM-DD format"
          },
          "dueAmount": {
            "type": "number",
            "description": "Due amount"
          },
          "vatAmount": {
            "type": "number",
            "description": "Vat amount"
          },
          "currentBillAmount": {
            "type": "number",
            "description": "Current bill amount"
          },
          "balanceAmount": {
            "type": "number",
            "description": "Balance amount"
          },
          "previousDueAmount": {
            "type": "number",
            "description": "Previous due amount"
          },
          "currency": {
            "$ref": "#/components/schemas/RefCurrency"
          },
          "emailAddress": {
            "type": "string",
            "description": "Email address"
          },
          "phoneNumber": {
            "type": "string",
            "description": "Phone number"
          },
          "statementNumber": {
            "type": "string",
            "description": "Statement number"
          },
          "currentPeriodUsage": {
            "type": "number",
            "description": "Current period usage"
          },
          "previousReading": {
            "type": "number",
            "description": "Previous period usage"
          },
          "presentReading": {
            "type": "number",
            "description": "Present period usage"
          },
          "supplier": {
            "type": "string",
            "description": "Supplier name"
          }
        }
      },
      "ArchiveEmploymentCertificateAnalysis": {
        "type": "object",
        "properties": {
          "employerName": {
            "type": "string",
            "description": "Name of the company or business employing the individual"
          },
          "fullName": {
            "type": "string",
            "description": "Name of the employee the CoE is for"
          },
          "firstName": {
            "type": "string",
            "description": "First name"
          },
          "middleName": {
            "type": "string",
            "description": "Middle name"
          },
          "lastName": {
            "type": "string",
            "description": "Last name"
          },
          "employeeIdNumber": {
            "type": "string",
            "description": "Any ID number of the employee found in the document (optional) - may be employee ID, may be any government ID"
          },
          "employeeIdType": {
            "type": "string",
            "description": "Type of ID if found; required if employeeIdNumber is found"
          },
          "position": {
            "type": "string",
            "description": "Position of the employee if found"
          },
          "department": {
            "type": "string",
            "description": "Department of the employee if found"
          },
          "employmentStatus": {
            "type": "string",
            "description": "Employment status of the employee if found"
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Start date of the employee's employment with the company, in YYYY-MM-DD format"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "description": "End date of the employee's employment with the company, if found, in YYYY-MM-DD format"
          },
          "salaryAmount": {
            "type": "number",
            "description": "Salary amount"
          },
          "salaryTerm": {
            "type": "string",
            "description": "Salary term"
          },
          "currency": {
            "$ref": "#/components/schemas/RefCurrency",
            "description": "ISO 4217 currency code"
          },
          "purpose": {
            "type": "string",
            "description": "Purpose of the certificate of employment"
          },
          "remarks": {
            "type": "string",
            "description": "Any additional remarks that may be provided"
          },
          "issueDate": {
            "type": "string",
            "format": "date",
            "description": "Date when the certificate of employment was issued, in YYYY-MM-DD format"
          },
          "signatoryName": {
            "type": "string",
            "description": "Full name of the signatory"
          },
          "signatoryPosition": {
            "type": "string",
            "description": "Position of the signatory"
          }
        }
      },
      "ArchiveAnalysis": {
        "deprecated": true,
        "allOf": [
          {
            "$ref": "#/components/schemas/ArchivePayslipAnalysis"
          },
          {
            "$ref": "#/components/schemas/ArchiveTaxDocumentAnalysis"
          },
          {
            "$ref": "#/components/schemas/ArchiveNbiClearanceDocumentAnalysis"
          },
          {
            "$ref": "#/components/schemas/ArchiveTelcoBillAnalysis"
          },
          {
            "$ref": "#/components/schemas/ArchiveElectricityBillAnalysis"
          },
          {
            "$ref": "#/components/schemas/ArchiveWaterBillAnalysis"
          },
          {
            "$ref": "#/components/schemas/ArchiveEmploymentCertificateAnalysis"
          }
        ]
      },
      "ArchivePayslipExtraction": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string"
          },
          "analysis": {
            "$ref": "#/components/schemas/ArchivePayslipAnalysis"
          }
        }
      },
      "ArchiveTaxDocumentExtraction": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string"
          },
          "analysis": {
            "$ref": "#/components/schemas/ArchiveTaxDocumentAnalysis"
          }
        }
      },
      "ArchiveNbiClearanceDocumentExtraction": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string"
          },
          "analysis": {
            "$ref": "#/components/schemas/ArchiveNbiClearanceDocumentAnalysis"
          }
        }
      },
      "ArchiveTelcoBillExtraction": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string"
          },
          "analysis": {
            "$ref": "#/components/schemas/ArchiveTelcoBillAnalysis"
          }
        }
      },
      "ArchiveElectricityBillExtraction": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string"
          },
          "analysis": {
            "$ref": "#/components/schemas/ArchiveElectricityBillAnalysis"
          }
        }
      },
      "ArchiveWaterBillExtraction": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string"
          },
          "analysis": {
            "$ref": "#/components/schemas/ArchiveWaterBillAnalysis"
          }
        }
      },
      "ArchiveEmploymentCertificateExtraction": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string"
          },
          "analysis": {
            "$ref": "#/components/schemas/ArchiveEmploymentCertificateAnalysis"
          }
        }
      },
      "ArchiveExtraction": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ArchivePayslipExtraction"
          },
          {
            "$ref": "#/components/schemas/ArchiveTaxDocumentExtraction"
          },
          {
            "$ref": "#/components/schemas/ArchiveNbiClearanceDocumentExtraction"
          },
          {
            "$ref": "#/components/schemas/ArchiveTelcoBillExtraction"
          },
          {
            "$ref": "#/components/schemas/ArchiveElectricityBillExtraction"
          },
          {
            "$ref": "#/components/schemas/ArchiveWaterBillExtraction"
          },
          {
            "$ref": "#/components/schemas/ArchiveEmploymentCertificateExtraction"
          }
        ],
        "discriminator": {
          "propertyName": "fileType",
          "mapping": {
            "PAYSLIP": "#/components/schemas/ArchivePayslipExtraction",
            "TAX_DOCUMENT": "#/components/schemas/ArchiveTaxDocumentExtraction",
            "CLEARANCE_NBI": "#/components/schemas/ArchiveNbiClearanceDocumentExtraction",
            "TELCO_BILL": "#/components/schemas/ArchiveTelcoBillExtraction",
            "ELECTRICITY_BILL": "#/components/schemas/ArchiveElectricityBillExtraction",
            "WATER_BILL": "#/components/schemas/ArchiveWaterBillExtraction",
            "EMPLOYMENT_CERTIFICATE": "#/components/schemas/ArchiveEmploymentCertificateExtraction"
          }
        }
      },
      "ArchiveValidationResult": {
        "type": "object",
        "required": [
          "resultCode"
        ],
        "properties": {
          "resultCode": {
            "type": "string",
            "enum": [
              "PASSED",
              "FAILED",
              "NO_DATA"
            ]
          },
          "score": {
            "type": "number",
            "description": "Validation score. 0-100."
          },
          "resultMessage": {
            "type": "string",
            "description": "Validation result message."
          }
        }
      },
      "ArchiveValidation": {
        "type": "object",
        "required": [
          "fileType"
        ],
        "properties": {
          "fileType": {
            "type": "string",
            "description": "Archive file type"
          },
          "metadata": {
            "$ref": "#/components/schemas/ArchiveValidationResult"
          },
          "computation": {
            "$ref": "#/components/schemas/ArchiveValidationResult"
          },
          "identity": {
            "$ref": "#/components/schemas/ArchiveValidationResult"
          },
          "location": {
            "$ref": "#/components/schemas/ArchiveValidationResult"
          }
        }
      },
      "Archive": {
        "title": "Archive",
        "type": "object",
        "description": "Collection of files.",
        "x-examples": {
          "Example": {
            "id": "u-17bbf36498de4d68a0d4f86c7b62f69f",
            "createdAt": "2021-04-14T09:30:24Z",
            "providerId": "user-provided",
            "userId": "tenant-5c1a2e8678e3494eba303ad1afa54ee8",
            "type": "PAYSLIP",
            "state": {
              "status": "STARTED",
              "errorCode": null,
              "errorMessage": null,
              "updatedAt": "2021-04-14T09:30:24Z"
            },
            "rawFiles": [
              {
                "id": "f-17bbf36498de4d68a0d4f86c7b62f69f",
                "createdAt": "2021-04-14T09:30:24Z",
                "name": "Screen Shot 2021-04-14 at 5.30.24 PM",
                "subType": "PERSONAL_INFORMATION",
                "size": 3048,
                "format": "PNG",
                "url": "https://file.smileapi.io/tenants/smileapi/users/smileapi-17bbf36498de4d68a0d4f86c7b62f69f/files/file-17bbf36498de4d68a0d4f86c7b62f69f.jpeg"
              }
            ],
            "classification": null,
            "analysis": null
          }
        },
        "x-tags": [
          "Archives"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/RefObjectID"
          },
          "createdAt": {
            "$ref": "#/components/schemas/RefDateTime"
          },
          "providerId": {
            "type": "string",
            "example": "user-provided",
            "description": "ID of the data provider, 'user-provided' if files are provided by the user, or 'tenant-provided' if files are provided via API"
          },
          "userId": {
            "type": "string",
            "description": "User ID associated with this archive",
            "example": "tenant-5c1a2e8678e3494eba303ad1afa54ee8"
          },
          "type": {
            "$ref": "#/components/schemas/FileTypeId"
          },
          "state": {
            "type": "object",
            "required": [
              "status",
              "updatedAt"
            ],
            "properties": {
              "status": {
                "type": "string",
                "example": "STARTED",
                "enum": [
                  "STARTED",
                  "ANALYZED",
                  "UNSUPPORTED",
                  "ERROR",
                  "REVOKED"
                ],
                "description": "Archive status"
              },
              "errorCode": {
                "type": "string",
                "description": "Error code",
                "enum": [
                  "MISSING_MANDATARY_FIELD",
                  "MISSING_MANDATORY_FIELD",
                  "INVALID_FIELD_FORMAT",
                  "SYSTEM_ERROR",
                  null
                ],
                "nullable": true
              },
              "errorMessage": {
                "type": "string",
                "description": "Error message",
                "nullable": true
              },
              "updatedAt": {
                "$ref": "#/components/schemas/RefDateTime"
              }
            }
          },
          "rawFiles": {
            "description": "Collection of files",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RawFile"
            }
          },
          "classification": {
            "$ref": "#/components/schemas/ArchiveClassification"
          },
          "analysis": {
            "$ref": "#/components/schemas/ArchiveAnalysis"
          },
          "extraction": {
            "$ref": "#/components/schemas/ArchiveExtraction"
          },
          "validation": {
            "$ref": "#/components/schemas/ArchiveValidation"
          }
        },
        "required": [
          "id",
          "createdAt",
          "providerId",
          "userId",
          "type",
          "state",
          "rawFiles"
        ]
      },
      "FileSubtype": {
        "type": "string",
        "enum": [
          "PAYSLIP",
          "PERSONAL_INFORMATION",
          "EMPLOYMENT_INFORMATION",
          "TAX_PAYMENT",
          "COMPANY_ID_FRONT",
          "COMPANY_ID_BACK",
          "CARD_FRONT",
          "CARD_BACK"
        ]
      },
      "FileObject": {
        "type": "object",
        "required": [
          "fileContent",
          "fileExtensionType"
        ],
        "properties": {
          "fileSubtype": {
            "$ref": "#/components/schemas/FileSubtype"
          },
          "fileName": {
            "type": "string",
            "description": "raw file name. If null, then Smile will use the file name from the fileType."
          },
          "fileExtensionType": {
            "type": "string",
            "description": "raw file type",
            "enum": [
              "PDF",
              "PNG",
              "JPG",
              "JPEG"
            ]
          },
          "fileContent": {
            "type": "string",
            "description": "Archive file content, use base64 of file byte data"
          }
        }
      },
      "ArchiveClassifyRequest": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "description": "User ID associated with this archive. If null, then Smile will create a new user associated with this archive"
          },
          "rawFiles": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/FileObject"
            }
          }
        }
      },
      "ArchiveClassifyResponse": {
        "type": "object",
        "title": "Archive Classify Response",
        "properties": {
          "code": {
            "$ref": "#/components/schemas/ObjectMetadataRefCode"
          },
          "message": {
            "$ref": "#/components/schemas/ObjectMetadataRefMessage"
          },
          "requestId": {
            "$ref": "#/components/schemas/ObjectMetadataRefRequestID"
          },
          "data": {
            "$ref": "#/components/schemas/Archive"
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}
```