GET/api/public/campaign-config

Campaign config

Returns runtime config for a campaign: show/hide decision and campaign content fields. Use this when your frontend needs both targeting rules and campaign-specific text/image values.

Query parameters

ParameterRequiredDescription
bannerIdYesBanner UUID from the dashboard
campaignIdYesCampaign ID (e.g. bnrflx-xxxxxxxx or raw UUID)
countryNoISO 3166-1 alpha-2 override for geo testing
dateNoDate/time override for schedule testing

Response

{
  "show": true,
  "campaignId": "6f8d...uuid",
  "contentFields": [
    { "id": "1", "key": "headline", "label": "Headline", "type": "text", "value": "Summer Sale" },
    { "id": "2", "key": "subcopy", "label": "Subcopy", "type": "text", "value": "Up to 40% off" }
  ]
}

Example

const res = await fetch(
  `${baseUrl}/api/public/campaign-config?bannerId=${bannerId}&campaignId=${campaignId}`
);
const { show, contentFields } = await res.json();
if (show) {
  const headline = contentFields.find((f) => f.key === 'headline')?.value;
  // render popup/banner with campaign-specific content
}