diff --git a/server/endpoints/api/system/index.js b/server/endpoints/api/system/index.js
index fa1237135eadda52bb376a05a90d59986c4b5a9c..c8e5e06cc76f3a9543ca0a55776e6d58eb5fc0e7 100644
--- a/server/endpoints/api/system/index.js
+++ b/server/endpoints/api/system/index.js
@@ -1,5 +1,10 @@
+const { EventLogs } = require("../../../models/eventLogs");
 const { SystemSettings } = require("../../../models/systemSettings");
 const { getVectorDbClass } = require("../../../utils/helpers");
+const {
+  prepareWorkspaceChatsForExport,
+  exportChatsAsType,
+} = require("../../../utils/helpers/chat/convertTo");
 const { dumpENV, updateENV } = require("../../../utils/helpers/updateENV");
 const { reqBody } = require("../../../utils/http");
 const { validApiKey } = require("../../../utils/middleware/validApiKey");
@@ -147,6 +152,60 @@ function apiSystemEndpoints(app) {
       }
     }
   );
+
+  app.get(
+    "/v1/system/export-chats",
+    [validApiKey],
+    async (request, response) => {
+      /*
+    #swagger.tags = ['System Settings']
+    #swagger.description = 'Export all of the chats from the system in a known format. Output depends on the type sent. Will be send with the correct header for the output.'
+   #swagger.parameters['type'] = {
+      in: 'query',
+      description: "Export format jsonl, json, csv, jsonAlpaca",
+      required: false,
+      type: 'string'
+    }
+    #swagger.responses[200] = {
+      content: {
+        "application/json": {
+          schema: {
+            type: 'object',
+            example: [
+              {
+                "role": "user",
+                "content": "What is AnythinglLM?"
+              },
+              {
+                "role": "assistant",
+                "content": "AnythingLLM is a knowledge graph and vector database management system built using NodeJS express server. It provides an interface for handling all interactions, including vectorDB management and LLM (Language Model) interactions."
+              },
+            ]
+          }
+        }
+      }
+    }
+    #swagger.responses[403] = {
+      schema: {
+        "$ref": "#/definitions/InvalidAPIKey"
+      }
+    }
+    */
+      try {
+        const { type = "jsonl" } = request.query;
+        const chats = await prepareWorkspaceChatsForExport(type);
+        const { contentType, data } = await exportChatsAsType(chats, type);
+        await EventLogs.logEvent("exported_chats", {
+          type,
+        });
+        response.setHeader("Content-Type", contentType);
+        response.status(200).send(data);
+      } catch (e) {
+        console.log(e.message, e);
+        response.sendStatus(500).end();
+      }
+    }
+  );
 }
 
 module.exports = { apiSystemEndpoints };
diff --git a/server/swagger/openapi.json b/server/swagger/openapi.json
index b300e3fa75f272297600664fbe92a0c403644eb2..3fe5a2a4d146a357293b8bc6f4cbdf62a6a519f7 100644
--- a/server/swagger/openapi.json
+++ b/server/swagger/openapi.json
@@ -2232,6 +2232,72 @@
           }
         }
       }
+    },
+    "/v1/system/export-chats": {
+      "get": {
+        "tags": [
+          "System Settings"
+        ],
+        "description": "Export all of the chats from the system in a known format. Output depends on the type sent. Will be send with the correct header for the output.",
+        "parameters": [
+          {
+            "name": "Authorization",
+            "in": "header",
+            "schema": {
+              "type": "string"
+            }
+          },
+          {
+            "name": "type",
+            "in": "query",
+            "description": "Export format jsonl, json, csv, jsonAlpaca",
+            "required": false,
+            "schema": {
+              "type": "string"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "OK",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "type": "object",
+                  "example": [
+                    {
+                      "role": "user",
+                      "content": "What is AnythinglLM?"
+                    },
+                    {
+                      "role": "assistant",
+                      "content": "AnythingLLM is a knowledge graph and vector database management system built using NodeJS express server. It provides an interface for handling all interactions, including vectorDB management and LLM (Language Model) interactions."
+                    }
+                  ]
+                }
+              }
+            }
+          },
+          "403": {
+            "description": "Forbidden",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/InvalidAPIKey"
+                }
+              },
+              "application/xml": {
+                "schema": {
+                  "$ref": "#/components/schemas/InvalidAPIKey"
+                }
+              }
+            }
+          },
+          "500": {
+            "description": "Internal Server Error"
+          }
+        }
+      }
     }
   },
   "components": {