API Version: 1.11 (as of the last update)
This directory contains the OpenAPI 3.0 specification for the AdGuard DNS API.
The AdGuard DNS API OpenAPI specification is publicly available at:
https://api.adguard-dns.io/swagger/openapi.json
The openapi.json file (primary) and optional openapi.yaml file define:
- All API endpoints (/oapi/v1/*)
- Request/response schemas
- Authentication methods (API Key and Bearer Token)
- Error responses
- Data models
Use the provided download script:
# From the parent directory
./download-openapi-spec.sh
# Or use the complete update workflow
./update-api-client.shDownload directly from the public URL:
# Download JSON format (primary)
curl -o openapi.json https://api.adguard-dns.io/swagger/openapi.json
# Convert to YAML (optional, requires yq)
yq eval -P openapi.json > openapi.yamlIf you obtain an updated OpenAPI specification:
-
Backup the current spec:
cp openapi.json openapi.json.backup
-
Replace with new spec:
cp /path/to/new/spec.json openapi.json # or if you have YAML, convert it yq eval -o=json /path/to/new/spec.yaml > openapi.json
-
Validate the spec (optional but recommended):
npm install -g @stoplight/spectral-cli spectral lint openapi.json
-
Review changes:
git diff openapi.json
-
Regenerate the API client:
cd .. ./regenerate-client.sh
https://api.adguard-dns.io
The API supports two authentication methods:
-
API Key (ApiKey)
- Header:
Authorization - Format:
ApiKey your-api-key-here
- Header:
-
Bearer Token (AuthToken)
- Header:
Authorization - Format:
Bearer your-access-token
- Header:
The specification includes endpoints for:
-
Account Management (
/oapi/v1/account/*)- Get account limits
-
Authentication (
/oapi/v1/oauth_token)- Generate access and refresh tokens
-
Devices (
/oapi/v1/devices/*)- Create, read, update, delete devices
- List devices
-
DNS Servers (
/oapi/v1/dns_servers/*)- Create, read, update, delete DNS server profiles
- List DNS servers
-
Dedicated IP Addresses (
/oapi/v1/dedicated_addresses/*)- Allocate dedicated IPv4 addresses
- List allocated addresses
-
Filter Lists (
/oapi/v1/filter_lists)- Get available filter lists
-
Query Log (
/oapi/v1/query_log)- Get query log
- Clear query log
-
Statistics (
/oapi/v1/stats/*)- Get time-based statistics
-
Web Services (
/oapi/v1/web_services)- List web services for blocking
| Date | Version | Notes |
|---|---|---|
| Initial | 1.11 | Initial version in repository |
- OpenAPI Update Guide - Complete guide for updating and regenerating
- API Client Usage Guide - How to use the generated client
- AdGuard DNS API Documentation - Official API docs
If you find a public URL where the OpenAPI specification can be downloaded, please:
- Test the URL to ensure it returns valid OpenAPI/Swagger JSON or YAML
- Add the URL to
download-openapi-spec.shin the URLS array - Submit a pull request with your changes
For issues related to:
- The OpenAPI specification itself: Contact AdGuard support
- API functionality: Check AdGuard DNS documentation
- Client generation: See OpenAPI Update Guide