Customize user schema
In Mosaic, each user record includes a set of standard identity attributes such as name
, birthday
, and phone
. To support more granular business needs, you can extend this default profile by defining a custom user schema.
Using the User schema wizard in the Admin Portal (B2C or B2B Identity > Users > Edit Schema), tenant administrators can add custom attributes to the user profile in addition to the built-in ones. These attributes become part of the user record and are available during creation, update, and retrieval operations across the tenant. They can be used throughout user management flows and accessed via platform APIs.
For example, you can use custom attributes to support:
-
Store and manage user preferences related to privacy and tracking:
-
cookieConsent
(Boolean or String) -
dataSharingConsentVersion
(String or Number) -
privacyNoticeAcceptedAt
(Date) -
marketingOptIn
(Boolean) These fields can help enforce compliance with privacy regulations like GDPR or CCPA.
-
-
Capture user profile extensions relevant to shopping behavior or loyalty programs:
-
loyaltyTier
(String — e.g., "Gold", "Silver", "Basic") -
preferredStoreLocation
(String) -
membershipType
(String — e.g., "Premium", "Standard") -
discountEligibility
(Boolean) -
wishlistCategories
(Array of Strings) These attributes can be used to personalize the user experience, enable segmentation, and support targeted promotions.
-
Custom attributes definition
To define custom attributes, navigate to B2C or B2B Identity > Users > Edit Schema in the Admin Portal.
Each tenant can define up to 40 custom attributes. For each attribute, you’ll set:
- Attribute name and type
- Attribute configuration (e.g., default value, mandatory, searchable)
Attribute types
The following data types are supported for custom attributes. They must comply with the following size and structure constraints:
Type | Limit |
---|---|
String | Up to 512 characters |
Number | 64-bit float |
Date | ISO 8601 format |
Valid email structure | |
Phone | Valid international phone format |
JSON | Maximum size: 10 KB |
Array | Any supported type |
When using complex types such as JSON or arrays, follow these structural rules:
-
A
JSON
object can contain nested key-value pairs and embedded objects.{ "consentPreferences": { "analytics": "yes", "marketing": "no", "functional": "yes" } }
-
An
Array
can include elements of any supported type, such as strings, numbers, dates, or JSON objects:[ { "program": "Gold Membership", "status": "active", "joinedAt": "2023-04-12" }, { "program": "Referral Program", "status": "pending", "joinedAt": "2024-01-20" } ]
Attribute configuration
Each custom attribute can be configured with the following properties:
- Default value : Sets a default value for the attribute, which remains until changed in the application.
- Mandatory : When enabled, the attribute must be provided during user creation.
- Indexed : When enabled, makes the attribute searchable in the Admin Portal user search . This setting can only be configured when the attribute is created and cannot be changed later. A maximum of 5 indexed attributes is allowed per tenant.
Note
These properties are disabled by default, and once enabled they are not applied retroactively. If you enable or change them after the schema is already in use, the configuration only affects new user records created from that point forward.
Managing attributes
You can add, modify, or remove custom attributes at any time.
Important
If an attribute is currently in use (i.e., it contains stored values for users), deleting it will permanently erase all associated data. This action is irreversible.