Skip to content

API Overview

The Queria REST API lets you integrate intelligent document search, AI chat and document management features into any application.

Base URL

All API requests use the following base URL:

https://api.queria.pro

The API uses path-based versioning. Current version is v3.5.0. Public endpoints live under /api/public/, authenticated ones under /api/.

Response format

All responses are in JSON with a consistent structure.

Success response:

json
{
  "success": true,
  "data": {
    "id": "doc_8f3a2b1c",
    "name": "Supply Contract 2025",
    "status": "VECTORIZED",
    "createdAt": "2026-02-15T10:30:00Z"
  }
}

Paginated response:

json
{
  "success": true,
  "data": {
    "items": [],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 143,
      "totalPages": 8
    }
  }
}

Error response:

json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Field 'message' is required.",
    "details": [
      { "field": "message", "reason": "Required field" }
    ]
  }
}

HTTP status codes

CodeMeaningDescription
200OKRequest completed successfully
201CreatedResource created successfully
400Bad RequestMissing or invalid parameters
401UnauthorizedMissing or invalid authentication
403ForbiddenInsufficient permissions for the operation
404Not FoundResource not found
429Too Many RequestsRequest limit exceeded
500Internal Server ErrorInternal server error

Rate limiting

The API applies frequency limits to ensure stability and performance.

Endpoint typeLimitWindow
Public endpoints60 requests1 minute
Authenticated endpoints300 requests1 minute
Document upload10 requests1 minute
Chat streaming20 requests1 minute

Responses include informative rate limit headers:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1709542800

When the limit is exceeded, the API returns a 429 error:

json
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Request limit exceeded. Retry in 23 seconds.",
    "retryAfter": 23
  }
}

Content-Type

All JSON requests must include the header:

Content-Type: application/json

For file uploads, use:

Content-Type: multipart/form-data

Authentication

The API supports two authentication methods:

  • JWT Token: for user sessions in web apps. Included via Authorization: Bearer {token} header.
  • API Key: for server-to-server integrations and widgets. Included via X-API-Key header.

API Keys follow the format qk_live_* for production and qk_test_* for test environments.

For full details, see the authentication guide.

Quick example

A typical call to the chat API with API Key authentication:

bash
curl -X POST https://api.queria.pro/api/public/chat/stream \
  -H "Content-Type: application/json" \
  -H "X-API-Key: qk_live_abc123def456ghi789" \
  -H "Accept: text/event-stream" \
  -d '{
    "message": "What are the main clauses of the contract?",
    "sessionId": "sess_a1b2c3d4"
  }'

Streaming response (Server-Sent Events):

data: {"type":"token","content":"The main"}
data: {"type":"token","content":" clauses of the contract"}
data: {"type":"token","content":" are the following [1]:"}
data: {"type":"sources","sources":[{"id":"doc_8f3a","name":"Supply Contract","score":0.92}]}
data: {"type":"done","citationMap":{"1":{"documentId":"doc_8f3a","chunkId":"chk_001"}}}

Main endpoints

Authentication

MethodEndpointDescription
POST/api/auth/loginUser login
POST/api/auth/registerRegistration
POST/api/auth/refreshRefresh token
POST/api/auth/logoutLogout

Chat

MethodEndpointDescription
GET/api/conversationsList conversations
POST/api/conversationsNew conversation
POST/api/chat/messageSend message
POST/api/chat/streamChat streaming

Documents

MethodEndpointDescription
GET/api/documentsList documents
POST/api/documents/uploadUpload document
GET/api/documents/:idDocument details
PUT/api/documents/:idUpdate document
DELETE/api/documents/:idDelete document

Topics

MethodEndpointDescription
GET/api/topicsList categories
POST/api/topicsCreate category
PUT/api/topics/:idUpdate category
DELETE/api/topics/:idDelete category

Companies

MethodEndpointDescription
GET/api/companiesList companies
GET/api/companies/:idCompany details
PUT/api/companies/:idUpdate company

Public APIs (Widget)

MethodEndpointDescription
POST/api/public/chatNon-streaming chat
POST/api/public/chat/streamSSE streaming chat
POST/api/public/search/webWeb search
GET/api/public/topicsList categories

Pagination

Standard query parameters for lists:

ParameterDefaultDescription
page1Page number
limit20Items per page (max 100)
sortcreatedAtSort field
orderdescDirection: asc or desc

Example:

bash
curl -X GET "https://api.queria.pro/api/documents?page=2&limit=50&sort=name&order=asc" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Webhook (Coming Soon)

Notifications for asynchronous events:

  • document.uploaded - Document uploaded
  • document.vectorized - Processing completed
  • document.error - Processing error
  • conversation.created - New conversation

SDKs

Official SDKs in development:

  • JavaScript / TypeScript
  • Python
  • PHP

In the meantime, use the REST API directly with any HTTP client.

Next steps

Queria - Document Intelligence con Cog-RAG