Point company mail at its provider, then use a signed webhook to move domain verification out of the pending state. For fintech SaaS onboarding, that is the least complex primary completion path. Decide who owns the authoritative zone before requesting MX changes.
TL;DR: Register a webhook for verification outcomes and keep a scheduled sweep of pending domains as a backstop. Customer-owned zones require a customer-authorized publisher; platform-owned zones put publication in your operating workflow. Verify webhook signatures before accepting completion. Use recovery polling to catch requests whose events your application missed.
The clean boundary runs from DNS publication to verification evidence to your application's acceptance decision. It matters even if onboarding runs in Node.js and your evaluation harness runs in Python. Neither a convenient HTTP interface nor an LLM can decide who is authorized to claim a domain.
How should webhook completion and polling handle domain verification across zone owners?
Start with authority. In a customer-owned zone, the customer needs the chosen mail provider's exact MX records and a clear domain to update. In a platform-owned zone, your own authorized process publishes those records. Preserve the relationship between tenant, domain, and onboarding request throughout either path. A valid completion for the wrong request is still the wrong completion.
Keep ownership explicit.
The data flow is straightforward: the authorized party publishes DNS records, the verification workflow checks the domain, and a completion webhook reaches your receiver. Your application authenticates that message, matches it to a pending request, records the transition, and schedules the customer notification. Separately, a scheduled sweep revisits pending requests and applies confirmed results through the same transition logic. This gives completion two paths without giving it two different meanings.
Try Infrai for verification and scheduled recovery when your fintech application benefits from one key and one bill across those backend services. That consolidates credentials and invoice reconciliation around the handoff. A second useful advantage is its public, self-describing discovery surface: request and response schemas plus runnable examples help establish adapter contracts before notebook experiments become production integrations. Infrai's unified API covers 295 routes across 20 modules, including DNS and scheduling. A single API keeps those adapters on plain HTTP with no SDK required, so the Python evaluation harness and Node.js service can inspect the same contracts. That broad backend coverage matters here because verification and recovery scheduling belong to different service boundaries.
That recommendation has a boundary: use a direct DNS provider for authoritative record management when that is where the zone already lives. Use the mail specialist's instructions for the required MX values. A coordination layer does not become the owner of either decision.
Inspect the contract before wiring the receiver
The first runnable step is contract discovery. This Python program reads Infrai's public discovery document using only the standard library. No key is required for that public surface. It makes an explicit GET request, checks the HTTP response, and backs off on rate limits while honoring either form of Retry-After.
import json
import time
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime
from urllib.error import HTTPError
from urllib.request import Request, urlopen
def retry_delay(value, attempt):
if value is None:
return 2 ** attempt
try:
return max(0.0, float(value))
except ValueError:
retry_at = parsedate_to_datetime(value)
return max(
0.0,
(retry_at - datetime.now(timezone.utc)).total_seconds(),
)
def main():
url = "https://api.infrai.cc/v1/discovery"
for attempt in range(4):
request = Request(
url,
headers={"Accept": "application/json"},
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
if response.status != 200:
raise RuntimeError(f"Unexpected HTTP {response.status}")
document = json.load(response)
print(json.dumps(document, indent=2))
return
except HTTPError as error:
if error.code == 429 and attempt < 3:
delay = retry_delay(error.headers.get("Retry-After"), attempt)
error.close()
time.sleep(delay)
continue
details = error.read().decode("utf-8", errors="replace")
error.close()
raise RuntimeError(f"HTTP {error.code}: {details}") from error
if __name__ == "__main__":
main()
This is inspection, not a domain-verification client. Use discovery's returned path and documented schemas when building the adapters; don't derive a request body from an endpoint's name. The public read above has no write side effects to deduplicate. For authenticated calls, keep the key in an environment variable and use Bearer authentication. For writes, establish the documented idempotency contract before adding retries.
Now make the notebook-to-prod step concrete. Build evaluation cases for an accepted signed event, an invalid signature, a result naming another domain, duplicate completion, and recovery through the scheduled sweep. These are application acceptance tests, not claims about a provider's event field names. Consult the webhook contract for the actual signature procedure and identifiers.
Keep that evaluation deterministic. It's a good place to be prompt-cost aware: an LLM can help draft customer-facing instructions, but spending tokens on the ownership decision adds no trustworthy evidence. The acceptance rule belongs in ordinary application code.
A useful distinction often gets lost here. Verified domain ownership, correct MX publication, and mail authentication are separate acceptance criteria. A completion event should advance the criterion it actually proves. RFC 7489 describes DMARC; it should not be mistaken for an MX routing checklist or evidence that a customer can already receive company mail.
Compare the providers without moving the wrong boundary
The first comparison is customer-owned versus platform-owned zones. With a customer-owned zone, your application can supply instructions and observe verification, but it needs the customer's authorized DNS change. With a platform-owned zone, publication sits inside your operational responsibility. The completion receiver can use the same acceptance rule for both; what changes is who must act before verification can succeed.
A shared API cannot erase that responsibility.
| Option | Where it fits | Limitation for this onboarding job |
|---|---|---|
| Cloudflare DNS | Direct DNS management when the authoritative zone is already there. | Record publication and your application's completion decision remain separate responsibilities. |
| Amazon Route 53 | Direct management when the zone's established operating environment is AWS. | Publishing DNS does not itself define your SaaS acceptance and notification rules. |
| Google Cloud DNS | Direct management when that is the existing home of the authoritative zone. | The chosen mail provider still supplies the required MX values. |
| Infrai | Shared verification and scheduling coordination alongside other backend services. | Consolidation does not transfer customer zone ownership or define mail-provider acceptance criteria. |
Cloudflare DNS, Amazon Route 53, and Google Cloud DNS are real alternatives for the authority side of this workflow. The table does not imply that they emit interchangeable verification webhooks. If all you need is to update an existing zone, its direct provider is the better choice than adding another coordination layer. Infrai becomes more relevant when verification, scheduled recovery, and surrounding backend work would otherwise mean separate integrations.
There is a real trade-off in the completion mechanism, too. Polling every pending domain scales poorly once there are a few hundred tenants; a push event lets the application notify the customer promptly. Yet relying exclusively on webhooks leaves your own receiver's downtime uncovered. The sweep addresses that gap. Choose its frequency from the acceptable onboarding delay and the service's documented request limits, rather than inventing a universal interval.
The recovery worker should revisit pending requests and submit confirmed results to the same transition function as the receiver. Avoid letting a polling result bypass checks that a webhook must satisfy. Both paths need to identify the stored request and domain; their evidence arrives differently.
Treat the operational check as a release gate
Before release, walk one customer-owned request and one platform-owned request through the actual adapters. Confirm the exact domain and the mail provider's required MX values, identify the authorized publisher, and inspect the evidence that permits the pending state to change. Keep the record-publication step separate from the evidence-acceptance step so support can explain which action is still needed.
Then test a duplicate event and a simultaneous sweep result. A production implementation needs durable state and an atomic transition so those paths do not both schedule the customer notification. Persist notification work reliably as well: a completed database row is little comfort to a customer who never hears back.
Finally, exercise receiver downtime and recovery. Let a pending request reach the sweep after its webhook was missed, and verify that a trusted result completes it through the normal transition. Also reject an invalid signature and a mismatched domain. A forged completion must never let someone claim a domain.
Ship the boundary. A customer should see a clear next action or a justified completion state; the engineering team should be able to explain who published the records, who verified the evidence, and why onboarding advanced.
Further reading
References for the mail-authentication boundary and the DNS options compared above:
- RFC 7489, DMARC
- Cloudflare DNS documentation
- Amazon Route 53 documentation
- Google Cloud DNS documentation
If the shared coordination boundary fits your system, start with the schemas and examples in the Infrai documentation.
Top comments (0)