Provisioning API
How an external system (a billing or hosting platform, a customer portal) sets
a customer up in Salt using the public HTTP API alone. Salt knows
nothing about that system: it sees a token, a reference string the system
chooses, and ordinary zones and records. Every call below is idempotent, so a
retry after a timeout is safe. The OpenAPI document (/api/v1/openapi.json) has
every field.
1. The provisioning token
An owner or admin creates a provisioning token for the organisation that will act as the provider. In the console that is the Provisioning page of the organisation (create, list and revoke tokens; the token is shown once, and the customers created through the API are listed, each linking to its zones, read only). From the command line:
bin/salt_dns eval 'IO.puts(SaltDns.Release.create_provisioning_token(1, "me@example.org", "billing"))'
(organisation id, an owner's or admin's email, a name). The token is shown once.
What it can do, and what it cannot:
- It creates and manages child organisations of the provider, one per
customer, named by your own reference. Inside one child it acts with the
grant "every name and type of every zone,
read,updateandmanage", so it can do what the REST API offers on zones, records, names, import and verification, and also read and set DNSSEC, read a zone's audit log and manage the child's secondary nameservers (these needmanageon zoneany). It has no certificate or routing grant: the/certificatesand/proxycalls are refused (403) for it. - It cannot act in the provider organisation itself, in any other
organisation (also not another provider's children: those are a plain
404, the same as a reference that does not exist), or on users, memberships and credentials: the API has no calls for those. The PowerDNS-compatible API rejects it (401). - Children have no members, so they do not appear in anybody's organisation list. Owners and admins of the provider can still look at them in the console, read only: the Provisioning page lists each customer with its number of zones, a customer's page lists its zones (status, DNSSEC, number of records, last change), and a zone shows its records and the state of its ownership proof. The provider's own Zones page repeats them in a separate "Zones of customers" section. Editors and viewers of the provider see none of this. Nothing can be changed there: adding, changing, importing, deleting, "Check now" and credentials stay with the API. Only direct children are shown.
A token can have an expiry date (set when it is created in the console), and an
owner or admin can revoke it there at any time. To rotate, create a second token,
switch your system to it, and revoke the first. A token that is expired, revoked,
malformed or unknown gets the same 401, and failed attempts are counted per
client address (20 a minute by default; then 429 until the window ends).
A leaked provisioning token can create, read and delete the provider's
customer organisations and, inside them, change or delete every zone and record
and manage their secondaries and DNSSEC. It cannot reach the provider
organisation itself, any other organisation, users, other credentials,
certificates or routing, and it cannot create tokens.
2. A customer, by your reference
curl -X PUT -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"name": "Acme BV"}' \
https://dns.salt-dns.example/api/v1/provisioning/organisations/cust-1042
201 the first time, 200 after (and the name is updated if it differs).
GET .../organisations/cust-1042 and GET .../organisations read them back;
DELETE removes a customer that has no zones left (409 organisation_not_empty otherwise). A reference is 1 to 128 characters: letters,
digits and . _ : @ -.
From here on every call acts in one customer, named in a header:
-H "X-Salt-Organisation: cust-1042"
A provisioning token without the header gets 400 organisation_required.
3. A zone
curl -X PUT -H "Authorization: Bearer $TOKEN" -H "X-Salt-Organisation: cust-1042" \
-H "Content-Type: application/json" -d '{}' \
https://dns.salt-dns.example/api/v1/zones/acme.example
201 creates the zone, 200 returns it unchanged if it exists (the zone name
is the key; the body is the one of POST /zones without name). DELETE /zones/acme.example removes it, GET reads it. A new zone is pending until
its ownership is verified (delegation or the _salt-dns-challenge TXT record, see
getting started); POST /zones/{zone}/verify checks at once.
4. Records, as a desired state
PUT /zones/{zone}/rrsets/{name} says what a name should hold and applies it in
one batch (one version, all or nothing):
curl -X PUT -H "Authorization: Bearer $TOKEN" -H "X-Salt-Organisation: cust-1042" \
-H "Content-Type: application/json" \
-d '{"rrsets": [
{"type": "MX", "ttl": 3600, "records": ["10 mail.example.net."]},
{"type": "TXT", "ttl": 3600, "records": ["\"v=spf1 mx -all\""]}
],
"types": ["MX", "TXT", "CNAME"]}' \
https://dns.salt-dns.example/api/v1/zones/acme.example/rrsets/acme.example
Every listed rrset is created or replaced. Every type in types (default: the
listed types) that is not listed is deleted from the name; types that are not
in types are never touched. Applying the same body twice changes nothing. Use
"@" or the zone name for the apex. Single rrsets are also PUT /zones/{zone}/rrsets/{name}/{type} and several names at once PATCH /zones/{zone}/rrsets, both as before.
5. Handing out sub-domains under a parent zone
For a zone you use to give customers a name (<name>.example.org), three calls
do it safely, even with several replicas. See also
Choosing a sub-domain.
GET /zones/{zone}/names/{label} free, taken or reserved
POST /zones/{zone}/names/{label}/claim reserve it and write its records
DELETE /zones/{zone}/names/{label} take it backcurl -X POST -H "Authorization: Bearer $TOKEN" -H "X-Salt-Organisation: parent" \
-H "Content-Type: application/json" \
-d '{"reference": "order-7731", "note": "Alice",
"rrsets": [{"type": "A", "ttl": 300, "records": ["192.0.2.10"]},
{"type": "AAAA", "ttl": 300, "records": ["2001:db8::10"]}]}' \
https://dns.salt-dns.example/api/v1/zones/example.org/names/alice/claim
claim checks that the label is free, reserves it and writes its A, AAAA, CNAME
and TXT records in one transaction with the zone locked: of any number of
simultaneous claims for a label, on any replica, exactly one gets 201; the
others get 409 name_reserved (or name_taken if the name has records but no
reservation). If the records are not valid, nothing is kept, the reservation
included (422). Send your own reference: a retry of the same claim (same
reference) is a 200 that sets the records again, while someone else's claim is
still a 409. The answer has version, reservation and the rrsets.
DELETE .../names/{label} deletes the label's A, AAAA, CNAME and TXT records and
its reservation together (204; 404 if the label is not reserved, so it only
ever removes what it handed out). Other record types at the name are left alone
and keep the name taken.
A bare reservation without records is POST .../names/{label}/reserve, and the
reserved list is GET /zones/{zone}/reserved-names.
6. Has it reached Knot?
Every change gives the zone a new version, which every zone, claim and
desired-state answer shows. GET /zones/{zone}/sync tells how far Knot is:
{"zone": "example.org", "version": 41, "applied_version": 41,
"applied_at": "2026-11-12T06:02:11Z", "state": "applied"}applied: the primary Knot has everything up toversion.pending: there is a change it has not applied; ask again (every second or so, with a timeout).inactive: the zone is pending (ownership not verified) or disabled, so it is not on Knot.frozen: the zone takes no change until its DNSSEC keys are restored.
To wait for your write, take the version from its answer (or read it just after)
and poll until applied_version is at least that. applied means the primary
has it; the public edges and the other replicas follow by zone transfer, normally
within seconds, and that last step is not reported here.
What is checked, for whom
| Call | Token needs |
|---|---|
/provisioning/... | a provisioning token |
| everything else, with a provisioning token | the header naming one of its children |
| everything else, with another token | the usual grants (read, update, manage on the zone; creating a zone needs manage on zone any) |
A second organisation is never reachable with the first one's token: not by reference, not by zone name, not through the PowerDNS API.
Errors, retries, limits
- Errors are RFC 9457
application/problem+json:{"type": "urn:salt-dns:problem:not_found", "title": "Not Found", "status": 404, "detail": "...", "errors": [{"path": [...], "pointer": "/...", "code": "...", "detail": "..."}]}. Switch ontype(the part afterurn:salt-dns:problem:) and, for422, on thecodeof each entry inerrors, not ondetail. Types:unauthorized,forbidden,not_found,validation,conflict,precondition_failed,rate_limited,bad_request,payload_too_large,unsupported_media,not_implemented; the ones named on this page (organisation_required,organisation_not_empty,name_taken,name_reserved) are further types. - Safe to repeat: the
PUTcalls above and the claim with the samereference.DELETEof an organisation or zone that is already gone answers404; treat that as done.409 organisation_not_emptymeans zones are left. Retry a timeout or a429(wait the seconds inRetry-After) with the same request. - Limits per minute, by default: 600 requests from one client address, 1200 for
one token, 10 ownership checks (
/verify) and 10 zone imports for one token. An installation may change them. - Ordering: create the customer before anything that names it; delete a customer's
zones before the customer. Within one zone, writes are serialised and each makes
one new
version.
Lifecycle of a customer
| Step | Call | What happens to data |
|---|---|---|
| create | PUT /provisioning/organisations/{ref} | an empty child organisation |
| change | PUT with another name; zone, record and name calls above | the zone's version rises with every change; each change is in the zone's audit log |
| suspend, resume | not available | |
| delete | DELETE /zones/{zone} for each zone, then DELETE /provisioning/organisations/{ref} | deleting a zone removes it and its records (the removal is audited); the organisation is removed only when no zone is left |
Callbacks, versioning
Salt sends no webhook or other callback to your system; poll
GET /zones/{zone}/sync as in section 6. The OpenAPI document is versioned
1.0.0 with the product and the paths are under /api/v1. There is no
stability promise yet beyond that: no deprecation policy is written down, so
read the changelog before an upgrade.
Not available yet
- Suspending and resuming a customer (the API cannot disable a zone; a disabled zone is something an operator does in the console).
- Creating or revoking provisioning tokens over the API (console and command line only), and any call on users or memberships.
- Usage or status read-outs per customer beyond the list of customers and the
zones, records and
syncstate read with the ordinary calls (no counts or history in/provisioning/organisations, which returns onlyref,nameandcreated_at). - Events or callbacks to your system.
- Certificates and routing for a customer (the provisioning token has no such grant).