API Quickstart
Log in, upload, ask: three calls
Replace
https://app.raghim.com with your own host if you self-host. All calls below are authenticated as you and only see your own organization's data.1. Log in
Exchange your username and password for a token (form encoded, not JSON).
curl -X POST https://app.raghim.com/api/token \
-d "[email protected]" -d "password=YOUR_PASSWORD"
# {"access_token": "eyJ...", "token_type": "bearer"}Accounts with 2FA enabled receive a challenge response instead and need the extra verification step first. For long-lived automation use an access token with the MCP endpoint rather than storing a password.
2. Upload a document
curl -X POST https://app.raghim.com/api/documents/upload/background \
-H "Authorization: Bearer $TOKEN" \
-F "[email protected]" \
-F "collection_name=my-docs"Processing runs in the background (chunking, embedding). Wait until the document shows as processed in the app before asking questions about it.
3. Ask a question
curl -X POST https://app.raghim.com/api/chat/agentic \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"message": "What is our refund policy?", "collections": ["my-docs"]}'
# {"response": "...", "sources": [...]}The answer comes back in response, with the passages it used in sources.
Using Claude, Cursor or another AI client? Skip the raw API and connect through MCP: MCP setup.