{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getsmileapi/json-schema/getsmileapi-account-get-response-schema.json",
  "title": "Account Get Response",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getsmileapi-accounts-api-openapi.yml#/components/schemas/AccountGetResponse",
  "properties": {
    "code": {
      "$ref": "#/$defs/ObjectMetadataRefCode"
    },
    "message": {
      "$ref": "#/$defs/ObjectMetadataRefMessage"
    },
    "requestId": {
      "$ref": "#/$defs/ObjectMetadataRefRequestID"
    },
    "data": {
      "$ref": "#/$defs/Account"
    }
  },
  "$defs": {
    "Account": {
      "title": "Account",
      "type": "object",
      "description": "Account of end-user from a particular employment data provider.",
      "x-tags": [
        "Accounts"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/RefObjectID"
        },
        "createdAt": {
          "$ref": "#/$defs/RefDateTime"
        },
        "providerId": {
          "type": "string",
          "description": "ID of the data provider"
        },
        "userId": {
          "type": "string",
          "description": "User ID associated with this account"
        },
        "connectionStatus": {
          "$ref": "#/$defs/AccountConnectionStatus"
        },
        "monitorStatus": {
          "$ref": "#/$defs/AccountMonitorStatus"
        },
        "monitor": {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "$ref": "#/$defs/AccountMonitorStatus"
            },
            "updatedAt": {
              "$ref": "#/$defs/RefDateTime"
            }
          }
        },
        "connection": {
          "type": "object",
          "required": [
            "status",
            "updatedAt"
          ],
          "properties": {
            "status": {
              "$ref": "#/$defs/AccountConnectionStatus"
            },
            "errorCode": {
              "$ref": "#/$defs/AccountErrorCode"
            },
            "errorMessage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Error message"
            },
            "updatedAt": {
              "$ref": "#/$defs/RefDateTime"
            }
          }
        }
      },
      "required": [
        "id",
        "createdAt",
        "providerId",
        "userId",
        "connectionStatus",
        "connection",
        "monitorStatus",
        "monitor"
      ]
    },
    "AccountConnectionStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "AWAITING_MFA",
        "ERROR",
        "CONNECTED",
        "DISCONNECTED"
      ],
      "description": "Account connection status"
    },
    "AccountErrorCode": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "ACCOUNT_DISABLED",
        "ACCOUNT_INACCESSIBLE",
        "ACCOUNT_INCOMPLETE",
        "ACCOUNT_LOCKED",
        "AUTH_REQUIRED",
        "EXPIRED_CREDENTIALS",
        "INVALID_ACCOUNT_TYPE",
        "INVALID_AUTH",
        "INVALID_CREDENTIALS",
        "INVALID_MFA",
        "MFA_TIMEOUT",
        "SERVICE_UNAVAILABLE",
        "SYSTEM_ERROR",
        "TOS_REQUIRED",
        "UNSUPPORTED_AUTH_TYPE",
        "UNSUPPORTED_MFA_METHOD",
        null
      ],
      "description": "Error code"
    },
    "AccountMonitorStatus": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "USER_ACTION_REQUIRED",
        "UNSUPPORTED",
        "CUSTOMER_DISABLED"
      ],
      "description": "Account CDS status"
    },
    "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
    },
    "RefDateTime": {
      "type": "string",
      "title": "Date and Time string",
      "format": "date-time",
      "description": "Date and time"
    },
    "RefObjectID": {
      "type": "string",
      "title": "Object ID",
      "description": "Unique ID of this object"
    }
  }
}