Banners
List your team's consent banners and create new ones with the CookieBeam REST API, using an API key or a dashboard session.
Last updated:
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.
To read and change a banner's themes and design settings, use the banner design endpoints under /api/v1/banners/{bannerId}/design/....
List banners
GET /api/v1/banners
Requires the banners:read scope. Test keys work. Returns every banner on the key's team (only the allowed banners for a banner-restricted key). The list is not paginated.
curl https://cookiebeam.com/api/v1/banners \
-H "Authorization: Bearer $COOKIEBEAM_API_KEY"
{
"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月01日T12:00:00.000Z",
"updatedAt": "2026年08月01日T12:00:00.000Z"
}
]
},
"version": "v1"
}
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | The banner's internal ID. Use it for the banner design endpoints and for POST /api/v1/consent/log |
name | string | |
domain | string | The banner's primary domain as an https:// URL |
isActive | boolean | |
configuration | object | Basic appearance fields stored on the banner record. Detailed design settings live in the banner's themes; read them with the banner design endpoints |
compliance | object | Which legal-framework flags are switched on: gdpr, ccpa, lgpd |
createdAt, updatedAt | string (ISO 8601) |
The public Banner ID that appears in the loader script URL is a different value. The cross-device consent and form consent endpoints take the public ID; each page says which one it needs.
Create a banner
POST /api/v1/banners
Requires the banners:write scope and a live key (test keys are read-only), on a key that is not restricted to specific banners. Accepts an Idempotency-Key. The body:
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | yes | 1–255 characters |
domain | string | yes | The site's address: a bare hostname or a pasted URL. The banner stores https://<host>, lower case, without a path, query or port, and with an international domain in its xn-- form. It must be a public domain (a name under a public suffix, such as example.com or shop.example.co.uk) or a public IP address. Email addresses, user names before an @, ports other than the default, schemes other than http and https, localhost, private and link-local IP addresses and local-only names such as .local or .internal are refused with 400 invalid_request. Add local or intranet hosts as extra domains in the dashboard |
configuration | object | yes | Stored on the banner record and returned as sent. These fields don't change the published banner: its look comes from the default theme the banner is created with. Change that theme with the banner design endpoints. Every field inside has a default |
configuration.layout | string | no | banner (default), modal, or inline |
configuration.position | string | no | top, bottom (default), or center |
configuration.primaryColor | string | no | Default #000000 |
configuration.secondaryColor | string | no | Default #ffffff |
configuration.textColor | string | no | Default #333333 |
configuration.accentColor | string | no | Default #007bff |
gdprEnabled | boolean | no | Default true |
ccpaEnabled | boolean | no | Default false |
lgpdEnabled | boolean | no | Default false |
curl -X POST https://cookiebeam.com/api/v1/banners \
-H "Authorization: Bearer $COOKIEBEAM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"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月13日T12:00:00.000Z",
"updatedAt": "2026年08月13日T12: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. A team that has reached its plan's banner limit gets HTTP 403 plan_required.
Errors
| HTTP status | Code | Cause |
|---|---|---|
| 400 | invalid_request | Validation failed. details lists each invalid field |
| 401 | unauthorized, invalid_key, revoked_key, expired_key | No API key and no dashboard session, or an invalid key |
| 403 | plan_required | The plan does not include API access, or the banner limit is reached (create) |
| 403 | missing_scope, test_key_read_only, key_restricted | See Authentication |
| 405 | method_not_allowed | The endpoint does not support the HTTP method used |
| 409, 422 | idempotency_in_progress, idempotency_key_reused | See Safe retries |
| 429 | rate_limited | See Rate limits |
A validation failure looks like this:
{
"data": {
"error": "Validation failed",
"code": "invalid_request",
"details": [
{ "message": "That looks like an email address. Enter your website address." }
],
"requestId": "9b2e5f0c-8d7a-4e0b-9c1d-2f3a4b5c6d7e"
},
"version": "v1"
}