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

# Validate email

> Validate an email address by performing the following checks:

    - Checks if the provided email address is valid.
    - Returns metadata about the email, such as:
    - Validation status (e.g., `Valid`).
    - The Internet Service Provider (ISP) associated with the email.
    - Mail Exchange (MX) records for the email domain.
    - Sender Policy Framework (SPF) records for the domain.
    - Includes additional details about the validation process, such as the rules applied and any errors encountered.

    **Request body** must be JSON: `{"email": "user@example.com"}`.
    Improperly formatted emails return a 422 validation error from FastAPI.



## OpenAPI

````yaml post /v1/emails/validation
openapi: 3.1.0
info:
  title: LeadX API
  version: 0.1.0
servers: []
security: []
tags:
  - name: All Attributes
    description: Aggregate and correlate data about companies and their associated records.
  - name: Better Business Bureau
    description: >-
      Retrieve Better Business Bureau (BBB) ratings and accreditation status for
      businesses.
  - name: Companies
    description: Enrich company data by URL, name, address, or phone.
  - name: Contacts
    description: Enrich data about contacts.
  - name: email
    description: Validate company email addresses.
  - name: Google Reviews
    description: Retrieve Google Reviews and ratings for businesses.
  - name: Mobile Number
    description: Enrich mobile phone numbers.
  - name: UCC
    description: Search across to the U.S. Uniform Commercial Code (UCC) lien filings.
paths:
  /v1/emails/validation:
    post:
      tags:
        - email
      summary: Validate email
      description: |-
        Validate an email address by performing the following checks:

            - Checks if the provided email address is valid.
            - Returns metadata about the email, such as:
            - Validation status (e.g., `Valid`).
            - The Internet Service Provider (ISP) associated with the email.
            - Mail Exchange (MX) records for the email domain.
            - Sender Policy Framework (SPF) records for the domain.
            - Includes additional details about the validation process, such as the rules applied and any errors encountered.

            **Request body** must be JSON: `{"email": "user@example.com"}`.
            Improperly formatted emails return a 422 validation error from FastAPI.
      operationId: email_validation_v1_emails_validation_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailValidationRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                success: true
                email:
                  processed_attempted: true
                  email: person@company.com
                  status: Valid
                  note: isp_spf rule 1,cached
                  isp: google
                  isp_spf: google
                  isp_used: google
                  isp_rule: mx
                  isp_error: ''
                  isp_server: desktop3-em
                  proxy: ip6proxyd
                  mx: aspmx.l.google.com
                  spfrecs: >-
                    v=spf1 a mx ptr include:secureserver.net
                    include:_spf.google.com ~all
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    EmailValidationRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
          description: The email address to validate.
          examples:
            - user@example.com
        mx_records:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Mx Records
          description: Whether to include MX records in the response. Default is false.
          default: false
      type: object
      required:
        - email
      title: EmailValidationRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer

````