For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Click here if your consent events require approvals to learn more about pending consent events.

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.

By default, consent events are stored under GDPR regulation. In order to register end-user choices for another regulation, you need to specify it in the request's payload.

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.

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: true on the purpose

  • Each preference value includes a from_propagation flag 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.

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