Identities
When Fides stores a user's consent records, it needs to know who those preferences belong to. An identity is the piece of information that connects a person to their consent choices -- it's what allows Fides to associate a set of preferences with a specific individual and retrieve them later.
What is an identity?
An identity is any piece of identifying information your organization uses to recognize a person.
Built-in identity types
Fides comes with the following identity types registered out of the box:
| Identity type | Key | Description |
|---|---|---|
| Email address | email | A user's email address |
| Phone number | phone_number | A user's phone number |
| Fides user device ID | fides_user_device_id | A device-level identifier assigned by FidesJS |
These built-in types are ready to use immediately -- you don't need to register them before saving or querying preferences.
Custom identity types
Fides doesn't restrict you to the built-in types. You can register additional identity types that make sense for your organization, such as loyalty IDs, account numbers, or external system identifiers. Once registered, custom identity types work exactly like the built-in ones.
When registering a custom identity, you specify its data type using the type field:
| Type | Description |
|---|---|
string | A freeform string value (e.g., a loyalty ID, account number, or username) |
uuid | A UUID string |
integer | A numeric integer identifier |
email | An email address |
phone_number | A phone number |
How identities are used
When a user submits their consent choices, the submission includes both the preferences and the identity that those preferences belong to. For example, a consent submission might say: "The person identified by email: user@example.com has opted out of the 'Targeted advertising' notice."
Later, when you need to check what a person has consented to, you look up their preferences using the same identity type -- for example, by looking up all preferences associated with a specific email address.
Registering identities with Fides
Before you can use a custom identity type to store or retrieve privacy preferences, you need to register it with Fides. This process is called creating an identity definition.
Why register identities?
Registering identity types tells Fides which identifiers your organization uses and enables you to:
- Store preferences by identity: When saving consent choices, Fides validates that the identity type you're using has been registered.
- Look up preferences by identity: Registered identities become available as filters when retrieving preferences, so you can query preferences by email, phone number, loyalty ID, or any other registered type.
- Keep your API discoverable: Registered identity types appear in the API schema, making it clear to developers which identity filters are available.
Example: registering a loyalty ID
Suppose your organization identifies customers by a loyalty program number. To use loyalty_id as an identity for privacy preferences:
- Register
loyalty_idas an identity definition in Fides. - When saving a customer's consent preferences, include
loyalty_idas the identity. - When retrieving a customer's preferences, filter by
loyalty_idto find their consent choices.
Once registered, loyalty_id works just like the built-in identity types -- you can save preferences against it, query current preferences by it, and filter preference records with it.