API draft

Versioned API surface

The Rust service starts with a health route and a versioned namespace that mirrors the endpoint plan in plan.md.

Auth

Auth

  • POST /api/v1/auth/login
  • POST /api/v1/auth/logout
  • POST /api/v1/auth/register
  • POST /api/v1/auth/login
  • GET /api/v1/auth/me returns the active user, workspace, and role memberships
Videos

Videos

  • POST /api/v1/videos/upload
  • PUT /api/v1/videos/upload/:upload_id?index=:chunk
  • POST /api/v1/videos/upload/:upload_id/complete
  • GET /api/v1/videos
  • GET /api/v1/videos/:id
  • GET /api/v1/videos/:id/frames returns frames, transcripts, and object tracks
Search

Search

  • POST /api/v1/search
  • POST /api/v1/videos/:id/search
  • GET /api/v1/search/history
  • Body: { query, video_id?, scope?, mode?, limit? } with transcript-aware ranking
Projects and Metadata

Projects and Metadata

  • GET /api/v1/projects
  • POST /api/v1/projects
  • PATCH /api/v1/videos/:id
Analytics

Analytics

  • GET /api/v1/analytics/usage
  • GET /api/v1/analytics/events
  • GET /api/v1/analytics/heatmap
Developer API

Developer API

  • GET /api/v1/api-keys
  • POST /api/v1/api-keys
  • DELETE /api/v1/api-keys/:id
  • GET /api/v1/webhooks
  • POST /api/v1/webhooks
ML Inference

ML Inference

  • GET /health
  • POST /encode/image
  • POST /encode/images
  • POST /encode/text
  • POST /encode/texts
  • POST /transcribe
Security

Security

  • GET /api/v1/audit-logs
  • Signed bearer sessions with expiry and revocation
  • Persisted audit records for auth and privileged mutations
Deployment

Deployment

  • docker-compose.yml for on-prem web + api + ml + postgres startup
  • deploy/k8s/*.yaml manifests for Kubernetes rollout
  • .env.example for browser-visible API endpoint, ML endpoint, and exposed ports
  • GET /health and GET /ready for liveness and readiness checks
  • production requires APP_SIGNING_SECRET and explicit CORS_ALLOWED_ORIGIN
Streams and Alerts

Streams and Alerts

  • GET /api/v1/streams
  • POST /api/v1/streams
  • PATCH /api/v1/streams/:id
  • GET /api/v1/alerts
  • POST /api/v1/alerts
  • PATCH /api/v1/alerts/:id