Skip to main content

Base URL

  • Local: http://localhost:8787
  • Production: https://parti.metacogna.ai

Authentication

All authenticated endpoints require a session cookie:
Session cookies are set on login and expire after 7 days.

Endpoints

Health & Debug

GET /

Service information and available endpoints.

GET /api/health

Health check endpoint.

Authentication

POST /api/auth/login

User login with SHA-256 hashed credentials.
Password must be SHA-256 hashed: SHA256(username + password)
Session cookie is set automatically with 7-day expiry.

POST /api/signup

Admin-only endpoint to create new users.
Only admin users can create new accounts. Non-admin users see “Contact administrator” message.
multipart/form-data
Notes:
  • Goals are automatically summarized using Workers AI
  • Files are uploaded to R2: users/{userId}/documents/{docId}-{filename}
  • User ID is generated as UUID v4

Documents

POST /api/ingest

Upload documents for indexing.
multipart/form-data
Pipeline Stages:
  1. Chunking (0-29%) - Text splitting into semantic chunks
  2. Embedding (30-59%) - Vector embedding generation
  3. Graph Extraction (60-89%) - Entity and relationship extraction
  4. Finalizing (90-100%) - Final indexing

GET /api/documents

Get all documents for authenticated user.
Status Values:
  • processing - Ingestion in progress
  • indexed - Successfully indexed
  • error - Ingestion failed

POST /api/documents/reindex

Reindex all documents (maintenance operation).

DELETE /api/documents/purge-errors

Remove all documents with error status.

GET /api/search

Semantic vector search.
string
Search query string
string
User ID for filtering
number
default:"5"
Number of results to return

Knowledge Graph

GET /api/graph

Get knowledge graph nodes and relationships.
string
User ID for filtering

Rate Limiting

Chat endpoint has rate limiting:
  • Limit: 10 requests per minute per user
  • Headers: X-RateLimit-Remaining, X-RateLimit-Reset
  • Status: 429 when limit exceeded

Error Responses

All errors follow this format:
Common status codes:
  • 400 - Bad Request (validation errors)
  • 401 - Unauthorized (authentication required)
  • 404 - Not Found
  • 429 - Too Many Requests (rate limit exceeded)
  • 500 - Internal Server Error