How do I make my first API call?
Replace $FLAXXA_KEY with a key from your workspace. The first call returns a real id you can use for the next ones.
# Verify one address
curl -X POST https://flaxxa.com/api/v1/mailcleaner/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "email": "[email protected]", "depth": "standard" }'const res = await fetch("https://flaxxa.com/api/v1/mailcleaner/verify", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FLAXXA_MAILCLEANER_KEY}`,
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({ email: "[email protected]", depth: "standard" }),
});
const { data, meta } = await res.json();
// data.verdict, data.risk_score; meta.pending = still being confirmed$res = Http::withToken(env('FLAXXA_MAILCLEANER_KEY'))->acceptJson()
->post('https://flaxxa.com/api/v1/mailcleaner/verify/batch', [
'emails' => ['[email protected]', '[email protected]'],
'depth' => 'standard',
'typo_mode' => 'fix',
])->throw()->json();
$jobId = $res['data']['id']; // poll GET /jobs/{id}/status until fully_doneimport requests
r = requests.post("https://flaxxa.com/api/v1/mailcleaner/jobs/upload",
headers={"Authorization": f"Bearer {KEY}", "Accept": "application/json"},
files={"file": open("emails.csv", "rb")})
r.raise_for_status()
print(r.json()["data"]["id"]) # the job idPOST /api/v1/mailcleaner/verify HTTP/1.1
Host: flaxxa.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"email": "[email protected]",
"depth": "standard"
}HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"email": "[email protected]",
"verdict": "valid",
"sub_verdict": "smtp_accepted",
"risk_score": 15,
"confidence_score": 92,
"mx_found": true,
"smtp_connectable": true,
"is_disposable": false,
"is_role_based": false,
"is_free_provider": false,
"catch_all_score": 0,
"suggested_correction": null,
"domain": "example.com"
},
"meta": { "pending": false, "fully_done": true, "recheck_after": null }
}
