Brand Studio docs
Engineering manualAPI route source

/api/local-runs/[run_id]

Exact current route handler: hosted-app/app/api/local-runs/[run_id]/route.js

Methods: GET. Input signals: none detected. Literal response-status signals: 404.

Source: hosted-app/app/api/local-runs/[run_id]/route.js. Imports: @/lib/local-runs.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/local-runs/<run_id> — one live run's state, recent events,
// summary, receipt and comparison. Local only; polled by /runs/<run_id>.
// The full result document is omitted here (it can be megabytes); the report
// page reads it server-side instead.
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
import { NextResponse } from "next/server";
import { readLocalRun } from "@/lib/local-runs.mjs";

export async function GET(_request, context) {
  const { run_id } = await context.params;
  const run = readLocalRun(run_id, { includeResult: false });
  if (!run) return NextResponse.json({ status: "not_found" }, { status: 404, headers: { "cache-control": "no-store" } });
  // summary and comparison need the result; recompute them without shipping it.
  const withResult = readLocalRun(run_id, { includeResult: true });
  const { result, ...rest } = withResult || run;
  return NextResponse.json(rest, { headers: { "cache-control": "no-store" } });
}