API reference

The API lists zones and records, and adds and deletes records. That covers ACME DNS-01 challenges and simple automation.

Requests

Every endpoint accepts GET and POST requests over HTTPS at this address:

https://api.nanelo.com/v1/header/endpoint

The current version is v1. Parameters can be sent in the query string or as form fields in the body. Encode them as UTF-8 and URL-encode them.

Authentication

Every request needs an API key, sent in the X-API-KEY header. API keys are created in the dashboard under Settings, API keys. A key belongs either to one domain or to a team or workspace.

curl -H "X-API-KEY: $NANELO_TOKEN" https://api.nanelo.com/v1/header/dns/getzones

For older clients the API also accepts the key in place of header in the URL. Avoid this: URLs end up in logs, shell history and proxies.

Responses

Responses are JSON with an ok field. A successful call returns the data in result:

{ "ok": true, "result": { … } }

A failed call returns the reason in error:

{ "ok": false, "error": "Invalid Domain" }

List zones

/dns/getzones

Lists all zones the API key has access to. No parameters.

List records

/dns/getrecords

Lists all records of a zone.

ParameterRequiredDescription
domainOnly for team and workspace keysName of the zone, for example example.org

Add a record

/dns/addrecord

Adds a record to a zone.

ParameterRequiredDescription
domainOnly for team and workspace keysName of the zone, for example example.org
nameYesFull name of the record, for example www.example.org
typeYesRecord type, for example A. Every type in the dashboard is accepted.
valueYesValue of the record, for example 192.0.2.8
ttlNoTTL in seconds, for example 3600. Values the dashboard does not list are rounded to the nearest one it lists.
priorityNoPriority, for MX records. For example 5
curl -H "X-API-KEY: $NANELO_TOKEN" \
  -d name=_acme-challenge.example.org -d type=TXT -d value=abc123 \
  https://api.nanelo.com/v1/header/dns/addrecord

Delete records

/dns/deleterecord

Deletes every record that matches name, type and value.

ParameterRequiredDescription
domainOnly for team and workspace keysName of the zone, for example example.org
nameYesFull name of the record, for example www.example.org
typeYesRecord type, for example A. Every type in the dashboard is accepted.
valueYesValue of the record, for example 192.0.2.8