Skip to main content

4. Handle consents

In this step, a user will give consent to your application for using their email address for advertising.

Following request from the events API registers a consent for a user.

curl --request POST '' \
--header 'Authorization: Bearer user_token' \
--header 'Content-Type: application/json' \
--data-raw '{
"consent_id": "id_of_the_consent_legal_base"

Invoke the endpoint after you have authenticated a user. Use the consent id, obtained during legal base configuration step.

function submit() {
const email = document.getElementById("email-field").value

.then(resp => resp.text())
.then(token => {
document.getElementById('devkit').setAttribute('api-token', `${token}`)

return fetch('', {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`
body: JSON.stringify({ consent_id: "id_of_the_consent_legal_base" })


The given consent is now stored in the PCE. A user will see it in the Privacy Request Interface and it will be visible in the Compliance Timeline when rewieving a privacy request.