# Unique Email (UniqueEmailGenerator)

The [Unique Email](/app/generation/generators/generator-reference/unique-email.md) generator generates unique email addresses. It replaces the username with a randomly generated GUID, and either uses a specified domain or uses a character scramble to mask the domain.

## Link object structure <a href="#generator-api-unique-email-link-object" id="generator-api-unique-email-link-object"></a>

The Unique Email generator does not support linking. It can be self-consistent, but not consistent with another column. You cannot configure differential privacy.

The `metadata` object is populated from the [`EmailMetadata`](https://app.tonic.ai/apidocs/index.html#/models/EmailMetadata) object. You can configure:

* The domain to use for all of the email addresses in the destination database. If not specified, a character scramble is applied to the domains.
* Domains for which to keep the email addresses as is in the destination database.
* Whether to replace invalid email addresses with valid ones.

```json
{
  "schema": "string",
  "table": "string",
  "column": "string",
  "path": "string",  //JSON fields only
  "dataType": "string",  //MongoDB, Amazon DynamoDB, and JSON fields only
  "metadata": {
    "presetId": "string",
    "generatorId": "UniqueEmailGenerator",
    "domain": "string",
    "replaceInvalidEmails": boolean,
    "isConsistent": boolean,
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"  //If custom value processor applied
  }
}
```

## Example replacement <a href="#generator-api-unique-email-replacement" id="generator-api-unique-email-replacement"></a>

In the following example replacement for the Unique Email generator, consistency is enabled.

`tonic.ai` is used as the domain for all of the email addresses, and invalid email addresses are not replaced.

```json
{
  "name": "email",
  "schema": "public",
  "table": "users",
  "links": [
    {
      "schema": "public",
      "table": "users",
      "column": "email",
      "metadata": {
        "presetId": "UniqueEmailGenerator",
        "generatorId": "UniqueEmailGenerator",
        "domain": "tonic.ai",
        "replaceInvalidEmails": false,
        "isConsistent": true
      }
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/generator-api-ref-unique-email.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
