Authentication
Generate API keys, understand scopes, and authenticate requests.
Overview
DNScale uses API keys for authentication. Each API key is scoped to a customer account and carries specific permissions that control what operations it can perform.
For human login architecture and identity-provider concepts, see What Is SSO?. SSO governs browser-based user authentication; API keys still need their own scope, storage, rotation, and revocation controls.
Your API key automatically provides customer context. You don't need to specify a customer ID in API requests—the system determines your customer from the authenticated key.
Creating API Keys
Via the Dashboard
- Navigate to DNScale Dashboard → Settings → API Keys
- Click Create API Key
- Enter a name, select the required action scopes, and choose a zone/DNS-name boundary
- Copy and securely store the key—it's only shown once
Via the API
Create a key for a specific user:
curl -X POST https://api.dnscale.eu/v1/users/{user_id}/apikeys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "ACME Automation",
"scopes": "[\"zones:read\",\"records:read\",\"records:write\"]",
"zone_scopes": [{
"zone_id": "11111111-1111-4111-8111-111111111111",
"record_access": "names",
"record_names": ["_acme-challenge", "_acme-challenge.api"]
}]
}'Response:
{
"status": "success",
"data": {
"api_key": {
"id": "22222222-2222-4222-8222-222222222222",
"name": "ACME Automation",
"key": "dnscale_xxxxxxxxxxxxxxxxxxxx",
"scopes": "[\"zones:read\",\"records:read\",\"records:write\"]",
"zone_ids": ["11111111-1111-4111-8111-111111111111"],
"zone_scopes": [{
"zone_id": "11111111-1111-4111-8111-111111111111",
"record_access": "names",
"record_names": ["_acme-challenge", "_acme-challenge.api"]
}],
"created_at": "2026-09-05T10:30:00Z"
}
}
}The API key is only returned once. Store it securely in a secrets manager or environment variable.
Using API Keys
Include your API key in the Authorization header:
curl https://api.dnscale.eu/v1/zones \
-H "Authorization: Bearer dnscale_live_xxxxxxxxxxxxxxxxxxxx"Managing API Keys
List API Keys
curl https://api.dnscale.eu/v1/users/{user_id}/apikeys \
-H "Authorization: Bearer YOUR_API_KEY"Get API Key Details
curl https://api.dnscale.eu/v1/users/{user_id}/apikeys/{key_id} \
-H "Authorization: Bearer YOUR_API_KEY"Delete API Key
curl -X DELETE https://api.dnscale.eu/v1/users/{user_id}/apikeys/{key_id} \
-H "Authorization: Bearer YOUR_API_KEY"Deletion is immediate and revokes all active sessions using that key.
Scopes Reference
Scopes control what operations an API key can perform. Use the principle of least privilege—grant only the scopes required for your use case.
Action scopes and resource boundaries are both enforced. For example, a key needs records:write to change records and its zone_scopes policy must also allow the exact DNS owner name.
Zone and DNS Name Boundaries
Use zone_scopes when an integration should reach only selected zones or record owners:
record_access: "all"grants normal access to that entire zone, subject to action scopes.record_access: "names"grants record access only to the exact names inrecord_names.- Names are stored relative to the zone and case-insensitively. Use
@for the zone apex. - Absolute in-zone names are accepted at creation and returned in relative form.
*is a literal wildcard DNS owner. It does not match arbitrary labels.- A names-restricted key can list its parent zone, but it cannot update/delete the zone, manage DNSSEC or zone access, or read zone-level usage.
Record lists are filtered before pagination, so totals and page boundaries describe only records visible to the key. Resource policies are immutable; create and rotate to a new key when the boundary needs to change.
The older zone_ids request field remains compatible and means record_access: "all" for every listed zone. Do not send non-empty zone_ids and zone_scopes together. Omitting both creates a customer-wide key.
Core Resource Scopes
| Scope | Grants |
|---|---|
zones:read | List and view DNS zones |
zones:write | Create, update, and delete DNS zones |
records:read | List and view DNS records (also requires zones:read) |
records:write | Create, update, and delete DNS records (also requires zones:read) |
dnssec:read | View DNSSEC status and keys (also requires zones:read) |
dnssec:write | Enable/disable DNSSEC, manage cryptographic keys (also requires zones:read) |
Record, DNSSEC, and zone-usage routes are nested under
/v1/zones/{zone_id}/..., so they always needzones:readin addition to their own scope. The dashboard scope picker auto-selectszones:readwhen you tick any nested scope.
Account Management Scopes
| Scope | Grants |
|---|---|
users:read | List and view team members |
users:write | Create, update, and delete users |
apikeys:read | List and view API keys |
apikeys:write | Create and delete API keys |
customers:read | View customer account details |
customers:write | Update customer account settings |
Usage & Billing Scopes
| Scope | Grants |
|---|---|
usage:read | View usage statistics |
billing:read | View billing summaries and history |
Observability Scopes
| Scope | Grants |
|---|---|
alerts:read | View DNS traffic alert routes for Scale and Enterprise accounts |
alerts:write | Create, update, and delete DNS traffic alert routes for Scale and Enterprise accounts |
DNS traffic alerts also require the
dns_traffic_alertsfeature entitlement. The feature is enabled by default for Scale and Enterprise plans. See Alerts for route examples and error behavior.
Recommended Scope Sets
DNS Automation (Terraform, Ansible)
["zones:read", "zones:write", "records:read", "records:write"]ACME DNS-01 Challenge (Let's Encrypt)
["zones:read", "records:read", "records:write"]Pair those action scopes with a names resource boundary for every challenge owner the client needs. A certificate for example.com uses _acme-challenge; a certificate for api.example.com uses _acme-challenge.api. Exact owner matching means _acme-challenge does not automatically include descendants.
Read-Only Monitoring
["zones:read", "records:read", "usage:read"]Full Account Management
["zones:read", "zones:write", "records:read", "records:write", "dnssec:read", "dnssec:write", "users:read", "users:write", "apikeys:read", "apikeys:write", "usage:read", "billing:read"]Security Best Practices
- Use separate keys for different automation tools and environments
- Rotate keys regularly - Delete old keys and create new ones periodically
- Grant minimal scopes - Only include the permissions actually needed
- Never commit keys to version control
- Use environment variables or secrets managers to store keys
- Monitor key usage via the dashboard audit log