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_TOKEN

For detailed authentication instructions, see the Authentication guide.

API Endpoints

Authentication

POST/auth/login/
POST/auth/token/refresh/
POST/auth/logout/

Agents

GET/agents/
POST/agents/
GET/agents/{id}/
PATCH/agents/{id}/
DELETE/agents/{id}/

Chat & Queries

POST/agents/{id}/query/
GET/agents/{id}/conversations/

Data Sources

GET/data-sources/
POST/data-sources/
DELETE/data-sources/{id}/
POST/data-sources/{id}/sync/

Analytics

GET/analytics/agents/{id}/

Rate Limits

API requests are rate limited to ensure fair usage:

User TypeLimit
Authenticated users1,000 requests/hour
Agent queries60 requests/minute per agent
Unauthenticated100 requests/hour

Rate limit information is included in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1699286400

Error 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.

Next Steps