Exporting the conversation record automatically and prechat form data

I am trying to export the conversation record automatically to a database for further actions. As the build-in export to CSV method for conversation history cannot batch export all conversation including those not assigned to the agents.
The first thing come up in my mind is to use the webhook subscripted to message create to export every message and get the text sent by users. However there are no suitable data to identify each data type from the user like the prechat form data. Here are one of the example:

  payload: {
    senderFullname: 'bot',
    type: 'text',
    channel_type: 'group',
    status: 0,
    _id: '638f003e254e9b0019f19bbf',
    sender: '63490e2642f3e6001add9eca',
    recipient: 'support-group-6348e24742f3e6001ada988d-3b96cbd8119a485cb324278ff85689f5',
    text: 'We are looking for an operator...\n' +
      '\n' +
      "If you don't want to wait online. Please kindly send your query to our email:",
    id_project: '6348e24742f3e6001ada988d',
    createdBy: '63490e2642f3e6001add9eca',
    attributes: {
      clienttimestamp: 1670316093866,
      _answerid: '63490e2642f3e6001add9ecf',
      intent_info: [Object],
      directives: true,
      splits: true,
      markbot: true,
      fillParams: true,
      webhook: false,
      updateUserEmail: 'user@email.com',
      updateUserFullname: 'name',
      commands: [Array]

The only property can identify it contain prechat form data will be the text property which may be changed in the CMS when the development of the bot and it is not a good practise. Is anyone have tried the same problem and have any suggestions.
Or is there simply a build-in method can batch export all the data in the history including the conversations solved by the bot for further analysis. like studying the users behavior.
Thanks a lot for everyone have any idea.