Brand Studio docs
Engineering manualAPI route source

/api/notifications/outbox

Exact current route handler: hosted-app/app/api/notifications/outbox/route.js

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

Source: hosted-app/app/api/notifications/outbox/route.js. Imports: ../../../../lib/bounded-http.mjs, ../../../../lib/comprehensive-pull.mjs, ../../../../lib/notification-outbox.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

import { NextResponse } from 'next/server';
import { readBoundedJsonRequest } from '../../../../lib/bounded-http.mjs';
import { supabaseConfigFromEnv } from '../../../../lib/supabase-rest.mjs';
import { bearerTokenFromHeader } from '../../../../lib/comprehensive-pull.mjs';
import { notificationOutbox } from '../../../../lib/notification-outbox.mjs';
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
const reply = result => NextResponse.json(result.body, { status: result.http_status, headers: { 'cache-control': 'private, no-store', 'x-content-type-options': 'nosniff' } });
const run = (request, body) => notificationOutbox({ token: bearerTokenFromHeader(request.headers.get('authorization')), config: supabaseConfigFromEnv(process.env), body });
export async function GET(request) { return reply(await run(request, null)); }
export async function POST(request) {
  const body = await readBoundedJsonRequest(request, 2048).catch(() => null);
  if (!body || typeof body !== 'object' || Array.isArray(body)) return reply({ http_status: 400, body: { status: 'refused', reason: 'invalid_notification_input' } });
  return reply(await run(request, body));
}