API Reference
Email Verification API
API reference for verifying email addresses using syntax checks, MX lookups, and SMTP validation in Taifa Mail.
Base URL: https://govconnect.ke/v1
All endpoints require authentication via API Key or JWT cookie.
Verify an email address
Verify whether an email address is deliverable. The verification process checks syntax, resolves MX records, and performs an SMTP RCPT TO probe against the destination mail server.
The verification flow runs three checks in order: a syntax check, an MX record lookup, and an SMTP RCPT TO probe. It never sends an email.
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | The email address to verify. |
cURL:
Python:
Node.js:
Response:
| Field | Type | Description |
|---|---|---|
email | string | The email address that was checked. |
result | string | Verification result. One of: valid, invalid, risky, unknown. |
reason | string | Human-readable explanation of the result. |
mx_found | boolean | Whether MX records were found for the domain. |
mx_host | string or null | The primary MX host, or null if no MX records exist. |
Result values
| Result | Meaning |
|---|---|
valid | The mailbox exists and accepts mail. Safe to send. |
invalid | The syntax is malformed, the domain has no MX records, or the mail server rejected the address. Do not send. |
risky | The mail server returned a temporary error (greylisting or similar). The address may or may not exist. |
unknown | Verification could not be completed. The mail server may be unreachable, timing out, or blocking SMTP probes. |
Example responses
Valid email:
Invalid email (mailbox rejected):
Invalid email (bad domain):
Risky email (temporary error):
Unknown (no clear response):
Best practices
- Verify addresses at the point of collection (signup forms, import flows) to prevent bounces.
- Treat
invalidresults as hard failures and do not attempt delivery. - Treat
riskyresults with caution. Consider sending but monitoring bounce rates. - Cache verification results for 24-48 hours. Email addresses do not change status frequently.
- Do not use verification to enumerate mailboxes on a domain.
Errors
| Status | Cause |
|---|---|
401 Unauthorized | Missing or invalid authentication token. |
422 Unprocessable Entity | Request body validation failed (missing email field). |