Customize user actions context
In Fraud Prevention, Mosaic evaluates user actions—such as logins, password resets, or financial transactions—in real time to support accurate risk decisions. Each user action is reported and assessed based on its context, which is defined by a set of action attributes.
Alongside the prebuilt action attributes, you can configure custom attributes in the Admin Portal to enrich event context with metadata tailored to your business needs. These attributes describe how, where, and under what conditions the action occurred, providing better visibility and segmentation.
For example, a bank might include attributes like:
-
accountAgeInDays
: indicates how recently the account was created—new accounts are often targeted for fraud. -
customerSegment
: provides additional context on the user type (e.g., VIP, Retail), which may influence expected behavior. -
hasCompletedKYC
: A boolean indicating whether the user has passed identity verification—lack of KYC may signal a higher-risk account.
Once you've defined custom attributes in the Admin Portal, you can include them when reporting user actions using the Trigger action events API in backend integrations.
Note
The Trigger action events API reference also includes the full list of standard action attributes supported out of the box.
Defining custom action attributes
To define custom attributes, go to Admin Portal > Fraud Prevention > Configuration > Action attributes > Custom attributes, and define each attribute by providing:
- Name : The attribute key (case sensitive). Up to 512 characters.
- Display name : A user-friendly label for UI display.
-
Type
:
string
,number
orboolean
You can configure up to 10 custom attributes per tenant.
Important
- Attributes that are not defined or that don’t match the expected type are silently ignored.
- Custom attributes are not applied retroactively. If you enable or modify them after the schema is already in use, the changes will only affect new actions performed from that point onward.
Using custom user action attributes
When using the Trigger action events API to send custom action attributes, include them as a flat JSON object. Each key must match a configured attribute name, and each value must be a primitive type—string, number, or boolean. Example:
"custom_attributes": {
"accountAgeInDays": 12,
"customerSegment": "VIP",
"hasCompletedKYC": true
}