{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getsmileapi/json-schema/getsmileapi-insight-get-response-schema.json",
  "title": "Insight Get Response",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getsmileapi-insights-api-openapi.yml#/components/schemas/InsightGetResponse",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/CommonResponse"
    },
    {
      "properties": {
        "data": {
          "$ref": "#/$defs/Insight"
        }
      }
    }
  ],
  "$defs": {
    "CommonResponse": {
      "title": "CommonResponse",
      "type": "object",
      "required": [
        "code",
        "requestId"
      ],
      "properties": {
        "code": {
          "$ref": "#/$defs/ObjectMetadataRefCode"
        },
        "message": {
          "$ref": "#/$defs/ObjectMetadataRefMessage"
        },
        "requestId": {
          "$ref": "#/$defs/ObjectMetadataRefRequestID"
        }
      },
      "description": ""
    },
    "Insight": {
      "title": "Insight",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/InsightPayload"
        },
        {
          "properties": {
            "metadata": {
              "$ref": "#/$defs/ObjectReferenceMetadata"
            }
          }
        }
      ]
    },
    "InsightPayload": {
      "type": "object",
      "required": [
        "id",
        "cutoffTime",
        "features"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "cutoffTime": {
          "type": "string",
          "title": "Cutoff time for feature calculations.",
          "format": "date-time",
          "description": "Date and time"
        },
        "features": {
          "$ref": "#/$defs/ObjectFeature"
        }
      }
    },
    "ObjectFeature": {
      "type": "object",
      "properties": {
        "incomes_count": {
          "type": "integer",
          "description": "The quantity of the estimated incomes"
        },
        "incomes_first_income_month_range": {
          "type": "integer",
          "description": "Calculate the interval from the first income record time to the current time by month"
        },
        "incomes_missing_month_max": {
          "type": "integer",
          "description": "From all estimated incomes, calculate the number of months between the last payment month and the next payment month, and then take the maximum value"
        },
        "incomes_missing_month_count": {
          "type": "integer",
          "description": "From all estimated incomes, calculate the months diff between current income month and the before income month, and count if the diff > 1"
        },
        "incomes_amount_sum": {
          "type": "number",
          "description": "From all estimated incomes, calculate the total of the amount"
        },
        "incomes_amount_average": {
          "type": "number",
          "description": "From all estimated incomes, calculate the average amount of the total amount"
        },
        "incomes_amount_min": {
          "type": "number",
          "description": "From all estimated incomes, get the minimum amount"
        },
        "incomes_amount_max": {
          "type": "number",
          "description": "From all estimated incomes, get the maximum amount"
        },
        "incomes_amount_median": {
          "type": "number",
          "description": "From all estimated incomes, get the median amount"
        },
        "incomes_amount_std": {
          "type": "number",
          "description": "From all estimated incomes, get the median amount"
        },
        "incomes_last3_months_amount_sum": {
          "type": "number",
          "description": "From all estimated incomes in last 3 months, calculate the total of the amount"
        },
        "incomes_last3_months_amount_average": {
          "type": "number",
          "description": "From all estimated incomes in last 3 months, calculate the average amount of the total amount"
        },
        "incomes_last3_months_amount_min": {
          "type": "number",
          "description": "From all estimated incomes in last 3 months, get the minimum amount"
        },
        "incomes_last3_months_amount_max": {
          "type": "number",
          "description": "From all estimated incomes in last 3 months, get the maximum amount"
        },
        "incomes_last3_months_amount_median": {
          "type": "number",
          "description": "From all estimated incomes in last 3 months, get the median amount"
        },
        "incomes_last3_months_amount_std": {
          "type": "number",
          "description": "From all estimated incomes in last 3 months, get the standard deviation of the amount"
        },
        "incomes_last6_months_amount_sum": {
          "type": "number",
          "description": "From all estimated incomes in last 6 months, calculate the total of the amount"
        },
        "incomes_last6_months_amount_average": {
          "type": "number",
          "description": "From all estimated incomes in last 6 months, calculate the average amount of the total amount"
        },
        "incomes_last6_months_amount_min": {
          "type": "number",
          "description": "From all estimated incomes in last 6 months, get the minimum amount"
        },
        "incomes_last6_months_amount_max": {
          "type": "number",
          "description": "From all estimated incomes in last 6 months, get the maximum amount"
        },
        "incomes_last6_months_amount_median": {
          "type": "number",
          "description": "From all estimated incomes in last 6 months, get the median amount"
        },
        "incomes_last6_months_amount_std": {
          "type": "number",
          "description": "From all estimated incomes in last 6 months, get the standard deviation of the amount"
        },
        "incomes_last9_months_amount_sum": {
          "type": "number",
          "description": "From all estimated incomes in last 9 months, calculate the total of the amount"
        },
        "incomes_last9_months_amount_average": {
          "type": "number",
          "description": "From all estimated incomes in last 9 months, calculate the average amount of the total amount"
        },
        "incomes_last9_months_amount_min": {
          "type": "number",
          "description": "From all estimated incomes in last 9 months, get the minimum amount"
        },
        "incomes_last9_months_amount_max": {
          "type": "number",
          "description": "From all estimated incomes in last 9 months, get the maximum amount"
        },
        "incomes_last9_months_amount_median": {
          "type": "number",
          "description": "From all estimated incomes in last 9 months, get the median amount"
        },
        "incomes_last9_months_amount_std": {
          "type": "number",
          "description": "From all estimated incomes in last 9 months, get the standard deviation of the amount"
        },
        "incomes_last12_months_amount_sum": {
          "type": "number",
          "description": "From all estimated incomes in last 12 months, calculate the total of the amount"
        },
        "incomes_last12_months_amount_average": {
          "type": "number",
          "description": "From all estimated incomes in last 12 months, calculate the average amount of the total amount"
        },
        "incomes_last12_months_amount_min": {
          "type": "number",
          "description": "From all estimated incomes in last 12 months, get the minimum amount"
        },
        "incomes_last12_months_amount_max": {
          "type": "number",
          "description": "From all estimated incomes in last 12 months, get the maximum amount"
        },
        "incomes_last12_months_amount_median": {
          "type": "number",
          "description": "From all estimated incomes in last 12 months, get the median amount"
        },
        "incomes_last12_months_amount_std": {
          "type": "number",
          "description": "From all estimated incomes in last 12 months, get the standard deviation of the amount"
        },
        "incomes_last18_months_amount_sum": {
          "type": "number",
          "description": "From all estimated incomes in last 18 months, calculate the total of the amount"
        },
        "incomes_last18_months_amount_average": {
          "type": "number",
          "description": "From all estimated incomes in last 18 months, calculate the average amount of the total amount"
        },
        "incomes_last18_months_amount_min": {
          "type": "number",
          "description": "From all estimated incomes in last 18 months, get the minimum amount"
        },
        "incomes_last18_months_amount_max": {
          "type": "number",
          "description": "From all estimated incomes in last 18 months, get the maximum amount"
        },
        "incomes_last18_months_amount_median": {
          "type": "number",
          "description": "From all estimated incomes in last 18 months, get the median amount"
        },
        "incomes_last18_months_amount_std": {
          "type": "number",
          "description": "From all estimated incomes in last 18 months, get the standard deviation of the amount"
        },
        "incomes_last18_months_max_amount_count": {
          "type": "number",
          "description": "From all estimated incomes in last 18 months, find the maximum amount, and count the number of monthly income equal to the maximum amount"
        },
        "incomes_starting_amount": {
          "type": "number",
          "description": "the estimated income from when the user has started earning income"
        },
        "incomes_current_amount": {
          "type": "number",
          "description": "the amount from the latetest one record"
        },
        "incomes_latest_growth": {
          "type": "number",
          "description": "For the latetest one record, calculate the growth of income from the same month last year"
        },
        "liabilities_loan_count": {
          "type": "integer",
          "description": "For the latetest one record, calculate the count of records"
        },
        "liabilities_loan_amount_min": {
          "type": "number",
          "description": "From all liabilities, calculate the minimum of the amount"
        },
        "liabilities_loan_amount_max": {
          "type": "number",
          "description": "From all liabilities, calculate the maximum of the amount"
        },
        "liabilities_loan_amount_total": {
          "type": "number",
          "description": "From all liabilities, calculate the total of the amount"
        },
        "liabilities_loan_amount_average": {
          "type": "number",
          "description": "From all liabilities, calculate the average of the amount"
        },
        "liabilities_loan_amount_std": {
          "type": "number",
          "description": "From all liabilities, calculate the standard deviation of the amount"
        },
        "liabilities_finished_loan_count": {
          "type": "number",
          "description": "From all liabilities that outstandingBalance <= 0, calculate the count of the records"
        },
        "liabilities_outstanding_loan_count": {
          "type": "integer",
          "description": "From all liabilities that outstandingBalance > 0, calculate the count of the records"
        },
        "liabilities_outstanding_amount_max": {
          "type": "number",
          "description": "From all liabilities that outstandingBalance > 0, calculate the count of the records"
        },
        "liabilities_outstanding_amount_total": {
          "type": "number",
          "description": "From all liabilities that outstandingBalance > 0, calculate the total of the amount"
        },
        "liabilities_outstanding_amount_average": {
          "type": "number",
          "description": "From all liabilities that outstandingBalance > 0, calculate the average of the amount"
        },
        "liabilities_overdue_loan_count": {
          "type": "integer",
          "description": "From all liabilities that overduePaymentAmount > 0, calculate the count of the records"
        },
        "liabilities_overdue_amount_total": {
          "type": "number",
          "description": "From all liabilities that overduePaymentAmount > 0, calculate the total of the amount"
        },
        "liabilities_overdue_amount_average": {
          "type": "number",
          "description": "From all liabilities that overduePaymentAmount > 0, calculate the average of the amount"
        },
        "liabilities_ongoing_amortization_amount_sum": {
          "type": "number",
          "description": "Sum of all amortization amounts for ongoing/current liabilities (not yet fully paid off)"
        },
        "liabilities_ongoing_amortization_amount_min": {
          "type": "number",
          "description": "Smallest of all amortization amounts for ongoing/current liabilities (not yet fully paid off)"
        },
        "liabilities_ongoing_amortization_amount_max": {
          "type": "number",
          "description": "Largest of all amortization amounts for ongoing/current liabilities (not yet fully paid off)"
        },
        "liabilities_ongoing_amortization_amount_average": {
          "type": "number",
          "description": "Average of all amortization amounts for ongoing/current liabilities (not yet fully paid off)"
        },
        "liabilities_ongoing_amortization_amount_median": {
          "type": "number",
          "description": "Median of all amortization amounts for ongoing/current liabilities (not yet fully paid off)"
        },
        "liabilities_ongoing_amortization_amount_std": {
          "type": "number",
          "description": "Standard deviation of all amortization amounts for ongoing/current liabilities (not yet fully paid off)"
        },
        "liabilities_payment_count": {
          "type": "number",
          "description": "Quantity of liability payments made (across all liability records)"
        },
        "liabilities_payment_amount_max": {
          "type": "number",
          "description": "Largest amount of payments made for liabilities (across all liability records)."
        },
        "liabilities_payment_amount_min": {
          "type": "number",
          "description": "Smallest amount of payments made for liabilities (across all liability records)."
        },
        "liabilities_payment_amount_median": {
          "type": "number",
          "description": "Median amount of payments made for liabilities (across all liability records)."
        },
        "liabilities_payment_amount_average": {
          "type": "number",
          "description": "Average amount of payments made for liabilities (across all liability records)."
        },
        "liabilities_payment_amount_sum": {
          "type": "number",
          "description": "Total amount of payments made for liabilities (across all liability records)."
        },
        "liabilities_payment_amount_std": {
          "type": "number",
          "description": "Standard deviation of payments made for liabilities (across all liability records)."
        },
        "employments_current_status": {
          "type": "string",
          "description": "The user's current employment status, may be one of: EMPLOYED, GIG (for gig economy workers), or UNEMPLOYED"
        },
        "employments_employer_count": {
          "type": "integer",
          "description": "Quantity of unique employers"
        },
        "employments_current_tenure": {
          "type": "integer",
          "description": "Quantity of months at current employer"
        },
        "identity_age": {
          "type": "integer",
          "description": "Age of the user based on date of birth"
        },
        "link_days_since_first": {
          "type": "integer",
          "description": "Number of days since the first account connection, if MAW is enabled."
        },
        "link_days_since_last": {
          "type": "integer",
          "description": "Number of days since the last account connection, if MAW is enabled."
        },
        "link_day3_count": {
          "type": "integer",
          "description": "Number of tenants this account has connected to in the last 3 days, if MAW is enabled."
        },
        "link_day7_count": {
          "type": "integer",
          "description": "Number of tenants this account has connected to in the last 7 days, if MAW is enabled."
        },
        "link_day30_count": {
          "type": "integer",
          "description": "Number of tenants this account has connected to in the last 30 days, if MAW is enabled."
        },
        "link_day90_count": {
          "type": "integer",
          "description": "Number of tenants this account has connected to in the last 90 days, if MAW is enabled."
        },
        "link_day180_count": {
          "type": "integer",
          "description": "Number of tenants this account has connected to in the last 180 days, if MAW is enabled."
        },
        "link_day365_count": {
          "type": "integer",
          "description": "Number of tenants this account has connected to in the last 365 days, if MAW is enabled."
        },
        "link_day730_count": {
          "type": "integer",
          "description": "Number of tenants this account has connected to in the last 730 days, if MAW is enabled."
        }
      }
    },
    "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"
      ],
      "x-internal": false
    },
    "ObjectMetadataRefMessage": {
      "type": "string",
      "title": "ObjectMetadataRefMessage",
      "description": "Message response to the request",
      "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
    },
    "ObjectReferenceMetadata": {
      "title": "Reference Metadata",
      "type": "object",
      "description": "Metadata related to account-specific data",
      "properties": {
        "itemCreatedAt": {
          "$ref": "#/$defs/RefDateTime"
        },
        "createdAt": {
          "$ref": "#/$defs/RefDateTime"
        },
        "accountId": {
          "type": "string",
          "deprecated": true,
          "description": "The accountId of this object"
        },
        "sourceId": {
          "type": "string",
          "description": "The ACCOUNT or ARCHIVE ID associated with this object"
        },
        "sourceType": {
          "$ref": "#/$defs/RefSourceType"
        },
        "userId": {
          "type": "string",
          "description": "The user ID associated with this object"
        },
        "providerId": {
          "type": "string",
          "description": "The provider ID associated with this object"
        }
      },
      "required": [
        "createdAt",
        "itemCreatedAt",
        "sourceId",
        "sourceType",
        "userId",
        "providerId"
      ]
    },
    "RefDateTime": {
      "type": "string",
      "title": "Date and Time string",
      "format": "date-time",
      "description": "Date and time"
    },
    "RefSourceType": {
      "type": [
        "string",
        "null"
      ],
      "title": "Ref-Source-Type",
      "enum": [
        "ACCOUNT",
        "UPLOAD",
        "ARCHIVE",
        "SOCIAL_SECURITY"
      ],
      "description": "Source Type"
    }
  }
}