openapi: 3.0.1
info:
  title: Email Validator
  version: 0.0.1
  description: |
    All timeouts are set in seconds with nanosecond precision. For example, 1.505402 is 1 second, 505 milliseconds and 402 microseconds.
servers:
  - url: /
  - url: https://email-validator15.p.rapidapi.com/
security:
  - AuthKey: [ ]
  - RapidApiSecret: [ ]
  - RapidApiKey: [ ]
components:
  schemas:
    ResultType:
      title: ResultType
      type: string
      description: &ResultTypeDescription |
        * CHECK_IF_EMAIL_EXIST, CIEE - [check-if-email-exists format](https://github.com/amaurymartiny/check-if-email-exists#%EF%B8%8F-json-output).
        * MAILBOXVALIDATOR, MAIL_BOX_VALIDATOR, MBV - [mailboxvalidator.com format](https://www.mailboxvalidator.com/api-single-validation).
        * PROMPT_EMAIL_VERIFICATION_API, PEVA - [Email Verification api format](https://promptapi.com/marketplace/description/email_verification-api) from [promptapi](https://promptapi.com).
      default: CHECK_IF_EMAIL_EXIST
      enum:
        - CHECK_IF_EMAIL_EXIST
        - CIEE
        - MAILBOXVALIDATOR
        - MAIL_BOX_VALIDATOR
        - MBV
        - PROMPT_EMAIL_VERIFICATION_API
        - PEVA
    CheckIfEmailExistMisc:
      type: object
      properties:
        is_disposable:
          type: boolean
        is_role_account:
          type: boolean
    CheckIfEmailExistSMTP:
      type: object
      properties:
        can_connect_smtp:
          type: boolean
        has_full_inbox:
          type: boolean
        is_catch_all:
          type: boolean
        is_deliverable:
          type: boolean
        is_disabled:
          type: boolean
    CheckIfEmailExistSyntax:
      type: object
      properties:
        address:
          nullable: true
          type: string
        domain:
          type: string
        is_valid_syntax:
          type: boolean
        username:
          type: string
    CheckIfEmailExistMX:
      type: object
      properties:
        accepts_mail:
          type: boolean
        records:
          type: array
          items:
            type: string
    CheckIfEmailExistResult:
      type: object
      properties:
        input:
          type: string
        is_reachable:
          type: string
        misc:
          $ref: '#/components/schemas/CheckIfEmailExistMisc'
        mx:
          $ref: '#/components/schemas/CheckIfEmailExistMX'
        smtp:
          $ref: '#/components/schemas/CheckIfEmailExistSMTP'
        syntax:
          $ref: '#/components/schemas/CheckIfEmailExistSyntax'
        error:
          type: string
    MailboxvalidatorResult:
      type: object
      properties:
        email_address:
          type: string
        domain:
          type: string
        is_free:
          type: string
        is_syntax:
          type: string
        is_domain:
          type: string
        is_smtp:
          type: string
        is_verified:
          type: string
        is_server_down:
          type: string
        is_greylisted:
          type: string
        is_disposable:
          type: string
        is_suppressed:
          type: string
        is_role:
          type: string
        is_high_risk:
          type: string
        is_catchall:
          type: string
        mailboxvalidator_score:
          type: string
        time_taken:
          type: string
        status:
          type: string
        credits_available:
          type: integer
          format: int64
        error_code:
          type: string
        error_message:
          type: string
    PromptEmailVerificationApiResult:
      type: object
      properties:
        can_connect_smtp:
          type: boolean
        email:
          type: string
        is_catch_all:
          type: boolean
        is_deliverable:
          type: boolean
        is_disabled:
          type: boolean
        is_disposable:
          type: boolean
        is_inbox_full:
          type: boolean
        is_role_account:
          type: boolean
        mx_records:
          $ref: '#/components/schemas/PromptEmailVerificationApiMX'
        syntax_valid:
          type: boolean
        message:
          type: string
    PromptEmailVerificationApiMX:
      type: object
      properties:
        accepts_mail:
          type: boolean
        records:
          type: array
          items:
            type: string
    UnexpectedError:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          additionalProperties: true
    EmailRequest:
      type: object
      properties:
        email:
          type: string
          example: SOME.EXISTING.EMAIL@domain.com
        smtp:
          type: object
          properties:
            email_from:
              type: string
              format: email
              default: user@example.org
              example: user@example.org
            hello_name:
              type: string
              default: localhost
              example: localhost
            proxy:
              type: string
              format: uri
              description: |
                Versions - SOCKS4, SOCKS4A and SOCKS5.
                Format -  schema://username:password@host:port.
            timeout_connection:
              type: number
              description: timeout creating smtp connection
              default: &TimeoutDefault 5.0
              example: *TimeoutDefault
            timeout_response:
              type: number
              description: timeout of communication with smtp server
              default: *TimeoutDefault
              example: *TimeoutDefault
            port:
              type: integer
              description: smtp port remote server
              format: int32
              default: 25
              example: 25
        #        gravatar:
        #          type: object
        #          properties:
        #            timeout:
        #              type: number
        #              description: timeout request to gravatar.com
        #              default: *TimeoutDefault
        result_type:
          $ref: '#/components/schemas/ResultType'
    EmailResponse:
      type: object
      properties:
        check_if_email_exist:
          $ref: '#/components/schemas/CheckIfEmailExistResult'
        mailboxvalidator:
          $ref: '#/components/schemas/MailboxvalidatorResult'
        prompt_email_verification_api:
          $ref: '#/components/schemas/PromptEmailVerificationApiResult'
  securitySchemes:
    AuthKey:
      type: apiKey
      in: header
      name: Authorization
    RapidApiSecret:
      type: apiKey
      in: header
      name: X-RapidAPI-Proxy-Secret
    RapidApiKey:
      type: apiKey
      in: header
      name: X-RapidAPI-Key
paths:
  /v1/validation/single:
    post:
      tags:
        - EmailValidation
      operationId: EmailValidation_singleValidation_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailRequest'
        required: true
      responses:
        200:
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnexpectedError'
      x-codegen-request-body-name: body
  /v1/validation/single/{email}:
    get:
      tags:
        - EmailValidation
      operationId: EmailValidation_singleValidation_get
      description: POST request contains additional parameters for detailed configuration
      parameters:
        - name: email
          in: path
          required: true
          schema:
            type: string
        - name: result_type
          in: query
          description: *ResultTypeDescription
          schema:
            $ref: '#/components/schemas/ResultType'
      responses:
        200:
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnexpectedError'