Support: support@tinplate.dev · Zero-Retention Edge Security Support Trust Center DPA GitHub Issues
Email & Domain Tier 2 All-Access

SPF & DMARC Record Generator & Linter API — Build Valid Email Auth TXT Records

Lint existing SPF/DMARC strings and generate clean, RFC-compliant DNS TXT records. Generate and lint RFC-compliant SPF, DMARC, MTA-STS, TLS-RPT, and BIMI DNS TXT records from structured sender configuration.

Interactive Sandbox · No API Key Required 200 OK · Ready
POST /v1/email-dns-generatorinput
200 OK sample / live responsejson
{
  "ok": true,
  "data": {
    "domain": "example.com",
    "records": {
      "spf": {
        "type": "TXT",
        "host": "example.com",
        "value": "v=spf1 ip4:203.0.113.10/32 include:_spf.google.com include:sendgrid.net -all"
      },
      "dmarc": {
        "type": "TXT",
        "host": "_dmarc.example.com",
        "value": "v=DMARC1; p=quarantine; sp=quarantine; adkim=s; aspf=s; pct=100; rua=mailto:dmarc-reports@example.com;"
      },
      "tls_rpt": {
        "type": "TXT",
        "host": "_smtp._tls.example.com",
        "value": "v=TLSRPTv1; rua=mailto:dmarc-reports@example.com"
      },
      "mta_sts_txt": {
        "type": "TXT",
        "host": "_mta-sts.example.com",
        "value": "v=STSv1; id=2026111401"
      }
    },
    "spf_estimated_dns_lookups": 5,
    "spf_within_10_lookup_limit": true,
    "lint_issues": []
  },
  "meta": {
    "request_id": "req_edg_01",
    "ms": 1
  }
}
OpenAPI 3.0.3 Get All-Access Key ($29/mo) No signup. No payload storage.
Quickstart Code Examples
curl -X POST "https://api.tinplate.dev/v1/email-dns-generator" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TINPLATE_KEY" \
  -d '{"domain":"example.com","providers":["google_workspace","sendgrid"],"ip4":["203.0.113.10/32"],"spf_policy":"hardfail","dmarc_policy":"quarantine","rua_emails":["dmarc@example.com"]}'
import { TinplateClient } from "@tinplate/sdk";

const tinplate = new TinplateClient({
  apiKey: process.env.TINPLATE_API_KEY!,
});

const { data, meta } = await tinplate.call("/v1/email-dns-generator", {
  "domain": "example.com",
  "providers": [
    "google_workspace",
    "sendgrid"
  ],
  "ip4": [
    "203.0.113.10/32"
  ],
  "spf_policy": "hardfail",
  "dmarc_policy": "quarantine",
  "rua_emails": [
    "dmarc@example.com"
  ]
});
console.log(`[${meta.ms} ms]`, data);
import requests

response = requests.post(
    "https://api.tinplate.dev/v1/email-dns-generator",
    headers={
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_TINPLATE_KEY",
    },
    json={
  "domain": "example.com",
  "providers": [
    "google_workspace",
    "sendgrid"
  ],
  "ip4": [
    "203.0.113.10/32"
  ],
  "spf_policy": "hardfail",
  "dmarc_policy": "quarantine",
  "rua_emails": [
    "dmarc@example.com"
  ]
}
)
print(response.json())
const response = await fetch("https://api.tinplate.dev/v1/email-dns-generator", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_TINPLATE_KEY",
  },
  body: JSON.stringify({
  "domain": "example.com",
  "providers": [
    "google_workspace",
    "sendgrid"
  ],
  "ip4": [
    "203.0.113.10/32"
  ],
  "spf_policy": "hardfail",
  "dmarc_policy": "quarantine",
  "rua_emails": [
    "dmarc@example.com"
  ]
}),
});
const result = await response.json();
console.log(result);
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "tinplate_email_dns_generator",
    "arguments": {
      "domain": "example.com",
      "providers": [
        "google_workspace",
        "sendgrid"
      ],
      "ip4": [
        "203.0.113.10/32"
      ],
      "spf_policy": "hardfail",
      "dmarc_policy": "quarantine",
      "rua_emails": [
        "dmarc@example.com"
      ]
    }
  }
}
OpenAPI 3.0.3 Schema Contract

Request Parameters & Response Schema Reference

Request Body Parameters (POST /v1/email-dns-generator)

ParameterType & ConstraintsDescription
domain required string
minLen: 3, maxLen: 253
Target email domain.
providers optional string[]
default: []
Known ESPs whose official SPF includes should be added.
custom_includes optional string[]
default: []
Field 'custom_includes'
ip4 optional string[]
default: []
Field 'ip4'
ip6 optional string[]
default: []
Field 'ip6'
allow_mx optional boolean
default: false
Field 'allow_mx'
allow_a optional boolean
default: false
Field 'allow_a'
spf_policy optional "hardfail" | "softfail" | "neutral"
default: "hardfail"
Field 'spf_policy'
dmarc_policy optional "none" | "quarantine" | "reject"
default: "reject"
Field 'dmarc_policy'
dmarc_subdomain_policy optional "none" | "quarantine" | "reject" Field 'dmarc_subdomain_policy'
dmarc_pct optional integer
min: 1, max: 100, default: 100
Field 'dmarc_pct'
rua_emails optional string[]
default: []
Field 'rua_emails'
ruf_emails optional string[]
default: []
Field 'ruf_emails'
adkim optional "r" | "s"
default: "s"
Field 'adkim'
aspf optional "r" | "s"
default: "s"
Field 'aspf'
existing_spf optional string
maxLen: 1024
Optional existing SPF TXT record to lint for RFC 7208 errors.
existing_dmarc optional string
maxLen: 1024
Optional existing DMARC TXT record to lint for RFC 7489 errors.

Response data Object Fields (200 OK)

FieldTypeDescription
domain string Field 'domain'
records object Field 'records'
spf_estimated_dns_lookups integer Field 'spf_estimated_dns_lookups'
spf_within_10_lookup_limit boolean Field 'spf_within_10_lookup_limit'
lint_issues object[] Field 'lint_issues'

What SPF, DKIM & DMARC Record Linter & Generator API Detects & Validates

  • Built-in presets for Google Workspace, Microsoft 365, SendGrid, Mailgun, Amazon SES, Postmark, Mailchimp, and Resend
  • Deduplicates SPF mechanisms, strips deprecated ptr tags, and warns before exceeding 10 DNS lookups or 255-char TXT string splits
  • Generates DMARC, MTA-STS (_mta-sts TXT + well-known policy body), and SMTP TLS-RPT (_smtp._tls) records
  • Lints existing raw SPF/DMARC strings and outputs auto-repaired versions
Honest Engineering Boundaries

Known Limitations & Test Verification

Release: v1.0.39 · Verified: 16 November 2026 · Portfolio Median: 0.318 ms in-Worker V8 compute (add 15–65 ms HTTPS RTT) · See Full Portfolio Benchmarks →

  • Pure deterministic generator/linter; use /v1/email-dns if you want to query live DNS records from the internet.
  • Tested v1.0.4 (14 November 2026).

Direct All-Access & Marketplace Plans

Direct Polar All-Access Keys unlock all 42 APIs (49 endpoints), /v1/pipeline, and /mcp on api.tinplate.dev: Pro ($29/mo · 120 req/min · 100k/mo · 128 KB) or Team ($79/mo · 300 req/min · 500k/mo · 256 KB).

PlanMonthly PriceIncluded RequestsRate LimitMax PayloadBest For
BASIC$0.00 / mo500 / month10 req / min64 KBEvaluation & CI smoke tests
PRO$9.99 / mo15,000 / month60 req / min128 KBSolo devs & production apps
ULTRA$29.99 / mo100,000 / month300 req / min256 KBGrowing SaaS & multi-agent pipelines
MEGA$79.99 / mo500,000 / month1,000 req / min256 KBHigh-volume enterprise workloads

Frequently Asked Questions

How does this complement the Email DNS Auditor API?

Email DNS Auditor (/v1/email-dns) inspects live domain DNS records, while Email DNS Generator (/v1/email-dns-generator) builds and repairs the exact TXT records your users need to paste into their DNS provider.

Does it handle the 255-character DNS TXT string limit?

Yes, it flags records exceeding 255 characters and provides properly quoted multi-string splits.

Which email providers have built-in include presets?

Google Workspace, Microsoft 365, SendGrid, Amazon SES, Mailgun, Postmark, Mailchimp, Resend, and HubSpot.

Zero Payload Logging

Data Handling, Privacy & Proxy Disclosure

100% deterministic in-memory execution; zero network calls or logging.

Worker Zero-Logging Guarantee: Cloudflare Workers Observability and invocation logging are disabled (observability.enabled = false, head_sampling_rate = 0, invocation_logs = false). Requests via RapidAPI or Zyla traverse marketplace proxies; use a Direct Bearer Key for zero-intermediary routing.

Related Tinplate APIs

POST /v1/email-dns Live

Email DNS Deliverability Auditor API

Audit MX, SPF 10-lookup limits, DMARC, DKIM, BIMI, and MTA-STS with a 0–100 score.

POST /v1/signup-fraud Compliance & Business

Signup Fraud & Disposable Email Scorer API

Block disposable emails, alias abuse, and bot signups with a 0–100 fraud risk score.

POST /v1/security-headers Security & Secrets

HTTP Security Header Scanner API

Audit CSP, HSTS, and browser security headers with an A+ to F grade and fix snippets.