API Documentation
REST API Reference
Complete API documentation for integrating ConvoAI into your applications. RESTful API with JSON responses.
Getting Started
Base URL
https://your-domain.com/api/v1Replace 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_KEYGet 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
/api/v1/chatSend a question and get an AI-generated answer with source citations
/api/v1/documentsUpload a new document to the knowledge base
/api/v1/documentsList all documents in the knowledge base
/api/v1/documents/{id}Delete a document from the knowledge base
/api/v1/analyticsGet 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
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal 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.