{
  "openapi": "3.1.0",
  "info": {
    "title": "AGPC Domain Health API",
    "version": "1.0.0",
    "summary": "Check whether anyone can send email as a domain.",
    "description": "A free check of one domain's email authentication \u2014 SPF, DKIM, DMARC, cross-domain DMARC reporting authorisation, MX and null-MX. It runs the same engine as the paid audit and returns what it actually found; anything it could not resolve is reported as unknown rather than as a finding, because a DNS timeout and a missing record mean different things. No signup and no key. Public DNS only: it never touches mailboxes, servers or accounts.",
    "contact": {
      "email": "markol@tradeuniquecapital.com"
    },
    "license": {
      "name": "Free to call within the stated rate limit"
    }
  },
  "servers": [
    {
      "url": "https://guild.tradeuniquecapital.com"
    }
  ],
  "paths": {
    "/api/check": {
      "get": {
        "operationId": "checkDomainAuthentication",
        "summary": "Check one domain's email authentication",
        "description": "Rate limited to 20 calls per caller per hour. Pass `ref` to attribute the call to your referral code and earn 25% of any resulting order.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "A single domain, e.g. example.com. A URL or a www. prefix is accepted and normalised.",
            "schema": {
              "type": "string",
              "maxLength": 253
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "description": "Your referral code, if you have one.",
            "schema": {
              "type": "string",
              "maxLength": 32
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The check completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "grade": {
                      "type": "string",
                      "description": "Posture grade. Reflects whether the configuration protects the domain, not merely whether records exist."
                    },
                    "checks_completed": {
                      "type": "integer"
                    },
                    "checks_total": {
                      "type": "integer"
                    },
                    "complete": {
                      "type": "boolean",
                      "nullable": true,
                      "description": "False when a lookup could not be resolved. Treat an incomplete result as unknown, not as a finding."
                    },
                    "findings": {
                      "type": "object"
                    },
                    "free_tier": {
                      "type": "object"
                    },
                    "earn_from_this": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not a domain, or the rate limit was reached. The message says which.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "docs": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/partners/terms": {
      "post": {
        "operationId": "registerReferralTerms",
        "summary": "Register a referral code and name your rate",
        "description": "Up to 25% is accepted immediately and earns from that moment. Above it is queued for review rather than refused. Above 40% is refused. Commission is paid on money that arrives and reverses if the order is refunded.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "agent_id",
                  "code"
                ],
                "properties": {
                  "agent_id": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 32
                  },
                  "rate": {
                    "type": "number",
                    "minimum": 0.05,
                    "maximum": 0.4
                  },
                  "rationale": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted or queued; the status field says which."
          },
          "400": {
            "description": "Refused, with the offer attached so you can retry."
          }
        }
      }
    }
  }
}