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

# Validate an email address

> Looks up the domain's MX records and asks the highest-priority mail server whether it accepts mail for the address. Can take up to about 10 seconds when the recipient's mail server is slow.



## OpenAPI

````yaml /api-reference/email-validation.yaml post /validate_email
openapi: 3.0.3
info:
  title: validate.al Email Validation API
  description: >-
    Checks whether an email address can receive mail by asking the domain's mail
    server over SMTP (RCPT TO). No email is sent.
  version: '1.0'
servers:
  - url: https://email.validate.al
security:
  - ApiKeyAuth: []
paths:
  /validate_email:
    post:
      summary: Validate an email address
      description: >-
        Looks up the domain's MX records and asks the highest-priority mail
        server whether it accepts mail for the address. Can take up to about 10
        seconds when the recipient's mail server is slow.
      operationId: validateEmail
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  description: >-
                    The address to check. `Name <user@example.com>` is accepted
                    and reduced to the address.
                  example: someone@example.com
      responses:
        '200':
          description: >-
            The check ran. `status` holds the verdict, including when the
            address can't receive mail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationResult'
              examples:
                deliverable:
                  summary: Mail server accepts the address
                  value:
                    cached: false
                    email: someone@example.com
                    status: true
                refused:
                  summary: Mail server refuses the address
                  value:
                    cached: false
                    email: nobody@example.com
                    status: false
                noDomain:
                  summary: Domain does not exist
                  value:
                    cached: false
                    email: a@no-such-domain.example
                    status: domain_not_found
                badFormat:
                  summary: Not an email address
                  value:
                    email: not-an-email
                    status: invalid_format
        '400':
          description: >-
            Missing `email` field, body is not JSON, or the address can't be
            parsed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail:
                  error: Missing 'email' field in request body
        '401':
          description: Missing, wrong, replaced or deactivated API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail:
                  error: Invalid API key
        '502':
          description: The validation service did not respond. Retry later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: 'Upstream error: timed out'
components:
  schemas:
    ValidationResult:
      type: object
      required:
        - email
        - status
      properties:
        email:
          type: string
          description: The address that was checked.
        status:
          description: >-
            `true` if the mail server accepts the address, `false` if it refuses
            it, or a string when no verdict could be reached.
          oneOf:
            - type: boolean
            - type: string
              enum:
                - invalid_format
                - domain_not_found
                - no_mx_records
                - smtp_connect_error
                - smtp_timeout
                - fatal_exception
        cached:
          type: boolean
          description: >-
            True when served from a recent identical check. Absent when the
            format check failed.
    Error:
      type: object
      properties:
        detail:
          type: object
          properties:
            error:
              type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your validate.al API key, from the portal (Settings → API Key).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.