Skip to main content

Overview

API Introduction

Learn how to integrate the kapa.ai API into your developer-facing product

Build on top of the kapa.ai core infrastructure and leverage the API to answer technical questions automatically.

Don't want to build a developer-facing chatbot yourself?

Head to kapa.ai and sign up for the fully managed bot available via Slack, Discord and embeddable JS widget. Want to jump right in? Head to the Quickstart section.

Key features

  • 🧠 Wide range of knowledge sources: kapa.ai supports various technical knowledge sources, including documentation, chat histories, forums, blogs, codebases, and YouTube videos.
  • ​ 💬 Managed conversation context: By leveraging the unique thread_id from a previous query, you can ask follow-up questions without worrying about keeping track of conversation history yourself.
  • 👍 User feedback & reactions: The Feedback endpoint enables users to submit feedback on specific question-answer pairs by providing reactions such as upvotes and downvotes.
  • 📈 Analytics: The Analytics API allows you to retrieve aggregated data and insights about threads and question-answer pairs in your project. By using the analytics endpoints, you can gain a better understanding of user interactions, preferences, and the performance of kapa.ai.

Example Image

API Core Concepts

Intro to the Query, Thread, and Feedback endpoints

This section provides an overview of the key concepts in the kapa.ai API, which helps you interact with the platform and create seamless developer-facing chatbot experiences. The API consists of three main endpoints: Query, Thread, and Feedback. These endpoints allow you to ask questions, maintain conversation context, and provide feedback on the answers received.

Query Endpoint

The Query endpoint is the primary method for interacting with kapa.ai to ask questions and receive answers. By submitting a question, kapa.ai generates an answer based on your product documentation, code, chat logs, and GitHub issues. The answer comes with a unique thread_id and question_answer_id that can be used for follow-up questions and providing feedback.

Thread Endpoint

The Thread endpoint is designed for maintaining the context of a conversation. By using the unique thread_id from a previous query, you can ask a follow-up question in the context of the existing conversation. kapa.ai will use this context to generate a more relevant answer. The response will also include a unique question_answer_id for the new question-answer pair, which can be used for providing feedback.

Feedback Endpoint

The Feedback endpoint allows you to submit feedback on specific question-answer pairs. By providing reactions such as upvotes and downvotes, you can help improve kapa.ai's performance and ensure it provides more accurate and useful answers to developers. The platform uses this feedback to adjust its understanding of the content and refine its response generation process. Each feedback submission requires a unique question_answer_id from a previous query or thread response, as well as a user_identifier to track user-specific preferences and feedback history. The feedback helps kapa.ai to continually learn and improve its performance over time.

Analytics Endpoint

The Analytics API in kapa.ai provides aggregated data and insights about threads and question-answer pairs in your project. This can help you understand user interactions, preferences, and the performance of kapa.ai.