Authentication
Authenticate REST API requests with an EdgeDNS API key. The same key works with supported MCP clients; browser clients can also connect through OAuth.
API Keys
API keys are used to authenticate your requests. You can generate and manage API keys from your dashboard. Give each key a name for identification; optional settings include an IP allowlist and expiration.
Key Format
API keys use the prefix edns_live_ or edns_test_, followed by a random identifier. The test prefix does not create a separate billing sandbox; requests use the organization’s allowance.
Using Your API Key
Include your API key as a Bearer token in the Authorization header of every request:
curl "https://api.edgedns.dev/v1/dns/lookup?domain=example.com" \ -H "Authorization: Bearer edns_live_YOUR_KEY"
API Key Permissions
A key with a nonempty permission list can call only the granted route namespaces and actions. For example, dns:read permits DNS reads and does not grant security checks or key-management writes. Read actions include GET, HEAD, and OPTIONS; operations that create, update, or delete resources require the corresponding write permission, such as keys:write. The read-only report comparison and drift POST routes use reports:read.
Empty permission lists retain unrestricted legacy behavior. The REST key-creation route currently creates keys with this default and accepts name, environment, IP allowlist, and expiration settings; it does not accept a permissions field. A denied permission returns HTTP 403 with the required permission in the error details.
Key permissions do not override plan eligibility, subscription status, or organization permissions. Wildcards can grant every action in one namespace (dns:*), reads across namespaces (*:read), or all actions (*).
Security Best Practices
- •Never expose your API key in client-side code
- •Use environment variables to store your API key
- •Rotate your API keys periodically
- •Use a separate API key for each application, and revoke keys you no longer use