API Reference

Primary worker endpoints used by Instalytics frontend.

POST /auth/login Public

Authenticate user and create session.

Request body

{ email: string, password: string }

Response

200 { ok: true, user }
POST /auth/logout Cookie session

Revoke current session.

Response

200 { ok: true }
GET /auth/session Cookie session

Session envelope for client auth guard.

Response

200/401/500 normalized envelope
POST /ai/query Cookie session

Streams AI answer + artifacts for a dashboard question or Videocontrol planning request.

Request body

{ message(max 32000 chars), mode, llm_model?, session_id?, history?, product_facts? }

Response

NDJSON/SSE-style stream with status, token, tool_call, tool_result, artifact, source, done. Videocontrol can emit timeline, shotlist, or storyboard artifacts.
GET /dashboard Cookie session

List dashboards with pagination.

Parameters

NameTypeRequiredDescription
pagenumbernoPage index
limitnumbernoPage size
offsetnumbernoAbsolute offset override

Response

Paginated list envelope