{
  "openapi": "3.1.0",
  "info": {
    "title": "Verify Domain API",
    "version": "1.0.0",
    "description": "Best-effort DNS observations from two public resolvers. Limits are maximums. No uptime, throughput, or full-allowance guarantee."
  },
  "servers": [
    {
      "url": "https://api.verifydomainapi.com"
    },
    {
      "url": "https://api-staging.verifydomainapi.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "developerKey": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Check": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "name",
              "type",
              "expected"
            ],
            "properties": {
              "name": {
                "type": "string",
                "example": "www.example.com",
                "description": "ASCII DNS name. Use A-labels for internationalized domains."
              },
              "type": {
                "const": "A"
              },
              "expected": {
                "type": "array",
                "minItems": 0,
                "maxItems": 64,
                "items": {
                  "type": "string",
                  "format": "ipv4"
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "name",
              "type",
              "expected"
            ],
            "properties": {
              "name": {
                "type": "string",
                "example": "www.example.com",
                "description": "ASCII DNS name. Use A-labels for internationalized domains."
              },
              "type": {
                "const": "AAAA"
              },
              "expected": {
                "type": "array",
                "minItems": 0,
                "maxItems": 64,
                "items": {
                  "type": "string",
                  "format": "ipv6"
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "name",
              "type",
              "expected"
            ],
            "properties": {
              "name": {
                "type": "string",
                "example": "www.example.com",
                "description": "ASCII DNS name. Use A-labels for internationalized domains."
              },
              "type": {
                "const": "CNAME"
              },
              "expected": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string"
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "name",
              "type",
              "expected"
            ],
            "properties": {
              "name": {
                "type": "string",
                "example": "www.example.com",
                "description": "ASCII DNS name. Use A-labels for internationalized domains."
              },
              "type": {
                "const": "TXT"
              },
              "expected": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "items": {
                  "type": "string"
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "name",
              "type",
              "expected"
            ],
            "properties": {
              "name": {
                "type": "string",
                "example": "www.example.com",
                "description": "ASCII DNS name. Use A-labels for internationalized domains."
              },
              "type": {
                "const": "MX"
              },
              "expected": {
                "type": "array",
                "minItems": 0,
                "maxItems": 64,
                "items": {
                  "type": "object",
                  "required": [
                    "priority",
                    "exchange"
                  ],
                  "properties": {
                    "priority": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 65535
                    },
                    "exchange": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        ]
      }
    }
  },
  "security": [
    {
      "developerKey": []
    }
  ],
  "paths": {
    "/v1/dns/check": {
      "post": {
        "operationId": "checkDNS",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Check"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "DNS observation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "outcome",
                    "reason",
                    "observedAt"
                  ],
                  "properties": {
                    "outcome": {
                      "enum": [
                        "matched",
                        "mismatch",
                        "unavailable"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "observedAt": {
                      "type": "integer",
                      "description": "Unix milliseconds"
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "required": [
                              "priority",
                              "exchange"
                            ],
                            "properties": {
                              "priority": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535
                              },
                              "exchange": {
                                "type": "string"
                              }
                            }
                          }
                        ]
                      }
                    },
                    "unexpected": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "required": [
                              "priority",
                              "exchange"
                            ],
                            "properties": {
                              "priority": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535
                              },
                              "exchange": {
                                "type": "string"
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid check or JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "resetAt": {
                      "type": "integer",
                      "description": "Unix milliseconds"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "resetAt": {
                      "type": "integer",
                      "description": "Unix milliseconds"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds 16 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "resetAt": {
                      "type": "integer",
                      "description": "Unix milliseconds"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited or monthly quota exhausted",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry, when available."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "resetAt": {
                      "type": "integer",
                      "description": "Unix milliseconds"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry, when available."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "resetAt": {
                      "type": "integer",
                      "description": "Unix milliseconds"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
