Docs / Checks
Validate an email
Checks the address syntax, then looks up the domain’s mail records. Send dns: false to skip that lookup. This does not connect to the mail server, so it cannot tell whether the mailbox exists.
POST
/v1/email/validateimport { Client } from "@liveapiio/liveapi";
const client = new Client({ token: process.env.LIVEAPI_TOKEN });
const email = await client.validateEmail("info@example.com", true);Request
Send Authorization: Bearer YOUR_TOKEN. The token stays on your server. Each library reads it from the environment and calls this endpoint for you.
| Field | Type | Description |
|---|---|---|
| string | The address to check. Required. | |
| dns | boolean | Optional. The lookup runs unless this is false. |
Response
200 with valid: false means the address failed the check. That response still uses one call.
Errors
A failed request returns { "error": { "code", "message" } } and does not use a call.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A required field is missing or has the wrong type. |
| 401 | unauthorized | The bearer token is missing or not recognized. |