DocumentationREST API Reference

REST API Reference

6 minLast updated: 2026-03-31

Authentication

API requests require authentication via JWT token or API key:

Authorization: Bearer <jwt-token>
// OR
X-API-Key: af_<32-hex-chars>

Chat Endpoint

POST /api/v1/chat/{agentUuid}
Content-Type: application/json

{
  "message": "Your question here",
  "sessionId": "optional-session-id",
  "stream": false
}

Response:

{
  "answer": "AI response text",
  "sessionId": "uuid",
  "tokensUsed": 142,
  "sources": [{"text": "...", "score": 0.92}]
}

Widget Chat (Public)

POST /api/v1/chat/{agentUuid}/widget
// No auth required: validates Origin header against domain whitelist

Agents CRUD

POST   /api/v1/agents         - Create agent
GET    /api/v1/agents         - List your agents
GET    /api/v1/agents/:id     - Get agent details
PUT    /api/v1/agents/:id     - Update agent
DELETE /api/v1/agents/:id     - Delete agent (soft)

Documents

POST   /api/v1/agents/:id/documents    - Upload file (multipart)
GET    /api/v1/agents/:id/documents    - List documents
DELETE /api/v1/agents/:id/documents/:id: Delete document

Rate Limits

Global: 100 requests/minute. Auth: 10/minute. Chat: 30/minute.

Was this article helpful?