Skip to documentation content

Banners

List and create consent banners with the CookieBeam REST API.

The banners endpoints list your team's banners and create new ones. Both also accept a dashboard session instead of an API key — that is how the CookieBeam dashboard calls them — but integrations should use a key.

List banners

GET /api/v1/banners

Requires the banners:read scope. Returns every banner on the key's team:

{
  "data": {
    "banners": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "Main site",
        "domain": "https://example.com",
        "isActive": true,
        "configuration": {
          "layout": "banner",
          "position": "bottom",
          "primaryColor": "#000000",
          "secondaryColor": "#ffffff",
          "textColor": "#333333",
          "accentColor": "#007bff"
        },
        "compliance": {
          "gdpr": true,
          "ccpa": false,
          "lgpd": false
        },
        "createdAt": "2026-08-01T12:00:00.000Z",
        "updatedAt": "2026-08-01T12:00:00.000Z"
      }
    ]
  },
  "version": "v1"
}

Create a banner

POST /api/v1/banners

Requires the banners:write scope (a live key; test keys are read-only). The body:

FieldTypeRequiredNotes
namestringyes1–255 characters
domainstringyesBare hostnames are normalized to an https:// URL; the result must be a valid domain (or localhost)
configurationobjectyesAppearance settings; every field inside has a default
configuration.layoutstringnobanner (default), modal, or inline
configuration.positionstringnotop, bottom (default), or center
configuration.primaryColorstringnoDefault #000000
configuration.secondaryColorstringnoDefault #ffffff
configuration.textColorstringnoDefault #333333
configuration.accentColorstringnoDefault #007bff
gdprEnabledbooleannoDefault true
ccpaEnabledbooleannoDefault false
lgpdEnabledbooleannoDefault false

Example request:

{
  "name": "Main site",
  "domain": "example.com",
  "configuration": {
    "layout": "banner",
    "position": "bottom"
  },
  "gdprEnabled": true
}

A successful create returns HTTP 201 with the new banner in the same shape as the list above:

{
  "data": {
    "banner": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "Main site",
      "domain": "https://example.com",
      "isActive": true,
      "configuration": {
        "layout": "banner",
        "position": "bottom",
        "primaryColor": "#000000",
        "secondaryColor": "#ffffff",
        "textColor": "#333333",
        "accentColor": "#007bff"
      },
      "compliance": { "gdpr": true, "ccpa": false, "lgpd": false },
      "createdAt": "2026-08-13T12:00:00.000Z",
      "updatedAt": "2026-08-13T12:00:00.000Z"
    }
  },
  "version": "v1"
}

Creation also registers the domain for consent collection and prepares the banner's production environment, in the same transaction, so a banner created through the API is ready for the same publish and install flow as one created in the dashboard.

Errors

HTTP statusCause
400Validation failed. The body includes a details array describing each invalid field
401No API key and no dashboard session, or an invalid key
403plan_required, missing_scope, or test_key_read_only — see Authentication
405The endpoint does not support the HTTP method used

A validation failure looks like this:

{
  "data": {
    "error": "Validation failed",
    "details": [
      { "message": "Domain must be a valid domain (e.g., example.com)" }
    ]
  },
  "version": "v1"
}