{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/chatinbox-net/json-schema/chatinbox-net-chat-vm-schema.json",
  "title": "ChatVM",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/chatinbox-net-openapi.yml#/components/schemas/ChatVM",
  "type": "object",
  "properties": {
    "companyCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "type": "integer",
      "format": "int32"
    },
    "instanceID": {
      "type": "integer",
      "format": "int32"
    },
    "instancePhoneNumber": {
      "type": [
        "string",
        "null"
      ]
    },
    "instanceChatID": {
      "type": [
        "string",
        "null"
      ]
    },
    "customerID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "customerPhoneNumber": {
      "type": [
        "string",
        "null"
      ]
    },
    "ownerUserID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "lastMessageTime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "lastMessageID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "lastMessageText": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastMessageType": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "lastMessageStatus": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "lastMessageSystemMessageType": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "lastMessageSystemNotificationType": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "lastMessageFromMe": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "hasOfflineMessage": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "transferred": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "startedByCustomer": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "customerFullName": {
      "type": [
        "string",
        "null"
      ]
    },
    "customerName": {
      "type": [
        "string",
        "null"
      ]
    },
    "customerSurname": {
      "type": [
        "string",
        "null"
      ]
    },
    "customerNote": {
      "type": [
        "string",
        "null"
      ]
    },
    "customerEmail": {
      "type": [
        "string",
        "null"
      ]
    },
    "customerPushName": {
      "type": [
        "string",
        "null"
      ]
    },
    "unViewedCount": {
      "type": "integer",
      "format": "int32"
    },
    "image": {
      "type": [
        "string",
        "null"
      ]
    },
    "waitCallMeLater": {
      "type": "boolean"
    },
    "ownerUserName": {
      "type": [
        "string",
        "null"
      ]
    },
    "ownerUserFullName": {
      "type": [
        "string",
        "null"
      ]
    },
    "ownerUserIconText": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastSendUserName": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastSendUserFullName": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastSendUserIconText": {
      "type": [
        "string",
        "null"
      ]
    },
    "customer": {
      "$ref": "#/$defs/CustomerVM"
    },
    "chatMessages": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ChatMessageVM"
      }
    },
    "chatDynamicMessages": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false
    },
    "allCustomerFeatures": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/FeatureVM"
      }
    },
    "featuresString": {
      "type": [
        "string",
        "null"
      ]
    },
    "customerFeatures": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/FeatureVM"
      }
    },
    "servingUserID": {
      "type": "integer",
      "format": "int32"
    },
    "operationStatus": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "CallMeLaterVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "customerID": {
          "type": "integer",
          "format": "int32"
        },
        "chatID": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "callReasonID": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "callReasonName": {
          "type": [
            "string",
            "null"
          ]
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "relatedUserID": {
          "type": "integer",
          "format": "int32"
        },
        "relatedUserName": {
          "type": [
            "string",
            "null"
          ]
        },
        "relatedUserFullName": {
          "type": [
            "string",
            "null"
          ]
        },
        "relatedTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "workGroupID": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "isCompleted": {
          "type": "boolean"
        },
        "completedUserID": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "completedUserName": {
          "type": [
            "string",
            "null"
          ]
        },
        "completedUserFullName": {
          "type": [
            "string",
            "null"
          ]
        },
        "completedTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "customerFullName": {
          "type": [
            "string",
            "null"
          ]
        },
        "callReason": {
          "$ref": "#/$defs/CallReasonVM"
        },
        "allCallReasons": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/CallReasonVM"
          }
        }
      },
      "additionalProperties": false
    },
    "CallReasonVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "ChatMessageAttachmentVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "messageID": {
          "type": "integer",
          "format": "int32"
        },
        "fileGuid": {
          "type": "string",
          "format": "uuid"
        },
        "fileName": {
          "type": [
            "string",
            "null"
          ]
        },
        "fileExtension": {
          "type": [
            "string",
            "null"
          ]
        },
        "fileBinary": {
          "type": [
            "string",
            "null"
          ],
          "format": "byte"
        },
        "fileVirtualPath": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "ChatMessageVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "chatID": {
          "type": "integer",
          "format": "int32"
        },
        "customerID": {
          "type": "integer",
          "format": "int32"
        },
        "userID": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "fromMe": {
          "type": "boolean"
        },
        "instanceMessageID": {
          "type": [
            "string",
            "null"
          ]
        },
        "systemMessageID": {
          "type": [
            "string",
            "null"
          ]
        },
        "messageType": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "body": {
          "type": [
            "string",
            "null"
          ]
        },
        "messageStatus": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "sentTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "deliveredTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "viewedTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "preview": {
          "type": [
            "string",
            "null"
          ]
        },
        "sendUserName": {
          "type": [
            "string",
            "null"
          ]
        },
        "sendUserFullName": {
          "type": [
            "string",
            "null"
          ]
        },
        "targetUserName": {
          "type": [
            "string",
            "null"
          ]
        },
        "targetUserFullName": {
          "type": [
            "string",
            "null"
          ]
        },
        "sendUserIconText": {
          "type": [
            "string",
            "null"
          ]
        },
        "matchingMessageRow": {
          "type": "boolean"
        },
        "locationLat": {
          "type": [
            "string",
            "null"
          ]
        },
        "locationLng": {
          "type": [
            "string",
            "null"
          ]
        },
        "caption": {
          "type": [
            "string",
            "null"
          ]
        },
        "systemMessageType": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "systemNotificationType": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "isForwarded": {
          "type": "boolean"
        },
        "hasQuotedMessage": {
          "type": "boolean"
        },
        "quotedMessageID": {
          "type": [
            "string",
            "null"
          ]
        },
        "chatMessageAttachments": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/ChatMessageAttachmentVM"
          }
        }
      },
      "additionalProperties": false
    },
    "CustomerPhoneVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "customerID": {
          "type": "integer",
          "format": "int32"
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "CustomerVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "surName": {
          "type": [
            "string",
            "null"
          ]
        },
        "pushName": {
          "type": [
            "string",
            "null"
          ]
        },
        "fullName": {
          "type": [
            "string",
            "null"
          ]
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "lastMessageID": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "chatId": {
          "type": "integer",
          "format": "int32"
        },
        "customerPhones": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/CustomerPhoneVM"
          }
        },
        "customerFeatures": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/FeatureVM"
          }
        },
        "callMeLaters": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/CallMeLaterVM"
          }
        },
        "cf1": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf2": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf3": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf4": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf5": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf6": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf7": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf8": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf9": {
          "type": [
            "string",
            "null"
          ]
        },
        "cf10": {
          "type": [
            "string",
            "null"
          ]
        },
        "dataListID": {
          "type": "integer",
          "format": "int32"
        }
      },
      "additionalProperties": false
    },
    "FeatureVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "featureType": {
          "type": "integer",
          "format": "int32"
        },
        "rgbCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "featureGroupID": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "dataStatus": {
          "type": "integer",
          "format": "int32"
        },
        "activeSelectionCount": {
          "type": "integer",
          "format": "int32"
        },
        "flagMinutes": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "sortOrder": {
          "type": "integer",
          "format": "int32"
        }
      },
      "additionalProperties": false
    }
  }
}