Setup values or an Apple configuration profile for a profile.
const url = 'https://api.opdns.io/v1/setup/apple?profile=example&protocol=doh';const options = {method: 'GET', headers: {cookie: 'opdns_session=<opdns_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.opdns.io/v1/setup/apple?profile=example&protocol=doh' \ --cookie opdns_session=<opdns_session>Token scope: profiles:read.
platform=apple returns an unsigned Apple configuration profile
(.mobileconfig, application/x-apple-aspen-config, served as an
attachment) with one com.apple.dnsSettings.managed payload: DoH
(ServerURL = the profile’s DoH URL, plus /<device> when device
is given) or, with protocol=dot, DoT (ServerName =
<device>-<id>.<domain> or <id>.<domain>). Payload UUIDs are
stable UUIDv5s of the profile id, protocol and device, and the
payload identifier is the same for both protocols, so reinstalling
replaces the installed profile. No on-demand rules: the settings
apply on every network. Unsigned profiles show as “Unverified”
(signing is planned).
Every other platform returns JSON: the profile’s endpoint values for the device and the docs page with the platform’s steps.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Public 6-character id; never 000000.
Device name, sanitised as the resolver does (lowercase, [a-z0-9-], at most 32 characters). A name with no letters or digits is a validation error.
platform=apple only: doh (default) or dot.
Responses
Section titled “Responses”Setup values (JSON) or the configuration profile (platform=apple).
object
The docs site page with this platform’s steps.
The profile’s endpoints; DoH, DoT and DoQ carry the device when one is given, IPv6 and IPv4 addresses never do.
object
The sanitised device name, or null.
Example
{ "platform": "windows", "instructions_url": "https://opdns.io/docs/setup/windows", "values": { "doh": "https://dns.opdns.net/abc123/living-room-tv", "dot": "living-room-tv-abc123.dns.opdns.net", "doq": "living-room-tv-abc123.dns.opdns.net" }}Not authenticated.
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
Example
{ "type": "https://opdns.io/problems/unauthenticated", "title": "Unauthorized", "status": 401, "code": "unauthenticated", "detail": "authentication required", "request_id": "5f2c9a0e7b1d4c38"}Authenticated but not allowed: insufficient_scope, session_required, csrf_rejected, mfa_enrolment_required (restricted session), mfa_required (an operator action, or an admin-scoped token, from a session signed in with the password alone; not in dev), reauth_required (sign in again within five minutes), account_pending_deletion (the account is in its deletion cooling-off).
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
Example
{ "type": "https://opdns.io/problems/insufficient_scope", "title": "Forbidden", "status": 403, "code": "insufficient_scope", "detail": "the token lacks the profiles:write scope", "request_id": "5f2c9a0e7b1d4c38"}Unknown platform, or profile not found.
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
Example
{ "type": "https://opdns.io/problems/not_found", "title": "Not Found", "status": 404, "code": "not_found", "detail": "resource not found", "request_id": "5f2c9a0e7b1d4c38"}Field validation failed (validation_failed, unknown_list).
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
Example
{ "type": "https://opdns.io/problems/validation_failed", "title": "Unprocessable Content", "status": 422, "code": "validation_failed", "detail": "the request has invalid fields", "errors": [ { "field": "settings.block_mode", "message": "one of nxdomain, refused, null, block-page" } ], "request_id": "5f2c9a0e7b1d4c38"}