From 2541d58fb1e1aa70b6056a2249af71d2ffe19c50 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Wed, 11 Mar 2026 11:04:13 -0400 Subject: [PATCH] feat(studio): add /api/status-override endpoint for status page banner override (#43641) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New feature — adds a platform-only API endpoint to Studio. ## What is the current behavior? `NEXT_PUBLIC_ONGOING_INCIDENT` is not exposed outside of the dashboard. ## What is the new behavior? `GET /api/status-override` returns `{ enabled: boolean }` indicating whether `NEXT_PUBLIC_ONGOING_INCIDENT` is set to `"true"`. The endpoint returns 404 on self-hosted and is added to the proxy allowlist for hosted platform access. This is so that the incident banner bot can detect whether an override is in place. --- apps/studio/pages/api/status-override.ts | 19 +++++++++++++++++++ apps/studio/proxy.ts | 1 + 2 files changed, 20 insertions(+) create mode 100644 apps/studio/pages/api/status-override.ts diff --git a/apps/studio/pages/api/status-override.ts b/apps/studio/pages/api/status-override.ts new file mode 100644 index 00000000000..145cc1dd4e3 --- /dev/null +++ b/apps/studio/pages/api/status-override.ts @@ -0,0 +1,19 @@ +import { IS_PLATFORM } from 'common' +import { NextApiRequest, NextApiResponse } from 'next' + +type ResponseData = { enabled: boolean } + +export default function handler(req: NextApiRequest, res: NextApiResponse) { + if (!IS_PLATFORM) { + return res.status(404).end() + } + + if (req.method !== 'GET') { + res.setHeader('Allow', ['GET']) + return res.status(405).end() + } + + return res.status(200).json({ + enabled: process.env.NEXT_PUBLIC_ONGOING_INCIDENT === 'true', + }) +} diff --git a/apps/studio/proxy.ts b/apps/studio/proxy.ts index d19ef58baf7..1b804831fb8 100644 --- a/apps/studio/proxy.ts +++ b/apps/studio/proxy.ts @@ -25,6 +25,7 @@ const HOSTED_SUPPORTED_API_URLS = [ '/edge-functions/body', '/generate-attachment-url', '/incident-status', + '/status-override', '/api/integrations/stripe-sync', '/content/graphql', ]