Authentication
Create an API key with access, send it, and check what it can do.
The API uses your organization's API keys, the same keys your middleware uses. Beyond GET /me, a key
reaches nothing until an owner or admin grants it access.
| Access | Permission | Reaches |
|---|---|---|
| Read records | dns:read | The DNS records of the domains you choose |
| Edit records | dns:edit, with dns:read | The same, and changes them |
| Read usage | usage:read | Usage for every site |
| Read earnings | earnings:read | Earnings for every site |
Create a key with access
- In the dashboard, open API keys.
- Enter a Key name and choose when it Expires.
- Under DNS records, choose Read records or Edit records, then All domains (including domains you connect later) or Only the ones I pick.
- Under Reports, tick Read usage, Read earnings, or both. Read earnings appears once D3 turns on Access and pricing for your organization.
- Click Create key. The key is shown once: copy it into your secret manager.
To change a key's access later, click Permissions on it.
A change made with a key is made in the name of the person who granted its access.
Authenticate
Send the key over HTTPS in the Authorization header, after Bearer . A key sent over plain HTTP is
refused and loses its API access, so an owner or admin has to grant it again.
GET /me answers any key with what it can reach:
curl https://api.d3.com/v1/me \
-H "Authorization: Bearer $DNA_API_KEY"{
"id": "6b1f0e9a-3c2d-4e8f-9a71-2d5c8b0e4f13",
"name": "deploy script",
"prefix": "d3_k_7Qm2xRa…k4Pz",
"organization_id": "Xc81LwQ0pTz5vNk2aR7yHd3e",
"expires_at": null,
"grants": [
{
"permission": "dns:edit",
"resource": { "type": "domain", "all": true },
"granted_by": "ana@example.com",
"granted_at": "2026-10-20T14:02:11.000Z"
},
{
"permission": "usage:read",
"resource": { "type": "organization", "all": true },
"granted_by": "ana@example.com",
"granted_at": "2026-10-20T14:02:11.000Z"
}
],
"lapsed": []
}A key reaches only your organization, and only what its access names.
When a key loses access
A key's API access ends when an owner or admin removes it, or on its own for the reasons below. The key keeps working for your middleware unless it is revoked. Access never comes back by itself: an owner or admin grants it again.
GET /me lists access the key lost in the last 30 days under lapsed, with one of these reasons:
reason | Why |
|---|---|
removed | an owner or admin removed it |
granter_lost_access | the person who granted it is no longer an owner or admin |
creator_left | the person who created the key left the organization |
creator_lost_access | the person who created the key is no longer an owner or admin |
sent_over_http | the key was sent over plain HTTP |
key_revoked | the key was revoked |
A key whose creator is no longer an owner or admin can't be given access again: create a new key.