Users
Consent users represent end users of your applications or websites that Didomi is storing consent and preferences information for.
The User entity represents the latest consent status, for a given regulation, of an end user as well as additional metadata. That's the entity that you should query when you want to check if you have consent for a specific data processing or purpose.
The /consents/users endpoint of the API exposes the users managed by Didomi for your organizations. For a full reference of the endpoint and the resources that it returns, visit https://api.didomi.io/docs/.
Create a consent user
While you can specify the consent status for a user when you create it, we recommend using consent events instead for registering the user consent status as you will benefit from automated consent history and updates. Otherwise it would not be possible.
You can create a user by calling the POST /consents/users endpoint and providing basic information on the user as well as custom metadata that you want to associate with the user.
You can provide following information on users:
Organization user ID: a free-form user ID that is specific to your organization and that is used to identify the user within your organization. This could be an email address, a CRM ID, etc. It can be used to query users and events.
Metadata: a free-form object with any custom metadata that you want to associate with the user
Consents: the consent status of the user for purposes, preferences, channels and vendors for GDPR regulation
Example
POST /consents/users?organization_id={organization_id}
BODY
{
"organization_user_id": "[email protected]",
"metadata": {
... free-form object with user metadata
}
}See the API documentation for more details on this endpoint.
Query a consent user
You can query consent users that belong to your organization, and filter by user ID or organization user ID.
Paginate through users
Users are returned by pages of 100 and every query returns a cursor value that can be used to get the next page of results. You can iterate through pages of results by specifying the $cursor query-string parameter from the previous query. The returned cursor is null when there is no more result available.
Get the first 100 users that belong to an organization:
Get the following 100 users:
Get a user by its organization user ID
Get user's consent state for a given regulation
By default, user choices are registered under GDPR regulation.
For organizations managing users globally under various privacy laws, you can query the user's consent state for specific regulations by specifying it in the query-string parameter regulation (See all regulations supported by Didomi).
Include full configuration tree
The $include_full_tree query-string parameter provides enhanced functionality for building comprehensive user interfaces and analytics. When set to true, this parameter returns a complete representation of your organization's configuration tree merged with user consent data.
What this parameter provides
When $include_full_tree=true is included in your request:
Complete tree coverage: All purposes, preferences, and values from your configuration tree are included, even those for which the user hasn't made choices
Content information: Names and descriptions are included for purposes, preferences, and values when available from the configuration tree
Full value representation: The
all_valuesproperty shows both checked and unchecked values, enabling complete reconstruction of the consent configurationHierarchical structure: Parent-child relationships are maintained through the
parent_idpropertyTree metadata: The
config_treeproperty indicates which configuration tree was used
Example request
Enhanced response structure
With $include_full_tree=true, the response includes additional properties:
Key properties explained
from_tree: Indicates whether an item exists in your configuration tree (true) or was added from user consent data (false)parent_id: Establishes parent-child relationships between items, allowing reconstruction of the nested hierarchyall_values: Contains both checked and unchecked values, providing complete visibility into the consent configurationconfig_tree: Metadata about the configuration tree used to build the response
Status propagation
Consents API V2 does not support Status propagation. For Consents API V2, use One-click consent instead, which provides similar functionality through consent propagation at the purpose level.
Status propagation is a feature available in Consents API V1 (deprecated), where the user choice at a specific level automatically propagates to elements at the lower level.
For instance, if a user sets enabled to false at the purpose level, it overrides lower-level enabled values (for preferences and channels) that will also be set to false automatically.
A practical example is that enabled at the purpose level can be used to implement Subscribe to all / Unsubscribe to all features where a user can subscribe to / unsubscribe from all preferences (current and future) by setting enabled to false on the purpose. Future preferences under that purpose will automatically get enabled set to false.
For instance, if you are pushing the following consent status to the API:
This status from the event indicates that the user has disabled the purpose but enabled the preference. When updating the user status from the event, the status from the purpose will be propagated down to the preference and the API will store:
Disable integrations
If you are importing users already present in your systems and there is no need for these users to be forwarded to your integrations, you can add the query parameter $disable_integrations=true to your request to disable such forwarding.
One-click consent and user consent status
When one-click consent is enabled for a selected purpose in your Configuration Tree, preference values that were automatically set by propagation appear in the user consent status the same way as values explicitly set by the user.
The user consent status returned by the GET /consents/users endpoint does not include the propagation or from_propagation flags. These flags are only present in events (accessible via the /consents/events endpoint) to maintain the history of how values were set.
This means:
User consent status shows the final result after propagation is applied
Both propagated and explicitly set values appear the same way in the user consent status
To determine if a value was set by propagation, you must query the consent events history
For more information about one-click consent, see the Configuration Tree documentation and Events documentation.
User Schema
Users have the following schema:
Last updated