Single Validation
Learn how to validate a single email address using the Mails API.
Endpoint
GET https://api.mails.so/v1/validate
Parameters
Name | Type | Description |
---|---|---|
string | The email address to be validated |
Request Example
Here's an example of how to make a request to validate a single email address:
curl \
-H "x-mails-api-key: YOUR_API_KEY_HERE" \
"https://api.mails.so/v1/[email protected]"
Replace YOUR_API_KEY_HERE
with your actual Mails API key.
Response
The API can return two types of responses:
Successful Response (200 OK)
If the request is successful, you'll receive a JSON response with a data
object containing the validation results:
{
"data": {
"id": "4c6b837a-1463-4f40-8d0b-b3afa31a4935",
"email": "[email protected]",
"username": null,
"domain": null,
"mx_record": "aspmx.l.google.com",
"score": 80,
"isv_format": true,
"isv_domain": true,
"isv_mx": true,
"isv_noblock": true,
"isv_nocatchall": false,
"isv_nogeneric": true,
"is_free": false,
"result": "risky",
"reason": "catch_all"
},
"error": null
}
Error Response (401 Unauthorized)
If the request fails due to authentication issues, you'll receive a JSON response with an error message:
{
"data": null,
"error": "Unauthorized"
}
Response Fields
Field | Description |
---|---|
id | Unique identifier for the validation request |
The email address that was validated | |
username | The part of the email address before the @ symbol |
domain | The domain part of the email address |
mx_record | The MX record for the email domain |
score | Validation score (0-100) |
isv_format | Whether the email format is valid |
isv_domain | Whether the domain is valid |
isv_mx | Whether the MX record is valid |
isv_noblock | Whether the email is not in block lists |
isv_nocatchall | Whether the domain doesn't have a catch-all policy |
isv_nogeneric | Whether the email is not a generic address |
is_free | Whether the email is from a free email provider |
result | Overall validation result (e.g., "risky", "valid", "invalid") |
reason | Reason for the validation result |
Error Handling
If you receive a 401 Unauthorized error, make sure you're using a valid API key in your request header. If the issue persists, contact Mails support for assistance.
Remember to handle potential network errors and timeout scenarios in your implementation.