The Chat API provides two entry points for user–assistant interactions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/HugoX2003/nisira-assistant/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/chat/ is the basic endpoint that routes messages through a keyword-response generator without document retrieval — it is lightweight, fast, and suitable for simple exchanges like greetings. For full Retrieval-Augmented Generation with document citations and adaptive context retrieval, use POST /api/rag/chat/ (documented in the RAG section). Both endpoints require a valid JWT Bearer token and scope all messages to the authenticated user’s conversations.
POST /api/chat/
Send a user message to an existing conversation and receive a basic assistant reply. Theconversation_id field is required — this endpoint does not auto-create conversations. To start a new thread first, call POST /api/conversations/create/ and then use the returned slug here.
POST /api/chat/ uses a keyword-based response generator (generate_basic_response), not the RAG pipeline. It does not retrieve documents or produce citations. Use POST /api/rag/chat/ for grounded, document-backed answers.Request
Endpoint:POST /api/chat/
Authentication: Authorization: Bearer <access_token>
The user’s question or message. Must be a non-empty string. Leading and trailing whitespace is stripped automatically.
The slug (preferred) or legacy numeric ID of an existing conversation to append the message to. This field is required — omitting it returns
400 Bad Request.Response
The saved user message record.
The saved assistant reply record.
URL-safe slug of the conversation (11 characters, randomly generated). Always prefer this over the numeric ID for subsequent requests.
Legacy numeric primary key of the conversation.
Same as
conversation_id — the conversation’s public slug.Error Responses
| HTTP | error value |
|---|---|
400 | "El mensaje no puede estar vacío" |
400 | "ID de conversación requerido" |
404 | "Conversación no encontrada" |
Example
- cURL
- Response
GET /api/documents/<filename>/
Serves the raw binary file for a document stored in the system — used by the frontend PDF viewer to display a source cited in a chat response. Thefilename path parameter is the document’s filename as stored in the system (as returned in the sources[].filename field of POST /api/rag/chat/ responses).
Authentication: This endpoint accepts the JWT token either via the standard Authorization: Bearer <token> header or via a ?token=<token> query parameter. The query-parameter method is required for browser <iframe> PDF embeds, which cannot send custom headers.
JWT access token as a query parameter. Only needed when the
Authorization header cannot be set (e.g., inside an <iframe src="...">).Example
- Header auth (cURL)
- Query param (iframe)
The response
Content-Disposition header is set to inline, allowing browsers to render PDFs natively rather than downloading them. The #page=N URL fragment works in most PDF viewers to jump directly to the cited page.UploadedDocument database record (which may point to a PostgreSQL binary store or a filesystem path), a direct PostgreSQL file store lookup, and finally a legacy filesystem directory fallback.