Configuration Tree
A configuration tree is made of purposes, preferences and values coming from your entities library.
Preferences Management Platform is based on a unique configuration: the Configuration Tree. This is the data model used to guarantee the consistency of your data at all times, and on several widgets.
The configuration is built on 2 types of entities: purposes and preferences (which contain values) to ensure GDPR compliance. The purposes describe WHY a company/organization collects data and preferences allow a more granular choice to be offered to the user for a given purpose.
In the configuration tree, purposes, preferences and values are the core entities that you work with. Purposes contain preferences. Preferences own/contain values. And values contain preferences which can be nested up to 3 levels.

Get a Configuration Tree

To retrieve data of your Configuration Tree, send a GET request on /config-trees.
GET https://api.didomi.io/config-trees?organization_id=YOUR_ORG_ID
[
{
"id": "String",
"created_at": "Date",
"updated_at": "Date",
"organization_id": "String",
"selected_purposes": [
{
"id": "string",
"created_at": "Date",
"updated_at": "Date",
"purpose": {
"id": "String",
"organization_id": "String",
"description": {},
"details": {}
},
"purpose_id": "String",
"configuration_tree_id": "String",
"order": 0,
"selected_preferences": [
{
"id": "String",
"created_at": "Date",
"updated_at": "Date",
"selected_preferences": [
{
"id": "String",
"created_at": "Date",
"updated_at": "Date",
"selected_preferences": [
{}
],
"parent_id": "String",
"preference": {
"id": "String",
"created_at": "Date",
"updated_at": "Date",
"name": {
"en": "String"
},
"description": {
"en": "String"
},
"organization_id": "String",
"type": "single",
"values": [
{
"id": "String",
"created_at": "Date",
"updated_at": "Date",
"name": {
"en": "String"
},
}
]
},
"parent_selected_purpose_id": "String",
"parent_preference_value_id": "String",
"order": 0,
"configuration_tree_id": "String"
}
],
"parent_id": "String",
"preference": {
"id": "String",
"created_at": "Date",
"updated_at": "Date",
"name": {
"en": "String"
},
"description": {
"en": "String"
},
"organization_id": "String",
"type": "single",
"values": [
{
"id": "String",
"created_at": "Date",
"updated_at": "Date",
"name": {
"en": "String"
},
"selected_preferences": [
{}
]
}
]
},
"parent_selected_purpose_id": "String",
"parent_preference_value_id": "String",
"order": 0,
"configuration_tree_id": "String"
}
]
}
]
}
]
Optional query parameters:
  • $limit: number of max results to return
  • $skip: number of results to skip
  • $sort: represents sorting options. Accepts properties to sort as keys and -1 or 1 for sort direction
  • $with[]: list of entity names to join, values possible : purpose, preference

Edit your Configuration Tree

Add a purpose into your Configuration Tree

To add a purpose into your Configuration Tree, send a POST request on /config-trees/{configuration_tree_id}/selected-purposes.
To retrieve purposes from you Data Manager, you can send a GET request on /metadata/purposes.
POST https://api.didomi.io/config-trees/{configuration_tree_id}/selected-purposes?organization_id=YOUR_ORG_ID
{
"purpose_id": "YOUR_PURPOSE_ID",
"order": 0
}

Add a preference into your Configuration Tree

To add a preference into your Configuration Tree, send a POST request on /config-trees/{configuration_tree_id}/selected-preferences.
To retrieve preferences from you Preferences Library, you can send a GET request on /preferences.
POST https://api.didomi.io/config-trees/{configuration_tree_id}/selected-preferences?organization_id=YOUR_ORG_ID
{
"preference_id": "string",
"parent_selected_purpose_id": "string",
"order": 0,
"parent_id": "string",
"parent_preference_value_id": "string"
}
Element
Required
Description
configuration_tree_id
Yes
id of the Configuration Tree
organization_id
Yes
id of the organization
preference_id
Yes
id of the preference
parent_selected_purpose_id
Yes
id of the SelectedPurpose the SelectedPreference belongs to.
order
Yes
Order of SelectedPurpose in Configuration Tree
parent_id
Yes, if nesting inside a preference value
id of the SelectedPreference the nested SelectedPreference belongs to.
parent_preference_value_id
Yes, if nested inside a preference value
id of the value the nested SelectedPreference belongs to.

Delete a SelectedPurpose

To delete a purpose from your Configuration Tree, send a DELETE request on /config-trees/{configuration_tree_id}/selected-purposes/{id}.
All SelectedPreferences nested inside the SelectedPurpose will be removed too.
DELETE https://api.didomi.io/config-trees/{configuration_tree_id}/selected-purposes/{selected_purposes_id}?organization_id=YOUR_ORG_ID

Delete a SelectedPreference

To delete a preference from your Configuration Tree, send a DELETE request on /config-trees/{configuration_tree_id}/selected-preferences/{id}.
All SelectedPreferences nested inside the SelectedPreference will be removed too.
DELETE https://api.didomi.io/config-trees/{configuration_tree_id}/selected-preferences/{selected_preferences_id}?organization_id=YOUR_ORG_ID

Delete multiple SelectedPreferences

To delete multiple preferences from your Configuration Tree, send a DELETE request on /config-trees/{configuration_tree_id}/selected-preferences?id[]={id}.
All SelectedPreferences nested inside the SelectedPreference will be removed too.
DELETE https://api.didomi.io/config-trees/{configuration_tree_id}/selected-preferences/?organization_id=YOUR_ORG_ID&id[]=ID
id query params have to follow array format id[] pattern.
Copy link
On this page
Get a Configuration Tree
Edit your Configuration Tree
Add a purpose into your Configuration Tree
Add a preference into your Configuration Tree
Delete a SelectedPurpose
Delete a SelectedPreference
Delete multiple SelectedPreferences