{
  "openapi": "3.1.0",
  "info": {
    "title": "dkim.fyi API",
    "version": "0.1.0",
    "summary": "Validate DKIM records, discover selectors and analyse DKIM-Signature headers.",
    "description": "Public JSON API of dkim.fyi. No authentication and no accounts. Per-client rate limit of 120 requests per minute (429 with Retry-After: 60). The GET endpoints /health, /dataset, /validate and /enumerate/plan send Access-Control-Allow-Origin: *; every other endpoint is same-origin only for browsers. HEAD is supported wherever GET is. A guide with recipes is at https://dkim.fyi/agents.md."
  },
  "servers": [
    {
      "url": "https://dkim.fyi"
    }
  ],
  "externalDocs": {
    "description": "Agent guide with task recipes",
    "url": "https://dkim.fyi/agents.md"
  },
  "paths": {
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service health and version",
        "description": "Always 200 while the Worker runs; makes no DNS queries. Answers with Access-Control-Allow-Origin: * so browsers on other sites can call it.",
        "responses": {
          "200": {
            "description": "Health.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/dataset": {
      "get": {
        "operationId": "getDataset",
        "summary": "The selector dataset",
        "description": "The curated DKIM selector dataset with provider attribution and its limitations, plus the CNAME signatures and the MX, SPF and DMARC hint rules the API uses for attribution and discovery. Cacheable for an hour (Cache-Control: public, max-age=3600). The dataset licence has not been published yet; until it is, link to https://dkim.fyi/selectors when you cite it. Answers with Access-Control-Allow-Origin: * so browsers on other sites can call it.",
        "responses": {
          "200": {
            "description": "The dataset.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/validate": {
      "get": {
        "operationId": "validateSelector",
        "summary": "Validate one selector for one domain",
        "description": "Looks up selector._domainkey.domain TXT over DNS-over-HTTPS, follows CNAME chains, parses the record, analyses the key and probes for a wildcard. Costs 2 DNS lookups. Answers with Access-Control-Allow-Origin: * so browsers on other sites can call it.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Domain, hostname, email address or URL; normalised to a lower-case punycode domain.",
            "schema": {
              "type": "string"
            },
            "example": "github.com"
          },
          {
            "name": "selector",
            "in": "query",
            "required": true,
            "description": "DKIM selector.",
            "schema": {
              "type": "string"
            },
            "example": "selector1"
          }
        ],
        "responses": {
          "200": {
            "description": "The validation result. A missing record is a normal result with verdict \"not_found\".",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamError"
          }
        }
      },
      "post": {
        "operationId": "validateSelectorPost",
        "summary": "Validate one selector for one domain (JSON body)",
        "description": "Same as GET /api/v1/validate with a JSON body. Same-origin only: no CORS headers, and a browser request marked cross-site is refused with 403.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateRequest"
              },
              "example": {
                "domain": "github.com",
                "selector": "selector1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The validation result.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/CrossSite"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamError"
          }
        }
      }
    },
    "/api/v1/enumerate/plan": {
      "get": {
        "operationId": "getEnumeratePlan",
        "summary": "Ordered candidate selectors for a domain",
        "description": "Reads MX, SPF and DMARC records for hints, probes once for a wildcard and returns the full ordered candidate list. Costs 4 DNS lookups. Walk candidates[].selector in chunks of chunkSize through POST /api/v1/enumerate/check. Answers with Access-Control-Allow-Origin: * so browsers on other sites can call it.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Domain, hostname, email address or URL; normalised to a lower-case punycode domain.",
            "schema": {
              "type": "string"
            },
            "example": "github.com"
          }
        ],
        "responses": {
          "200": {
            "description": "The plan.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnumeratePlan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamError"
          }
        }
      }
    },
    "/api/v1/enumerate/check": {
      "post": {
        "operationId": "checkSelectors",
        "summary": "Check a chunk of selectors for a domain",
        "description": "Makes one DNS fetch per distinct selector (no cache) and returns one entry per selector. At most chunkSize selectors per call; more gives 400 too_many_selectors with details {max, received}. A not_found result is not proof that DKIM is absent. Same-origin only: no CORS headers, and a browser request marked cross-site is refused with 403.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnumerateCheckRequest"
              },
              "example": {
                "domain": "github.com",
                "selectors": ["google", "selector1", "selector2", "k1"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per checked selector.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnumerateCheckResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/CrossSite"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamError"
          }
        }
      }
    },
    "/api/v1/message": {
      "post": {
        "operationId": "analyseMessage",
        "summary": "Analyse the DKIM signatures of a message",
        "description": "Parses every DKIM-Signature header, looks up each key and, when a body is present, verifies the body hash and signature (rsa-sha256, rsa-sha1 flagged as weak, ed25519-sha256). The first 50 signatures are verified and at most 10 distinct keys are looked up per message; later ones report temperror. Request body up to 1 MiB. Same-origin only: no CORS headers, and a browser request marked cross-site is refused with 403.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The analysis.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageAnalysis"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/CrossSite"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/inbox": {
      "post": {
        "operationId": "createInbox",
        "summary": "Mint a throwaway address",
        "description": "Creates an address whose incoming mail is analysed by header block only. Takes no request body. Limited to 5 requests per minute per client in addition to the general limit. Same-origin only: no CORS headers, and a browser request marked cross-site is refused with 403.",
        "parameters": [
          {
            "name": "X-Turnstile-Token",
            "in": "header",
            "required": false,
            "description": "Only on a deployment that turns on its Turnstile check (off by default). A widget token for the sitekey and action given in a 403 turnstile_required answer; each token works once.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The new session.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboxSession"
                }
              }
            }
          },
          "403": {
            "description": "Cross-site refusal (bad_request), or, when the deployment's Turnstile check is on, turnstile_required (no token; details give sitekey and action) or turnstile_failed (token rejected; details add reason).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "error": {
                    "code": "turnstile_required",
                    "message": "This deployment asks for a Turnstile check before it creates an address. Send the widget token in the X-Turnstile-Token header.",
                    "details": {
                      "sitekey": "0x4AAAAAAA...",
                      "action": "inbox"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/inbox/{token}": {
      "get": {
        "operationId": "getInbox",
        "summary": "Read the messages received at an address",
        "description": "Poll no faster than pollIntervalSeconds. Every 200 carries a weak ETag; send it back as If-None-Match and an unchanged inbox answers 304 with no body. Unknown, malformed, deleted and purged tokens all answer 404 not_found. Clients that are not the web page should stop polling after about 30 minutes without a new message. No CORS headers: a browser request marked cross-site is refused with 403.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The 12-character token returned by POST /api/v1/inbox.",
            "schema": {
              "type": "string",
              "pattern": "^[abcdefghjkmnpqrstvwxyz23456789]{12}$"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "An ETag from an earlier response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The session and its messages.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboxResponse"
                }
              }
            }
          },
          "304": {
            "description": "Nothing changed since the ETag; no body.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/InboxNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "delete": {
        "operationId": "deleteInbox",
        "summary": "Delete an address and its results now",
        "description": "Idempotent: any well-formed token answers 204 whether or not the session still exists. A malformed token answers 404. Same-origin only: no CORS headers, and a browser request marked cross-site is refused with 403.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The 12-character token returned by POST /api/v1/inbox.",
            "schema": {
              "type": "string",
              "pattern": "^[abcdefghjkmnpqrstvwxyz23456789]{12}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/CrossSite"
          },
          "404": {
            "$ref": "#/components/responses/InboxNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Severity": {
        "type": "string",
        "enum": ["ok", "info", "warning", "error"]
      },
      "Finding": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable machine-readable identifier, for example \"record.found\" or \"dns.wildcard\"."
          },
          "severity": {
            "$ref": "#/components/schemas/Severity"
          },
          "message": {
            "type": "string",
            "description": "One-sentence statement of the finding."
          },
          "hint": {
            "type": "string",
            "description": "Optional remediation or context hint."
          }
        },
        "required": ["code", "severity", "message"]
      },
      "DnsRcode": {
        "type": "string",
        "enum": [
          "NOERROR",
          "FORMERR",
          "SERVFAIL",
          "NXDOMAIN",
          "NOTIMP",
          "REFUSED",
          "TIMEOUT",
          "NETWORK",
          "UNKNOWN"
        ],
        "description": "DNS response code. TIMEOUT and NETWORK are synthetic: the resolver was unreachable."
      },
      "CnameHop": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "ttl": {
            "type": "integer"
          }
        },
        "required": ["from", "to", "ttl"]
      },
      "TxtRecord": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Owner name of the TXT record, after CNAME resolution."
          },
          "value": {
            "type": "string",
            "description": "The TXT character-strings joined into one string."
          },
          "ttl": {
            "type": "integer"
          }
        },
        "required": ["name", "value", "ttl"]
      },
      "DnsLookup": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Fully qualified name that was queried, for example \"selector1._domainkey.example.com\"."
          },
          "type": {
            "type": "string",
            "enum": ["TXT", "MX", "A", "AAAA", "CNAME"]
          },
          "rcode": {
            "$ref": "#/components/schemas/DnsRcode"
          },
          "dnssec": {
            "type": "boolean",
            "description": "True when the resolver reported the data as DNSSEC-validated (the AD bit). dkim.fyi does not validate DNSSEC itself."
          },
          "truncated": {
            "type": "boolean",
            "description": "Truncated response (TC bit)."
          },
          "cnameChain": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CnameHop"
            },
            "description": "CNAME hops followed, in order, before the terminal records."
          },
          "txt": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TxtRecord"
            },
            "description": "Terminal TXT records (TXT queries only)."
          },
          "resolver": {
            "type": "string",
            "description": "Resolver used (URL or label)."
          },
          "elapsedMs": {
            "type": "integer"
          },
          "error": {
            "type": "string",
            "description": "Set when the lookup could not be completed; rcode is then TIMEOUT, NETWORK or UNKNOWN."
          }
        },
        "required": [
          "name",
          "type",
          "rcode",
          "dnssec",
          "truncated",
          "cnameChain",
          "txt",
          "resolver",
          "elapsedMs"
        ]
      },
      "WildcardCheck": {
        "type": "object",
        "properties": {
          "probe": {
            "type": "string",
            "description": "Random label probed under _domainkey."
          },
          "detected": {
            "type": "boolean",
            "description": "True when the random probe resolved to a record, which makes hits under _domainkey unreliable."
          },
          "rcode": {
            "$ref": "#/components/schemas/DnsRcode"
          }
        },
        "required": ["probe", "detected", "rcode"]
      },
      "DkimRecord": {
        "type": "object",
        "properties": {
          "raw": {
            "type": "string",
            "description": "Raw TXT value the record was parsed from."
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "All tags as parsed (tag to value), including unknown tags."
          },
          "version": {
            "type": ["string", "null"],
            "description": "v= tag (should be \"DKIM1\" when present)."
          },
          "keyType": {
            "type": "string",
            "description": "k= key type; \"rsa\" when absent. Usually \"rsa\" or \"ed25519\"."
          },
          "hashAlgorithms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "h= acceptable hash algorithms; empty means all."
          },
          "publicKey": {
            "type": "string",
            "description": "p= base64 public key. An empty string means the key is revoked."
          },
          "serviceTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "s= service types; [\"*\"] by default."
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "t= flags, for example \"y\" (testing) and \"s\" (strict)."
          },
          "notes": {
            "type": ["string", "null"],
            "description": "n= human-readable notes."
          },
          "granularity": {
            "type": ["string", "null"],
            "description": "g= granularity (deprecated)."
          },
          "revoked": {
            "type": "boolean",
            "description": "True when p= is present but empty."
          },
          "testing": {
            "type": "boolean",
            "description": "True when t=y is set."
          },
          "strict": {
            "type": "boolean",
            "description": "True when t=s is set."
          }
        },
        "required": [
          "raw",
          "tags",
          "version",
          "keyType",
          "hashAlgorithms",
          "publicKey",
          "serviceTypes",
          "flags",
          "notes",
          "granularity",
          "revoked",
          "testing",
          "strict"
        ]
      },
      "KeyAnalysis": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["rsa", "ed25519", "unknown"]
          },
          "bits": {
            "type": ["integer", "null"],
            "description": "RSA modulus size in bits, or 256 for Ed25519; null when the key could not be parsed."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the key material parsed and imported. RSA keys above 8192 bits are not accepted."
          },
          "fingerprintSha256": {
            "type": ["string", "null"],
            "description": "SHA-256 fingerprint of the DER-encoded key, hex, colon-separated."
          },
          "strength": {
            "type": "string",
            "enum": ["strong", "acceptable", "weak", "unknown"],
            "description": "Assessment following RFC 8301: RSA of 2048 bits or more is strong, 1024 to 2047 acceptable, smaller weak."
          },
          "error": {
            "type": "string"
          }
        },
        "required": ["type", "bits", "valid", "fingerprintSha256", "strength"]
      },
      "ProviderMatch": {
        "type": "object",
        "properties": {
          "company": {
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "evidence": {
            "type": "string",
            "enum": ["selector", "cname", "selector+cname", "mx", "pattern"],
            "description": "Why this provider is suggested. selector: the selector name alone, a hint that says who might use the name, not who owns this key. cname: a CNAME target in the provider's zone, so the domain handed its key to that provider. selector+cname: both, the strongest evidence DNS can give. pattern: a generated selector shape the provider uses. mx is reserved and not produced."
          },
          "confidence": {
            "type": "string",
            "enum": ["high", "medium", "low"],
            "description": "How strong the evidence is for this domain. A selector-name match is at most medium, and low when the name is generic, is listed under two or more companies, belongs to a provider that only publishes CNAMEs when this name has no CNAME, or when a CNAME points at another provider. A CNAME match takes the signature's confidence; selector+cname is high."
          },
          "status": {
            "type": "string",
            "description": "Dataset status for the selector, for example \"current_or_observed\" or \"legacy_or_observed\"."
          },
          "selectorMode": {
            "type": "string"
          },
          "notes": {
            "type": ["string", "null"]
          },
          "sourceUrls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dnsRecordTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["TXT", "CNAME"]
            },
            "description": "Record types the dataset says this provider's customers publish for the selector (from dns_record_types). Absent for a match found by CNAME target alone."
          }
        },
        "required": ["company", "products", "evidence", "confidence"]
      },
      "Verdict": {
        "type": "string",
        "enum": ["valid", "testing", "revoked", "invalid", "not_found", "error"],
        "description": "valid: record found, key parsed, no error findings. testing: valid with t=y. revoked: empty p=. invalid: record found but malformed or key unusable. not_found: no DKIM TXT record at the name (a miss is not proof that DKIM is absent). error: resolver failure."
      },
      "ValidateResult": {
        "type": "object",
        "properties": {
          "query": {
            "type": "object",
            "properties": {
              "domain": {
                "type": "string",
                "description": "Normalised (lower-cased, punycode) domain."
              },
              "selector": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "description": "selector._domainkey.domain"
              }
            },
            "required": ["domain", "selector", "name"]
          },
          "verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "dns": {
            "$ref": "#/components/schemas/DnsLookup"
          },
          "record": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DkimRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "key": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/KeyAnalysis"
              },
              {
                "type": "null"
              }
            ]
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            }
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderMatch"
            },
            "description": "Provider attribution by selector name and by CNAME target, strongest first. A selector name alone is a hint; a CNAME into the provider's zone is strong. Not proof: a signed message shows which selector signs live mail."
          },
          "wildcard": {
            "$ref": "#/components/schemas/WildcardCheck",
            "description": "Present when a wildcard probe was performed (always for /validate; not for results inside /enumerate/check, /message or the inbox)."
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "query",
          "verdict",
          "dns",
          "record",
          "key",
          "findings",
          "providers",
          "checkedAt"
        ]
      },
      "SelectorCandidate": {
        "type": "object",
        "properties": {
          "selector": {
            "type": "string"
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Providers from the dataset that list this selector."
          },
          "confidence": {
            "type": "string",
            "enum": ["high", "medium", "low"]
          },
          "rank": {
            "type": "integer",
            "description": "Priority rank (lower first). Hinted selectors come first."
          },
          "hinted": {
            "type": "boolean",
            "description": "True when the candidate was boosted by a hint such as MX or SPF."
          }
        },
        "required": ["selector", "providers", "confidence", "rank", "hinted"]
      },
      "EnumerationHint": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": ["mx", "spf", "dmarc", "txt"]
          },
          "observed": {
            "type": "string",
            "description": "What was observed, for example \"aspmx.l.google.com\"."
          },
          "provider": {
            "type": "string",
            "description": "Provider inferred from the observation."
          },
          "selectors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Selectors boosted because of this hint."
          }
        },
        "required": ["kind", "observed", "provider", "selectors"]
      },
      "DatasetInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "generatedOn": {
            "type": "string"
          },
          "providerCount": {
            "type": "integer"
          },
          "selectorCount": {
            "type": "integer"
          }
        },
        "required": ["name", "version", "generatedOn", "providerCount", "selectorCount"]
      },
      "EnumeratePlan": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "description": "Total candidates in the ordered list."
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SelectorCandidate"
            },
            "description": "Ordered candidate selectors. Walk them in chunks of chunkSize."
          },
          "chunkSize": {
            "type": "integer",
            "description": "Maximum selectors the server accepts per POST /enumerate/check call (40 by default, never more than 45). Authoritative."
          },
          "hints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnumerationHint"
            }
          },
          "wildcard": {
            "$ref": "#/components/schemas/WildcardCheck"
          },
          "context": {
            "type": "object",
            "properties": {
              "mx": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "dmarc": {
                "type": ["string", "null"]
              },
              "spf": {
                "type": ["string", "null"]
              },
              "dnssec": {
                "type": "boolean",
                "description": "True when the resolver reported DNSSEC-validated data for the lookups."
              }
            },
            "required": ["mx", "dmarc", "spf", "dnssec"]
          },
          "dataset": {
            "$ref": "#/components/schemas/DatasetInfo"
          }
        },
        "required": [
          "domain",
          "total",
          "candidates",
          "chunkSize",
          "hints",
          "wildcard",
          "context",
          "dataset"
        ]
      },
      "EnumerateStatus": {
        "type": "string",
        "enum": ["found", "revoked", "testing", "invalid", "not_found", "error"],
        "description": "found corresponds to the validate verdict \"valid\"."
      },
      "EnumerateHit": {
        "type": "object",
        "properties": {
          "selector": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/EnumerateStatus"
          },
          "result": {
            "$ref": "#/components/schemas/ValidateResult",
            "description": "Full validate result (without a wildcard probe) for found, revoked, testing and invalid; omitted for not_found."
          },
          "error": {
            "type": "string",
            "description": "The resolver failure, for status \"error\"."
          }
        },
        "required": ["selector", "status"]
      },
      "EnumerateCheckResult": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "checked": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Selectors that were looked up, in request order, duplicates removed case-insensitively."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnumerateHit"
            },
            "description": "One entry per checked selector, in the same order."
          },
          "notFound": {
            "type": "integer",
            "description": "Number of selectors in this chunk with status not_found."
          },
          "elapsedMs": {
            "type": "integer"
          }
        },
        "required": ["domain", "checked", "results", "notFound", "elapsedMs"]
      },
      "DkimSignatureHeader": {
        "type": "object",
        "properties": {
          "raw": {
            "type": "string",
            "description": "Raw (unfolded) header value."
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "version": {
            "type": ["string", "null"]
          },
          "algorithm": {
            "type": ["string", "null"],
            "description": "a= tag, for example rsa-sha256 or ed25519-sha256."
          },
          "canonicalization": {
            "type": "object",
            "properties": {
              "header": {
                "type": "string",
                "enum": ["simple", "relaxed"]
              },
              "body": {
                "type": "string",
                "enum": ["simple", "relaxed"]
              }
            },
            "required": ["header", "body"]
          },
          "domain": {
            "type": ["string", "null"],
            "description": "d= tag."
          },
          "selector": {
            "type": ["string", "null"],
            "description": "s= tag."
          },
          "signedHeaders": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "h= tag."
          },
          "bodyHash": {
            "type": ["string", "null"],
            "description": "bh= tag."
          },
          "signature": {
            "type": ["string", "null"],
            "description": "b= tag."
          },
          "identity": {
            "type": ["string", "null"],
            "description": "i= tag."
          },
          "bodyLength": {
            "type": ["integer", "null"],
            "description": "l= tag."
          },
          "timestamp": {
            "type": ["integer", "null"],
            "description": "t= tag (Unix time)."
          },
          "expiration": {
            "type": ["integer", "null"],
            "description": "x= tag (Unix time)."
          },
          "queryMethods": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "q= tag."
          },
          "copiedHeaders": {
            "type": "string",
            "description": "z= tag (copied header fields): the Name:value entries the signer copied at signing time, separated by \"|\" and quoted-printable encoded, as written. Not decoded and not used for verification. Absent when the signature has no z= tag."
          }
        },
        "required": [
          "raw",
          "tags",
          "version",
          "algorithm",
          "canonicalization",
          "domain",
          "selector",
          "signedHeaders",
          "bodyHash",
          "signature",
          "identity",
          "bodyLength",
          "timestamp",
          "expiration",
          "queryMethods"
        ]
      },
      "VerificationStatus": {
        "type": "string",
        "enum": ["pass", "fail", "neutral", "permerror", "temperror", "not_attempted"],
        "description": "Follows RFC 8601 result semantics. not_attempted: only headers were supplied, so the key and the header signature were checked but the body hash was not."
      },
      "VerificationResult": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/VerificationStatus"
          },
          "reason": {
            "type": ["string", "null"],
            "description": "Why the status was reached; present for non-pass results."
          },
          "bodyHashMatches": {
            "type": ["boolean", "null"]
          },
          "signatureValid": {
            "type": ["boolean", "null"]
          },
          "expired": {
            "type": "boolean",
            "description": "True when the signature has expired (x= in the past)."
          },
          "computedBodyHash": {
            "type": ["string", "null"],
            "description": "Computed body hash (base64), for diagnostics."
          }
        },
        "required": [
          "status",
          "reason",
          "bodyHashMatches",
          "signatureValid",
          "expired",
          "computedBodyHash"
        ]
      },
      "SignatureReport": {
        "type": "object",
        "properties": {
          "header": {
            "$ref": "#/components/schemas/DkimSignatureHeader"
          },
          "key": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ValidateResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "Key lookup for d= and s=; null when either is missing. No wildcard probe."
          },
          "verification": {
            "$ref": "#/components/schemas/VerificationResult"
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            }
          }
        },
        "required": ["header", "key", "verification", "findings"]
      },
      "Alignment": {
        "type": "object",
        "properties": {
          "signatureDomain": {
            "type": "string"
          },
          "aligned": {
            "type": "boolean"
          },
          "mode": {
            "type": "string",
            "enum": ["strict", "relaxed", "none"]
          }
        },
        "required": ["signatureDomain", "aligned", "mode"]
      },
      "MessageAnalysis": {
        "type": "object",
        "properties": {
          "hasBody": {
            "type": "boolean",
            "description": "True when the input contained a blank line separating headers from a body."
          },
          "signatures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignatureReport"
            },
            "description": "One per DKIM-Signature header. The first 50 are verified; keys are looked up for at most 10 distinct (d=, s=) pairs, later ones report temperror."
          },
          "fromDomain": {
            "type": ["string", "null"],
            "description": "Domain of the From header, if present."
          },
          "alignment": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alignment"
            }
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            }
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": ["hasBody", "signatures", "fromDomain", "alignment", "findings", "checkedAt"]
      },
      "DatasetProvider": {
        "type": "object",
        "properties": {
          "company_name": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "description": "Stable, unique identifier of the record, named after the product people search for rather than the parent company (\"mailgun\", not \"sinch\")."
          },
          "products_services": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "selectors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "selector_patterns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "selector_mode": {
            "type": "string"
          },
          "dns_record_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "customer_domain_applicability": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "confidence": {
            "type": "string",
            "enum": ["high", "medium", "low"]
          },
          "notes": {
            "type": ["string", "null"]
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "last_verified": {
            "type": ["string", "null"],
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Date (YYYY-MM-DD) the vendor's own documentation was last found to support this record's selectors or documented selector scheme; null when no such check is recorded."
          }
        },
        "required": [
          "company_name",
          "slug",
          "products_services",
          "selectors",
          "selector_patterns",
          "selector_mode",
          "dns_record_types",
          "customer_domain_applicability",
          "status",
          "confidence",
          "notes",
          "source_urls",
          "last_verified"
        ]
      },
      "CnameSignature": {
        "type": "object",
        "description": "A DKIM CNAME target suffix that identifies the provider hosting the key.",
        "properties": {
          "suffix": {
            "type": "string",
            "description": "Lower-case domain suffix. A CNAME target matches when it equals the suffix or ends with \".\" plus the suffix; the longest matching suffix wins."
          },
          "company": {
            "type": "string",
            "description": "Company, spelled as company_name in the dataset where the dataset has it."
          },
          "product": {
            "type": "string",
            "description": "The product behind the target, for example \"SendGrid\" for company \"Twilio\"."
          },
          "basis": {
            "type": "string",
            "enum": ["observed", "documented", "inferred"],
            "description": "observed: seen on real DKIM CNAMEs of live domains; documented: stated in the provider's DKIM setup guide; inferred: a domain the provider operates for mail, not seen on a DKIM CNAME."
          },
          "confidence": {
            "type": "string",
            "enum": ["high", "medium"],
            "description": "Confidence of an attribution from this signature: medium for inferred, high otherwise."
          }
        },
        "required": ["suffix", "company", "product", "basis", "confidence"]
      },
      "HintRule": {
        "type": "object",
        "description": "Maps a mail-infrastructure host name to the selectors that provider is known to use.",
        "properties": {
          "provider": {
            "type": "string"
          },
          "match": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Entries containing a dot are domain suffixes (google.com matches aspmx.l.google.com, not notgoogle.com); entries without a dot match any DNS label that starts with them (klaviyo matches _spf.klaviyo.com)."
          },
          "selectors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Selectors to try first when the rule matches. A trailing * stands for every dataset selector with that prefix; selectors not in the dataset are skipped."
          }
        },
        "required": ["provider", "match", "selectors"]
      },
      "HintRules": {
        "type": "object",
        "description": "The rules discovery uses to put a provider's selectors first, by the record they are matched against.",
        "properties": {
          "mx": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HintRule"
            },
            "description": "Matched against MX host names."
          },
          "spf": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HintRule"
            },
            "description": "Matched against SPF include: and redirect= domains."
          },
          "dmarc": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HintRule"
            },
            "description": "Matched against the hosts of DMARC rua= and ruf= mailto addresses."
          }
        },
        "required": ["mx", "spf", "dmarc"]
      },
      "DatasetResponse": {
        "type": "object",
        "properties": {
          "info": {
            "$ref": "#/components/schemas/DatasetInfo"
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DatasetProvider"
            }
          },
          "generic": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Common selectors that cannot be attributed to a single provider."
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The dataset's limitations."
          },
          "cnameSignatures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CnameSignature"
            },
            "description": "CNAME target suffixes used to attribute a provider when a selector is a CNAME."
          },
          "hintRules": {
            "$ref": "#/components/schemas/HintRules"
          }
        },
        "required": ["info", "providers", "generic", "limitations", "cnameSignatures", "hintRules"]
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "version": {
            "type": "string",
            "description": "Service version (package.json)."
          },
          "dataset": {
            "$ref": "#/components/schemas/DatasetInfo"
          },
          "resolver": {
            "type": "string",
            "description": "Primary DNS-over-HTTPS endpoint in use."
          }
        },
        "required": ["ok", "version", "dataset", "resolver"]
      },
      "InboxSession": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Full address to send to, for example \"k7m2q9x4tc3f@dkim.fyi\"."
          },
          "token": {
            "type": "string",
            "description": "12 lowercase characters; the local part of the address and the only credential for the session."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "description": "After this instant mail is rejected and results are deleted.",
            "format": "date-time"
          },
          "pollIntervalSeconds": {
            "type": "integer",
            "description": "The fastest a client should poll GET /inbox/{token}."
          },
          "maxMessages": {
            "type": "integer",
            "description": "Messages accepted per session; further mail is rejected."
          }
        },
        "required": [
          "address",
          "token",
          "createdAt",
          "expiresAt",
          "pollIntervalSeconds",
          "maxMessages"
        ]
      },
      "InboxSignatureHeader": {
        "type": "object",
        "description": "The DKIM-Signature tags kept per message: everything except the raw header, the tag map, b= and bh=.",
        "properties": {
          "version": {
            "type": ["string", "null"]
          },
          "algorithm": {
            "type": ["string", "null"]
          },
          "canonicalization": {
            "type": "object",
            "properties": {
              "header": {
                "type": "string",
                "enum": ["simple", "relaxed"]
              },
              "body": {
                "type": "string",
                "enum": ["simple", "relaxed"]
              }
            },
            "required": ["header", "body"]
          },
          "domain": {
            "type": ["string", "null"]
          },
          "selector": {
            "type": ["string", "null"]
          },
          "signedHeaders": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "identity": {
            "type": ["string", "null"],
            "description": "i= reduced to \"@domain\"; null when it has no \"@\"."
          },
          "bodyLength": {
            "type": ["integer", "null"]
          },
          "timestamp": {
            "type": ["integer", "null"]
          },
          "expiration": {
            "type": ["integer", "null"]
          },
          "queryMethods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "version",
          "algorithm",
          "canonicalization",
          "domain",
          "selector",
          "signedHeaders",
          "identity",
          "bodyLength",
          "timestamp",
          "expiration",
          "queryMethods"
        ]
      },
      "InboxReceiverResults": {
        "type": "object",
        "properties": {
          "authserv": {
            "type": "string",
            "description": "authserv-id of the receiving server, for example \"mx.cloudflare.net\"."
          },
          "dkim": {
            "type": ["string", "null"],
            "description": "Result token, for example \"pass\", \"fail\" or \"none\"."
          },
          "spf": {
            "type": ["string", "null"]
          },
          "dmarc": {
            "type": ["string", "null"]
          },
          "arc": {
            "type": ["string", "null"]
          }
        },
        "required": ["authserv", "dkim", "spf", "dmarc", "arc"]
      },
      "InboxSignature": {
        "type": "object",
        "properties": {
          "header": {
            "$ref": "#/components/schemas/InboxSignatureHeader"
          },
          "key": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ValidateResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "The public key record as /validate reports it (no wildcard probe); null when d= or s= is missing. When the message carries an inbox.result_truncated finding, parts of the key lookup (DNS details, TXT answers, raw records) may have been left out or shortened."
          },
          "verification": {
            "$ref": "#/components/schemas/VerificationResult",
            "description": "status is always not_attempted (the body is never read); signatureValid carries the cryptographic result over the signed headers."
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            }
          }
        },
        "required": ["header", "key", "verification", "findings"]
      },
      "InboxMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          },
          "fromDomain": {
            "type": ["string", "null"],
            "description": "Domain of the From header (never the address)."
          },
          "headerBytes": {
            "type": "integer",
            "description": "Bytes of header block read. The body is never read."
          },
          "signatures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboxSignature"
            },
            "description": "At most 20 signatures per message are reported."
          },
          "alignment": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alignment"
            }
          },
          "receiver": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/InboxReceiverResults"
              },
              {
                "type": "null"
              }
            ],
            "description": "Result tokens from the receiving server's Authentication-Results header; null when absent."
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            }
          }
        },
        "required": [
          "id",
          "receivedAt",
          "fromDomain",
          "headerBytes",
          "signatures",
          "alignment",
          "receiver",
          "findings"
        ]
      },
      "InboxResponse": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "expired": {
            "type": "boolean",
            "description": "True once expiresAt has passed (the session may linger until the hourly purge)."
          },
          "messageCount": {
            "type": "integer"
          },
          "maxMessages": {
            "type": "integer"
          },
          "pollIntervalSeconds": {
            "type": "integer"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboxMessage"
            },
            "description": "Oldest first."
          }
        },
        "required": [
          "address",
          "createdAt",
          "expiresAt",
          "expired",
          "messageCount",
          "maxMessages",
          "pollIntervalSeconds",
          "messages"
        ]
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "bad_request",
                  "invalid_domain",
                  "invalid_selector",
                  "too_many_selectors",
                  "rate_limited",
                  "upstream_error",
                  "internal_error",
                  "not_found",
                  "unavailable",
                  "turnstile_required",
                  "turnstile_failed"
                ],
                "description": "Wrong method, unknown path, cross-site refusal and oversized bodies all use bad_request; branch on the HTTP status. turnstile_required and turnstile_failed come only from POST /api/v1/inbox on a deployment that has turned on its Turnstile check."
              },
              "message": {
                "type": "string"
              },
              "details": {
                "description": "Optional extra data. too_many_selectors carries {max, received}; turnstile_required and turnstile_failed carry {sitekey, action} (and reason on turnstile_failed)."
              }
            },
            "required": ["code", "message"]
          }
        },
        "required": ["error"]
      },
      "ValidateRequest": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "Domain, hostname, email address or URL; normalised to a lower-case punycode domain."
          },
          "selector": {
            "type": "string",
            "description": "DKIM selector, up to 63 characters per label. selector._domainkey.domain may be at most 253 characters.",
            "minLength": 1
          }
        },
        "required": ["domain", "selector"]
      },
      "EnumerateCheckRequest": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "selectors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Between 1 and the plan chunkSize selectors.",
            "minItems": 1
          }
        },
        "required": ["domain", "selectors"]
      },
      "MessageRequest": {
        "type": "object",
        "properties": {
          "raw": {
            "type": "string",
            "description": "A raw RFC 5322 message, or just its header block. At most 1 MiB for the whole request body."
          }
        },
        "required": ["raw"]
      }
    },
    "headers": {
      "XRequestId": {
        "description": "Request id, also present in the service log lines.",
        "schema": {
          "type": "string"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        }
      },
      "ETag": {
        "description": "Weak entity tag derived from the session state; send it as If-None-Match.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed input. Codes: bad_request, invalid_domain, invalid_selector, too_many_selectors.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "example": {
              "error": {
                "code": "invalid_domain",
                "message": "Domain names must have at least two labels."
              }
            }
          }
        }
      },
      "CrossSite": {
        "description": "A state-changing request carried an Origin or Sec-Fetch-Site marking it cross-site. Calls without those headers (curl, scripts, servers) are not affected.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "example": {
              "error": {
                "code": "bad_request",
                "message": "Cross-site requests are not allowed. Call this endpoint from the dkim.fyi page or from a server."
              }
            }
          }
        }
      },
      "TooLarge": {
        "description": "Request body over the limit (256 KiB; 1 MiB for /message).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "example": {
              "error": {
                "code": "bad_request",
                "message": "Request body is too large (limit 256 KiB).",
                "details": {
                  "maxBytes": 262144
                }
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "Per-client rate limit exceeded: 120 requests per minute for /api/*, 5 per minute for POST /inbox.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "example": {
              "error": {
                "code": "rate_limited",
                "message": "Too many requests. Try again in a minute."
              }
            }
          }
        }
      },
      "UpstreamError": {
        "description": "The DNS-over-HTTPS resolver did not answer, so there is no result.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "example": {
              "error": {
                "code": "upstream_error",
                "message": "The DNS-over-HTTPS resolver did not answer. Try again in a moment."
              }
            }
          }
        }
      },
      "Unavailable": {
        "description": "The email check is not enabled on this deployment (unavailable). On POST /api/v1/inbox also: its Turnstile check is on but not configured (unavailable), or could not be verified (upstream_error).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "example": {
              "error": {
                "code": "unavailable",
                "message": "Email checks are not enabled on this deployment (no database is configured)."
              }
            }
          }
        }
      },
      "InboxNotFound": {
        "description": "Unknown, malformed, deleted or purged token.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "example": {
              "error": {
                "code": "not_found",
                "message": "No such inbox. It may have expired or been deleted; request a new address."
              }
            }
          }
        }
      }
    }
  }
}
