RAG
POST /rag/query
Ask a natural-language question grounded in your uploaded documents
POST
Authentication
Bearer token from an authenticated Supabase session. See the note on RAG auth.
Request Body
The question to answer.
UUID of the workspace whose documents to search.
Response
"success"Token/quota usage for this query
Timing/processing metrics
ISO 8601
Errors
| Status | Error | Cause |
|---|---|---|
| 400 | Query is required and must be a string | Missing/invalid query |
| 400 | workspace_id is required | Missing workspace_id |
| 401 | Authentication required | Missing/invalid session |
| 403 | Access denied to workspace | Caller isn’t a member of the workspace |
| 403 | RAG service not enabled for this workspace | RAG hasn’t been enabled/provisioned yet — upload a document first |
| 429 | Monthly quota exceeded (includes quota and current_usage) | Workspace has used its monthly query quota |
| 500 | Failed to process query | Server error (see details in response) |