Agent
Single-shot queries, multi-turn chat, and batch processing
The Agent endpoints let you ask questions over your project’s knowledge base. Three options depending on your use case: single query, chat, or batch.
POST /api/v2/agent/query
Single-shot Q&A. Ask one question, get one answer with source citations. Stateless — no conversation history is stored.
Authentication: Bearer token required
Request body:
Example request:
Example response 200 OK:
POST /api/v2/chat
Multi-turn conversation. Send a message history and get a contextual response. The AI understands follow-up questions based on prior messages.
Authentication: Bearer token required
Request body:
Example request:
Example response 200 OK (when stream: false):
Streaming: When stream: true, the response is delivered as Server-Sent Events (SSE). See Streaming & Async for implementation details.
POST /api/v2/agent/batches
Create a batch query. Submit multiple questions to be answered in the background. Ideal for compliance checklists, regulatory questionnaires, or bulk data extraction.
Authentication: Bearer token required
Request body:
Example request:
Example response 201 Created:
GET /api/v2/agent/batches
List all batch queries. Supports pagination and filtering by project.
Authentication: Bearer token required
Query parameters:
GET /api/v2/agent/batches/{id}
Get batch details with full results for each question.
Authentication: Bearer token required
Path parameters:
Example response 200 OK:
GET /api/v2/agent/batches/{id}/export
Download batch results as a CSV file. Opens in Excel, Google Sheets, etc.
Authentication: Bearer token required
Path parameters:
Response: 200 OK with Content-Type: text/csv
CSV columns: