API Documentation

v2.4

Domain Guardian Security Scanning API — embed scanning into any site or tool

v2.4 (June 2026): DMARC results now include full RFC 9989/9990/9991 (DMARCbis) compliance data — new tags (t=, np=, psd=), deprecated tag flags (pct=, rf=, ri=), and a complianceLevel field. Accuracy fixes: scan modules are set per-tenant via enabled_modules (not per-request selectedCategories); auth uses X-API-Key (not Authorization: Bearer); self-service keys use the wgt_ prefix; tier limits are enforced per day.
Base URL
https://guardian.itfortress.com/functions

All API requests use this base URL (note the /functions path). HTTPS only. Full endpoint example: https://guardian.itfortress.com/functions/widgetApi. Requests must be POST with a JSON body — calling the bare /widgetApi path without /functions returns 405 Method Not Allowed.

Authentication

Two credential types are supported:

API Key
Server-to-server

Starts with wgt_ (admin-generated) or sk_ (partner self-service). Both prefixes accepted on all /widgetApi endpoints.

X-API-Key: wgt_YOUR_KEY
Embed Token
Client-side widget

Starts with emb_. Safe to expose in iframe/JS embed code.

X-Embed-Token: emb_YOUR_TOKEN
Never expose your API key in client-side code. Use environment variables or a secrets manager. Do not use Authorization: Bearer — the correct header is X-API-Key.
API Endpoints
POST
/widgetApi

Run a full security scan on a domain or IP address.

Request Body Parameters

ParameterTypeRequiredDescription
actionstring
Required
Must be "scan"
domainstring
Required
Domain name or IP address to scan
analyticsobject
Optional
Optional tracking metadata: { referrer, sourceUri, widgetId, timestamp, userAgent }

The set of modules run on a scan is determined by your tenant's enabled_modules (configured in the Partner Portal / by an admin), not by request parameters. Subdomain scanning runs when subdomainScanning is included in enabled_modules.

Scan Categories (enabled per tenant)

Category KeyWhat It Checks
emailSecuritySPF, DKIM, DMARC (RFC 9989/9990/9991 — p=, sp=, np=, t=, pct deprecation, rua=, complianceLevel, warnings[]), spam filter, Spamhaus blacklist, BIMI, TLS-RPT, MTA-STS
dnsSecurityDNSSEC, CAA records, SOA, IPv6, TLS/SSL certificate expiry
webSecuritySecurity headers: CSP, HSTS, X-Frame-Options, X-Content-Type, Referrer-Policy, Permissions-Policy
seoTitle tag, meta description, Open Graph, canonical URL, robots meta
infrastructureShodan: open ports, exposed services, known CVEs across all IPs
reputationIP/domain reputation (Talos), lookalike/typosquat domain detection
threatIntelligenceVirusTotal, AbuseIPDB, AlienVault OTX cross-feed analysis
censysScanningCensys internet-facing service & certificate inventory
certTransparencyCertificate Transparency log subdomain discovery
securityTrailsHistorical DNS records, WHOIS history
darkwebExposureIntelX breach databases, paste sites, Tor/Ahmia network mentions (riskPoints-based scoring)
pentestScanPort scanning, directory enumeration — aggressive, default OFF, requires explicit opt-in

Example Response

{
  "domain": "example.com",
  "scanId": "abc123xyz",
  "inputType": "domain",
  "timestamp": "2026-06-18T14:22:00Z",
  "scores": {
    "overall": 71,
    "emailSecurity": 82,
    "dnsSecurity": 65,
    "webSecurity": 88,
    "seo": 70,
    "infrastructure": 60,
    "reputation": 85,
    "threatIntelligence": 95,
    "censysScanning": 72,
    "darkwebExposure": 90,
    "pentestScan": null
  },
  "emailSecurity": {
    "mx": { "status": "pass", "records": [{ "priority": 10, "server": "mail.example.com." }] },
    "spf": { "status": "pass", "record": "v=spf1 include:_spf.google.com ~all" },
    "dmarc": {
      "status": "warning",
      "record": "v=DMARC1; p=none; rua=mailto:[email protected]",
      "parsed": {
        "policy": "none",
        "subdomainPolicy": "none",
        "hasExplicitSP": false,
        "isTestMode": false,
        "testMode": null,
        "nonExistentSubdomainPolicy": null,
        "psdTag": null,
        "hasPctTag": false,
        "hasRfTag": false,
        "hasRiTag": false,
        "aggregateReports": ["mailto:[email protected]"],
        "forensicReports": [],
        "spfAlignment": "r",
        "dkimAlignment": "r",
        "complianceLevel": "monitoring",
        "rfcVersion": "RFC 9989/9990/9991 (DMARCbis 2026)",
        "warnings": [
          {
            "code": "policy_none",
            "severity": "high",
            "message": "p=none is Monitoring Mode (RFC 9989 §3.2). Upgrade to p=quarantine or p=reject."
          },
          {
            "code": "no_explicit_sp",
            "severity": "low",
            "message": "No explicit sp= tag. Subdomains inherit p=none."
          },
          {
            "code": "no_np_tag",
            "severity": "low",
            "message": "No np= tag (RFC 9989). Consider adding np=reject."
          }
        ]
      }
    },
    "dkim": { "status": "pass", "selectors": [{ "selector": "google" }] },
    "spamFilter": { "status": "pass", "message": "Google Workspace detected", "hasEnterpriseFilter": false },
    "bimi": { "status": "warning", "message": "No BIMI record found (optional)" },
    "tlsrpt": { "status": "warning", "message": "No TLS-RPT record (optional)" },
    "mtasts": { "status": "warning", "message": "No MTA-STS policy (optional)" },
    "spamhausBlacklist": { "status": "pass", "listed": false, "checkedIPs": ["93.184.216.34"] }
  },
  "dnsSecurity": {
    "dnssec": { "status": "fail", "enabled": false },
    "caa": { "status": "pass", "count": 2 },
    "tlsCert": { "status": "pass", "daysUntilExpiry": 87, "issuerOrganization": "Let's Encrypt" }
  },
  "discoveredAssets": {
    "subdomains": ["mail.example.com", "www.example.com"],
    "ips": ["93.184.216.34"],
    "totalSubdomains": 2,
    "totalIPs": 1
  }
}

Code Examples

const axios = require('axios');

async function scanDomain(domain, apiKey) {
  // Which modules run is controlled by your tenant's enabled_modules
  // configuration (set in the Partner Portal) — not by request params.
  const res = await axios.post('https://guardian.itfortress.com/functions/widgetApi', {
    action: 'scan',
    domain
  }, {
    headers: {
      'X-API-Key': apiKey,
      'Content-Type': 'application/json'
    }
  });

  const { scores, scanId, emailSecurity } = res.data;
  console.log('Overall score:', scores.overall);
  // DMARC RFC 9989 fields:
  const dmarc = emailSecurity?.dmarc?.parsed;
  console.log('DMARC compliance level:', dmarc?.complianceLevel);
  console.log('DMARC RFC version:', dmarc?.rfcVersion);
  console.log('DMARC test mode (t=):', dmarc?.isTestMode);
  return res.data;
}

scanDomain('example.com', 'wgt_YOUR_API_KEY');
DMARC Response Fields (RFC 9989/9990/9991 — DMARCbis)
Error Responses
Rate Limits & Scan Quotas
Known Gaps & Planned Endpoints
Best Practices

Need help? Contact [email protected] or visit your Partner Portal.