# Person Enrichment

Full person profile (employment, location, social handles) for an email. Qualify leads by role and seniority, or route them by location.

**Credits:** 1 search credit when found. Lookups that find nothing cost nothing. See [Pricing and limits](../pricing-and-limits).

## Inputs and options

Input: `email` (Email address)

This tool has no options.

## Try one value

```sql
CALL TOMBA.core.person_enrichment('jane.doe@acme.com');
```

The call returns the result as a `VARIANT` (example values, shortened):

```json
{
    "status": "found",
    "credits": 1,
    "results": [
        {
            "FULL_NAME": "Jane Doe",
            "TITLE": "Head of Sales",
            "ROLE": "sales",
            "SENIORITY": "senior",
            "COMPANY_NAME": "Acme",
            "CITY": "Berlin",
            "COUNTRY": "DE"
        }
    ]
}
```

`status` is `found`, `not_found`, `invalid` or `error`; `results` holds the output columns and `data` the complete
Tomba record.

## Run it over a table

Create a small table to try it (or use one of yours, after [granting the app access](../installation#3-let-the-app-read-your-tables)):

```sql
CREATE OR REPLACE TABLE my_db.public.signups (EMAIL STRING);
INSERT INTO my_db.public.signups VALUES
    ('jane.doe@acme.com');
GRANT SELECT ON TABLE my_db.public.signups TO APPLICATION TOMBA;
```

Run the tool, then read the results:

```sql
CALL TOMBA.core.enrich_people('MY_DB.PUBLIC.SIGNUPS', 'EMAIL', 'SIGNUPS_PERSON_ENRICHMENT', 100);

SELECT INPUT_EMAIL, FULL_NAME, TITLE, ROLE, SENIORITY, COMPANY_NAME, CITY, COUNTRY
  FROM TOMBA.results.SIGNUPS_PERSON_ENRICHMENT
 WHERE lookup_status = 'found';
```

Signature: `enrich_people(input_table STRING, email_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`

<Callout type="tip">
    Start with a small `max_rows` (like 100) to check the match rate on your
    data, then run the whole table, in the [background](../background-runs) if
    it is large.
</Callout>

## Output columns

Each row starts with `INPUT_<name>` columns (your values, unchanged) and then has:

`EMAIL`, `FULL_NAME`, `FIRST_NAME`, `LAST_NAME`, `TITLE`, `ROLE`, `SENIORITY`, `COMPANY_NAME`, `COMPANY_DOMAIN`, `LOCATION`, `CITY`, `COUNTRY`, `LINKEDIN_HANDLE`, `TWITTER_HANDLE`, `GITHUB_HANDLE`, followed by the [common columns](../reference/output-columns)
(`LOOKUP_STATUS`, `CREDITS`, `DATA`, `SOURCE`, …).

## Tips

- `ROLE` and `SENIORITY` are normalized values, good for segmenting and lead scoring.
- Need the company's firmographics too? Combined Enrichment returns both for 2 credits.

## Related

- [Email Enrichment](./email-enrichment)
- [Combined Enrichment](./combined-enrichment)
- [Company Enrichment](./company-enrichment)
