{
  "openapi": "3.1.0",
  "info": {
    "title": "FabTally EmailAuth — DMARC/SPF/DKIM validation API for CI/CD & agents",
    "version": "1.0.0",
    "description": "A machine endpoint that validates email authentication (SPF, DKIM, DMARC, MX, +BIMI/MTA-STS) over public DNS — what MX Toolbox does, but scriptable for CI/CD and agents, with a hard PASS/WARN/FAIL gate you can fail a build on. Flagship POST /v1/email-auth {domain} returns per-mechanism verdicts, a recursive SPF DNS-lookup count vs the RFC 7208 limit of 10, a plain-English summary, and specific fix hints. Individual mechanism endpoints too. Free tier with a per-IP daily quota; unlimited via x402 (USDC on Base) or a prepaid credit key. Stateless, no PII, bad input never charged.",
    "x-guidance": "Flagship: POST /v1/email-auth {domain} ($0.003, x402 USDC on Base or prepaid X-FabTally-Key) -> {overall: PASS|WARN|FAIL, pass: bool, checks:{spf,dkim,dmarc,mx,...}, summary, fixes}. Use `overall`/`pass` as a CI gate. Cheaper single-mechanism: POST /v1/spf, /v1/dmarc, /v1/dkim ($0.001 each). Each has a free /free variant (per-IP daily quota) and a GET ?domain= convenience form. Unpaid paid-calls return an x402 402 challenge; pay and retry with the X-PAYMENT header. Bad/invalid domain -> 400, never charged.",
    "contact": {
      "email": "hello@fabtally.com"
    }
  },
  "servers": [
    {
      "url": "https://emailauth.fabtally.com"
    }
  ],
  "paths": {
    "/agent/overview": {
      "get": {
        "operationId": "overview",
        "summary": "Capabilities, pricing, payment info (free)",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Overview"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Health (free)",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/email-auth": {
      "post": {
        "operationId": "email_auth",
        "summary": "email-auth (paid, $0.003 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Full email-authentication audit for a domain over public DNS: SPF (record, recursive DNS-lookup count vs the RFC 7208 limit of 10, +all/~all/-all, syntax), DKIM (probe common or a provided selector -> key present, length, algorithm), DMARC (p=/sp=/pct, rua/ruf, aspf/adkim alignment), MX presence, and optionally BIMI/MTA-STS. Returns per-mechanism PASS/WARN/FAIL, an overall gate verdict, a plain-English summary, and specific fix hints. Built to be a CI/CD gate.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "3000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://emailauth.fabtally.com/v1/email-auth",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "example.com",
                "selector": "(optional DKIM selector)",
                "extras": "true (include BIMI/MTA-STS)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result with PASS/WARN/FAIL verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad/invalid domain (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/email-auth/free": {
      "post": {
        "operationId": "email_auth_free",
        "summary": "email-auth — free (per-IP daily quota)",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free email-auth check (per-IP daily quota of 25).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "example.com",
                "selector": "(optional DKIM selector)",
                "extras": "true (include BIMI/MTA-STS)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result"
          },
          "400": {
            "description": "Bad domain"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/spf": {
      "post": {
        "operationId": "spf",
        "summary": "spf (paid, $0.001 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "SPF analysis: the raw record, a recursive DNS-lookup count (includes/a/mx/ptr/redirect) checked against the RFC 7208 limit of 10, the all-qualifier (+all/~all/-all/?all), duplicate-record and syntax detection, verdict + fixes.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "1000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://emailauth.fabtally.com/v1/spf",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 30
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result with PASS/WARN/FAIL verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad/invalid domain (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/spf/free": {
      "post": {
        "operationId": "spf_free",
        "summary": "spf — free (per-IP daily quota)",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free spf check (per-IP daily quota of 25).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result"
          },
          "400": {
            "description": "Bad domain"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/dmarc": {
      "post": {
        "operationId": "dmarc",
        "summary": "dmarc (paid, $0.001 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "DMARC analysis: policy (p=), subdomain policy (sp=), pct, rua/ruf report addresses, aspf/adkim alignment mode, duplicate-record detection, PASS/WARN/FAIL verdict + fixes.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "1000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://emailauth.fabtally.com/v1/dmarc",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 30
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result with PASS/WARN/FAIL verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad/invalid domain (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/dmarc/free": {
      "post": {
        "operationId": "dmarc_free",
        "summary": "dmarc — free (per-IP daily quota)",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free dmarc check (per-IP daily quota of 25).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result"
          },
          "400": {
            "description": "Bad domain"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/dkim": {
      "post": {
        "operationId": "dkim",
        "summary": "dkim (paid, $0.001 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "DKIM analysis: give a `selector` (from a message's DKIM-Signature s= tag) or let it probe common selectors. Reports whether a key is published, its algorithm (rsa/ed25519), key length in bits, revoked/empty keys, and a verdict + fixes. Selectors are not DNS-enumerable, so a common-selector miss is reported as inconclusive, not a failure.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "1000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://emailauth.fabtally.com/v1/dkim",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 30
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "example.com",
                "selector": "google"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result with PASS/WARN/FAIL verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad/invalid domain (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/dkim/free": {
      "post": {
        "operationId": "dkim_free",
        "summary": "dkim — free (per-IP daily quota)",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free dkim check (per-IP daily quota of 25).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "example.com",
                "selector": "google"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result"
          },
          "400": {
            "description": "Bad domain"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    }
  }
}