> ## Documentation Index
> Fetch the complete documentation index at: https://www.datalegion.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Email Hashing

> Hash email addresses using SHA-256, SHA-1, and MD5 for privacy-safe enrichment via the email_hash parameter.

## How It Works

Pass an email address and receive SHA-256, SHA-1, and MD5 hashes of the normalized email. The email is cleaned (lowercased, Gmail dots removed, plus tags stripped) before hashing.

Use the returned hash with the `email_hash` field in [Person Enrichment](/docs/api-reference/person-enrichment) for privacy-safe lookups — you never need to send the raw email address.

## Workflow

1. Hash the email using this endpoint
2. Store or transmit only the hash
3. Use the hash with `email_hash` in person enrichment


## OpenAPI

````yaml POST /utility/hash/email
openapi: 3.1.0
info:
  title: Data Legion API
  description: API for enriching, searching, and discovering person and company data
  version: 1.0.0
servers:
  - url: https://api.datalegion.ai
security:
  - APIKeyHeader: []
paths:
  /utility/hash/email:
    post:
      tags:
        - utility
      summary: Hash email address for privacy
      description: >-
        Hash an email address using SHA-256, SHA-1, and MD5. Returns all hashes.
        Rate limited to 100 emails per minute.
      operationId: hash_email_endpoint_utility_hash_email_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailHashRequest'
        required: true
      responses:
        '200':
          description: Success - email hashed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailHashResponse'
              example:
                email: Jane.Doe+tag@gmail.com
                normalized_email: janedoe@gmail.com
                hashes:
                  sha256: >-
                    d6117306485ed0e50afab3ac871e98f81699151f30281527d63ff5f233656c69
                  sha1: 3e12c6d13e5c00d46fee94de65239ce9c5e7bc25
                  md5: a9601f3839e5d5da764c1861a5e1daf6
        '400':
          description: Bad request - invalid email
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment required - insufficient credits or expired contract
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - API key not authorized for this endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    EmailHashRequest:
      properties:
        email:
          type: string
          title: Email
          description: Email address to hash
      type: object
      required:
        - email
      title: EmailHashRequest
      description: Request model for email hashing.
      example:
        email: Jane.Doe+tag@gmail.com
    EmailHashResponse:
      properties:
        email:
          type: string
          title: Email
          description: Original email address
        normalized_email:
          type: string
          title: Normalized Email
          description: Normalized email address (used for hashing)
        hashes:
          additionalProperties:
            type: string
          type: object
          title: Hashes
          description: Hash values keyed by algorithm (sha256, sha1, md5)
      type: object
      required:
        - email
        - normalized_email
        - hashes
      title: EmailHashResponse
      description: Response model for email hashing.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: Error type/code
        message:
          type: string
          title: Message
          description: Human-readable error message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: Details
          description: Additional error details (for validation errors)
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Error response model for customer-facing API.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: API-Key

````