Create consent event
When an end-user gives consent to a set of purposes or vendors, create a consent event to register the user choices by calling the POST /consents/events endpoint.
Create consent event overview
A consent event consists of a set of partial choices, related to a specific regulation, from a user that will be merged into the user consent status. You can also send additional user information like a new ID or custom metadata. When pushing consent events, you do not need to know the prior consent status of the user and the consent information you are pushing will be automatically merged into the user consent status of the Users endpoints.
Below is an example of an end-user giving consent to the purpose "purpose_id":
POST /consents/events?organization_id={organization_id}
BODY
{
"user": {
"organization_user_id": "user@domain.com",
"metadata": {
"custom_key": "value"
}
},
/**
* regulation is optional
* if regulation is not specified,
* the consent will be stored under GDPR regulation
*/
"regulation": "cpra" // gdpr...
"consents": {
"purposes": [
{
"id": "purpose_id",
"enabled": true
}
]
}
}You can specify the user.organization_user_id field with your own organization user ID.
If you do not specify any user ID, a random ID will be automatically created for the user.
Click here to view the API specification for this endpoint.
One-click consent
When a selected purpose has one-click consent enabled in your Preference Management Platform (PMP) configuration tree, the API automatically applies propagation logic when processing events. This means that when an end-user accepts or rejects a purpose with propagation enabled:
The API automatically sets all multi-choice preference values for that purpose
The event is enriched with
propagation: trueon the purposeEach preference value includes a
from_propagationflag indicating whether it was set by propagation (true) or explicitly by the user (false)Explicit end-user choices in the same request always take precedence over propagated values
Example:
If you submit an event enabling a purpose that has propagation configured, the stored event includes all propagated preference values:
For more information about one-click consent, see the Configuration Tree documentation.
Attach proofs to consent event
If you are collecting physical proofs of consents from your end-users (signatures, forms, etc.), you can attach them to the created events. Add your files as base64-encoded data URIs in the proofs property:
Files must be smaller than 10mb and their type must be one of the following formats: PDF, PNG, JPG, GIF, DOCX, DOC, MSG. You can attach a maximum of 5 proofs per event.
Last updated