Skip to main content
The state of ai impact assessment
Category: CMP Implementation

CMP API

Also known as: CMP API, Consent Management API, Consent Management Platform API
Simply put

A CMP API is a programming interface that a consent management platform (CMP) provides so that websites, apps, and other digital products can connect to it and work with a user's privacy and cookie choices. It lets developers integrate consent functionality into their own products and read or act on the preferences a user has been shown and has agreed to or declined. Note that some products use the term 'CMP' to mean a content marketing platform rather than a consent management platform, so the same acronym can refer to unrelated tools.

Formal definition

In the consent context, a CMP API is the interface a consent management platform exposes to callers (web and in-app) to access information about the privacy preferences disclosed to and obtained from a user, as defined for example in the IAB Global Privacy Platform CMP API Specification. Implementations vary: client-side APIs surface consent state to on-page or in-app callers, while server-side variants compute CMP functions server-side (for instance to enhance performance on web-based CTV platforms), which typically requires developers to build their own UI. Vendors also offer integration or REST APIs enabling website builders and digital agencies to embed CMP functionality into existing products. A CMP API supports technical integration of consent signaling but does not by itself determine whether consent obtained is valid under the ePrivacy rules governing access to information on a device or under the GDPR; those remain matters of legal configuration and judgment. The specific data model, signals, and behavior depend on the particular CMP and specification implemented, which is out of scope for this definition. Be aware that 'CMP API' is also used by content marketing platforms (a distinct, non-consent product category) and those usages fall outside this entry.

Why it matters

For most digital products, a CMP API is the connective layer that carries a user's cookie and privacy choices from the consent interface into the systems that act on them. Without a reliable way to read and pass consent state, tags, scripts, SDKs, and advertising integrations cannot know whether they are permitted to run for a given user. This makes the CMP API central to operationalizing consent: the legal decision to obtain opt-in consent (as generally required for non-essential cookies in most EU jurisdictions) or to honor opt-out signals (as commonly relied upon under US state privacy laws such as those in California) has to be enforced somewhere, and the CMP API is often where that enforcement is wired in.

The stakes are practical. If a CMP API is misconfigured, or if downstream tools ignore or misread the consent state it exposes, trackers can fire before or against a user's choices even though a consent banner appears to be working. That kind of gap between what a user was shown and what actually executed is precisely the sort of discrepancy that data protection authorities and private litigants scrutinize. It is worth stressing that a CMP API supports technical integration of consent signaling but does not by itself determine whether the consent obtained is valid under the ePrivacy rules governing access to information on a device or under the GDPR; those remain matters of legal configuration and judgment.

A further, more mundane risk is terminological confusion. The same acronym 'CMP' is used by content marketing platforms, which expose their own unrelated APIs, so teams evaluating or procuring tools should confirm they are looking at a consent management platform rather than a content marketing platform before drawing any compliance conclusions.

Who it's relevant to

Web and app developers
Developers use a CMP API to integrate consent functionality into their own products, reading the consent state and gating scripts, tags, and SDKs accordingly. Those working with server-side implementations, such as for web-based CTV platforms, should note that they may need to build their own UI, since the API computes CMP functions but does not necessarily provide a front end.
Website builders and digital agencies
Integration or REST APIs allow builders and agencies to embed CMP functionality into existing products and offer consent handling to their clients. Because the API is the mechanism that carries user choices through the stack, correct integration is essential; the tool supports compliance but does not replace the legal judgment needed to configure it for the relevant jurisdiction.
Privacy officers and data protection professionals
These readers rely on the CMP API layer to ensure that documented consent decisions are actually enforced downstream. They should treat the API as an implementation detail that must be validated against legal requirements, since a technically functioning API does not guarantee that consent is valid under the ePrivacy rules or the GDPR, or that opt-out signals are honored under applicable US state laws.
Procurement and vendor evaluation teams
Teams selecting tools should be aware that 'CMP' can refer to a content marketing platform as well as a consent management platform, and that both expose APIs. Confirming which product category is under review avoids conflating unrelated tools when assessing consent capabilities.

Inside CMP API

Consent retrieval methods
Functions exposed by a consent management platform that allow websites, tags, and scripts to query the current consent state of a user before placing or accessing information on the user's device or processing personal data.
Event and callback mechanisms
Interfaces that notify integrated scripts and vendors when a user's consent choices are made or updated, enabling tags to fire or suppress in line with the recorded preferences.
Consent string or signal encoding
The structured representation of a user's choices that the API surfaces to downstream parties. Where a CMP participates in the IAB Transparency and Consent Framework (TCF), this may take the form of a standardized TC string, though a CMP may also use proprietary formats.
Vendor and purpose granularity
API parameters that convey consent at the level of specific purposes (such as analytics or advertising) and specific vendors, supporting the specific and informed elements of valid consent under the GDPR in EU jurisdictions.
Integration points for tags and SDKs
Hooks that let tag managers, pixels, local storage scripts, and mobile SDKs check consent, reflecting that these non-cookie technologies generally fall within the same consent rules as cookies under EU law.
Signal ingestion
Capabilities that allow a CMP to receive external preference signals, such as Global Privacy Control, which are more commonly relevant under certain US state privacy frameworks that rely on opt-out rather than opt-in.

Common questions

Answers to the questions practitioners most commonly ask about CMP API.

Does implementing a CMP API mean our website is compliant with cookie consent law?
No. A CMP API is a technical interface that helps you capture, store, and communicate consent signals, but it does not by itself guarantee compliance. Compliance depends on how consent is designed and presented, whether it meets the applicable legal standard (for example, freely given, specific, informed, and unambiguous consent in most EU jurisdictions), and how the underlying data processing is handled. The API is a tool that supports compliance; it does not replace legal judgment or a properly configured consent flow.
Does a CMP API handle both the ePrivacy consent for storing cookies and the GDPR obligations for processing personal data?
Not automatically, and it is important not to conflate the two regimes. The ePrivacy Directive and its national implementations govern the placing of and access to information on a user's device, while the GDPR governs any subsequent processing of personal data. A CMP API can help you record and signal a user's consent choices, but you still need to ensure that any personal data processing that follows has its own valid basis and complies with GDPR requirements. Consent captured for one purpose does not necessarily satisfy the other.
How does a CMP API typically communicate consent status to other scripts and tags on a page?
A CMP API generally exposes methods and event listeners that other scripts, tag managers, or SDKs can query to determine whether consent has been given for particular purposes or vendors. Integrations commonly wait for a consent signal before firing analytics, advertising, or other non-essential technologies. The exact command structure varies by CMP and by any framework it supports, such as the IAB Transparency and Consent Framework, which defines its own API conventions.
Can a CMP API be used to block cookies and similar technologies before consent is obtained?
A CMP API can support consent-gated loading, where scripts and tags are held back until the user makes a choice, which is generally the expected approach in most EU jurisdictions for non-essential technologies. In practice this often requires configuring tags to check the API before executing, or integrating with a tag manager. Note that the same rules typically apply to pixels, local storage, and SDKs even though they are not literally cookies. Whether prior blocking is required depends on the applicable jurisdiction and the category of technology involved, and strictly necessary items are generally exempt.
How can a CMP API support consent logging and record-keeping?
Many CMP APIs allow you to retrieve the current consent state, which can be captured and stored to help demonstrate what a user chose and when. Maintaining such records may be relevant to accountability obligations under the GDPR in the EU. The specific data retained, its format, and its retention period are configuration decisions that depend on your own compliance requirements; the API provides access to the signals but does not determine what logging practices are adequate for your context.
Does a CMP API respond to browser-based signals such as Global Privacy Control?
Some CMPs offer support for interpreting signals like Global Privacy Control, which are more directly relevant under certain US state privacy laws that rely on opt-out mechanisms rather than the opt-in model common in the EU. Whether and how a particular CMP API surfaces or acts on such signals varies by product and configuration. You should confirm the behavior with your specific CMP and align it with the requirements of the jurisdictions in which you operate, as obligations differ between the EU, the UK, and individual US states.

Common misconceptions

Integrating a CMP API automatically makes a website compliant with cookie and privacy law.
A CMP API is a technical tool that supports compliance by conveying and enforcing consent states, but it does not replace legal judgment. Whether the underlying consent is valid, whether categories are correctly classified, and whether the ePrivacy and GDPR obligations are met still depend on configuration and legal analysis. Requirements also differ across the EU, the UK, and individual US states.
If the CMP API reports consent, all tracking technologies can fire freely regardless of type.
Consent obligations depend on the category of technology. Strictly necessary or essential cookies are generally exempt from consent, while analytics, advertising, and functional cookies typically require prior consent under EU law. The API only reflects the state configured for each purpose and vendor; it does not determine which technologies lawfully require consent.
A consent signal obtained through the API satisfies both the ePrivacy rules and the GDPR at once.
These are distinct legal regimes. The ePrivacy Directive and its national implementations govern the placing of and access to information on a device, while the GDPR governs any subsequent processing of personal data. Consent surfaced by a CMP API may need to address both, and satisfying one does not automatically satisfy the other.

Best practices

Query the CMP API for the current consent state before placing or accessing any non-essential cookie, pixel, local storage item, or SDK, since these technologies generally fall within the same consent rules under EU law.
Use the API's purpose- and vendor-level granularity so that tags fire only for the specific purposes and vendors the user has consented to, supporting the specific and informed requirements of valid consent in EU jurisdictions.
Subscribe to the API's update events so that changes or withdrawals of consent are respected in real time rather than relying on a single initial read.
Where the API ingests external signals such as Global Privacy Control, confirm how those are handled, keeping in mind such signals are more commonly relevant under certain US state opt-out frameworks than under EU opt-in rules.
Log the consent states retrieved through the API to support consent record-keeping obligations, but treat these logs as evidence rather than proof of overall lawfulness.
Treat the CMP API as a support for compliance, not a guarantee of it, and confirm category classifications and legal scope with qualified advice, since enforcement positions and guidance from data protection authorities continue to evolve.
Promotional banner for the Pentest Readiness checklist download