GET
/api/public/should-showShould show
Returns whether the banner should be shown for this campaign and context. Call this before displaying the banner so you respect schedule and geolocation rules.
Query parameters
| Parameter | Required | Description |
|---|---|---|
| bannerId | Yes | Banner UUID from the dashboard |
| campaignId | Yes | Campaign ID (e.g. bnrflx-xxxxxxxx or raw UUID) |
| country | No | ISO 3166-1 alpha-2 (e.g. GB). Overrides geo from request IP; use for test links. |
| date | No | Date for schedule check (e.g. 2025-12-25). Overrides current time; use for test links. |
Response
JSON:
{ "show": true } // or false400 if bannerId or campaignId missing. 404 if banner or campaign not found (response still includes show: false).
Behavior
- Schedule: If the campaign has start/end dates, the current time (or date param) must fall within that range.
- Geolocation: If geo is enabled on the campaign, the server uses country from the query, or X-Vercel-IP-Country from the request. Campaign overrides (show/hide per country) are applied.
- If geo is disabled, the response is show: true when the schedule allows.
Example
const res = await fetch(
`${baseUrl}/api/public/should-show?bannerId=${bannerId}&campaignId=${campaignId}&country=GB`
);
const { show } = await res.json();
if (show) {
// display banner
}