API Documentation
REST API Reference

Complete API documentation for integrating ConvoAI into your applications. RESTful API with JSON responses.

REST
API Type
JSON
Response Format
Bearer
Authentication
HTTPS
Protocol

Getting Started

Base URL

https://your-domain.com/api/v1

Replace your-domain.com with your actual domain after deployment.

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Get your API key from the admin dashboard after deployment.

Rate Limits

  • Standard: 100 requests per minute
  • Burst: 200 requests per minute (short duration)
  • Daily: 10,000 requests per day

Rate limits can be customized in your deployment configuration.

API Endpoints

POST/api/v1/chat
Required

Send a question and get an AI-generated answer with source citations

POST/api/v1/documents
Required

Upload a new document to the knowledge base

GET/api/v1/documents
Required

List all documents in the knowledge base

DELETE/api/v1/documents/{id}
Required

Delete a document from the knowledge base

GET/api/v1/analytics
Required

Get usage analytics and performance metrics

Code Examples

Python

import requests

url = "https://your-domain.com/api/v1/chat"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "question": "What is your refund policy?",
    "max_sources": 3
}

response = requests.post(url, headers=headers, json=data)
result = response.json()

print(f"Answer: {result['answer']}")
print(f"Sources: {result['sources']}")

JavaScript

const response = await fetch('https://your-domain.com/api/v1/chat', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    question: 'What is your refund policy?',
    max_sources: 3
  })
});

const result = await response.json();
console.log('Answer:', result.answer);
console.log('Sources:', result.sources);

cURL

curl -X POST https://your-domain.com/api/v1/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What is your refund policy?",
    "max_sources": 3
  }'

Error Codes

CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Note on API Documentation

This is a general API reference. After deployment, you'll receive complete, customized API documentation specific to your implementation, including interactive API explorer, detailed request/response schemas, and webhook documentation.

Ready to Integrate ConvoAI?

Get started with your custom RAG chatbot implementation.