{"openapi":"3.0.3","info":{"title":"SPF, DMARC, MTA-STS & TLS-RPT Linter & Generator API","version":"1.0.0","description":"Generates RFC-compliant SPF, DMARC, MTA-STS, and SMTP TLS-RPT DNS TXT records for major email providers and lints existing records for lookup-limit and policy flaws."},"servers":[{"url":"https://api.tinplate.dev","description":"Production Edge Gateway"}],"components":{"schemas":{"EmailDnsGenerateResponseData":{"type":"object","properties":{"domain":{"type":"string"},"records":{"type":"object","properties":{"spf":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"host":{"type":"string"},"value":{"type":"string"}},"required":["type","host","value"]},"dmarc":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"host":{"type":"string"},"value":{"type":"string"}},"required":["type","host","value"]},"tls_rpt":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"host":{"type":"string"},"value":{"type":"string"}},"required":["type","host","value"]},"mta_sts_txt":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"host":{"type":"string"},"value":{"type":"string"}},"required":["type","host","value"]}},"required":["spf","dmarc","tls_rpt","mta_sts_txt"]},"spf_estimated_dns_lookups":{"type":"integer","minimum":0,"example":5},"spf_within_10_lookup_limit":{"type":"boolean","example":true},"lint_issues":{"type":"array","items":{"type":"object","properties":{"target":{"type":"string","enum":["spf","dmarc"]},"severity":{"type":"string","enum":["error","warning"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["target","severity","code","message"]}}},"required":["domain","records","spf_estimated_dns_lookups","spf_within_10_lookup_limit","lint_issues"]},"EmailDnsGenerateRequest":{"type":"object","properties":{"domain":{"type":"string","minLength":3,"maxLength":253,"example":"tinplate.dev","description":"Target email domain."},"providers":{"type":"array","items":{"type":"string","enum":["google_workspace","microsoft_365","sendgrid","aws_ses","mailgun","postmark","resend","hubspot","zendesk","cloudflare_email"]},"default":[],"example":["google_workspace","resend"],"description":"Known ESPs whose official SPF includes should be added."},"custom_includes":{"type":"array","items":{"type":"string"},"maxItems":20,"default":[]},"ip4":{"type":"array","items":{"type":"string"},"maxItems":50,"default":[]},"ip6":{"type":"array","items":{"type":"string"},"maxItems":50,"default":[]},"allow_mx":{"type":"boolean","default":false},"allow_a":{"type":"boolean","default":false},"spf_policy":{"type":"string","enum":["hardfail","softfail","neutral"],"default":"hardfail","example":"hardfail"},"dmarc_policy":{"type":"string","enum":["none","quarantine","reject"],"default":"reject","example":"reject"},"dmarc_subdomain_policy":{"type":"string","enum":["none","quarantine","reject"]},"dmarc_pct":{"type":"integer","minimum":1,"maximum":100,"default":100},"rua_emails":{"type":"array","items":{"type":"string","format":"email"},"maxItems":10,"default":[],"example":["dmarc-reports@tinplate.dev"]},"ruf_emails":{"type":"array","items":{"type":"string","format":"email"},"maxItems":10,"default":[]},"adkim":{"type":"string","enum":["r","s"],"default":"s"},"aspf":{"type":"string","enum":["r","s"],"default":"s"},"existing_spf":{"type":"string","maxLength":1024,"description":"Optional existing SPF TXT record to lint for RFC 7208 errors."},"existing_dmarc":{"type":"string","maxLength":1024,"description":"Optional existing DMARC TXT record to lint for RFC 7489 errors."}},"required":["domain"]},"ResponseMeta":{"type":"object","required":["request_id"],"properties":{"request_id":{"type":"string","format":"uuid"},"ms":{"type":"integer","minimum":0},"version":{"type":"string","example":"1.0.0"}}},"ErrorEnvelope":{"type":"object","required":["ok","error","meta"],"properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"invalid_input"},"message":{"type":"string","example":"Request body failed validation"}}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}},"parameters":{}},"paths":{"/v1/email-dns-generator":{"post":{"tags":["24_EMAIL_DNS_GENERATOR"],"summary":"Generate and lint SPF, DMARC, MTA-STS, and TLS-RPT DNS TXT records","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDnsGenerateRequest"}}}},"responses":{"200":{"description":"Generated DNS TXT records, RFC 7208 lookup estimate, and lint issues","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/EmailDnsGenerateResponseData"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["ok","data","meta"]}}}},"400":{"description":"Invalid input or malformed JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid authentication credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Request payload exceeds subscribed plan byte cap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}}}