API reference / Email verification
Clean a list
Written and maintained by The ProspectAPIs team
POST/v1/email/clean
POST /v1/email/clean is the ProspectAPIs operation emailClean, in the Email verification group of the REST API. Sorts up to 1,000 addresses into keep, review and remove with quick checks; no mail server is contacted. $0.001 per well-formed address. Cost: $0.001 per address (quick checks, up to 1,000 a call). Send your API key as a Bearer token in the Authorization header.
How this fits with the rest of the email verification API, with worked examples, is in the email verification guide.
Parameters
This operation takes no path or query parameters.
Request body
JSON.
| Field | Type | Description |
|---|---|---|
| emails required | array of string |
{
"emails": [
"emails"
]
}Responses
| Status | Meaning |
|---|---|
| 200 | The sorted list. |
| 400 | The request was invalid (e.g. a bad filter or input); nothing was charged. |
| 401 | The API key is missing or invalid. |
| 402 | Out of credits. The body carries top_up_url; nothing was charged. |
Every error answers with the same JSON body, an error string and sometimes a code; the errors page lists each status and when it happens.
200 response fields
The sorted list.
| Field | Type | Description |
|---|---|---|
| keep | array of string | |
| review | array of object | |
| review[].email | string | |
| review[].reason | string | |
| review[].did_you_mean | string or null | |
| remove | array of object | |
| remove[].email | string | |
| remove[].reason | string | |
| remove[].reason_text | string | |
| not_checked | array of string | |
| counts | object | |
| amount_usd | number | |
| note | string |
Code samples
Each sample sends the same request. Set PROSPECTAPIS_KEY in your environment first. Values come from the spec's examples; replace them with your own.
curl -X POST https://api.prospectapis.com/v1/email/clean \
-H "Authorization: Bearer $PROSPECTAPIS_KEY" \
-H "Content-Type: application/json" \
-d '{ "emails": [ "emails" ] }'const res = await fetch("https://api.prospectapis.com/v1/email/clean", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PROSPECTAPIS_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"emails": [
"emails"
]
}),
});
if (!res.ok) throw new Error(`${res.status}: ${(await res.json().catch(() => ({}))).error ?? res.statusText}`);
const data = await res.json();
console.log(data);import os, requests
res = requests.post(
"https://api.prospectapis.com/v1/email/clean",
headers={"Authorization": f"Bearer {os.environ['PROSPECTAPIS_KEY']}"},
json={
"emails": ["emails"],
},
timeout=30,
)
res.raise_for_status()
data = res.json()
print(data)Billing
Billing reserves before it serves: the call holds what it may cost, serves at most what that hold covers, and refunds the rest when the response closes. Any non-2xx answer refunds the whole hold, so a failed call costs nothing. The response reports your balance in X-Credits-Remaining.
Related
The email verification guide covers this area end to end. Previous operation: What a score means. Next operation: Start a verification job. Every operation, grouped by area, is on the API reference index.
Create a free account to get a key, then run the samples above with your own values (this call acts for real, so use real inputs).
Was this page helpful?