{"openapi":"3.1.0","info":{"title":"zona.pt API","description":"DNS zone diagnostics: delegation, name servers, consistency, connectivity, DNSSEC, syntax and zone content, tested against the authoritative servers from the root. Free, no registration, no API key. Rate-limited per IP address; results are kept for 30 days. Messages in Portuguese (`lang=pt`, default) or English (`lang=en`).\n\nQuick start: `GET /api/v1/domains/example.pt` runs the test and returns the result (10 to 60 seconds).\n\nMCP server for AI assistants: `https://zona.pt/mcp` (Streamable HTTP).\n\nThe test descriptions follow the Zonemaster specifications (AFNIC and Internetstiftelsen), CC BY 4.0.","contact":{"name":"Sooma","url":"https://sooma.com/","email":"support@sooma.com"},"version":"1.0"},"servers":[{"url":"https://zona.pt"}],"paths":{"/api/v1/domains/{domain}":{"get":{"tags":["tests"],"summary":"Test a domain and wait for the result","description":"Runs the full check and waits up to 100 seconds. If the test is still running when the wait ends, the response has\n`status: running` and an `id` to poll with `GET /api/v1/tests/{id}`.","operationId":"api_domain_api_v1_domains__domain__get","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","description":"Delegated zone, e.g. example.pt","title":"Domain"},"description":"Delegated zone, e.g. example.pt"},{"name":"lang","in":"query","required":false,"schema":{"enum":["pt","en"],"type":"string","description":"Language of names and messages","default":"pt","title":"Lang"},"description":"Language of names and messages"},{"name":"min_level","in":"query","required":false,"schema":{"enum":["INFO","NOTICE","WARNING","ERROR","CRITICAL"],"type":"string","description":"Lowest level included in `entries`","default":"INFO","title":"Min Level"},"description":"Lowest level included in `entries`"},{"name":"fresh","in":"query","required":false,"schema":{"type":"boolean","description":"Force a new test instead of reusing one finished in the last 10 minutes","default":false,"title":"Fresh"},"description":"Force a new test instead of reusing one finished in the last 10 minutes"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Test"}}}},"400":{"description":"Invalid domain"},"429":{"description":"Rate limit reached"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tests":{"post":{"tags":["tests"],"summary":"Start a test","description":"Starts a test and returns immediately with its `id`. Poll `GET /api/v1/tests/{id}` until `status` is `done`.","operationId":"api_create_api_v1_tests_post","parameters":[{"name":"lang","in":"query","required":false,"schema":{"enum":["pt","en"],"type":"string","description":"Language of names and messages","default":"pt","title":"Lang"},"description":"Language of names and messages"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewTest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Test"}}}},"400":{"description":"Invalid domain"},"429":{"description":"Rate limit reached"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tests/{test_id}":{"get":{"tags":["tests"],"summary":"Status and result of a test","operationId":"api_get_api_v1_tests__test_id__get","parameters":[{"name":"test_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{6,40}$","title":"Test Id"}},{"name":"lang","in":"query","required":false,"schema":{"enum":["pt","en"],"type":"string","description":"Language of names and messages","default":"pt","title":"Lang"},"description":"Language of names and messages"},{"name":"min_level","in":"query","required":false,"schema":{"enum":["INFO","NOTICE","WARNING","ERROR","CRITICAL"],"type":"string","description":"Lowest level included in `entries`","default":"INFO","title":"Min Level"},"description":"Lowest level included in `entries`"},{"name":"wait","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":0,"description":"Seconds to wait for the test to finish (long polling)","default":0,"title":"Wait"},"description":"Seconds to wait for the test to finish (long polling)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Test"}}}},"404":{"description":"Unknown or expired test"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/testcases":{"get":{"tags":["reference"],"summary":"List of test cases","operationId":"api_testcases_api_v1_testcases_get","parameters":[{"name":"lang","in":"query","required":false,"schema":{"enum":["pt","en"],"type":"string","description":"Language of names and messages","default":"pt","title":"Lang"},"description":"Language of names and messages"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TestCase"},"title":"Response Api Testcases Api V1 Testcases Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Category":{"properties":{"score":{"type":"integer","title":"Score"},"tested":{"type":"boolean","title":"Tested","default":true}},"type":"object","required":["score"],"title":"Category"},"Entry":{"properties":{"module":{"type":"string","title":"Module","description":"Test area id, e.g. Delegation, DNSSEC"},"module_name":{"type":"string","title":"Module Name","description":"Area name in the requested language"},"testcase":{"type":"string","title":"Testcase","description":"Test case id, e.g. Connectivity03"},"testcase_name":{"type":"string","title":"Testcase Name","description":"Test case description in the requested language"},"level":{"type":"string","title":"Level","description":"INFO, NOTICE, WARNING, ERROR or CRITICAL"},"tag":{"type":"string","title":"Tag","description":"Stable message identifier"},"message":{"type":"string","title":"Message","description":"Message in the requested language"},"args":{"additionalProperties":true,"type":"object","title":"Args","description":"Raw message arguments"}},"type":"object","required":["module","module_name","testcase","testcase_name","level","tag","message"],"title":"Entry"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"NameServer":{"properties":{"nameserver":{"type":"string","title":"Nameserver"},"address":{"type":"string","title":"Address"},"median_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median Ms"},"max_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Ms"},"queries":{"type":"integer","title":"Queries","default":0},"timeouts":{"type":"integer","title":"Timeouts","default":0},"status":{"type":"string","title":"Status","default":"ok"}},"type":"object","required":["nameserver","address"],"title":"NameServer"},"NewTest":{"properties":{"domain":{"type":"string","title":"Domain","description":"Delegated zone to test, e.g. example.pt (not a hostname)","examples":["example.pt"]}},"type":"object","required":["domain"],"title":"NewTest"},"Test":{"properties":{"id":{"type":"string","title":"Id"},"domain":{"type":"string","title":"Domain"},"status":{"type":"string","enum":["queued","running","done","failed"],"title":"Status"},"progress":{"type":"integer","title":"Progress","description":"0 to 100"},"result_url":{"type":"string","title":"Result Url","description":"Human-readable report"},"api_url":{"type":"string","title":"Api Url"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"},"score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score","description":"0 to 100, when done"},"grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grade","description":"A+ to F, when done"},"categories":{"additionalProperties":{"$ref":"#/components/schemas/Category"},"type":"object","title":"Categories","description":"connectivity, dnssec, nameserver_health, zone_consistency"},"summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Summary","description":"Number of messages per level"},"best_practices":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Best Practices"},"problems":{"items":{"$ref":"#/components/schemas/Entry"},"type":"array","title":"Problems","description":"Messages at WARNING level or above, most severe first"},"entries":{"items":{"$ref":"#/components/schemas/Entry"},"type":"array","title":"Entries","description":"All messages at or above min_level"},"nameservers":{"items":{"$ref":"#/components/schemas/NameServer"},"type":"array","title":"Nameservers"}},"type":"object","required":["id","domain","status","progress","result_url","api_url"],"title":"Test"},"TestCase":{"properties":{"id":{"type":"string","title":"Id"},"module":{"type":"string","title":"Module"},"module_name":{"type":"string","title":"Module Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["id","module","module_name","description"],"title":"TestCase"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}