{
  "openapi": "3.1.0",
  "info": {
    "title": "MailSift API",
    "version": "1.0.0",
    "summary": "Real-time email verification and bulk CSV validation.",
    "description": "The MailSift API verifies email addresses in real time and processes bulk CSV jobs.\n\nAuthenticate every request with an API key in the `X-API-Key` header. Generate a key in the MailSift dashboard. The same endpoints also accept an authenticated session cookie when called from the dashboard, but API integrations should use an API key.\n\nAll responses are JSON unless noted (CSV download and the SSE progress stream). Errors use the shape `{ \"error\": \"message\" }`.\n\n## Verification modes\n\nEvery verification endpoint accepts an optional `mode` of `fast` or `deep`.\n\n`fast` is the default and the existing engine: syntax, normalization, domain and DNS, MX, disposable and temp-mail detection, relay and forwarder detection, role accounts, free providers, SPF, DMARC, typo suggestions, domain intelligence, domain age, local-part risk signals, catch-all detection, and the MailSift trust score. It costs 1 credit per email.\n\n`deep` (Deep Verification) runs everything in `fast` and then opens an SMTP conversation with the recipient's mail server to check the mailbox itself: mailbox acceptance, recipient-specific rejection, catch-all resolution, greylisting detection, provider-specific interpretation, and STARTTLS. It costs up to 5 credits per email and adds an `smtp` object to the response.\n\nOmitting `mode` means `fast`. Existing integrations are unchanged: same latency, same 1-credit cost, same response fields. The `smtp` object appears only on deep responses.\n\nDeep verification takes longer than standard verification because MailSift talks to the recipient's mail server and waits for its replies. No exact completion time is promised.\n\nDeep verification confirms a mailbox where the receiving mail server supports it. Some providers deliberately conceal mailbox existence: Yahoo and AOL accept recipients they cannot confirm, and secure gateways such as Proofpoint and Mimecast accept every recipient at the perimeter. For those, MailSift returns an honest `unknown`, usually with `catch_all: true`, instead of guessing.",
    "contact": {
      "name": "MailSift Support",
      "url": "https://mailsift.dev/contact"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://mailsift.dev/terms"
    }
  },
  "externalDocs": {
    "description": "Human-readable API reference",
    "url": "https://mailsift.dev/api"
  },
  "servers": [
    { "url": "https://mailsift.dev/api/v1", "description": "Production" }
  ],
  "security": [{ "ApiKeyAuth": [] }],
  "tags": [
    { "name": "Verification", "description": "Single and batch email verification." },
    { "name": "Bulk Jobs", "description": "Asynchronous CSV verification jobs." },
    { "name": "Account", "description": "Credits, usage, and webhook configuration." }
  ],
  "paths": {
    "/verify": {
      "get": {
        "tags": ["Verification"],
        "operationId": "verifyEmail",
        "summary": "Verify a single email address",
        "description": "Runs syntax, MX, SPF, DMARC, disposable, role, catch-all and related checks for one address and returns a status, score, and the individual signals.\n\nWith `mode=fast` (the default) the call costs 1 credit. With `mode=deep` it also runs an SMTP mailbox check and costs up to 5 credits; see the `mode` parameter and the `smtp` field on VerifyResult for details.",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "description": "Email address to verify (max 254 characters, RFC 5321).",
            "schema": { "type": "string", "format": "email", "maxLength": 254 },
            "example": "johnsmith@gmail.com"
          },
          { "$ref": "#/components/parameters/VerifyMode" },
          { "$ref": "#/components/parameters/IdempotencyKey" }
        ],
        "responses": {
          "200": {
            "description": "Verification result.",
            "headers": {
              "Idempotent-Replay": {
                "description": "Present and set to `true` when this response was replayed from a stored result for a repeated `Idempotency-Key`. The verification was not re-run and no credits were charged again.",
                "schema": { "type": "string", "enum": ["true"] }
              }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/VerifyResult" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "409": { "$ref": "#/components/responses/IdempotencyInFlight" },
          "422": { "$ref": "#/components/responses/IdempotencyMismatch" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/verify/batch": {
      "post": {
        "tags": ["Verification"],
        "operationId": "verifyBatch",
        "summary": "Verify up to 100 emails synchronously",
        "description": "Verifies an array of up to 100 addresses in a single call and returns a result per address. Processing stops early (with `truncated: true`) if credits run out mid-batch.\n\nWith `mode=fast` (the default) each successfully verified address costs 1 credit. With `mode=deep` each address costs up to 5 credits and its result carries an `smtp` object.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/BatchRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-email results.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/BatchResponse" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/verify/bulk": {
      "post": {
        "tags": ["Bulk Jobs"],
        "operationId": "createBulkJob",
        "summary": "Create a bulk verification job from a CSV",
        "description": "Uploads a CSV (multipart form field `file`) and enqueues an asynchronous job. The CSV must include a header row and a column whose name contains \"email\". Returns the created job immediately with `status: pending`; poll `GET /jobs/{id}` or stream `GET /jobs/{id}/stream` for progress.\n\nA `mode=deep` job reserves 5 credits per row before it starts and refunds the unused remainder when the job finishes. Its results CSV appends two columns after all existing columns: `smtp_status` and `mailbox_exists`.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["file"],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV file with an email column and a header row. Max 32 MB."
                  },
                  "mode": {
                    "type": "string",
                    "enum": ["fast", "deep"],
                    "default": "fast",
                    "description": "Verification mode for every row in this job. `fast` costs 1 credit per row. `deep` adds an SMTP mailbox check and costs up to 5 credits per row."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Job created.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/BulkJob" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/jobs": {
      "get": {
        "tags": ["Bulk Jobs"],
        "operationId": "listJobs",
        "summary": "List bulk jobs",
        "description": "Returns the caller's bulk jobs, most recent first.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of jobs to return. Returns all jobs if omitted.",
            "schema": { "type": "integer", "minimum": 1 }
          }
        ],
        "responses": {
          "200": {
            "description": "List of jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/BulkJob" }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/jobs/{id}": {
      "parameters": [{ "$ref": "#/components/parameters/JobId" }],
      "get": {
        "tags": ["Bulk Jobs"],
        "operationId": "getJob",
        "summary": "Get a bulk job",
        "description": "Returns a job's summary and live progress counters (updated in real time by the worker while processing).",
        "responses": {
          "200": {
            "description": "Job summary.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/BulkJob" }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      },
      "delete": {
        "tags": ["Bulk Jobs"],
        "operationId": "cancelJob",
        "summary": "Cancel or delete a bulk job",
        "description": "Cancels a pending/processing job, or deletes a finished job and its stored results.",
        "responses": {
          "200": {
            "description": "Job cancelled or deleted.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Message" },
                "examples": {
                  "cancelled": { "value": { "message": "job cancelled" } },
                  "deleted": { "value": { "message": "job deleted" } }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/jobs/{id}/results": {
      "parameters": [{ "$ref": "#/components/parameters/JobId" }],
      "get": {
        "tags": ["Bulk Jobs"],
        "operationId": "getJobResults",
        "summary": "Get parsed result rows",
        "description": "Returns paginated, parsed result rows for a completed job — useful for in-app filtering without downloading the full CSV.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "1-indexed page number.",
            "schema": { "type": "integer", "minimum": 1, "default": 1 }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "Rows per page.",
            "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by verification status.",
            "schema": { "type": "string", "enum": ["valid", "risky", "invalid", "unknown"] }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive substring match on the email address.",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated result rows.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/JobResultsPage" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/jobs/{id}/download": {
      "parameters": [{ "$ref": "#/components/parameters/JobId" }],
      "get": {
        "tags": ["Bulk Jobs"],
        "operationId": "downloadJob",
        "summary": "Download the results CSV",
        "description": "Streams the final results CSV as a file attachment. Available once the job is complete.\n\nA deep job appends two extra columns after all existing columns, whose positions are unchanged: `smtp_status` (the values of `smtp.status`) and `mailbox_exists` (`yes`, `no`, or `unknown`).",
        "responses": {
          "200": {
            "description": "Results CSV.",
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename, e.g. attachment; filename=\"results-<original>.csv\".",
                "schema": { "type": "string" }
              }
            },
            "content": {
              "text/csv": { "schema": { "type": "string", "format": "binary" } }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/jobs/{id}/stream": {
      "parameters": [{ "$ref": "#/components/parameters/JobId" }],
      "get": {
        "tags": ["Bulk Jobs"],
        "operationId": "streamJobProgress",
        "summary": "Stream job progress (SSE)",
        "description": "Server-Sent Events stream that emits job progress (processed/valid/invalid/risky counts and status) until the job reaches a terminal state. Consume with an EventSource-compatible client.",
        "responses": {
          "200": {
            "description": "An event stream of job progress snapshots.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "SSE frames whose `data:` payload is a JSON-encoded BulkJob snapshot."
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/account": {
      "get": {
        "tags": ["Account"],
        "operationId": "getAccount",
        "summary": "Get account, credits, and usage",
        "description": "Returns the current credit balance, usage for the calendar month, and (when present and authenticated via session) the webhook configuration. Some fields are omitted depending on the authentication mode.",
        "responses": {
          "200": {
            "description": "Account summary.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Account" }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "API key generated in the MailSift dashboard. Format: msk_..."
      }
    },
    "parameters": {
      "JobId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Bulk job identifier (UUID).",
        "schema": { "type": "string", "format": "uuid" }
      },
      "VerifyMode": {
        "name": "mode",
        "in": "query",
        "required": false,
        "description": "Verification mode.\n\n`fast` (default) runs the standard engine: syntax, normalization, domain and DNS, MX, disposable and temp-mail detection, relay and forwarder detection, role accounts, free providers, SPF, DMARC, typo suggestions, domain intelligence, domain age, local-part risk signals, catch-all detection, and the MailSift trust score. Costs 1 credit.\n\n`deep` runs all of the above and then opens an SMTP conversation with the recipient's mail server to check the mailbox itself. The response gains an `smtp` object. Costs up to 5 credits and takes longer, because it waits on the recipient's mail server.\n\nOmitting this parameter behaves exactly as before: fast mode, 1 credit, no `smtp` object.",
        "schema": { "type": "string", "enum": ["fast", "deep"], "default": "fast" },
        "example": "deep"
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Optional client-generated key that makes a retry safe. Retrying with the same key and the same request replays the stored response instead of re-running the verification or charging again, and the replay carries an `Idempotent-Replay: true` header. Reusing a key with a different request returns `422`; a key whose original request is still in flight returns `409`. Stored responses last 24 hours.",
        "schema": { "type": "string", "maxLength": 255 },
        "example": "3f1c9a7e-5d40-4c1b-9c2e-0a7b6d3e8f12"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "Unauthorized": {
        "description": "Missing or invalid credentials.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" },
            "example": { "error": "unauthorized" }
          }
        }
      },
      "PaymentRequired": {
        "description": "Insufficient credits.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" },
            "example": { "error": "insufficient credits" }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" },
            "example": { "error": "job not found" }
          }
        }
      },
      "IdempotencyInFlight": {
        "description": "The original request for this Idempotency-Key is still running. Retry shortly.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" },
            "example": { "error": "a request with this idempotency key is still in progress" }
          }
        }
      },
      "IdempotencyMismatch": {
        "description": "This Idempotency-Key was already used for a different request. Use a new key.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" },
            "example": { "error": "idempotency key was already used for a different request" }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded. See the X-RateLimit-* response headers.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "ServerError": {
        "description": "Unexpected server error.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": { "type": "string", "description": "Human-readable error message." }
        }
      },
      "Message": {
        "type": "object",
        "required": ["message"],
        "properties": {
          "message": { "type": "string" }
        }
      },
      "Checks": {
        "type": "object",
        "description": "Individual boolean signals that feed the score and status.",
        "properties": {
          "syntax": { "type": "boolean", "description": "Address is syntactically valid." },
          "free": { "type": "boolean", "description": "Free email provider (e.g. Gmail)." },
          "disposable": { "type": "boolean", "description": "Disposable/temporary provider." },
          "mx": { "type": "boolean", "description": "Domain has MX records." },
          "parked": { "type": "boolean", "description": "Domain appears parked." },
          "relay": { "type": "boolean", "description": "Address is an anonymized relay." },
          "spf": { "type": "boolean", "description": "Domain publishes an SPF record." },
          "dmarc": { "type": "boolean", "description": "Domain publishes a DMARC record." },
          "catch_all": { "type": "boolean", "description": "Domain accepts all addresses (catch-all)." },
          "role": { "type": "boolean", "description": "Role-based mailbox (e.g. support@)." },
          "dnsbl": { "type": "boolean", "description": "Domain or its primary mail server is on a blocklist. Present only when the blocklist check produced an answer: `false` means checked and clean, and an absent key means the check did not run for this address." },
          "mx_routable": { "type": "boolean", "description": "At least one MX host resolves to a public address. Omitted when a resolver failure kept it from being determined." },
          "forwarder": { "type": "boolean", "description": "Mail for the domain is handled by a forwarding service (ImprovMX, Forward Email, Cloudflare Email Routing, Namecheap forwarding). Context only; it does not affect the score." },
          "smtputf8": { "type": "boolean", "description": "The local part contains non-ASCII characters (RFC 6531). Such addresses are valid but not every mail system can deliver to them, and deep verification reports smtp_smtputf8 for them." },
          "mta_sts": { "type": "boolean", "description": "The domain publishes an MTA-STS record. Context only. Omitted when the lookup failed." },
          "tls_rpt": { "type": "boolean", "description": "The domain publishes a TLS-RPT record. Context only. Omitted when the lookup failed." },
          "bimi": { "type": "boolean", "description": "The domain publishes a BIMI record. Context only. Omitted when the lookup failed." }
        }
      },
      "Smtp": {
        "type": "object",
        "description": "Result of the SMTP mailbox check. Present only on deep responses; fast responses omit this object entirely.\n\n`smtp.status` is not the overall status. It describes what the recipient's mail server said about this mailbox. The top-level `status` combines every signal, so an address can be SMTP-`deliverable` and still be overall `risky` because it is disposable, a role account, or a relay.",
        "required": ["checked", "status"],
        "properties": {
          "checked": {
            "type": "boolean",
            "description": "Whether an SMTP conversation actually took place. When false, `status` is `not_checked` and `reason` explains why."
          },
          "status": {
            "type": "string",
            "enum": [
              "deliverable",
              "undeliverable",
              "catch_all",
              "unknown",
              "greylisted",
              "rate_limited",
              "policy_blocked",
              "timeout",
              "not_checked"
            ],
            "description": "Mailbox-level outcome.\n\n`deliverable`: the server accepted the recipient and its acceptance is trustworthy.\n`undeliverable`: the server issued a recipient-specific permanent rejection.\n`catch_all`: the domain accepts every recipient, so acceptance proves nothing about this mailbox.\n`unknown`: the conversation completed but the answer is not conclusive, usually because the provider conceals mailbox existence.\n`greylisted`: a temporary deferral typical of greylisting.\n`rate_limited`: the server is throttling right now.\n`policy_blocked`: the server rejected on policy or reputation grounds aimed at the sender, not the recipient.\n`timeout`: the server did not answer in time.\n`not_checked`: no SMTP conversation was attempted."
          },
          "reason": {
            "type": "string",
            "enum": [
              "smtp_not_required",
              "smtp_not_requested",
              "smtp_unavailable",
              "smtp_no_mx",
              "smtp_invalid_syntax",
              "smtp_smtputf8",
              "smtp_unsafe_mx",
              "smtp_throttled",
              "smtp_abuse_throttled"
            ],
            "description": "Why no SMTP conversation ran. Present only when `checked` is false.\n\n`smtp_not_required`: the standard checks already settled the address.\n`smtp_not_requested`: the caller asked for fast mode.\n`smtp_unavailable`: the SMTP layer was not available for this request.\n`smtp_no_mx`: the domain has no usable MX record.\n`smtp_invalid_syntax`: the address is not well-formed.\n`smtp_smtputf8`: the local part is internationalized (RFC 6531); the probe does not negotiate SMTPUTF8, so it does not ask.\n`smtp_unsafe_mx`: the MX record resolved to an address MailSift will not connect to.\n`smtp_throttled`: no probe slot was available in time.\n`smtp_abuse_throttled`: the caller exceeded mailbox-enumeration limits."
          },
          "sub_reason": {
            "type": "string",
            "enum": [
              "mailbox_not_found",
              "mailbox_full",
              "mailbox_disabled",
              "domain_not_found",
              "accept_all_gateway",
              "provider_unverifiable",
              "connection_failed",
              "protocol_error",
              "tls_required",
              "sender_rejected"
            ],
            "description": "Extra detail the status alone cannot express, such as the difference between a mailbox that does not exist and one that exists but is full or disabled. Omitted when there is nothing to add."
          },
          "response_code": { "type": "integer", "description": "SMTP reply code from the recipient's server, e.g. 250 or 550." },
          "enhanced_code": { "type": "string", "description": "Enhanced status code from the reply, e.g. \"2.1.5\" or \"5.1.1\"." },
          "catch_all": {
            "type": "boolean",
            "description": "Whether the domain accepts every recipient. Omitted entirely when the catch-all state is unknown, so an omitted field is not the same as false."
          },
          "tls": { "type": "boolean", "description": "Whether the conversation used STARTTLS." },
          "mx_host": { "type": "string", "description": "Mail host that answered, e.g. \"mx.example.com\"." },
          "provider": { "type": "string", "description": "Recognized mail provider, e.g. \"google\"." },
          "latency_ms": { "type": "integer", "description": "Time the SMTP conversation took, in milliseconds." }
        },
        "examples": [
          {
            "checked": true,
            "status": "deliverable",
            "response_code": 250,
            "enhanced_code": "2.1.5",
            "catch_all": false,
            "tls": true,
            "mx_host": "mx.example.com",
            "provider": "google",
            "latency_ms": 84
          },
          {
            "checked": true,
            "status": "undeliverable",
            "sub_reason": "mailbox_not_found",
            "response_code": 550,
            "enhanced_code": "5.1.1",
            "catch_all": false,
            "tls": true,
            "mx_host": "mx.example.com",
            "provider": "google",
            "latency_ms": 96
          },
          {
            "checked": false,
            "status": "not_checked",
            "reason": "smtp_not_required"
          }
        ]
      },
      "VerifyResult": {
        "type": "object",
        "required": ["email", "status", "score", "checks", "domain"],
        "properties": {
          "email": { "type": "string" },
          "status": {
            "type": "string",
            "enum": ["valid", "risky", "invalid", "unknown"],
            "description": "Overall classification, combining every signal. This is not the same field as `smtp.status`: a mailbox can be SMTP-`deliverable` while the address is overall `risky` because it is disposable, a role account, or a relay."
          },
          "sub_status": { "type": "string", "enum": ["failed_syntax_check", "domain_not_found", "does_not_accept_mail", "mx_unroutable", "mailbox_not_found", "mailbox_disabled", "domain_rejected_by_mail_server", "dns_error", "no_mx_records", "disposable", "blocklisted", "parked", "role_based", "role_based_catch_all", "relay", "catch_all", "synthetic_local_part", "new_domain", "low_score"], "description": "Stable code for the most decisive finding behind a status that is not valid. Omitted for valid addresses. Values may be added over time but are never renamed.\n\n`failed_syntax_check` (invalid): The address is not well-formed.\n`domain_not_found` (invalid): The domain does not exist.\n`does_not_accept_mail` (invalid): The domain publishes a null MX: it declares that it accepts no mail.\n`mx_unroutable` (invalid): The domain's MX records name hosts that do not exist, or that resolve only to loopback or private addresses.\n`mailbox_not_found` (invalid): Deep only. The receiving mail server rejected the mailbox as nonexistent.\n`mailbox_disabled` (invalid): Deep only. The mailbox exists but has been disabled or suspended.\n`domain_rejected_by_mail_server` (invalid): Deep only. The receiving server does not handle mail for this domain.\n`dns_error` (unknown): A temporary DNS failure kept the domain from being resolved. Retry.\n`no_mx_records` (risky): The domain exists but publishes no MX records, so deliverability cannot be confirmed.\n`disposable` (risky): Throwaway address provider.\n`blocklisted` (risky): The domain or its mail server is on a blocklist. See dnsbl_listings.\n`parked` (risky): The domain is parked or for sale.\n`role_based` (risky): A shared functional inbox such as info@ or support@.\n`role_based_catch_all` (risky): A role address on a domain that accepts every recipient.\n`relay` (risky): A privacy alias service that hides the real recipient.\n`catch_all` (risky): The domain accepts every recipient, so this mailbox cannot be confirmed. See catch_all_confidence.\n`synthetic_local_part` (risky): The local part looks machine-generated or like a test address, on a free provider.\n`new_domain` (risky): The domain was registered less than 30 days ago.\n`low_score` (risky): No single finding; the combined score is below 80." },
          "score": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Confidence/quality score." },
          "mode": {
            "type": "string",
            "enum": ["fast", "deep"],
            "description": "Verification mode that produced this result. Fast responses carry no `smtp` object."
          },
          "credits_used": {
            "type": "integer",
            "description": "Credits actually charged for this request. Omitted where billing does not apply, such as the public demo.\n\nFast mode is always 1. Deep mode is 1 when the SMTP check was unnecessary or could not produce a useful answer, and 5 when it produced real mailbox- or domain-level intelligence. It is 1 or 5 for the whole request, never both added together. An overall `status` of `unknown` costs 0, as it always has."
          },
          "smtp": { "$ref": "#/components/schemas/Smtp" },
          "checks": { "$ref": "#/components/schemas/Checks" },
          "domain": { "type": "string" },
          "mx_records": { "type": "array", "items": { "type": "string" } },
          "free_check": { "type": "boolean" },
          "response_time_ms": { "type": "integer", "description": "Server-side verification time in milliseconds." },
          "checked_at": { "type": "string", "format": "date-time" },
          "engine_version": { "type": "string", "description": "Identifier of the check + scoring ruleset that produced this result; changes when the ruleset changes. A status of \"unknown\" means the result could not be determined (e.g. a transient DNS failure), not a property of the address." },
          "normalized_email": { "type": "string", "description": "Canonicalized form of the address." },
          "did_you_mean": { "type": "string", "description": "Typo suggestion, when detected." },
          "mx_provider": { "type": "string", "description": "Recognized mail provider, e.g. \"Google\"." },
          "domain_age_days": { "type": "integer", "description": "Approximate domain age in days." },
          "dnsbl_listings": { "type": "array", "items": { "type": "string" }, "description": "Blocklists the domain (`Spamhaus DBL`) or its primary mail server IP (`Spamhaus ZEN`) appears on. Omitted when there are none." },
          "spf_record": { "type": "string" },
          "dmarc_record": { "type": "string" },
          "dmarc_policy": { "type": "string", "enum": ["none", "quarantine", "reject"], "description": "The DMARC policy that applies to the domain: none, quarantine or reject. Taken from the organizational domain (honoring sp=) when the domain itself publishes no record." },
          "is_catch_all": { "type": "boolean" },
          "catch_all_confidence": { "type": "integer", "minimum": 5, "maximum": 95, "description": "Integer from 5 to 95: how likely the mailbox is to be real when the domain accepts every recipient, weighed from domain age, email authentication, mail provider and the shape of the local part. Present only for catch-all domains. The catch-all score penalty scales with it: 5 points at 70 or above, 15 at 40 to 69, 25 below 40." },
          "reasons": { "type": "array", "items": { "type": "string" } }
        },
        "examples": [
          {
            "email": "johnsmith@gmail.com",
            "status": "valid",
            "score": 92,
            "mode": "fast",
            "credits_used": 1,
            "checks": {
              "syntax": true, "free": true, "disposable": false, "mx": true,
              "parked": false, "relay": false, "spf": true, "dmarc": true,
              "catch_all": false, "role": false
            },
            "domain": "gmail.com",
            "mx_records": ["gmail-smtp-in.l.google.com", "alt1.gmail-smtp-in.l.google.com"],
            "normalized_email": "johnsmith@gmail.com",
            "mx_provider": "Google",
            "is_catch_all": false,
            "domain_age_days": 11188,
            "response_time_ms": 46,
            "checked_at": "2026-04-01T17:32:18Z",
            "engine_version": "2026-08-09"
          },
          {
            "email": "johnsmith@gmail.com",
            "status": "valid",
            "score": 97,
            "mode": "deep",
            "credits_used": 5,
            "checks": {
              "syntax": true, "free": true, "disposable": false, "mx": true,
              "parked": false, "relay": false, "spf": true, "dmarc": true,
              "catch_all": false, "role": false
            },
            "smtp": {
              "checked": true,
              "status": "deliverable",
              "response_code": 250,
              "enhanced_code": "2.1.5",
              "catch_all": false,
              "tls": true,
              "mx_host": "gmail-smtp-in.l.google.com",
              "provider": "google",
              "latency_ms": 84
            },
            "domain": "gmail.com",
            "mx_records": ["gmail-smtp-in.l.google.com", "alt1.gmail-smtp-in.l.google.com"],
            "normalized_email": "johnsmith@gmail.com",
            "mx_provider": "Google",
            "is_catch_all": false,
            "domain_age_days": 11188,
            "response_time_ms": 612,
            "checked_at": "2026-04-01T17:32:18Z",
            "engine_version": "2026-08-09"
          }
        ]
      },
      "BatchRequest": {
        "type": "object",
        "required": ["emails"],
        "properties": {
          "emails": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": { "type": "string", "format": "email" }
          },
          "mode": {
            "type": "string",
            "enum": ["fast", "deep"],
            "default": "fast",
            "description": "Verification mode for every address in this batch. `fast` costs 1 credit per address. `deep` adds an SMTP mailbox check and costs up to 5 credits per address."
          }
        }
      },
      "BatchResultItem": {
        "type": "object",
        "required": ["email"],
        "properties": {
          "email": { "type": "string" },
          "result": { "$ref": "#/components/schemas/VerifyResult" },
          "error": { "type": "string", "description": "Present only when this address failed to verify." }
        }
      },
      "BatchResponse": {
        "type": "object",
        "required": ["results", "count", "credits_used", "truncated"],
        "properties": {
          "results": { "type": "array", "items": { "$ref": "#/components/schemas/BatchResultItem" } },
          "count": { "type": "integer", "description": "Number of results returned." },
          "credits_used": { "type": "integer", "description": "Total credits charged across the batch." },
          "mode": {
            "type": "string",
            "enum": ["fast", "deep"],
            "description": "Verification mode used for this batch."
          },
          "truncated": { "type": "boolean", "description": "True if processing stopped early due to credit depletion." }
        }
      },
      "BulkJob": {
        "type": "object",
        "required": ["id", "filename", "total_rows", "status", "created_at"],
        "properties": {
          "id": { "type": "string", "format": "uuid" },
          "filename": { "type": "string" },
          "total_rows": { "type": "integer" },
          "processed_rows": { "type": "integer" },
          "valid_count": { "type": "integer" },
          "invalid_count": { "type": "integer" },
          "risky_count": { "type": "integer" },
          "unknown_count": { "type": "integer" },
          "status": {
            "type": "string",
            "enum": ["pending", "processing", "complete", "failed", "cancelled"]
          },
          "mode": {
            "type": "string",
            "enum": ["fast", "deep"],
            "description": "Verification mode this job runs in."
          },
          "credits_reserved": {
            "type": "integer",
            "description": "Credits held for this job when it was created: 1 per row for a fast job, 5 per row for a deep job. The unused remainder is refunded when the job finishes."
          },
          "error_message": { "type": "string" },
          "started_at": { "type": ["string", "null"], "format": "date-time" },
          "completed_at": { "type": ["string", "null"], "format": "date-time" },
          "created_at": { "type": "string", "format": "date-time" }
        }
      },
      "JobResultRow": {
        "type": "object",
        "description": "A parsed result row.",
        "properties": {
          "email": { "type": "string" },
          "verification_status": { "type": "string" },
          "verification_sub_status": { "type": "string", "description": "Same values as `sub_status`. Empty for valid rows and for result files written before the column existed. In the CSV it is the last column." },
          "verification_score": { "type": "integer" },
          "is_disposable": { "type": "boolean" },
          "has_mx": { "type": "boolean" },
          "is_role_based": { "type": "boolean" },
          "is_free_provider": { "type": "boolean" },
          "is_relay": { "type": "boolean" },
          "is_blacklisted": { "type": ["boolean", "null"], "description": "Domain or its mail server is on a blocklist. `null` when the blocklist check did not run for this row; the CSV cell is blank in that case." },
          "has_spf": { "type": "boolean" },
          "has_dmarc": { "type": "boolean" },
          "domain_age_days": { "type": "integer", "description": "Approximate domain age in days. Omitted when unknown." },
          "mx_provider": { "type": "string" },
          "normalized_email": { "type": "string" },
          "did_you_mean": { "type": "string" }
        }
      },
      "JobResultsPage": {
        "type": "object",
        "required": ["results", "total_rows", "page", "page_size", "total_pages"],
        "properties": {
          "results": { "type": "array", "items": { "$ref": "#/components/schemas/JobResultRow" } },
          "total_rows": { "type": "integer" },
          "page": { "type": "integer" },
          "page_size": { "type": "integer" },
          "total_pages": { "type": "integer" }
        }
      },
      "Usage": {
        "type": "object",
        "description": "Verification usage for the current calendar month.",
        "properties": {
          "year": { "type": "integer" },
          "month": { "type": "integer" },
          "total_checks": { "type": "integer" },
          "single_checks": { "type": "integer" },
          "bulk_checks": { "type": "integer" },
          "api_checks": { "type": "integer" },
          "public_checks": { "type": "integer" }
        }
      },
      "Account": {
        "type": "object",
        "required": ["credits", "usage", "auth_mode", "checked_at"],
        "properties": {
          "email": { "type": "string", "description": "Omitted when authenticated via API key." },
          "credits": { "type": "integer" },
          "is_admin": { "type": "boolean", "description": "Present only for admin accounts." },
          "webhook_url": { "type": "string", "description": "Configured webhook URL, when set." },
          "webhook_secret": {
            "type": "string",
            "description": "HMAC signing secret for webhook payloads. Omitted under API-key auth."
          },
          "usage": { "$ref": "#/components/schemas/Usage" },
          "auth_mode": { "type": "string", "enum": ["jwt", "api_key"] },
          "checked_at": { "type": "string", "format": "date-time" }
        }
      }
    }
  }
}
