# Validate email

`POST https://api.foxentry.com/email/validate`

This endpoint will let you check if the e-mail address sent in query is valid. Please pay attention to the validationType option since it has direct impact on the returned data. Extended validation (default) is the more advanced type that checks the real existence of the e-mail address and its deliverability. It also informs you about various flags such as freemail and disposable mail detection. Foxentry validator is able not only to evaluate the validity of the inputed information but it also can fix various typos, errors and missing data. Foxentry can also suggest more suitable alternatives to the data sent in query. Please pay attention to the result, resultCorrected and suggestions in the response. Always check result.proposal in the response for a proposed solution by Foxentry how you should process the response in your form or application.

## Headers

| Header | Value |
|---|---|
| `Api-Version` | `2.1` or `2.0` |
| `Authorization` | `Bearer <your API key>` |
| `Content-Type` | `application/json` |

## Request body

### request.query

Parameters you want to validate or search for.

| Field | Type | Description |
|---|---|---|
| `email` | string |  |

### request.options

Options that change how the endpoint behaves.

| Field | Type | Description |
|---|---|---|
| `validationType` | string | Type of validation. Basic = only the format of e-mail is checked and only standard corrections are included. Extended = in depth check of deliverability. Additional information is returned such as temporary mail check or freemail check. More complicated corrections are included. One of: `basic`, `extended`. Default: `"extended"`. |
| `acceptDisposableEmails` | boolean | If true, the disposable e-mails will be marked as valid. Works only in Extended validation. Default: `true`. |
| `acceptFreemails` | boolean | If true, the freemails will be marked as valid. Works only in Extended validation. Default: `true`. |
| `acceptPhishingDomains` | boolean | If true, the e-mails from domains used for phishing will be marked as valid. Works only in Extended validation. Default: `true`. |
| `correctionMode` | string | This option determines how automatic corrections are handled. You can choose between full to allow all corrections, format to fix formatting only, suggestion to return corrected data in suggestions, or none for no corrections to be applied. One of: `full`, `format`, `suggestion`, `none`. Default: `"full"`. |

### request.client

Information about your user, to make results more relevant.

| Field | Type | Description |
|---|---|---|
| `ip` | string |  |
| `country` | string | Country code in ISO-3166-1 alpha-2 format. |
| `location.lat` | number | Client's latitude |
| `location.lon` | number | Client's longitude |

### Example

```json
{
  "request": {
    "query": {
      "email": "p.novak@gamil.com"
    },
    "options": {
      "validationType": "extended",
      "acceptDisposableEmails": true,
      "acceptFreemails": true
    },
    "client": {
      "country": "CZ",
      "location": {
        "lat": 50.0628,
        "lon": 13.9271
      }
    }
  }
}
```

## Responses

- `200` Successful response. Examples: `valid`, `invalidWithSuggestion`, `invalid`, `invalidWithCorrection`, `invalidWithPartialCorrection`, `disallowedDisposable`, `disallowedFreemails`
- `400` Bad Request
- `401` Unauthorized
- `402` Payment Required
- `403` Forbidden
- `404` Not Found
- `405` Method Not Allowed
- `429` Too Many Requests
- `500` Internal Server Error
- `503` Service Unavailable
