Skip to content

API Endpoints

Framework: Hono.js
Base URL: /api
Auth: Supabase JWT (Bearer token)

Authentication

All endpoints (except /api/health) require a valid Supabase JWT in the Authorization header:

Authorization: Bearer eyJ...

Projects

POST /api/projects

Create a new project.

Body:

json
{
  "name": "Mein Projekt",
  "brief": "Eine moderne Landing Page für eine Steuerberatung..."
}

Response:

json
{
  "id": "uuid",
  "name": "Mein Projekt",
  "status": "draft",
  "createdAt": "2026-05-04T00:00:00Z"
}

GET /api/projects/:id

Fetch project with current state.

Response:

json
{
  "id": "uuid",
  "name": "Mein Projekt",
  "status": "ready",
  "brief": { "raw": "..." },
  "designBrief": { "style": "corporate-minimal", ... },
  "currentOutput": { "files": [...] }
}

PUT /api/projects/:id

Update project name or brief draft.

Body:

json
{
  "name": "Neuer Name"
}

DELETE /api/projects/:id

Delete project and all associated assets.


Generation

POST /api/generate

Trigger the full AI pipeline for a project.

Body:

json
{
  "projectId": "uuid",
  "options": {
    "regenerateImages": false
  }
}

Response (streaming):

The response is a Server-Sent Events stream:

data: {"stage": "planner", "status": "running"}
data: {"stage": "planner", "status": "done", "brief": {...}}
data: {"stage": "images", "status": "running"}
data: {"stage": "images", "status": "done", "count": 4}
data: {"stage": "executor", "status": "running"}
data: {"stage": "executor", "status": "done"}
data: {"stage": "complete", "projectId": "uuid"}

Assets

GET /api/assets/:projectId

List all generated assets for a project.

POST /api/assets/upload

Upload a user-provided asset (replaces AI-generated one).

Multipart form data:

  • file: Image file (max 10MB)
  • projectId: Project UUID
  • slot: Asset slot identifier

Health

GET /api/health

No auth required. Returns server status.

json
{ "status": "ok", "version": "1.0.0" }

Internal documentation for development team