Skip to main content

API Reference

Oversight exposes 18 RESTful API endpoints via Next.js API Routes. All endpoints are serverless functions deployed on Vercel with a maximum execution time of 120 seconds.

Base URL

https://the-painters-product.vercel.app/api

For local development: http://localhost:3000/api

Authentication

Most endpoints require authentication via a NextAuth.js session cookie. Authenticated requests must include the session cookie set during login. Unauthenticated requests to protected endpoints receive a 401 Unauthorized response.

Public endpoints (no authentication required):

  • POST /api/auth/register
  • POST /api/chat
  • GET /api/chat/[id]
  • POST /api/chat/[id]/complete
  • GET /api/health

Rate Limiting

Rate limits are enforced per-user (authenticated) or per-IP (public endpoints):

Endpoint GroupMinute LimitDaily LimitIdentifier
Upload (POST /api/upload)5/min40/dayuser:{userId}
Chat (POST /api/chat)5/min40/dayip:{clientIP}
Feedback (POST /api/feedback)5/min20/dayuser:{userId}

Rate-limited responses return HTTP 429 Too Many Requests with a Retry-After header.

Endpoint Categories

CategoryEndpointsDescription
Authentication2User registration and session management
Uploads3File upload, status, and history
Batch1Batch upload grouping
Chat3Live chatbot messaging and session management
Ground Truth4Knowledge base document management
Settings2User preferences
Monitoring & Trends2Live session monitoring and analytics
System2Health check and feedback

Common Error Responses

Status CodeMeaning
400Bad request — invalid or missing parameters
401Unauthorized — session cookie missing or expired
403Forbidden — authenticated but not authorized (e.g., accessing another user's upload)
404Not found — resource does not exist
429Too many requests — rate limit exceeded
500Internal server error — unexpected failure