All SnapValid API requests are performed over HTTPS and return responses in JSON format.
Always check both:
- The HTTP status code
- The
successfield in the response body
Success Response
When a request is successful, the API returns HTTP 200 along with a JSON response.
Example:
{
"email": "[email protected]",
"user": "help",
"domain": "unelmasupport.com",
"accept_all": 0,
"role": 0,
"free_email": 0,
"disposable": 0,
"spamtrap": 0,
"success": true,
"result": "deliverable",
"message": "This address can receive emails."
}
Response Fields
| Field | Type | Description |
|---|---|---|
| string | The verified email address | |
| user | string | Local part of the email |
| domain | string | Domain part of the email |
| accept_all | integer (0/1) | Indicates if the domain accepts all emails |
| role | integer (0/1) | Indicates if the email is role-based |
| free_email | integer (0/1) | Indicates if the email is from a free provider |
| disposable | integer (0/1) | Indicates if the email is disposable |
| spamtrap | integer (0/1) | Indicates if the email is a spam trap |
| success | boolean | Indicates if the request was successful |
| result | string | Validation result |
| message | string | Human-readable message |
Result Values
| Result | Meaning | Recommended Action |
|---|---|---|
| deliverable | Email is valid | Accept |
| undeliverable | Email cannot receive mail | Reject |
| accept-all | Domain accepts all emails | Accept with caution |
| unknown | Verification could not be completed | Accept with caution |
Only undeliverable emails should be automatically rejected.
Error Response
If a request fails, the API returns an appropriate HTTP status code along with an error message.
Example (401 Unauthorized):
{
"message": "Unauthorized"
}
Common Error Status Codes
| HTTP Status Code | Error Type | Description |
|---|---|---|
| 400 | Bad Request | Missing or invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 402 | Payment Required | Insufficient API credits |
| 403 | Forbidden | Request not allowed |
| 404 | Not Found | Resource not found (e.g. invalid file ID) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Unexpected server-side error |
| 503 | Service Unavailable | Temporary server overload or maintenance |
Best Practice
-
Always check the HTTP status code first
-
Then inspect the success field
-
Implement proper error handling in your application
-
Do not rely solely on the message field for logic decisions
