> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/setup-and-monitor/collect-and-manage-your-data/design-your-data-model-and-schema/user-identity/user-identifiers/user-email.md).

# User Email

Identify a user by their email address, using a hash consistently across every data flow.

## Your goal

Use the email address as an identifier without moving the address around more than you need to - and hash it the same way everywhere, so the same person matches across your flows.

## Expected outcome

One hash function agreed for the datamart and used by every integration that sends or receives email-based identifiers.

## What a UserEmail is

A **UserEmail** is an identifier based on the user's email address. It is usually derived from the address by a hash function such as MD5 or SHA-256. The email can be hashed directly by the platform.

A user can have several UserEmails registered.

| Property        | Type                | Description                                    |
| --------------- | ------------------- | ---------------------------------------------- |
| `hash`          | ID                  | The hashed email.                              |
| `email`         | String, optional    | The user's email, not hashed.                  |
| `creation_ts`   | Timestamp           | When the email was registered on the platform. |
| `expiration_ts` | Timestamp, optional | The email's eventual expiration timestamp.     |

The `hash` property is **mandatory** and is the property used to identify a user. It is provided as `$hash` in user activity requests.

{% hint style="warning" %}
**Always use the same hashing function** in your datamart and in all its integrations. Matching between data flows depends on it: a SHA-256 hash and an MD5 hash of the same address are two different identifiers, and neither will match the other.
{% endhint %}

## In the schema

```graphql
type UserEmail {
  id: ID! @TreeIndex(index:"USER_INDEX")
  creation_ts: Timestamp! @TreeIndex(index:"USER_INDEX")
  last_activity_ts: Timestamp @TreeIndex(index:"USER_INDEX")

  email: String @TreeIndex(index:"USER_INDEX")
}
```

## In an activity

```json
{
  "$user_identifiers": [
    {
      "$type": "USER_EMAIL",
      "$hash": "<the email hash>",
      "$email": "<the raw email, optional>"
    }
  ]
}
```

## Where the hash is used elsewhere

The email hash is one of the identifiers accepted by the endpoints reachable with [signature authentication](/setup-and-monitor/manage-the-platform/manage-api-access.md#signature-authentication), which is how a public application can look up a user's segments without carrying a long-term token.

It is also one of the technical names available for [segment metrics](/setup-and-monitor/plan-and-integrate/set-up-the-environment/set-up-segment-metrics.md), which is how teams see how many users in a segment are reachable by email.

## Verify

* Every integration sending email-based identifiers uses the agreed hash function.
* A test user identified by email hash resolves to the expected UserPoint.
* Segment metrics counting emails return plausible values.

## Related pages

<table data-view="cards" data-search="false"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>User Account</strong></td><td>The other person-level identifier.</td><td><a href="/setup-and-monitor/collect-and-manage-your-data/design-your-data-model-and-schema/user-identity/user-identifiers/user-account.md">User Account</a></td></tr><tr><td><strong>Email tracking</strong></td><td>Collecting email views and clicks.</td><td><a href="/setup-and-monitor/collect-and-manage-your-data/collect-data-in-real-time/email-tracking.md">Email tracking</a></td></tr><tr><td><strong>Import identifiers</strong></td><td>Sending email identifiers in batch.</td><td><a href="/setup-and-monitor/collect-and-manage-your-data/import-data-in-batch/import-identifiers.md">Import identifiers</a></td></tr></tbody></table>


---

# 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://docs.mediarithmics.io/setup-and-monitor/collect-and-manage-your-data/design-your-data-model-and-schema/user-identity/user-identifiers/user-email.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.
