API Reference
Build powerful AI integrations with the RAG Chats REST API. Query your knowledge base from any application.
Base URL: https://api.ragchats.ai/api
Quick Start
Make your first API call in seconds:
-purple-500">curl -X POST https://api.ragchats.ai/api/agents/YOUR_BOT_ID/query/ \
-H -green-500">"Authorization: Bearer YOUR_API_KEY" \
-H -green-500">"Content-Type: application/json" \
-d -green-500">'{"message-green-500">": "What is your return policy?-green-500">"}'Authentication
The API uses JWT tokens for authentication. Include the token in the Authorization header:
Authorization: Bearer YOUR_ACCESS_TOKENFor detailed authentication instructions, see the Authentication guide.
API Endpoints
Authentication
POST
/auth/login/Login with credentialsPOST
/auth/token/refresh/Refresh access tokenPOST
/auth/logout/Logout and invalidate tokensAgents
GET
/agents/List all agentsPOST
/agents/Create a new agentGET
/agents/{id}/Get agent detailsPATCH
/agents/{id}/Update agent settingsDELETE
/agents/{id}/Delete an agentChat & Queries
POST
/agents/{id}/query/Query an agentGET
/agents/{id}/conversations/List conversationsData Sources
GET
/data-sources/List data sourcesPOST
/data-sources/Create data sourceDELETE
/data-sources/{id}/Delete data sourcePOST
/data-sources/{id}/sync/Trigger syncAnalytics
GET
/analytics/agents/{id}/Get agent analyticsRate Limits
API requests are rate limited to ensure fair usage:
| User Type | Limit |
|---|---|
| Authenticated users | 1,000 requests/hour |
| Agent queries | 60 requests/minute per agent |
| Unauthenticated | 100 requests/hour |
Rate limit information is included in response headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1699286400Error Handling
Errors are returned with appropriate HTTP status codes:
{
"error": "not_found",
"message": "Agent not found",
"details": {
"agent_id": "invalid_id"
}
}See the Errors guide for all error codes.
SDKs & Libraries
Coming Soon
Official SDKs for Python, JavaScript, and Go are in development. For now, use any HTTP client to interact with the API.

