Scripts

Publish Script to Website

Use this API to publish the script configuration options for the specified website.

👍

For more information, see Publishing and Implementing Cookie Consent Scripts.

put/api/cmp/v1/domains/publish

Request

  • Base URL
    https://hostname
  • URL
    https://hostname/api/cmp/v1/domains/publish
  • Auth
    OAuth 2
    Client credentials
    Token URL: https://{hostname}/api/access/v1/oauth/token scopes: COOKIE, COOKIE_READ

Query parameters

scriptType'production' | 'test'

The type of script either production or test.

websitestring required

The website domain to target for the operation.

Request body

scriptVersionstring

(Optional) The SDK version to publish to. If not provided, the previously configured SDK version will be used.

languagesstring[]

The list of language codes for localized content.

publishIndividualLanguagesboolean

This flag indicates whether to publish scripts for individual languages separately.

requireReconsentboolean

This flag indicates whether user reconsent is required.

suppressBannerEnabledboolean

This flag indicates whether the consent banner display is suppressed.

suppressPCEnabledboolean

This flag indicates whether the preference center display is suppressed.

ccpaOptOutEnabledboolean

When the toggle is ON, the CCPA/CPRA opt-out icon will display next to the "Do Not Sell or Share" button whenever it is shown to site visitors.

gaTrackingEnabledboolean

When toggle is ON, Google Analytics events will be created and passed based on user interaction. You can also choose for gaEvent tracking on the banner to be associated with the acceptance of a category. The data-ignore-ga='true' attribute will override this configuration. Google Analytics integration also required.

gaAssignCategorystring

Name of the category to assign to Google Analytics events. Use 'AS' for always send. Unnecessary unless gaTrackingEnabled is true.

autoblockEnabledboolean

This flag indicates whether automatic blocking of cookies is enabled.

enableCommonTrackersboolean

This flag indicates whether common tracking technologies are enabled.

commonTrackersstring[]

Select the hosts that you want to autoblock. Only applicable when autoblockEnabled and enableCommonTrackers are true.

sameSiteNoneboolean

Sets the cookies used SameSite attribute to 'None'

separateCookieByDomainboolean

Only applicable when sameSiteNone is true.When cookies are created with partitioned state from an iframe, they are created specific to their top level site domain and are not shared with other top-level domains using the same iframe. This setting is ignored if sameSiteNone is false.

supportSPAboolean

Enabling this allows you to force the banner to reload, the same as it would on an actual page change.

supportCSPboolean

If enabled, the polyfill allows us to add inline styles, style tags with a nonce are allowed by the CSP

languageDetectionEnabledboolean

This flag indicates whether automatic language detection is enabled.

languageDetectionVisitorboolean

This flag indicates whether visitor-based language detection is enabled.

languageDetectionHtmlboolean

This flag indicates whether HTML-based language detection is enabled.

autoRefreshEnabledboolean

When a user makes any consent choice, the web page and consent banner will refresh automatically. This setting can further prevent unauthorized cookies from dropping without consent.

Example request

{
  "scriptVersion": "202607.1.0",
  "languages": [
    "Irish",
    "English - United States of America",
    "Greek"
  ],
  "publishIndividualLanguages": true,
  "requireReconsent": true,
  "regionRules": [
    {
      "ruleId": "f2229953-b4b5-4042-8cb9-b78038cc4c46",
      "ruleName": "Global"
    },
    {
      "ruleId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "ruleName": "Europe"
    }
  ],
  "gaAssignCategory": "C0001"
}

Response

OK

responseMsgstring

The response message returned from the operation.

publishVersionstring

The version number of the published script.

consentPolicyNamestring

The name of the consent policy that is applied.

autoBlockingboolean

This flag indicates whether automatic cookie blocking is enabled.

reconsentRequiredboolean

This flag indicates whether user reconsent is required.

publishedDatestring date-time

The date and time when the script was published.

userNamestring

The name of the user who performed the operation.

Example response

{
  "responseMsg": "Publish initiated successfully!",
  "publishVersion": "202503.2.0",
  "consentPolicyName": "Default Consent Policy",
  "autoBlocking": true,
  "reconsentRequired": true,
  "publishedDate": "2025-05-29T14:53:00Z",
  "userName": "User user"
}

Changes

No recorded changes to this operation across all 1 revision of this API.