DocuChat Logo
Api

Endpoints

Learn what endpoints are available in the DocuChat API.

This page contains the API reference for the DocuChat API.

Get Chatbot by Session ID

Based on sessionId, returns the chatbot, session info and the messages in the session.

GET /session/getChatbotAndSession
const sessionId = "1234567890";
const response = await fetch(`https://api.docuchat.io/session/getChatbotAndSession?sessionId=${sessionId}`, {
  method: "GET",
  headers: {
    "x-api-key": "your-api-key",
  },
});
{
  "success": true,
  "message": "",
  "content": {
    "chatbot": {
      "id": "18aeff4a-6b6a-4c7b-819d-45f9293c6d1c",
      "status": "Ready",
      "name": "DocuChat HelpBot",
      "adminNotes": "",
      "description": "DocuChat's own chatbot trained on its website and documentation.",
      "avatarUrl": "https://s3.eu-central-1.amazonaws.com/docuchatv2/18aeff4a-6b6a-4c7b-819d-45f9293c6d1c/avatar.png?v=5614f929-dae4-4de7-9dd0-d3c5cc92d0ea",
      "temperature": 0.1,
      "organizationCustomCss": "",
      "gtmCode": "",
      "documentGroups": [
        {
          "documents": [
            {
              "id": "d6f3b528-0994-485e-b9cf-698da8d7eedf",
              "name": "Docuchat.io",
              "contentType": "Webpage",
              "content": {
                "fileExtension": "",
                "url": "https://www.docuchat.io"
              },
              "status": "Ready"
            }
          ],
          "id": "fb473420-d54c-4a85-8482-9a57eff79563",
          "name": "default"
        }
      ],
      "answers": {
        "answerLength": "Long",
        "citeSources": true,
        "firstMessage": "I am a chatbot trained on DocuChat's website and documentation. Ask me anything about DocuChat.",
        "enableAccessToSources": true,
        "model": "Gpt4oMini",
        "customModelInstructions": "- Only answer questions about DocuChat.\n- If you don't know the answer, reply saying the user can ask his question to the developers at hi@docuchat.io or can sign up and then use the human chat support inside the application.",
        "questionPlaceHolder": "What can I help you with?",
        "questionSuggestionMethod": "Custom",
        "suggestedQuestions": [
          "Why should I choose DocuChat over other chatbot builders?",
          "What type of documents can I use to train my chatbot?",
          "How long does it take to train a chatbot?",
          "What languages does DocuChat support?"
        ],
        "semanticRate": 0.7,
        "rerankingEnabled": true,
        "replaceSystemPrompt": false,
        "autoAddContext": false
      },
      "whiteLabel": {
        "enabled": true,
        "logoUrl": "",
        "color": "",
        "pageTitle": "DocuChat HelpBot",
        "ctaDescriptionText": "",
        "ctaUrlText": "Website",
        "ctaUrl": "http://www.docuchat.io",
        "disclaimer": "Feel free to contact us at hi@docuchat.io.",
        "darkModeColor": ""
      },
      "sharing": {
        "team": {
          "enabled": false
        },
        "link": {
          "enabled": true,
          "publicListingCategory": [],
          "publicListingCreatedBy": "",
          "publicListingEnabled": false
        },
        "embed": {
          "enabled": true,
          "domains": []
        }
      },
      "limits": {
        "enabled": false,
        "monthlyMaxQuestions": 0
      }
    },
    "session": {
      "sessionId": "8622fb09-cc09-40f2-8365-4bc49828d3cc",
      "messages": [
        {
          "answer": "DocuChat is a powerful AI chatbot platform that enables businesses to create intelligent, context-aware chatbots trained on their own content. It aims to reduce support costs, enhance customer satisfaction, and improve employee productivity. As an EU-based solution, DocuChat ensures data privacy and GDPR compliance while allowing the creation of chatbots from various content sources.\n\nThe platform offers several applications, including:\n\n- **Customer Support**: Automating responses to common inquiries, potentially reducing support costs by up to 70%.\n- **Employee Assistance**: Creating internal knowledge bases for departments like HR and IT.\n- **Documentation Bots**: Making product documentation interactive and easily accessible.\n- **Sales and Marketing**: Providing instant information to potential customers to boost conversion rates.\n- **Education**: Developing interactive learning bots for educational institutions.\n- **Research**: Building bots to answer questions from research papers.\n\nDocuChat utilizes advanced Retrieval Augmented Generation (RAG) techniques to deliver accurate and context-aware responses.",
          "indices": [
            {
              "documentId": "950b6433-21a0-4a9e-a0b8-0a94dbf846e3",
              "documentName": "Docs.docuchat.io | Getting started",
              "content": "DocuChat is a powerful AI chatbot platform that empowers businesses to create intelligent, context-aware chatbots trained on their own content. With DocuChat, you can reduce support costs, enhance customer satisfaction, and improve employee productivity in just minutes.\n\nAs an EU-based solution, DocuChat ensures data privacy and GDPR compliance while enabling you to create chatbots from various content sources. These AI-powered assistants excel at understanding context and delivering precise information, streamlining support and knowledge management processes.\n\n* **Customer Support**: Automate responses to common inquiries, reducing support costs by up to 70%.\n* **Employee Assistance**: Create internal knowledge bases for HR, IT, and other departments.\n* **Documentation Bots**: Make your product documentation interactive and easily accessible.\n* **Sales and Marketing**: Provide instant information to potential customers, boosting conversion rates.\n* **Education**: Create interactive learning bots for educational institutions.\n* **Research**: Build bots to answer questions from your research papers.\n* **And more!**\n\nDocuChat leverages advanced Retrieval Augmented Generation (RAG) techniques, along with proprietary and open-source enhancements, to deliver highly accurate and context-aware responses.\n\n### [Retrieval Augmented Generation (RAG)](https://docs.docuchat.io/getting-started#retrieval-augmented-generation-rag)\n\nRAG is an AI framework that grounds language models in external knowledge sources, similar to an open-book exam. This approach offers several benefits:\n\n* Ensures access to current and reliable information\n* Provides transparency by allowing users to verify sources\n* Eliminates the need for frequent model retraining\n* Reduces the risk of data leakage and hallucinations\n\n### [DocuChat's Enhanced RAG Process](https://docs.docuchat.io/getting-started#docuchats-enhanced-rag-process)\n\n1. **Document Processing**: Uploaded documents are divided into manageable chunks",
              "url": "https://docs.docuchat.io/getting-started"
            },
            {
              "documentId": "702988c7-60bc-4fa8-9f7b-505dd42e2525",
              "documentName": "Docs.docuchat.io | Chatbot",
              "content": "Chatbots\n\nA chatbot is an AI-powered tool designed to simulate conversation with human users. DocuChat enables you to create chatbots that are trained on your content, providing accurate and context-aware responses.\n\nDocuChat's core concept revolves around chatbots. It enables you to create intelligent chatbots that understand and leverage the context from your uploaded documents.\n\nHere's what you can expect from your chatbots:\n\n* **Accurate and Context-Aware Responses**: Our chatbots are trained on your content, ensuring they provide accurate and context-aware responses.\n* **High-Quality Interactions**: Utilize state-of-the-art AI models to deliver high-quality interactions.\n* **Customizable**: Adjust the AI settings to customize the chatbot's behavior and appearance to fit your theme.\n* **Embeddable**: Easily integrate your chatbot into your website with our embeddable widgets.\n* **Analytics**: Track and analyze your chatbot's performance, user interactions, and engagement metrics.\n\n---",
              "url": "https://docs.docuchat.io/chatbots/chatbot"
            },
            {
              "documentId": "40fd91d9-c177-4f9e-a4fe-1c6f3305a6f6",
              "documentName": "Docs.docuchat.io | Types",
              "content": "In the context of DocuChat, a `document` is any source of information that can be used by your AI chatbots to answer questions. Documents come in various types, including:\n\n* **Text Files**: PDF, Word documents (DOCX), Excel spreadsheets (XLSX), PowerPoint presentations (PPTX), CSV files, E-books (EPUB), plain text (TXT), Markdown files (MD)\n* **Audio Files**: MP3, WAV, M4A, MPGA\n* **Video Files**: MP4, MPEG, WEBM\n\nAudio and video files must be under 25MB each. For longer videos, we recommend converting them to audio format first to stay within the size limit while maintaining content quality.\n\nDocuChat can extract content from websites by adding web page URLs. Simply paste URLs (one per line) and DocuChat will automatically extract the relevant content from those pages to train your chatbot. This works for most modern websites.\n\nYou can enable the `Include all webpages linked from these websites` toggle to automatically discover and extract content from pages that are linked from your provided URLs. This works for both regular web pages and sitemap URLs (e.g., example.com/sitemap.xml), allowing you to easily add content from larger websites.\n\nWhen scraping websites, DocuChat intelligently filters out navigation menus, footers, and other non-content elements to focus on the meaningful information.\n\nDocuChat can process YouTube videos that have English captions available as a source of information. The captions will be used as the video's content.\n\nSimply paste a YouTube video URL and DocuChat will process it if English captions are available.\n\n### [Google Drive](https://docs.docuchat.io/documents/types#google-drive)\n\nWhen you select folders from your Google Drive, each folder becomes a single document in your library. DocuChat syncs all supported file types within those folders, including any subfolders.\n\nWhen you add a Google Drive folder document to a chatbot, the chatbot gains access to all files inside that folder. ",
              "url": "https://docs.docuchat.io/documents/types"
            }
          ],
          "question": "What is docuchat? ",
          "sentAt": "2025-01-10T13:25:12.037Z",
          "feedback": {
            "comments": "",
            "ratedUp": false,
            "isNotTrue": false,
            "isNotHelpful": false,
            "hasInconsistentLanguage": false
          }
        }
      ],
      "startedAt": "2025-01-10T13:24:15.589Z"
    }
  }
}

Get Chatbot Analytics

Retrieve analytics data for a chatbot.

GET /analytics/getChatbotAnalytics
// You don't need any parameters. This endpoint returns all analytics data available for the user.
const response = await fetch("https://api.docuchat.io/analytics/getChatbotAnalytics", {
  method: "GET",
  headers: {
    "x-api-key": "your-api-key",
  },
});
{
  "success": true,
  "message": "",
  "content": {
    "years": [
      {
        "year": 2024,
        "months": [
          {
            "monthNumber": 12,
            "analytics": [
              {
                "chatBotId": "18aeff4a-6b6a-4c7b-819d-45f9293c6d1c",
                "chatbotName": "DocuChat HelpBot",
                "totalSessions": 2229,
                "totalMessages": 112,
                "feedbacks": {
                  "total": 0,
                  "ratedUp": 0,
                  "ratedDown": 0,
                  "numberOfIsNotTrue": 0,
                  "numberOfIsNotHelpful": 0,
                  "numberOfHasInconsistentLanguage": 0
                },
                "averageHandlingTime": 17.93098833557649,
                "ctaClickRate": 0
              }
            ]
          }
        ]
      },
      {
        "year": 2025,
        "months": [
          {
            "monthNumber": 1,
            "analytics": [
              {
                "chatBotId": "18aeff4a-6b6a-4c7b-819d-45f9293c6d1c",
                "chatbotName": "DocuChat HelpBot",
                "totalSessions": 10,
                "totalMessages": 5,
                "feedbacks": {
                  "total": 10,
                  "ratedUp": 9,
                  "ratedDown": 0,
                  "numberOfIsNotTrue": 0,
                  "numberOfIsNotHelpful": 0,
                  "numberOfHasInconsistentLanguage": 0
                },
                "averageHandlingTime": 17.93098833557649,
                "ctaClickRate": 0
              }
            ]
          }
        ]
      }
    ]
  }
}

Get Chatbot Sessions

Retrieve chat sessions for a specific chatbot.

GET /chatbot/getSessions
const chatbotId = "18aeff4a-6b6a-4c7b-819d-45f9293c6d1c";
const response = await fetch(`https://api.docuchat.io/chatbot/getSessions?chatbotId=${chatbotId}`, {
  method: "GET",
  headers: {
    "x-api-key": "your-api-key",
  },
});
{
  "success": true,
  "message": "",
  "content": {
    "sessions": [
      {
        "sessionId": "9c9b73ae-9a98-48e3-91bf-85fbbc868cab",
        "startedAt": "2025-01-03T20:22:08.178Z",
        "messages": [
          {
            "sentAt": "2025-01-03T20:22:21.536Z",
            "question": "Why should I choose DocuChat over other chatbot builders?",
            "answer": "You should choose DocuChat over other chatbot builders for several compelling reasons:\n\n1. **Cost Reduction**: DocuChat can reduce support costs by up to 70% by automating responses to common inquiries, which enhances overall efficiency.\n\n2. **Data Privacy and Security**: As an EU-based solution, DocuChat ensures full GDPR compliance and data privacy. All data processing and storage occur within EU servers, and you have complete control over your data, including the ability to delete it permanently.\n\n3. **Ease of Use**: Setting up your AI chatbots is effortless and can be done in minutes without any coding required. You can import resources from various formats and customize your chatbot's appearance and conversational logic.\n\n4. **Advanced Technology**: DocuChat utilizes advanced Retrieval Augmented Generation (RAG) techniques, which provide accurate and context-aware responses by grounding language models in external knowledge sources.\n\n5. **Multilingual Support**: The platform caters to diverse linguistic needs, making it suitable for a global audience.\n\n6. **Wide Range of Supported File Types**: DocuChat supports various file types, including PDFs, Word documents, Excel files, and more, allowing for versatile content integration.\n\n7. **Real-Time Analytics**: You can monitor chatbot performance with in-depth analytics, enabling continuous improvement of user satisfaction.\n\n8. **No Data Used for AI Training**: Your data is not used for training AI models, ensuring that your proprietary information remains confidential.\n\nThese features collectively make DocuChat a reliable and efficient choice for businesses looking to enhance their customer support and internal processes.",
            "indices": [
              {
                "documentId": "950b6433-21a0-4a9e-a0b8-0a94dbf846e3",
                "documentName": "Docs.docuchat.io | Getting started",
                "content": "DocuChat is a powerful AI chatbot platform that empowers businesses to create intelligent, context-aware chatbots trained on their own content. With DocuChat, you can reduce support costs, enhance customer satisfaction, and improve employee productivity in just minutes.\n\nAs an EU-based solution, DocuChat ensures data privacy and GDPR compliance while enabling you to create chatbots from various content sources. These AI-powered assistants excel at understanding context and delivering precise information, streamlining support and knowledge management processes.\n\n* **Customer Support**: Automate responses to common inquiries, reducing support costs by up to 70%.\n* **Employee Assistance**: Create internal knowledge bases for HR, IT, and other departments.\n* **Documentation Bots**: Make your product documentation interactive and easily accessible.\n* **Sales and Marketing**: Provide instant information to potential customers, boosting conversion rates.\n* **Education**: Create interactive learning bots for educational institutions.\n* **Research**: Build bots to answer questions from your research papers.\n* **And more!**\n\nDocuChat leverages advanced Retrieval Augmented Generation (RAG) techniques, along with proprietary and open-source enhancements, to deliver highly accurate and context-aware responses.\n\n### [Retrieval Augmented Generation (RAG)](https://docs.docuchat.io/getting-started#retrieval-augmented-generation-rag)\n\nRAG is an AI framework that grounds language models in external knowledge sources, similar to an open-book exam. This approach offers several benefits:\n\n* Ensures access to current and reliable information\n* Provides transparency by allowing users to verify sources\n* Eliminates the need for frequent model retraining\n* Reduces the risk of data leakage and hallucinations\n\n### [DocuChat's Enhanced RAG Process](https://docs.docuchat.io/getting-started#docuchats-enhanced-rag-process)\n\n1. **Document Processing**: Uploaded documents are divided into manageable chunks",
                "url": "https://docs.docuchat.io/getting-started"
              },
              {
                "documentId": "d6f3b528-0994-485e-b9cf-698da8d7eedf",
                "documentName": "Docuchat.io",
                "content": "## Empower Your Business with Reliable AI Chatbots \n\nReduce support costs, delight customers and employees with AI chatbots trained on your content. Experience unrivaled accuracy in answers and full EU data residency — set up in mere minutes.\n\n 14-day free trial — No credit card required \n\n## Transform Your Support in Minutes\n\nSet up your AI chatbots effortlessly and start saving time and resources immediately. Here's how we help you get there:\n\nImport Resources\n\nUpload documents or sync websites and Google Drive folders instantly. Add as many as you like, in any language.\n\nCustomize & Refine\n\nPersonalize every aspect of your chatbot, from visual style to conversational logic. No coding required.\n\nDeploy & Analyze\n\nEmbed on your site or share via link. Monitor performance with in-depth analytics to continually improve user satisfaction.\n\n## Real Results from Satisfied Customers\n\nJoin businesses that have transformed their customer support and internal processes with DocuChat.\n\nAll based on real-world data from our feedback logs and customer surveys.\n\n## Why Choose DocuChat?\n\nDiscover the unparalleled features that set us apart from the competition.\n\n![](https://www.docuchat.io/_amplify/image?url=%2Fimages%2Fcompliance-badges.png&w=1536&q=100)\n\n## Your Data, Secure and Sovereign\n\nWe know that your data is sensitive and proprietary. At DocuChat, we believe that data privacy and security are priority zero.\n\nEnd-to-End EU Data Residency\n\nAll data processing and storage, including AI model inferences, occur within our EU-based servers, ensuring full GDPR compliance.\n\nYour Data Is Yours\n\nYou have full control over your data. If you delete anything, it will be permanently removed from our servers.\n\nNo Data Used for AI Training\n\nRest assured, neither we nor our AI providers use your data to train models.\n\nBest-in-Class Security\n\nOur infrastructure leverages AWS's comprehensive compliance programs, including ISO 27001, SOC 2, and GDPR. Your data is encrypted in transit and at rest.\n\n## Premium Features, Accessible Pricing\n\nExperience enterprise-grade AI chatbots at a fraction of the cost. Un",
                "url": "https://www.docuchat.io"
              },
              {
                "documentId": "2e56cc41-66cc-483c-a5d4-edb778a2cf55",
                "documentName": "Docs.docuchat.io | Product",
                "content": "All our subprocessors and service providers are either based in the EU or guarantee that their data storage is located within the EU. And we have also established detailed subprocessor agreements with each of these providers. We take data privacy and security very seriously, and we are committed to ensuring that your data is always protected.\n\nDocuChat enhances your business by providing efficient information retrieval, reducing time spent on data lookup or answering redundant questions. It serves as a 24/7 customer service tool, delivering precise answers to customer inquiries, and aids in internal knowledge management, supporting employees in their tasks. With DocuChat, you can streamline operations, improve customer experience, and bolster internal support.\n\nDocuChat boosts productivity in personal projects through efficient information extraction from vast documents and an intuitive query interface for natural language inquiries. It provides transparent citations for answer verification and offers multilingual support, catering to diverse linguistic needs. Whether for research, study, or document management, DocuChat is a valuable time-saving tool.\n\nDocuChat supports a wide range of file types including PDF, Word, Excel, PowerPoint, e-book, Notepad, CSV, markdown, and media files. You can also add URLs and YouTube videos as sources of information as well as sync Google Drive folders into your chatbots.\n\nThe process is incredibly fast. For documents shorter than 100 pages, it typically takes just a few seconds to create a chatbot. If you upload a large number of documents or a single long document, it might take slightly longer, but almost never exceeds a minute.\n\nWe support several AI models including GPT-4o, GPT-4o mini, GPT-4 Turbo, Claude 3.5 Sonnet, Claude 3 Haiku, Mistral Large 2, and Llama 3.1 70b. The availability of specific models depends on your subscription plan",
                "url": "https://docs.docuchat.io/faqs/product"
              }
            ]
          }
        ]
      }
    ]
  }
}
All dates are returned in ISO 8601 format (e.g., "2024-03-20T00:00:00Z")