Engineering manualAPI route source
/api/brands
Exact current route handler: hosted-app/app/api/brands/route.js
Methods: GET. Input signals: none detected. Literal response-status signals: none detected.
Source: hosted-app/app/api/brands/route.js. Imports: ../../../lib/basic-brands.mjs, ../../../lib/comprehensive-pull.mjs, ../../../lib/supabase-rest.mjs, next/server. Exact source is shown for inspection; its presence does not prove authentication, validation or live behavior.
All API routes · API and execution contract
// GET /api/brands — the signed-in account's brand library: every brand it has
// read or reported on, with saved reads, reports, review/search/social schedules
// and bounded last-change summaries. All comparison readers use saved data only.
// Sessions and API keys with read_reports. See lib/basic-brands.mjs.
import { NextResponse } from "next/server";
import { supabaseConfigFromEnv } from "../../../lib/supabase-rest.mjs";
import { bearerTokenFromHeader } from "../../../lib/comprehensive-pull.mjs";
import { listBrands } from "../../../lib/basic-brands.mjs";
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
const PRIVATE = { "cache-control": "private, no-store", "x-content-type-options": "nosniff" };
export async function GET(request) {
const result = await listBrands({ token: bearerTokenFromHeader(request.headers.get("authorization")), config: supabaseConfigFromEnv(process.env) });
return NextResponse.json(result.body, { status: result.http_status, headers: PRIVATE });
}