MailSpecto API documentation
Integrate email verification and contact list processing directly with your application, e-commerce store or CRM.
https://api.mailspecto.com/api/v1
Authentication
Send every request over HTTPS with your organisation's API key in the Authorization header (or in the X-API-Key header). You create keys in the app.mailspecto.com panel; each key can have its own scopes and IP allowlist.
Authorization: Bearer <YOUR_API_KEY>
Never put the API key in front-end code (a browser or a mobile app). Call the API only from the server side, e.g. in Next.js API routes or your own backend.
Responses and errors
The API accepts and returns JSON (UTF-8). Every error uses the same envelope: a code to handle in your code, a human-readable message and a request ID worth including when you contact support.
{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key",
"request_id": "req_…",
"details": null
}
}
Each verification uses credits from your organisation's balance. When credits run out the API returns 402; when you exceed the rate limit it returns 429. On 429 and 503, retry with an increasing delay (backoff).
/api/v1/verify
Verifies a single address in real time: syntax and normalisation, domain policy, DNS (MX, implicit MX via A/AAAA, Null MX), disposable domains, role accounts and domain typos, and, when enabled, the mailbox itself over SMTP (RCPT TO only; no message is ever sent).
| Field (JSON) | Type | Required | Description |
|---|---|---|---|
| string | Yes | The address to check (1–512 characters). Any other field in the request body is rejected with 422. |
curl -X POST https://api.mailspecto.com/api/v1/verify \
-H "Authorization: Bearer $MAILSPECTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'
{
"email_original": "[email protected]",
"email_normalized": "[email protected]",
"local_part": "contact",
"domain": "acme-trading.com",
"ascii_domain": "acme-trading.com",
"status": "mailbox_exists",
"reason_code": "mailbox_exists",
"reason_message": "…",
"mailbox_verified": true,
"flags": {
"is_disposable": false,
"is_role_account": true,
"has_typo_suggestion": false,
"is_plus_addressed": false,
"is_internationalized": false
},
"risk_signals": ["role_account"],
"suggested_correction": null,
"checks": {
"dns": {
"name": "dns",
"outcome": "pass",
"details": {
"mx_records": [
{ "preference": 10, "exchange": "mx1.acme-trading.com" }
]
},
"duration_ms": 18.4
}
},
"duration_ms": 1176.45,
"verified_at": "2026-11-25T10:42:07Z",
"engine_version": "…"
}
mailbox_verified tells whether the recipient's mail server answered for this specific mailbox (exists, does not exist, disabled, full). false means the SMTP check was disabled or inconclusive, or the domain is catch-all. The checks object holds the result of each check (outcome: pass, fail, warn, error, skipped); the example shows DNS only.
/api/v1/jobs
Uploads a CSV file for bulk (asynchronous) verification. The request is multipart/form-data; the 202 Accepted response contains the job ID and links to its status, results and export.
| Field | Required | Description |
|---|---|---|
| file | Yes | A UTF-8 CSV file (BOM allowed) with a header row. |
| email_column | No | Header of the column holding the email addresses. |
| delimiter | No | , ; tab or |; auto-detected if omitted. |
| Idempotency-Key | No | Header (up to 128 characters). Retrying the request with the same key will not create a second job. |
curl -X POST https://api.mailspecto.com/api/v1/jobs \
-H "Authorization: Bearer $MAILSPECTO_API_KEY" \
-H "Idempotency-Key: import-2026-11-25" \
-F "[email protected]" \
-F "email_column=email"
{
"id": "6f1c2a4e-…",
"status": "queued",
"original_filename": "contacts.csv",
"email_column": "email",
"progress": {
"total_rows": 2500,
"processed_rows": 0,
"percent": 0
},
"links": {
"self": "/api/v1/jobs/6f1c2a4e-…",
"results": "/api/v1/jobs/6f1c2a4e-…/results",
"export": "/api/v1/jobs/6f1c2a4e-…/export"
}
}
Job status, results and export
/api/v1/jobs/{job_id}
Status (queued, processing, completed, failed, cancelled) and progress.
/api/v1/jobs/{job_id}/results
Paginated results (limit up to 1000, offset) with filters, e.g. status, is_disposable, is_duplicate.
/api/v1/jobs/{job_id}/export
The results as a CSV file (optionally only one status).
/api/v1/jobs/{job_id}/retry
Retries a failed job, or the rows that failed with processing errors.
Addresses the recipient's server temporarily refused to check (greylisting, throttling) are retried automatically: their number and the time of the next attempt are in progress.waiting_rows and progress.next_retry_at.
/api/v1/credits
Returns your organisation's credit balance and whether it has fallen below the warning threshold. Handy to check before a large import.
{
"billing_mode": "prepaid",
"balance": 18450,
"low_balance": false,
"low_balance_threshold": 1000
}
Webhook notifications
Available
Instead of polling GET /api/v1/jobs/{job_id}, receive a signed notification at your HTTPS endpoint. Set the URL and events in the panel under Webhooki (admin role); the signing secret (whsec_…) is shown only once.
| Event | When |
|---|---|
| job.completed | A CSV job (including integration jobs) finished: row counts, statuses, recommendations and result links. |
| job.failed | A job failed, with its error code and message. |
| integration_sync.completed | A MailerLite, GetResponse, Mailchimp, Brevo or ActiveCampaign sync finished: contacts fetched, skipped and written. |
| integration_sync.failed | A sync failed. |
| credits.low_balance | The credit balance dropped below the warning threshold (level: low) or to zero (empty). |
| domain.dns_changed | Domain monitoring: an SPF, DKIM, DMARC, MX, MTA-STS or TLS-RPT record changed. |
| domain.dns_broken / domain.dns_recovered | Domain monitoring: a problem appeared or cleared (e.g. DMARC missing, a DKIM key gone, a weaker policy). |
| dmarc.new_source / dmarc.compliance_drop / dmarc.reports_missing / dmarc.recovered | DMARC reports: a new non-compliant source, a compliance drop, no reports for 3 days, back to normal. |
Example request
POST https://your-server.com/mailspecto
Content-Type: application/json
MailSpecto-Event: job.completed
MailSpecto-Event-Id: 5b0f2c1e-8d7a-4f3b-9e21-6c4d0a7b9f10
MailSpecto-Delivery-Id: 9c2e7a44-1b3d-4e5f-a6b7-c8d9e0f1a2b3
MailSpecto-Signature: t=1764190000,v1=3f9a…c41e
{
"id": "5b0f2c1e-8d7a-4f3b-9e21-6c4d0a7b9f10",
"type": "job.completed",
"created_at": "2026-11-26T15:02:00+00:00",
"data": {
"job": {
"id": "0d3f…",
"status": "completed",
"original_filename": "list.csv",
"rows": {"total": 812, "processed": 812, "errors": 0, "duplicates": 3, "unique_emails": 809},
"recommendations": {"send": 520, "send_with_caution": 150, "do_not_send": 120, "retry_later": 22},
"links": {"results": "/api/v1/jobs/0d3f…/results", "export": "/api/v1/jobs/0d3f…/export"}
}
}
}
Verifying the signature
Compute HMAC-SHA256 of <t>.<raw request body> with the webhook secret, compare it with v1 in constant time and reject t older than 5 minutes. Use MailSpecto-Event-Id to skip duplicates.
import hashlib, hmac, time
def verify(secret: str, header: str, body: bytes) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
signed = parts["t"].encode() + b"." + body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(expected, parts["v1"])
Answer with any 2xx code within 10 seconds; redirects are not followed. Failed deliveries are retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h (8 attempts). An endpoint that accepts nothing for 72 hours is disabled and you get an e-mail. The panel shows the delivery history with payloads and responses, sends test events and retries failed deliveries. We only deliver to public HTTPS addresses.
Verification statuses
| status | Meaning |
|---|---|
| mailbox_exists | The mail server accepted this address and refused a random one in the same domain: the mailbox exists. |
| catch_all | The server accepts any address, even non-existent ones, so the specific mailbox cannot be confirmed. |
| domain_accepts_mail | The domain receives mail (valid DNS and MX), but the mailbox was not confirmed: SMTP was disabled or the answer was inconclusive. |
| risky | The address may cause problems, e.g. a disposable domain, a role account or a likely typo (see reason_code and risk_signals). |
| invalid | Mail cannot be delivered to this address: invalid syntax, no such domain, Null MX or the mailbox does not exist. |
| unknown | The result could not be determined (e.g. a DNS timeout). Try again later. |
HTTP error codes
| Code | Meaning |
|---|---|
| 401 Unauthorized | The API key is missing, invalid, revoked or used from an IP address outside its allowlist. |
| 402 Payment Required | Your organisation has run out of credits. |
| 404 Not Found | The job does not exist or belongs to another organisation. |
| 409 Conflict | The operation is not possible in the current state, e.g. exporting a job that is still running. |
| 413 Content Too Large | The CSV file exceeds the size limit. |
| 415 Unsupported Media Type | Unsupported file or request body type. |
| 422 Unprocessable Content | Invalid input, e.g. a missing email field or an unknown JSON field. |
| 429 Too Many Requests | Rate limit exceeded. Retry with a delay (backoff). |
| 503 Service Unavailable | Service temporarily unavailable. Retry shortly. |
The full, auto-generated specification of every endpoint: api.mailspecto.com/docs (OpenAPI).