Email Validator: Validation

Validate Emails

Validate up to 50 addresses in one command. They are checked in parallel and come back in the order you sent them.

POSThttps://g.sendcorex.com/v1/tool/validatecommand: validate_emails
i

Needs the tools:validate scope on your API key.

i

1 credit per distinct address. Repeated addresses are validated and charged once, and appear once in results.

!

If your credits do not cover the whole list, nothing is validated: you get INSUFFICIENT_CREDITS with how many you need and how many you have.

Arguments

  • emailsstring[]required

    1 to 50 addresses.

    e.g. ["ana@acme.com", "jhon@gmial.com"]

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/tool/validate',
  {
    commands: [
      {
        command: "validate_emails",
        args: {
          emails: [
            "ana@acme.com",
            "jhon@gmial.com"
          ]
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);

Response

{
  "type": "SUCCESS",
  "results": [
    {
      "command": "validate_emails",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 18,
      "data": {
        "results": [
          {
            "email": "ana@acme.com",
            "valid": true,
            "checks": [
              {
                "check": "Format Validation",
                "status": "Passed",
                "details": "Valid email format"
              },
              {
                "check": "Local Part Validation",
                "status": "Passed",
                "details": "Local part is RFC compliant"
              },
              {
                "check": "Role-based Email Check",
                "status": "Passed",
                "details": "Not a role-based address"
              },
              {
                "check": "No-reply Email Check",
                "status": "Passed",
                "details": "Not a no-reply address"
              },
              {
                "check": "Temporary Email Check",
                "status": "Passed",
                "details": "Not a temporary email"
              },
              {
                "check": "Misspelled Domain Check",
                "status": "Passed",
                "details": "Correct"
              },
              {
                "check": "Spam Trap Check",
                "status": "Passed",
                "details": "Not a spam trap"
              },
              {
                "check": "Provider Type",
                "status": "Passed",
                "details": "Corporate or custom domain"
              },
              {
                "check": "Domain Validation",
                "status": "Passed",
                "details": "Domain is valid and has MX records"
              },
              {
                "check": "Null MX Check",
                "status": "Passed",
                "details": "Domain accepts email"
              },
              {
                "check": "Email Provider Detection",
                "status": "Passed",
                "details": "Domain is hosted on a known provider: Google Workspace",
                "providerId": 1,
                "providerName": "Google Workspace"
              },
              {
                "check": "Email Deliverability",
                "status": "Passed",
                "details": "Mailbox exists",
                "fullResponse": "250 2.1.5 OK"
              },
              {
                "check": "Catch-all Mail Exchanger Check",
                "status": "Passed",
                "details": "Mail exchanger correctly rejects nonexistent addresses"
              }
            ]
          },
          {
            "email": "jhon@gmial.com",
            "valid": false,
            "checks": [
              {
                "check": "Format Validation",
                "status": "Passed",
                "details": "Valid email format"
              },
              {
                "check": "Local Part Validation",
                "status": "Passed",
                "details": "Local part is RFC compliant"
              },
              {
                "check": "Role-based Email Check",
                "status": "Passed",
                "details": "Not a role-based address"
              },
              {
                "check": "No-reply Email Check",
                "status": "Passed",
                "details": "Not a no-reply address"
              },
              {
                "check": "Temporary Email Check",
                "status": "Passed",
                "details": "Not a temporary email"
              },
              {
                "check": "Misspelled Domain Check",
                "status": "Failed",
                "details": "Possible typo. Suggested correction: jhon@gmail.com"
              },
              {
                "check": "Spam Trap Check",
                "status": "Passed",
                "details": "Not a spam trap"
              },
              {
                "check": "Provider Type",
                "status": "Passed",
                "details": "Corporate or custom domain"
              },
              {
                "check": "Domain Validation",
                "status": "Failed",
                "details": "Invalid domain or no MX records"
              }
            ]
          }
        ],
        "count": 2,
        "valid_count": 1,
        "invalid_count": 1,
        "credits_used": 2
      }
    }
  ]
}

Response fields

  • results

    One result per distinct address, in the order you sent them.

  • count / valid_count / invalid_count

    How many were checked, and how many came back valid and invalid.

  • credits_used

    Credits taken by this command.

  • results[].email

    The address, trimmed and in lowercase.

  • results[].valid

    true only when every check passed. Provider Type and Email Provider Detection are informative and never make it false.

  • results[].checks[].check

    The name of the check. See Checks below.

  • results[].checks[].status

    Passed or Failed.

  • results[].checks[].details

    A sentence explaining the result, ready to show to a user.

  • results[].checks[].fullResponse

    Only on Email Deliverability: the exact answer of the mailbox server.

  • results[].checks[].providerId / providerName

    Only on Email Provider Detection: the mailbox provider that hosts the domain.

Big lists

For thousands of addresses, call this command in chunks of 50, one after the other, or upload the file in the dashboard (Email Validator → Lists): it is validated in the background and you get an email with the CSV when it is done.

Errors

HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.

  • 401INVALID_API_KEY

    The API key does not exist, was revoked or was disabled in the dashboard.

  • 429RATE_LIMITED

    More than 75 requests/s or 75 in flight for the same IP + API key. Wait the number of seconds in Retry-After.

  • CMDMISSING_SCOPE

    The API key does not have `tools:validate`.

  • CMDINVALID_ARGS

    An argument is invalid: missing email (or domain, for `check_disposable`), more than 50 emails, an address longer than 254 characters, limit out of range…

  • CMDINSUFFICIENT_CREDITS

    You do not have enough credits for the whole command (validation credits for `validate_*`, disposable credits for `check_disposable`). Nothing was checked and nothing was charged.

  • CMDCREDITS_UNAVAILABLE

    Your credits could not be read right now. Nothing was charged. Try again.

  • CMDNO_SERVERS_AVAILABLE

    No validation server is available right now. Nothing was charged. Try again shortly.

  • CMDVALIDATION_FAILED

    The validation servers did not answer in time. Your credits were returned. Try again.

  • CMDINTERNAL

    Server error. The detail is only written to the server log.