Skip to main content

Reference

This article contains documentation for AdGuard DNS API. For the complete AdGuard DNS API changelog, visit this page.

Current version: 1.9

/oapi/v1/account/limits

GET

Summary

Gets account limits

Responses
CodeDescription
200Account limits info

/oapi/v1/dedicated_addresses/ipv4

GET

Summary

Lists dedicated IPv4 addresses

Responses
CodeDescription
200List of dedicated IPv4 addresses

POST

Summary

Allocates new IPv4

Responses
CodeDescription
200New IPv4 successfully allocated
429Dedicated IPv4 count reached the limit

/oapi/v1/devices

GET

Summary

Lists devices

Responses
CodeDescription
200List of devices

POST

Summary

Creates a new device

Responses
CodeDescription
200Device created
400Validation failed
429Devices count reached the limit

/oapi/v1/devices/{device_id}

DELETE

Summary

Removes a device

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
Responses
CodeDescription
200Device deleted
404Device not found

GET

Summary

Gets an existing device by ID

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
Responses
CodeDescription
200Device info
404Device not found

PUT

Summary

Updates an existing device

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
Responses
CodeDescription
200Device updated
400Validation failed
404Device not found

/oapi/v1/devices/{device_id}/dedicated_addresses

GET

Summary

List dedicated IPv4 and IPv6 addresses for a device

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
Responses
CodeDescription
200Dedicated IPv4 and IPv6

/oapi/v1/devices/{device_id}/dedicated_addresses/ipv4

DELETE

Summary

Unlink dedicated IPv4 from the device

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
Responses
CodeDescription
200Dedicated IPv4 successfully unlinked from the device
404Device or address not found

POST

Summary

Link dedicated IPv4 to the device

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
Responses
CodeDescription
200Dedicated IPv4 successfully linked to the device
400Validation failed
404Device or address not found
429Linked dedicated IPv4 count reached the limit

/oapi/v1/devices/{device_id}/doh.mobileconfig

GET

Summary

Gets DNS-over-HTTPS .mobileconfig file.

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
exclude_wifi_networksqueryList Wi-Fi networks by their SSID in which you want AdGuard DNS to be disabledNo[ string ]
exclude_domainqueryList domains that will use default DNS servers instead of AdGuard DNSNo[ string ]
Responses
CodeDescription
200DNS-over-HTTPS .plist file
404Device not found

/oapi/v1/devices/{device_id}/doh_password/reset

PUT

Summary

Generate and set new DNS-over-HTTPS password

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
Responses
CodeDescription
200DNS-over-HTTPS password successfully reset
404Device not found

/oapi/v1/devices/{device_id}/dot.mobileconfig

GET

Summary

Gets DNS-over-TLS .mobileconfig file.

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
exclude_wifi_networksqueryList Wi-Fi networks by their SSID in which you want AdGuard DNS to be disabledNo[ string ]
exclude_domainqueryList domains that will use default DNS servers instead of AdGuard DNSNo[ string ]
Responses
CodeDescription
200DNS-over-HTTPS .plist file
404Device not found

/oapi/v1/devices/{device_id}/settings

PUT

Summary

Updates device settings

Parameters
NameLocated inDescriptionRequiredSchema
device_idpathYesstring
Responses
CodeDescription
200Device settings updated
400Validation failed
404Device not found

/oapi/v1/dns_servers

GET

Summary

Lists DNS servers that belong to the user.

Description

Lists DNS servers that belong to the user. By default there is at least one default server.

Responses
CodeDescription
200List of DNS servers

POST

Summary

Creates a new DNS server

Description

Creates a new DNS server. You can attach custom settings, otherwise DNS server will be created with default settings.

Responses
CodeDescription
200DNS server created
400Validation failed
429DNS servers count reached the limit

/oapi/v1/dns_servers/{dns_server_id}

DELETE

Summary

Removes a DNS server

Description

Removes a DNS server. All devices attached to this DNS server will be moved to the default DNS server. Deleting the default DNS server is forbidden.

Parameters
NameLocated inDescriptionRequiredSchema
dns_server_idpathYesstring
Responses
CodeDescription
200DNS server deleted
404DNS server not found

GET

Summary

Gets an existing DNS server by ID

Parameters
NameLocated inDescriptionRequiredSchema
dns_server_idpathYesstring
Responses
CodeDescription
200DNS server info
404DNS server not found

PUT

Summary

Updates an existing DNS server

Parameters
NameLocated inDescriptionRequiredSchema
dns_server_idpathYesstring
Responses
CodeDescription
200DNS server updated
400Validation failed
404DNS server not found

/oapi/v1/dns_servers/{dns_server_id}/settings

PUT

Summary

Updates DNS server settings

Parameters
NameLocated inDescriptionRequiredSchema
dns_server_idpathYesstring
Responses
CodeDescription
200DNS server settings updated
400Validation failed
404DNS server not found

/oapi/v1/filter_lists

GET

Summary

Gets filter lists

Responses
CodeDescription
200List of filters

/oapi/v1/oauth_token

POST

Summary

Generates Access and Refresh token

Responses
CodeDescription
200Access token issued
400Missing required parameters
401Invalid credentials, MFA token or refresh token provided

null

/oapi/v1/query_log

DELETE

Summary

Clears query log

Responses
CodeDescription
202Query log was cleared

GET

Summary

Gets query log

Parameters
NameLocated inDescriptionRequiredSchema
time_from_millisqueryTime from in milliseconds (inclusive)Yeslong
time_to_millisqueryTime to in milliseconds (inclusive)Yeslong
devicesqueryFilter by devicesNo[ string ]
countriesqueryFilter by countriesNo[ string ]
companiesqueryFilter by companiesNo[ string ]
statusesqueryFilter by statusesNo[ FilteringActionStatus ]
categoriesqueryFilter by categoriesNo[ CategoryType ]
searchqueryFilter by domain nameNostring
limitqueryLimit the number of records to be returnedNointeger
cursorqueryPagination cursor. Use cursor from response to paginate through the pages.Nostring
Responses
CodeDescription
200Query log

/oapi/v1/revoke_token

POST

Summary

Revokes a Refresh Token

Parameters
NameLocated inDescriptionRequiredSchema
refresh_tokenqueryRefresh TokenYesstring
Responses
CodeDescription
200Refresh token revoked

null

/oapi/v1/stats/categories

GET

Summary

Gets categories statistics

Parameters
NameLocated inDescriptionRequiredSchema
time_from_millisqueryTime from in milliseconds (inclusive)Yeslong
time_to_millisqueryTime to in milliseconds (inclusive)Yeslong
devicesqueryFilter by devicesNo[ string ]
countriesqueryFilter by countriesNo[ string ]
Responses
CodeDescription
200Categories statistics received
400Validation failed

/oapi/v1/stats/companies

GET

Summary

Gets companies statistics

Parameters
NameLocated inDescriptionRequiredSchema
time_from_millisqueryTime from in milliseconds (inclusive)Yeslong
time_to_millisqueryTime to in milliseconds (inclusive)Yeslong
devicesqueryFilter by devicesNo[ string ]
countriesqueryFilter by countriesNo[ string ]
Responses
CodeDescription
200Companies statistics received
400Validation failed

/oapi/v1/stats/companies/detailed

GET

Summary

Gets detailed companies statistics

Parameters
NameLocated inDescriptionRequiredSchema
time_from_millisqueryTime from in milliseconds (inclusive)Yeslong
time_to_millisqueryTime to in milliseconds (inclusive)Yeslong
devicesqueryFilter by devicesNo[ string ]
countriesqueryFilter by countriesNo[ string ]
cursorqueryPagination cursorNostring
Responses
CodeDescription
200Detailed companies statistics received
400Validation failed

/oapi/v1/stats/countries

GET

Summary

Gets countries statistics

Parameters
NameLocated inDescriptionRequiredSchema
time_from_millisqueryTime from in milliseconds (inclusive)Yeslong
time_to_millisqueryTime to in milliseconds (inclusive)Yeslong
devicesqueryFilter by devicesNo[ string ]
countriesqueryFilter by countriesNo[ string ]
Responses
CodeDescription
200Countries statistics received
400Validation failed

/oapi/v1/stats/devices

GET

Summary

Gets devices statistics

Parameters
NameLocated inDescriptionRequiredSchema
time_from_millisqueryTime from in milliseconds (inclusive)Yeslong
time_to_millisqueryTime to in milliseconds (inclusive)Yeslong
devicesqueryFilter by devicesNo[ string ]
countriesqueryFilter by countriesNo[ string ]
Responses
CodeDescription
200Devices statistics received
400Validation failed

/oapi/v1/stats/domains

GET

Summary

Gets domains statistics

Parameters
NameLocated inDescriptionRequiredSchema
time_from_millisqueryTime from in milliseconds (inclusive)Yeslong
time_to_millisqueryTime to in milliseconds (inclusive)Yeslong
devicesqueryFilter by devicesNo[ string ]
countriesqueryFilter by countriesNo[ string ]
Responses
CodeDescription
200Domains statistics received
400Validation failed

/oapi/v1/stats/time

GET

Summary

Gets time statistics

Parameters
NameLocated inDescriptionRequiredSchema
time_from_millisqueryTime from in milliseconds (inclusive)Yeslong
time_to_millisqueryTime to in milliseconds (inclusive)Yeslong
devicesqueryFilter by devicesNo[ string ]
countriesqueryFilter by countriesNo[ string ]
Responses
CodeDescription
200Time statistics received
400Validation failed

/oapi/v1/web_services

GET

Summary

Lists web services

Responses
CodeDescription
200List of web-services