> For the complete documentation index, see [llms.txt](https://developers.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.didomi.io/api-and-platform/consents/users/users-schema.md).

# Users schema

{% hint style="info" %}
Organizations subscribed to Didomi after 18 January 2022 is utilizing API v2 by default.
{% endhint %}

Expand the accordions below to view the user schema and data dictionary.

{% hint style="warning" %}
**Note**: The `$include_full_tree=true` parameter can alter the shape of the schema. For your convenience, we provide separate data dictionaries and schemas for when the parameter changes the shape of the schema
{% endhint %}

<details>

<summary>User schema and data dictionary API v2 and v1 (Legacy) with <code>$include_full_tree=true</code></summary>

```jsonc
{
    /**
    * Didomi user ID
    */
    "id": "string",
    /**
    * A unique user ID provided by your organization. 
    * This could be an email, a phone number, an internal client ID, etc... 
    * It is used to link Didomi users to your internal systems.
    */
    "organization_user_id": "string",
    /**
    * Type of the external user ID defined by the organization
    */
    "organization_user_id_type": "string",
    /**
    * Organization ID that owns the user
    */
    "organization_id": "string",
    /**
    * Version number of the user record 
    */
    "version": 1,
    /**
    * Creation date of the user record
    */
    "created_at": "ISO-8601",
    /**
    * Last update date of the user record
    */
    "updated_at": null,
    /**
    * External email defined by the organization. 
    * Used to link the Didomi user with a user that the organization knows in their systems as an email
    */
    "email": "user@example.com",
    /**
    * External phone number defined by the organization. 
    * Used to link the Didomi user with a user that the organization knows in their systems as a phone number
    */
    "phone": "+15551234567",
    /**
    * Free-form metadata object for the user
    */
    "metadata": {},
    /**
    * API-assigned metadata for internal system properties
    */
    "api_metadata": {
        /**
        * Indicates whether this user entity represents a merge fix user. 
        * When true, this user was created by the API to persist merged consent state for mulitple user organization user IDs, with the organization user ID as the user ID.
        */
        "merge_fix_user": true,
        /**
        * Version number of the merge fix implementation. 
        * Used to track which version of the merge fix logic created this user entity.
        */        
        "merge_fix_version": 1
    },
    /**
    * Consent status of the user
    */
    "consents": {
        /**
        * Channels for which the end-user made choices
        * Note: This is a legacy property.
        */
        "channels": [
            {
                /**
                * Unique channel ID
                */
                "id": "string",
                /**
                * Whether the end-user has enabled this channel or not 
                * Note: A null value indicates that the user has not made a specific choice for the channel
                */
                "enabled": false,
                /**
                * Free-form metadata object
                */
                "metadata": {}
            }
        ],
        /**
        * Purposes (for both CMP and Preference Management Platform)
        */
        "purposes": [
            {
                /**
                * Unique identifier for the data processing purpose
                */
                "id": "string",
                /**
                * End-user's consent choice for this purpose.
                * true: consent given (user opted in)
                * false: consent denied (user opted out)
                * undefined: not specified
                */
                "enabled": true,
                /**
                * End-user's objection status for legitimate interest processing.
                * true: no objection (legitimate interest processing allowed)
                * false: objection raised (legitimate interest processing blocked)
                * undefined: not specified (legitimate interest not applicable)
                */
                "enabled_li": null,
                /**
                * Custom metadata for organization-specific data storage
                */
                "metadata": {},
                /**
                * Indicates whether this purpose exists in the configuration tree 
                * true: exists in configuration tree
                * false: added from user consent data
                * Note: Always present when using $include_full_tree=true.
                */
                "from_tree": true,
                /**
                * Localized names for the purpose from the configuration tree. 
                * Only present if the configuration tree has name content for this purpose.
                */
                "name": {},
                /**
                * Localized descriptions explaining the purpose from the configuration tree. 
                * Only present if the configuration tree has description content for this purpose.
                */
                "description": {},
                /**
                * Preferences for which the end-user has made choices 
                */
                "values": {
                    /**
                    * Preference selection containing the end-user's choice
                    * Note: Key is the configured ID of the preference
                    */
                    "PREFERENCE_ID": {
                        /**
                        * Preference values that the end-user has made choices for
                        */
                        "value": "string",
                        /**
                        * Indicates whether this preference exists in the configuration tree 
                        * true: exists in configuration tree
                        * false: added from user consent data
                        * Note: Always present when using $include_full_tree=true.
                        */
                        "from_tree": true,
                        /**
                        * Parent preference ID that this preference belongs to. 
                        * Can be null for top-level preferences or undefined if not specified.
                        */
                        "parent_id": null,
                        /**
                        * Name of the preference in the configuration tree
                        */
                        "name": {},
                        /**
                        * Description of the preference in the configuration tree
                        */
                        "description": {}
                    }
                }
            }
        ],
        /**
        * Vendors for which the end-user has made choices 
        */
        "vendors": {
            /**
            * List of vendors where end-user has explicitly given consent for data processing
            */
            "enabled": [
                "string"
            ],
            /**
            * List of vendors where end-user has explicitly denied consent for data processing
            */
            "disabled": [
                "string"
            ],
            /**
            * List of vendors where end-user allows legitimate interest processing
            */
            "enabled_li": [
                "string"
            ],
            /**
            * List of vendors where end-user objects to legitimate interest processing
            */
            "disabled_li": [
                "string"
            ]
        },
        /**
        * TCF consent string for the end-user (if it was available or generated at the time of consent collection)
        */
        "tcfcs": "string",
        /**
        * Timestamp of when consents were last updated
        */
        "updated_at": "ISO-8601",
        /**
        * Configuration tree metadata.
        * Note: Always present when $include_full_tree=true.
        */
        "config_tree": {
            /**
            * Unique ID of the configuration tree
            */
            "id": "string",
            /**
            * Date the configuration tree was created
            */
            "created_at": "ISO-8601",
            /**
            * Update date for the configuration tree
            */
            "updated_at": "ISO-8601"
        }
    },
    /**
    * Two-letter ISO code of the user country
    */
    "country": "US",
    /**
    * Two-letter ISO country code of the last submitted consent event for the user
    */
    "last_seen_country": "US"
}
```

<table><thead><tr><th width="173.066650390625">Key</th><th width="134.800048828125">Data type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>String</td><td>Didomi user ID</td></tr><tr><td><code>organization_user_id</code></td><td>String | null</td><td>A unique user ID provided by your organization. This could be an email, a phone number, an internal client ID, etc... It is used to link Didomi users to your internal systems.</td></tr><tr><td><code>organization_user_id_type</code></td><td>String | null</td><td>Type of the external user ID defined by the organization</td></tr><tr><td><code>organization_id</code></td><td>String</td><td>Organization ID that owns the user</td></tr><tr><td><code>version</code></td><td>Number</td><td>Version number of the user record </td></tr><tr><td><code>created_at</code></td><td>ISO 8601 Date</td><td>Creation date of the user record</td></tr><tr><td><code>updated_at</code></td><td>ISO 8601 Date | null</td><td>Last update date of the user record</td></tr><tr><td><code>email</code></td><td>String | null</td><td>External email defined by the organization. Used to link the Didomi user with a user that the organization knows in their systems as an email</td></tr><tr><td><code>phone</code></td><td>String | null</td><td>External phone number defined by the organization. Used to link the Didomi user with a user that the organization knows in their systems as a phone number</td></tr><tr><td><code>metadata</code></td><td>Object</td><td>Free-form metadata object for the user</td></tr><tr><td><code>api_metadata</code></td><td>Object</td><td>API-assigned metadata for internal system properties</td></tr><tr><td><code>api_metadata.merge_fix_user</code></td><td>Boolean</td><td>Indicates whether this user entity represents a merge fix user. When <code>true</code>, this user was created by the API to persist merged consent state for mulitple user organization user IDs, with the organization user ID as the user ID.</td></tr><tr><td><code>api_metadata.merge_fix_version</code></td><td>Number</td><td><p>Version number of the merge fix implementation. </p><p></p><p>Used to track which version of the merge fix logic created this user entity.</p></td></tr><tr><td><code>consents</code></td><td>Object</td><td>Consent status of the user</td></tr><tr><td><code>consents.channels</code></td><td>Array of Objects</td><td><p>Channels for which the end-user made choices</p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: This is a legacy property.</mark></p></td></tr><tr><td><code>consents.channels.id</code></td><td>String</td><td>Unique channel ID</td></tr><tr><td><code>consents.channels.enabled</code></td><td>Boolean | null</td><td><p>Whether the end-user has enabled this channel or not </p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: A <code>null</code> value indicates that the user has not made a specific choice for the channel</mark></p></td></tr><tr><td><code>consents.channels.metadata</code></td><td>Object</td><td>Free-form metadata object</td></tr><tr><td><code>consents.purposes</code></td><td>Array of Objects</td><td>Purposes (for both CMP and Preference Management Platform)</td></tr><tr><td><code>consents.purposes.id</code></td><td>String</td><td>Unique identifier for the data processing purpose</td></tr><tr><td><code>consents.purposes.enabled</code></td><td>Boolean | null</td><td><p>End-user's consent choice for this purpose.</p><ul><li><code>true</code>: consent given (user opted in)</li><li><code>false</code>: consent denied (user opted out)</li><li><code>undefined</code>: not specified</li></ul></td></tr><tr><td><code>consents.purposes.enabled_li</code></td><td>Boolean | null</td><td><p>End-user's objection status for legitimate interest processing.</p><ul><li><code>true</code>: no objection (legitimate interest processing allowed)</li><li><code>false</code>: objection raised (legitimate interest processing blocked)</li><li><code>undefined</code>: not specified (legitimate interest not applicable)</li></ul></td></tr><tr><td><code>consents.purposes.metadata</code></td><td>Object</td><td>Custom metadata for organization-specific data storage</td></tr><tr><td><code>consents.purposes.from_tree</code></td><td>Boolean</td><td><p>Indicates whether this purpose exists in the configuration tree </p><ul><li><code>true</code>: exists in configuration tree</li><li><code>false</code>: added from user consent data</li></ul><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: Always present when using <code>$include_full_tree=true</code>.</mark></p></td></tr><tr><td><code>consents.purposes.name</code></td><td>Object</td><td>Localized names for the purpose from the configuration tree. Only present if the configuration tree has name content for this purpose.</td></tr><tr><td><code>consents.purposes.description</code></td><td>Object</td><td>Localized descriptions explaining the purpose from the configuration tree. Only present if the configuration tree has description content for this purpose.</td></tr><tr><td><code>consents.purposes.values</code></td><td>Object</td><td>Preferences for which the end-user has made choices </td></tr><tr><td><code>consents.purposes.values.[PREFERENCE_ID]</code></td><td>Object</td><td><p>Preference selection containing the end-user's choice</p><p><br><mark style="background-color:$warning;"><strong>Note</strong>: Key is the configured ID of the preference</mark></p></td></tr><tr><td><code>consents.purposes.values.[PREFERENCE_ID].value</code></td><td>String</td><td>Preference values that the end-user has made choices for</td></tr><tr><td><code>consents.purposes.values.[PREFERENCE_ID].from_tree</code></td><td>Boolean</td><td><p>Indicates whether this preference exists in the configuration tree </p><ul><li><code>true</code>: exists in configuration tree</li><li><code>false</code>: added from user consent data</li></ul><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: Always present when using <code>$include_full_tree=true</code>.</mark></p></td></tr><tr><td><code>consents.purposes.values.[PREFERENCE_ID].parent_id</code></td><td>String | null</td><td>Parent preference ID that this preference belongs to. Can be <code>null</code> for top-level preferences or <code>undefined</code> if not specified.</td></tr><tr><td><code>consents.purposes.values.[PREFERENCE_ID].name</code></td><td>Object</td><td>Name of the preference in the configuration tree</td></tr><tr><td><code>consents.purposes.values.[PREFERENCE_ID].description</code></td><td>Object</td><td>Description of the preference in the configuration tree</td></tr><tr><td><code>consents.vendors</code></td><td>Object</td><td>Vendors for which the end-user has made choices </td></tr><tr><td><code>consents.vendors.enabled</code></td><td>Array</td><td>List of vendors where end-user has explicitly given consent for data processing</td></tr><tr><td><code>consents.vendors.disabled</code></td><td>Array</td><td>List of vendors where end-user has explicitly denied consent for data processing</td></tr><tr><td><code>consents.vendors.enabled_li</code></td><td>Array</td><td>List of vendors where end-user allows legitimate interest processing</td></tr><tr><td><code>consents.vendors.disabled_li</code></td><td>Array</td><td>List of vendors where end-user objects to legitimate interest processing</td></tr><tr><td><code>consents.tcfcs</code></td><td>String | null</td><td>TCF consent string for the end-user (if it was available or generated at the time of consent collection)</td></tr><tr><td><code>consents.updated_at</code></td><td>ISO 8601 Date | null</td><td>Timestamp of when consents were last updated</td></tr><tr><td><code>consents.config_tree</code></td><td>Object</td><td><p>Configuration tree metadata.</p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: Always present when <code>$include_full_tree=true</code>.</mark></p></td></tr><tr><td><code>consents.config_tree.id</code></td><td>String</td><td>Unique ID of the configuration tree</td></tr><tr><td><code>consents.config_tree.created_at</code></td><td>ISO 8601 Date </td><td>Date the configuration tree was created</td></tr><tr><td><code>consents.config_tree.updated_at</code></td><td>ISO 8601 Date </td><td>Update date for the configuration tree</td></tr><tr><td><code>country</code></td><td>String | null</td><td>Two-letter ISO code of the user country</td></tr><tr><td><code>last_seen_country</code></td><td>String | null</td><td>Two-letter ISO country code of the last submitted consent event for the user</td></tr></tbody></table>

</details>

<details>

<summary>User schema and data dictionary API v2 without <code>$include_full_tree=true</code></summary>

```jsonc
{
    /**
    * Didomi user ID
    */    
    "id": "string",
    /**
    * A unique user ID provided by your organization. 
    * This could be an email, a phone number, an internal client ID, etc... 
    * It is used to link Didomi users to your internal systems.
    */    
    "organization_user_id": "string",
    /**
    * Type of the external user ID defined by the organization
    */
    "organization_user_id_type": "string",
    /**
    * Organization ID that owns the user
    */
    "organization_id": "string",
    /**
    * Version number of the user record 
    */
    "version": 1,
    /**
    * Creation date of the user record
    */
    "created_at": "ISO-8601",
    /**
    * Last update date of the user record
    */
    "updated_at": null,
    /**
    * External email defined by the organization. 
    * Used to link the Didomi user with a user that the organization knows in their systems as an email
    */
    "email": "user@example.com",
    /**
    * External phone number defined by the organization. 
    * Used to link the Didomi user with a user that the organization knows in their systems as a phone number
    */
    "phone": "+15551234567",
    /**
    * Free-form metadata object for the user
    */
    "metadata": {},
    /**
    * API-assigned metadata for internal system properties
    */
    "api_metadata": {
        /**
        * Indicates whether this user entity represents a merge fix user. 
        * When true, this user was created by the API to persist merged consent state for mulitple user organization user IDs, with the organization user ID as the user ID.
        */
        "merge_fix_user": true,
        /**
        * Version number of the merge fix implementation. 
        * Used to track which version of the merge fix logic created this user entity.
        */     
        "merge_fix_version": 1
    },
    /**
    * Consent status of the user
    */
    "consents": {
        /**
        * Channels for which the end-user made choices
        * Note: This is a legacy property.
        */
        "channels": [
            {
                /**
                * Unique channel ID
                */
                "id": "string",
                /**
                * Whether the end-user has enabled this channel or not 
                * Note: A null value indicates that the user has not made a specific choice for the channel
                */
                "enabled": false,
                /**
                * Free-form metadata object
                */
                "metadata": {}
            }
        ],
        /**
        * Purposes (for both CMP and Preference Management Platform)
        */
        "purposes": [
            {
                /**
                * Unique identifier for the data processing purpose
                */
                "id": "string",
                /**
                * End-user's consent choice for this purpose.
                * true: consent given (user opted in)
                * false: consent denied (user opted out)
                * undefined: not specified
                */
                "enabled": true,
                /**
                * End-user's objection status for legitimate interest processing.
                * true: no objection (legitimate interest processing allowed)
                * false: objection raised (legitimate interest processing blocked)
                * undefined: not specified (legitimate interest not applicable)
                */
                "enabled_li": null,
                /**
                * Custom metadata for organization-specific data storage
                */
                "metadata": {},
                /**
                * Preferences for which the end-user has made choices 
                */
                "values": {

                    "PREFERENCE_ID": {
                        /**
                        * Preference values that the end-user has made choices for
                        */
                        "value": "string"
                    }
                }
            }
        ],
        /**
        * Vendors for which the end-user has made choices 
        */
        "vendors": {
            /**
            * List of vendors where end-user has explicitly given consent for data processing
            */
            "enabled": ["vendor_enabled_1"],
            /**
            * List of vendors where end-user has explicitly denied consent for data processing
            */
            "disabled": ["vendor_disabled_1"],
            /**
            * List of vendors where end-user allows legitimate interest processing
            */
            "enabled_li": ["vendor_li_enabled_1"],
            /**
            * List of vendors where end-user objects to legitimate interest processing
            */
            "disabled_li": ["vendor_li_disabled_1"]
        },
        /**
        * TCF consent string for the end-user (if it was available or generated at the time of consent collection)
        */
        "tcfcs": "string",
        /**
        * Timestamp of when consents were last updated
        */
        "updated_at": "ISO-8601"
    },
    /**
    * Two-letter ISO code of the user country
    */
    "country": "US",
    /**
    * Two-letter ISO country code of the last submitted consent event for the user
    */
    "last_seen_country": "US"
}
```

<table><thead><tr><th width="211.5999755859375">Key</th><th width="134.800048828125">Data type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>String</td><td>Didomi user ID</td></tr><tr><td><code>organization_user_id</code></td><td>String | null</td><td>A unique user ID provided by your organization. This could be an email, a phone number, an internal client ID, etc... It is used to link Didomi users to your internal systems.</td></tr><tr><td><code>organization_user_id_type</code></td><td>String | null</td><td>Type of the external user ID defined by the organization</td></tr><tr><td><code>organization_id</code></td><td>String</td><td>Organization ID that owns the user</td></tr><tr><td><code>version</code></td><td>Number</td><td>Version number of the user record. Used for optimistic locking</td></tr><tr><td><code>created_at</code></td><td>ISO 8601 Date</td><td>Creation date of the user record</td></tr><tr><td><code>updated_at</code></td><td>ISO 8601 Date | null</td><td>Last update date of the user record</td></tr><tr><td><code>email</code></td><td>String | null</td><td>External email defined by the organization. Used to link the Didomi user with a user that the organization knows in their systems as an email</td></tr><tr><td><code>phone</code></td><td>String | null</td><td>External phone number defined by the organization. Used to link the Didomi user with a user that the organization knows in their systems as a phone number</td></tr><tr><td><code>metadata</code></td><td>Object</td><td>Free-form metadata object for the user</td></tr><tr><td><code>api_metadata</code></td><td>Object</td><td>API-assigned metadata for internal system properties</td></tr><tr><td><code>api_metadata.merge_fix_user</code></td><td>Boolean</td><td>Indicates whether this user entity represents a merge fix user. When <code>true</code>, this user was created by the API to persist merged consent state for mulitple user organization user IDs, with the organization user ID as the user ID.</td></tr><tr><td><code>api_metadata.merge_fix_version</code></td><td>Number</td><td><p>Version number of the merge fix implementation. </p><p>Used to track which version of the merge fix logic created this user entity.</p></td></tr><tr><td><code>consents</code></td><td>Object</td><td>Consent status of the end-user</td></tr><tr><td><code>consents.channels</code></td><td>Array of Objects</td><td><p>Channels for which the end-user made choices</p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: This is a legacy property.</mark></p></td></tr><tr><td><code>consents.channels.id</code></td><td>String</td><td>Unique channel ID</td></tr><tr><td><code>consents.channels.enabled</code></td><td>Boolean | null</td><td><p>Whether the end-user has enabled this channel or not </p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: A <code>null</code> value indicates that the user has not made a specific choice for the channel</mark></p></td></tr><tr><td><code>consents.channels.metadata</code></td><td>Object</td><td>Free-form metadata object</td></tr><tr><td><code>consents.purposes</code></td><td>Array of Objects</td><td>Purposes (for both CMP and Preference Management Platform)</td></tr><tr><td><code>consents.purposes.id</code></td><td>String</td><td>Unique identifier for the data processing purpose</td></tr><tr><td><code>consents.purposes.enabled</code></td><td>Boolean | null</td><td><p></p><p>End-user's consent choice for this purpose.</p><ul><li><code>true</code>: consent given (user opted in)</li><li><code>false</code>: consent denied (user opted out)</li><li><code>undefined</code>: not specified</li></ul></td></tr><tr><td><code>consents.purposes.enabled_li</code></td><td>Boolean | null</td><td><p>End-user's objection status for legitimate interest processing.</p><ul><li><code>true</code>: no objection (legitimate interest processing allowed)</li><li><code>false</code>: objection raised (legitimate interest processing blocked)</li><li><code>undefined</code>: not specified (legitimate interest not applicable)</li></ul></td></tr><tr><td><code>consents.purposes.metadata</code></td><td>Object</td><td>Custom metadata for organization-specific data storage</td></tr><tr><td><code>consents.purposes.values</code></td><td>Object</td><td>Preferences for which the end-user has made choices </td></tr><tr><td><code>consents.purposes.values.{PREFERENCE_ID}</code></td><td>Object</td><td><p>Preference selection containing the end-user's choice</p><p><br><mark style="background-color:$warning;"><strong>Note</strong>: Key is the configured ID of the preference</mark></p></td></tr><tr><td><code>consents.purposes.values.{PREFERENCE_ID}.value</code></td><td>String</td><td>Preference values that the end-user has made choices for</td></tr><tr><td><code>consents.vendors</code></td><td>Object</td><td>Vendors for which the end-user has made choices </td></tr><tr><td><code>consents.vendors.enabled</code></td><td>Array</td><td>List of vendors where end-user has explicitly given consent for data processing</td></tr><tr><td><code>consents.vendors.disabled</code></td><td>Array</td><td>List of vendors where end-user has explicitly denied consent for data processing</td></tr><tr><td><code>consents.vendors.enabled_li</code></td><td>Array</td><td>List of vendors where end-user allows legitimate interest processing</td></tr><tr><td><code>consents.vendors.disabled_li</code></td><td>Array</td><td>List of vendors where end-user objects to legitimate interest processing</td></tr><tr><td><code>consents.tcfcs</code></td><td>String</td><td>TCF consent string for the end-user (if it was available or generated at the time of consent collection)</td></tr><tr><td><code>consents.updated_at</code></td><td>ISO 8601 Date | null</td><td>Timestamp of when consents were last updated</td></tr><tr><td><code>country</code></td><td>String | null</td><td>Two-letter ISO code of the user country</td></tr><tr><td><code>last_seen_country</code></td><td>String | null</td><td>Two-letter ISO country code of the last submitted consent event for the user</td></tr></tbody></table>

</details>

<details>

<summary>User schema and data dictionary API v1 (Legacy) without <code>$include_full_tree=true</code></summary>

```jsonc
{
    /**
    * Didomi user ID
    */
    "id": "string",
    /**
    * A unique user ID provided by your organization. 
    * This could be an email, a phone number, an internal client ID, etc... 
    * It is used to link Didomi users to your internal systems.
    */
    "organization_user_id": "string",
    /**
    * Type of the external user ID defined by the organization
    */
    "organization_user_id_type": "string",
    /**
    * Organization ID that owns the user
    */
    "organization_id": "string",
    /**
    * Version number of the user record
    */
    "version": 1,
    /**
    * Creation date of the user record
    */
    "created_at": "ISO-8601",
    /**
    * Last update date of the user record
    */
    "updated_at": null,
    /**
    * External email defined by the organization. 
    * Used to link the Didomi user with a user that the organization knows in their systems as an email
    */
    "email": "user@example.com",
    /**
    * External phone number defined by the organization. 
    * Used to link the Didomi user with a user that the organization knows in their systems as a phone number
    */
    "phone": "+15551234567",
    /**
    * Free-form metadata object for the user
    */
    "metadata": {},
    /**
    * API-assigned metadata for internal system properties
    */
    "api_metadata": {
        /**
        * Indicates whether this user entity represents a merge fix user. 
        * When true, this user was created by the API to persist merged consent state for mulitple user organization user IDs, with the organization user ID as the user ID.
        */        
        "merge_fix_user": true,
        /**
        * Version number of the merge fix implementation. 
        * Used to track which version of the merge fix logic created this user entity.
        */
        "merge_fix_version": 1
    },
    /**
    * Consent status of the end-user
    */
    "consents": {
        /**
        * Channels for which the end-user made choices
        * Note: This is a legacy property.
        */
        "channels": [
            {
                /**
                * Unique channel ID
                */
                "id": "string",
                /**
                * Whether the end-user has enabled this channel or not 
                * Note: A null value indicates that the user has not made a specific choice for the channel
                */
                "enabled": true,
                /**
                * Free-form metadata object
                */
                "metadata": {}
            }
        ],
        /**
        * Purposes (for both CMP and Preference Management Platform)
        */
        "purposes": [
            {
                /**
                * Unique identifier for the data processing purpose
                */
                "id": "string",
                /**
                * End-user's consent choice for this purpose.
                * true: consent given (user opted in)
                * false: consent denied (user opted out)
                * undefined: not specified
                */
                "enabled": true,
                /**
                * End-user's objection status for legitimate interest processing.
                * true: no objection (legitimate interest processing allowed)
                * false: objection raised (legitimate interest processing blocked)
                * undefined: not specified (legitimate interest not applicable)
                */
                "enabled_li": null,
                /**
                * Custom metadata for organization-specific data storage
                */
                "metadata": {},
                /**
                * Communication channels enabled at the purpose level
                */
                "channels": [
                    {
                        /**
                        * Unique channel ID
                        */
                        "id": "string",
                        /**
                        * Whether the end-user has enabled this channel or not 
                        * Note: A null value indicates that the user has not made a specific choice for the channel
                        */
                        "enabled": true,
                        /**
                        * Custom metadata for the channel
                        */
                        "metadata": {}
                    }
                ],
                /**
                * Nested preference structure providing granular consent control. 
                * Each preference can have its own enabled state, metadata, and channel overrides.
                */
                "preferences": [
                    {
                        /**
                        * Unique identifier for the preference within its parent purpose
                        */
                        "id": "string",
                        /**
                        * End-user's choice for this specific preference.
                        * true: explicitly enabled 
                        * false: explicitly disabled
                        * null: no preference set (inherits from parent purpose or defaults)
                        */
                        "enabled": true,
                        /**
                        * Custom metadata for preference-specific data storage
                        */
                        "metadata": {},
                        /**
                        * Communication channels enabled at the preference level
                        */
                        "channels": [
                            {
                                /**
                                * Unique channel ID
                                */
                                "id": "string",
                                /**
                                * Whether the end-user has enabled this channel or not 
                                * Note: A null value indicates that the user has not made a specific choice for the channel
                                */
                                "enabled": true,
                                /**
                                * Custom metadata for the channel
                                */
                                "metadata": {}
                            }
                        ]
                    }
                ]
            }
        ],
        /**
        * Vendors for which the end-user has made choices 
        */
        "vendors": {
            /**
            * List of vendors where end-user has explicitly given consent for data processing
            */
            "enabled": ["vendor_enabled_1"],
            /**
            * List of vendors where end-user has explicitly denied consent for data processing
            */
            "disabled": ["vendor_disabled_1"],
            /**
            * List of vendors where end-user allows legitimate interest processing
            */
            "enabled_li": ["vendor_li_enabled_1"],
            /**
            * List of vendors where end-user objects to legitimate interest processing
            */
            "disabled_li": ["vendor_li_disabled_1"]
        },
        /**
        * TCF consent string for the end-user (if it was available or generated at the time of consent collection)
        */
        "tcfcs": "string",
        /**
        * Timestamp of when consents were last updated
        */
        "updated_at": "ISO-8601"
    },
    /**
    * Two-letter ISO code of the user country
    */
    "country": "US",
    /**
    * Two-letter ISO country code of the last submitted consent event for the user
    */
    "last_seen_country": "US"
}
```

<table><thead><tr><th width="211.5999755859375">Key</th><th width="134.800048828125">Data type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>String</td><td>Didomi user ID</td></tr><tr><td><code>organization_user_id</code></td><td>String | null</td><td>A unique user ID provided by your organization. This could be an email, a phone number, an internal client ID, etc... It is used to link Didomi users to your internal systems.</td></tr><tr><td><code>organization_user_id_type</code></td><td>String | null</td><td>Type of the external user ID defined by the organization</td></tr><tr><td><code>organization_id</code></td><td>String</td><td>Organization ID that owns the user</td></tr><tr><td><code>version</code></td><td>Number</td><td>Version number of the user record. Used for optimistic locking</td></tr><tr><td><code>created_at</code></td><td>ISO 8601 Date</td><td>Creation date of the user record</td></tr><tr><td><code>updated_at</code></td><td>ISO 8601 Date | null</td><td>Last update date of the user record</td></tr><tr><td><code>email</code></td><td>String | null</td><td>External email defined by the organization. Used to link the Didomi user with a user that the organization knows in their systems as an email</td></tr><tr><td><code>phone</code></td><td>String | null</td><td>External phone number defined by the organization. Used to link the Didomi user with a user that the organization knows in their systems as a phone number</td></tr><tr><td><code>metadata</code></td><td>Object</td><td>Free-form metadata object for the user</td></tr><tr><td><code>api_metadata</code></td><td>Object</td><td>API-assigned metadata for internal system properties</td></tr><tr><td><code>api_metadata.merge_fix_user</code></td><td>Boolean</td><td>Indicates whether this user entity represents a merge fix user. When <code>true</code>, this user was created by the API to persist merged consent state for mulitple user organization user IDs, with the organization user ID as the user ID.</td></tr><tr><td><code>api_metadata.merge_fix_version</code></td><td>Number</td><td><p>Version number of the merge fix implementation. <br></p><p>Used to track which version of the merge fix logic created this user entity.</p></td></tr><tr><td><code>consents</code></td><td>Object</td><td>Consent status of the end-user</td></tr><tr><td><code>consents.channels</code></td><td>Array of Objects</td><td><p>Channels for which the end-user made choices</p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: This is a legacy property.</mark></p></td></tr><tr><td><code>consents.channels.id</code></td><td>String</td><td>Unique channel ID</td></tr><tr><td><code>consents.channels.enabled</code></td><td>Boolean | null</td><td><p>Whether the end-user has enabled this channel or not </p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: A <code>null</code> value indicates that the user has not made a specific choice for the channel</mark></p></td></tr><tr><td><code>consents.channels.metadata</code></td><td>Object</td><td>Free-form metadata object</td></tr><tr><td><code>consents.purposes</code></td><td>Array of Objects</td><td>Purposes (for both CMP and Preference Management Platform)</td></tr><tr><td><code>consents.purposes.id</code></td><td>String</td><td>Unique identifier for the data processing purpose</td></tr><tr><td><code>consents.purposes.enabled</code></td><td>Boolean | null</td><td><p>End-user's consent choice for this purpose.</p><ul><li><code>true</code>: consent given (user opted in)</li><li><code>false</code>: consent denied (user opted out)</li><li><code>undefined</code>: not specified</li></ul></td></tr><tr><td><code>consents.purposes.enabled_li</code></td><td>Boolean | null</td><td><p>End-user's objection status for legitimate interest processing.</p><ul><li><code>true</code>: no objection (legitimate interest processing allowed)</li><li><code>false</code>: objection raised (legitimate interest processing blocked)</li><li><code>undefined</code>: not specified (legitimate interest not applicable)</li></ul></td></tr><tr><td><code>consents.purposes.metadata</code></td><td>Object</td><td>Custom metadata for organization-specific data storage</td></tr><tr><td><code>consents.purposes.channels</code></td><td>Array of Objects</td><td>Communication channels enabled at the purpose level</td></tr><tr><td><code>consents.purposes.channels.id</code></td><td>String</td><td>Unique channel ID</td></tr><tr><td><code>consents.purposes.channels.enabled</code></td><td>Boolean | null</td><td><p>Whether the end-user has enabled this channel or not </p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: A <code>null</code> value indicates that the user has not made a specific choice for the channel</mark></p></td></tr><tr><td><code>consents.purposes.channels.metadata</code></td><td>Object</td><td>Custom metadata for the channel</td></tr><tr><td><code>consents.purposes.preferences</code></td><td>Array of Objects</td><td>Nested preference structure providing granular consent control. Each preference can have its own enabled state, metadata, and channel overrides.</td></tr><tr><td><code>consents.purposes.preferences.id</code></td><td>String</td><td>Unique identifier for the preference within its parent purpose</td></tr><tr><td><code>consents.purposes.preferences.enabled</code></td><td>Boolean | null</td><td><p>End-user's choice for this specific preference.</p><ul><li><code>true</code>: explicitly enabled </li><li><code>false</code>: explicitly disabled</li><li><code>null</code>: no preference set (inherits from parent purpose or defaults)</li></ul></td></tr><tr><td><code>consents.purposes.preferences.metadata</code></td><td>Object</td><td>Custom metadata for preference-specific data storage</td></tr><tr><td><code>consents.purposes.preferences.channels</code></td><td>Array of Objects</td><td>Communication channels enabled at the preference level</td></tr><tr><td><code>consents.purposes.preferences.channels.id</code></td><td>String</td><td>Unique channel ID</td></tr><tr><td><code>consents.purposes.preferences.channels.enabled</code></td><td>Boolean | null</td><td><p>Whether the end-user has enabled this channel or not </p><p></p><p><mark style="background-color:$warning;"><strong>Note</strong>: A <code>null</code> value indicates that the user has not made a specific choice for the channel</mark></p></td></tr><tr><td><code>consents.purposes.preferences.channels.metadata</code></td><td>Object</td><td>Custom metadata for the channel</td></tr><tr><td><code>consents.vendors</code></td><td>Object</td><td>Vendors for which the end-user has made choices </td></tr><tr><td><code>consents.vendors.enabled</code></td><td>Array</td><td>List of vendors where end-user has explicitly given consent for data processing</td></tr><tr><td><code>consents.vendors.disabled</code></td><td>Array</td><td>List of vendors where end-user has explicitly denied consent for data processing</td></tr><tr><td><code>consents.vendors.enabled_li</code></td><td>Array</td><td>List of vendors where end-user allows legitimate interest processing</td></tr><tr><td><code>consents.vendors.disabled_li</code></td><td>Array</td><td>List of vendors where end-user objects to legitimate interest processing</td></tr><tr><td><code>consents.tcfcs</code></td><td>String</td><td>TCF consent string for the end-user (if it was available or generated at the time of consent collection)</td></tr><tr><td><code>consents.updated_at</code></td><td>ISO 8601 Date | null</td><td>Timestamp of when consents were last updated</td></tr><tr><td><code>country</code></td><td>String | null</td><td>Two-letter ISO code of the user country</td></tr><tr><td><code>last_seen_country</code></td><td>String | null</td><td>Two-letter ISO country code of the last submitted consent event for the user</td></tr></tbody></table>

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.didomi.io/api-and-platform/consents/users/users-schema.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
