Zones
A zone is a domain hosted on Dinio. See DNS hosting.
interface Zone { uuid: string; name: string; // "example.com" has_api_key: boolean; // whether a zone key exists suspended: boolean; // suspended by Dinio owner_suspended: boolean; // the Owner's account is suspended created_at: number; // Unix seconds updated_at: number; records?: RecordValue[]; // only with ?include=records}Wherever a route takes :ref, use the zone’s uuid or its name.
While suspended or owner_suspended is true, the zone can be read and deleted, and its
key revoked, but every other change is refused with 403 SUSPENDED.
List zones
Section titled “List zones”/api/v1/zonesZones the key can see: a zone key sees its own zone; a personal key sees the zones where the user is Owner or Administrator. Every zone comes in one response.
curl -H "Authorization: Bearer $DINIO_API_KEY" \ https://api-dinio.bitelex.com/api/v1/zonesCreate a zone
Section titled “Create a zone”/api/v1/zonesThe caller becomes the zone’s Owner, and the apex SOA and NS records are created with
it. Needs a personal key — a zone key gets 403.
| Field | Type | |
|---|---|---|
name |
string | Zone name, e.g. example.com. |
curl -X POST -H "Authorization: Bearer $DINIO_API_KEY" -H "Content-Type: application/json" \ -d '{"name":"example.com"}' \ https://api-dinio.bitelex.com/api/v1/zonesReturns 201 with the zone. 409 CONFLICT if the name is taken, 422 for an invalid name.
A zone counts against your package’s auth.zones.max: without an auth package the call is
403 NO_SUBSCRIPTION, at the limit 403 PLAN_LIMIT. Near the limit, the response carries a
PLAN_USAGE warning. See Packages and usage.
A name directly below a free domain — myhome.example.net — is a
lease: Dinio also adds the delegation to the free domain. A lease that isn’t possible (the
name is taken or reserved) is 409 CONFLICT, with the reason in message. Leases count
against auth.free_subdomains.max instead of auth.zones.max. Names deeper below a free domain, and the free domain itself, are
refused.
Get a zone
Section titled “Get a zone”/api/v1/zones/:refQuery include=records adds every record value of the zone as records, in the same flat
form as List record values.
curl -H "Authorization: Bearer $DINIO_API_KEY" \ "https://api-dinio.bitelex.com/api/v1/zones/example.com?include=records"Issue a zone key
Section titled “Issue a zone key”/api/v1/zones/:ref/api-keyGenerates a new zone key and returns it — the only time it is shown. A previous zone key stops working immediately. Allowed for the zone key itself, the Owner and Administrators.
curl -X POST -H "Authorization: Bearer $DINIO_API_KEY" \ https://api-dinio.bitelex.com/api/v1/zones/example.com/api-key{ "success": true, "data": { "api_key": "dz_3q2-7wEvCzYxQ…" } }Returns 201.
Revoke the zone key
Section titled “Revoke the zone key”/api/v1/zones/:ref/api-keyThe zone key stops working immediately. Returns the zone, with has_api_key: false. Same
access as issuing one.
curl -X DELETE -H "Authorization: Bearer $DINIO_API_KEY" \ https://api-dinio.bitelex.com/api/v1/zones/example.com/api-keyDelete a zone
Section titled “Delete a zone”/api/v1/zones/:refDeletes the zone with everything in it: records, health checks, geo bans, redirects and zone certificates. Deleting a lease also removes its delegation from the free domain. Allowed for the zone key and the Owner, not for Administrators.
curl -X DELETE -H "Authorization: Bearer $DINIO_API_KEY" \ https://api-dinio.bitelex.com/api/v1/zones/example.comExporting and importing a zone’s records is described in Zone files.