Authentication
Two auth modes: dashboard management and public API access.
Dashboard authentication
The web dashboard uses Clerk. When calling management endpoints from your own backend or scripts during development, pass the Clerk user ID in a header:
http
X-Clerk-User-Id: user_2abc123Example — list knowledge bases:
curl
curl https://api.docubix.com/kbs \
-H "X-Clerk-User-Id: user_2abc123"Endpoints that require dashboard auth include knowledge bases, documents, API key management, conversations, analytics, and settings.
API authentication
Public chat and query endpoints authenticate with a knowledge-base API key in the JSON request body:
json
{
"api_key": "rag_live_your_api_key_here",
"message": "What is ATP?"
}No dashboard header is required for /chat or /query.
curl
curl -X POST https://api.docubix.com/chat \
-H "Content-Type: application/json" \
-d '{
"api_key": "rag_live_your_api_key_here",
"message": "What is ATP?"
}'Security tips
- Never expose API keys in frontend code or public repos.
- Store keys in environment variables on your server.
- Revoke compromised keys immediately from the dashboard.
- Create separate keys per environment when possible.