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/endpointThe 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/getzonesFor 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/getzonesLists all zones the API key has access to. No parameters.
List records
/dns/getrecordsLists all records of a zone.
| Parameter | Required | Description |
|---|---|---|
domain | Only for team and workspace keys | Name of the zone, for example example.org |
Add a record
/dns/addrecordAdds a record to a zone.
| Parameter | Required | Description |
|---|---|---|
domain | Only for team and workspace keys | Name of the zone, for example example.org |
name | Yes | Full name of the record, for example www.example.org |
type | Yes | Record type, for example A. Every type in the dashboard is accepted. |
value | Yes | Value of the record, for example 192.0.2.8 |
ttl | No | TTL in seconds, for example 3600. Values the dashboard does not list are rounded to the nearest one it lists. |
priority | No | Priority, 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/addrecordDelete records
/dns/deleterecordDeletes every record that matches name, type and value.
| Parameter | Required | Description |
|---|---|---|
domain | Only for team and workspace keys | Name of the zone, for example example.org |
name | Yes | Full name of the record, for example www.example.org |
type | Yes | Record type, for example A. Every type in the dashboard is accepted. |
value | Yes | Value of the record, for example 192.0.2.8 |