4 title: PowerDNS Authoritative HTTP API
16 # X-API-Key: abcdef12345
25 # TODO: Return types are not consistent across documentation
26 # We need to look at the code and figure out the default HTTP response
27 # codes and adjust docs accordingly.
31 summary: List all servers
32 operationId: listServers
37 description: An array of servers
41 $ref: '#/definitions/Server'
43 '/servers/{server_id}':
45 summary: List a server
46 operationId: listServer
53 description: The id of the server to retrieve
57 description: An server
59 $ref: '#/definitions/Server'
61 '/servers/{server_id}/cache/flush':
63 summary: Flush a cache-entry by name
64 operationId: cacheFlushByName
71 description: The id of the server to retrieve
76 description: The domain name to flush from the cache
80 description: Flush successful
82 $ref: '#/definitions/CacheFlushResult'
84 '/servers/{server_id}/zones':
86 summary: List all Zones in a server
87 operationId: listZones
94 description: The id of the server to retrieve
101 When set to the name of a zone, only this zone is returned.
102 If no zone with that name exists, the response is an empty array.
103 This can e.g. be used to check if a zone exists in the database without having to guess/encode the zone's id or to check if a zone exists.
106 description: An array of Zones
110 $ref: '#/definitions/Zone'
112 summary: Creates a new domain, returns the Zone on creation.
113 operationId: createZone
120 description: The id of the server to retrieve
124 description: '“true” (default) or “false”, whether to include the “rrsets” in the response Zone object.'
128 description: The zone struct to patch with
132 $ref: '#/definitions/Zone'
137 $ref: '#/definitions/Zone'
139 '/servers/{server_id}/zones/{zone_id}':
141 summary: zone managed by a server
142 operationId: listZone
149 description: The id of the server to retrieve
155 description: The id of the zone to retrieve
160 $ref: '#/definitions/Zone'
162 summary: Deletes this zone, all attached metadata and rrsets.
163 operationId: deleteZone
170 description: The id of the server to retrieve
176 description: The id of the zone to retrieve
179 description: 'Returns 204 No Content on success.'
181 summary: 'Creates/modifies/deletes RRsets present in the payload and their comments. Returns 204 No Content on success.'
182 operationId: patchZone
189 description: The id of the server to retrieve
196 description: The zone struct to patch with
200 $ref: '#/definitions/Zone'
203 description: 'Returns 204 No Content on success.'
206 summary: Modifies basic zone data (metadata).
207 description: 'Allowed fields in client body: all except id, url and name. Returns 204 No Content on success.'
215 description: The id of the server to retrieve
222 description: The zone struct to patch with
226 $ref: '#/definitions/Zone'
229 description: 'Returns 204 No Content on success.'
231 '/servers/{server_id}/zones/{zone_id}/notify':
233 summary: Send a DNS NOTIFY to all slaves.
234 description: 'Fails when zone kind is not Master or Slave, or master and slave are disabled in the configuration. Only works for Slave if renotify is on. Clients MUST NOT send a body.'
235 operationId: notifyZone
242 description: The id of the server to retrieve
248 description: The id of the zone to retrieve
253 '/servers/{server_id}/zones/{zone_id}/axfr-retrieve':
255 summary: Retrieve slave zone from its master.
256 description: 'Fails when zone kind is not Slave, or slave is disabled in the configuration. Clients MUST NOT send a body.'
257 operationId: axfrRetrieveZone
264 description: The id of the server to retrieve
270 description: The id of the zone to retrieve
275 '/servers/{server_id}/zones/{zone_id}/export':
277 summary: 'Returns the zone in AXFR format.'
278 operationId: axfrExportZone
285 description: The id of the server to retrieve
291 description: The id of the zone to retrieve
298 '/servers/{server_id}/zones/{zone_id}/check':
300 summary: 'Verify zone contents/configuration.'
301 operationId: checkZone
308 description: The id of the server to retrieve
314 description: The id of the zone to retrieve
321 '/servers/{server_id}/zones/{zone_id}/rectify':
323 summary: 'Rectify the zone data.'
324 description: 'This does not take into account the API-RECTIFY metadata. Fails on slave zones and zones that do not have DNSSEC.'
325 operationId: rectifyZone
332 description: The id of the server to retrieve
338 description: The id of the zone to retrieve
345 '/servers/{server_id}/config':
347 summary: 'Returns all ConfigSettings for a single server'
348 operationId: getConfig
355 description: The id of the server to retrieve
359 description: List of config values
363 $ref: '#/definitions/ConfigSetting'
365 '/servers/{server_id}/config/{config_setting_name}':
367 summary: 'Returns a specific ConfigSetting for a single server'
368 description: 'NOT IMPLEMENTED'
369 operationId: getConfigSetting
376 description: The id of the server to retrieve
378 - name: config_setting_name
381 description: The name of the setting to retrieve
385 description: List of config values
387 $ref: '#/definitions/ConfigSetting'
389 '/servers/{server_id}/statistics':
391 summary: 'Query statistics.'
392 description: 'Query PowerDNS internal statistics.'
393 operationId: getStats
400 description: The id of the server to retrieve
407 When set to the name of a specific statistic, only this value is returned.
408 If no statistic with that name exists, the response has a 422 status and an error message.
412 description: List of Statistic Items
416 - $ref: '#/definitions/StatisticItem'
417 - $ref: '#/definitions/MapStatisticItem'
418 - $ref: '#/definitions/RingStatisticItem'
420 description: 'Returned when a non-existing statistic name has been requested. Contains an error message'
422 '/servers/{server_id}/search-data':
424 summary: 'Search the data inside PowerDNS'
425 description: 'Search the data inside PowerDNS for search_term and return at most max_results. This includes zones, records and comments. The * character can be used in search_term as a wildcard character and the ? character can be used as a wildcard for a single character.'
426 operationId: searchData
433 description: The id of the server to retrieve
438 description: 'The string to search for'
443 description: 'Maximum number of entries to return'
448 description: 'Type of data to search for, one of “all”, “zone”, “record”, “comment”'
452 description: Returns a JSON array with results
454 $ref: '#/definitions/SearchResults'
456 '/servers/{server_id}/zones/{zone_id}/metadata':
458 summary: Get all the MetaData associated with the zone.
459 operationId: listMetadata
466 description: The id of the server to retrieve
472 description: The id of the zone to retrieve
475 description: List of Metadata objects
479 $ref: '#/definitions/Metadata'
481 summary: 'Creates a set of metadata entries'
482 description: 'Creates a set of metadata entries of given kind for the zone. Existing metadata entries for the zone with the same kind are not overwritten.'
483 operationId: createMetadata
490 description: The id of the server to retrieve
497 description: List of metadata to add/create
503 $ref: '#/definitions/Metadata'
508 '/servers/{server_id}/zones/{zone_id}/metadata/{metadata_kind}':
510 summary: Get the content of a single kind of domain metadata as a list of MetaData objects.
511 operationId: getMetadata
518 description: The id of the server to retrieve
524 description: The id of the zone to retrieve
525 - name: metadata_kind
532 description: List of Metadata objects
534 $ref: '#/definitions/Metadata'
536 summary: 'Modify the content of a single kind of domain metadata.'
537 operationId: modifyMetadata
544 description: The id of the server to retrieve
550 - name: metadata_kind
551 description: The kind of metadata
556 description: metadata to add/create
560 $ref: '#/definitions/Metadata'
565 summary: 'Delete all items of a single kind of domain metadata.'
566 operationId: deleteMetadata
573 description: The id of the server to retrieve
579 description: The id of the zone to retrieve
580 - name: metadata_kind
589 '/servers/{server_id}/zones/{zone_id}/cryptokeys':
591 summary: 'Get all CryptoKeys for a zone, except the privatekey'
592 operationId: listCryptokeys
599 description: The id of the server to retrieve
605 description: The id of the zone to retrieve
608 description: List of Cryptokey objects
612 $ref: '#/definitions/Cryptokey'
614 summary: 'Creates a Cryptokey'
615 description: 'This method adds a new key to a zone. The key can either be generated or imported by supplying the content parameter. if content, bits and algo are null, a key will be generated based on the default-ksk-algorithm and default-ksk-size settings for a KSK and the default-zsk-algorithm and default-zsk-size options for a ZSK.'
616 operationId: createCryptokey
623 description: The id of the server to retrieve
630 description: Add a Cryptokey
634 $ref: '#/definitions/Cryptokey'
639 $ref: '#/definitions/Cryptokey'
641 '/servers/{server_id}/zones/{zone_id}/cryptokeys/{cryptokey_id}':
643 summary: 'Returns all data about the CryptoKey, including the privatekey.'
644 operationId: getCryptokey
651 description: The id of the server to retrieve
657 description: The id of the zone to retrieve
662 description: 'The id value of the CryptoKey'
665 description: Cryptokey
667 $ref: '#/definitions/Cryptokey'
669 summary: 'This method (de)activates a key from zone_name specified by cryptokey_id'
670 operationId: modifyCryptokey
677 description: The id of the server to retrieve
684 description: Cryptokey to manipulate
689 description: the Cryptokey
693 $ref: '#/definitions/Cryptokey'
698 description: 'Returned when something is wrong with the content of the request. Contains an error message'
700 summary: 'This method deletes a key specified by cryptokey_id.'
701 operationId: deleteCryptokey
708 description: The id of the server to retrieve
714 description: The id of the zone to retrieve
719 description: 'The id value of the Cryptokey'
724 description: 'Returned when something is wrong with the content of the request. Contains an error message'
726 '/servers/{server_id}/tsigkeys':
731 description: 'The id of the server'
734 summary: 'Get all TSIGKeys on the server, except the actual key'
735 operationId: listTSIGKeys
740 description: List of TSIGKey objects
744 $ref: '#/definitions/TSIGKey'
746 description: 'Internal Server Error, keys could not be retrieved. Contains error message'
748 $ref: '#/definitions/Error'
750 summary: 'Add a TSIG key'
751 description: 'This methods add a new TSIGKey. The actual key can be generated by the server or be provided by the client'
752 operationId: createTSIGKey
757 description: The TSIGKey to add
761 $ref: '#/definitions/TSIGKey'
766 $ref: '#/definitions/TSIGKey'
768 description: 'Conflict. A key with this name already exists'
770 $ref: '#/definitions/Error'
772 description: 'Unprocessable Entry, the TSIGKey provided has issues.'
774 $ref: '#/definitions/Error'
776 description: 'Internal Server Error. There was a problem creating the key'
778 $ref: '#/definitions/Error'
780 '/servers/{server_id}/tsigkeys/{tsigkey_id}':
785 description: 'The id of the server to retrieve the key from'
790 description: 'The id of the TSIGkey. Should match the "id" field in the TSIGKey object'
793 summary: 'Get a specific TSIGKeys on the server, including the actual key'
794 operationId: getTSIGKey
801 $ref: '#/definitions/TSIGKey'
803 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
805 $ref: '#/definitions/Error'
807 description: 'Internal Server Error, keys could not be retrieved. Contains error message'
809 $ref: '#/definitions/Error'
812 The TSIGKey at tsigkey_id can be changed in multiple ways:
813 * Changing the Name, this will remove the key with tsigkey_id after adding.
814 * Changing the Algorithm
816 Only the relevant fields have to be provided in the request body.
817 operationId: putTSIGKey
822 description: A (possibly stripped down) TSIGKey object with the new values
824 $ref: '#/definitions/TSIGKey'
829 description: OK. TSIGKey is changed.
831 $ref: '#/definitions/TSIGKey'
833 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
835 $ref: '#/definitions/Error'
837 description: 'Internal Server Error. Contains error message'
839 $ref: '#/definitions/Error'
841 summary: 'Delete the TSIGKey with tsigkey_id'
842 operationId: deleteTSIGKey
847 description: 'OK, key was deleted'
849 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
851 $ref: '#/definitions/Error'
853 description: 'Internal Server Error. Contains error message'
855 $ref: '#/definitions/Error'
863 description: 'Set to “Server”'
866 description: 'The id of the server, “localhost”'
869 description: '“recursor” for the PowerDNS Recursor and “authoritative” for the Authoritative Server'
872 description: 'The version of the server software'
875 description: 'The API endpoint for this server'
878 description: 'The API endpoint for this server’s configuration'
881 description: 'The API endpoint for this server’s zones'
886 $ref: '#/definitions/Server'
890 description: This represents an authoritative DNS Zone.
894 description: 'Opaque zone id (string), assigned by the server, should not be interpreted by the application. Guaranteed to be safe for embedding in URLs.'
897 description: 'Name of the zone (e.g. “example.com.”) MUST have a trailing dot'
900 description: 'Set to “Zone”'
903 description: 'API endpoint for this zone'
910 description: 'Zone kind, one of “Native”, “Master”, “Slave”'
914 $ref: '#/definitions/RRSet'
915 description: 'RRSets in this zone'
918 description: 'The SOA serial number'
921 description: 'The SOA serial notifications have been sent out for'
926 description: ' List of IP addresses configured as a master for this zone (“Slave” type zones only)'
929 description: 'Whether or not this zone is DNSSEC signed (inferred from presigned being true XOR presence of at least one cryptokey with active being true)'
932 description: 'The NSEC3PARAM record'
935 description: 'Whether or not the zone uses NSEC3 narrow'
938 description: 'Whether or not the zone is pre-signed'
941 description: 'The SOA-EDIT metadata item'
944 description: 'The SOA-EDIT-API metadata item'
947 description: ' Whether or not the zone will be rectified on data changes via the API'
950 description: 'MAY contain a BIND-style zone file when creating a zone'
953 description: 'MAY be set. Its value is defined by local policy'
958 description: 'MAY be sent in client bodies during creation, and MUST NOT be sent by the server. Simple list of strings of nameserver names, including the trailing dot. Not required for slave zones.'
963 description: 'The id of the TSIG keys used for master operation in this zone'
965 url: 'https://doc.powerdns.com/authoritative/tsig.html#provisioning-outbound-axfr-access'
970 description: 'The id of the TSIG keys used for slave operation in this zone'
972 url: 'https://doc.powerdns.com/authoritative/tsig.html#provisioning-signed-notification-and-axfr-requests'
977 $ref: '#/definitions/Zone'
981 description: This represents a Resource Record Set (all records with the same name and type).
991 description: 'Name for record set (e.g. “www.powerdns.com.”)'
994 description: 'Type of this record (e.g. “A”, “PTR”, “MX”)'
997 description: 'DNS TTL of the records, in seconds. MUST NOT be included when changetype is set to “DELETE”.'
1000 description: 'MUST be added when updating the RRSet. Must be REPLACE or DELETE. With DELETE, all existing RRs matching name and type will be deleted, including all comments. With REPLACE: when records is present, all existing RRs matching name and type will be deleted, and then new records given in records will be created. If no records are left, any existing comments will be deleted as well. When comments is present, all existing comments for the RRs matching name and type will be deleted, and then new comments given in comments will be created.'
1003 description: 'All records in this RRSet. When updating Records, this is the list of new records (replacing the old ones). Must be empty when changetype is set to DELETE. An empty list results in deletion of all records (and comments).'
1005 $ref: '#/definitions/Record'
1008 description: 'List of Comment. Must be empty when changetype is set to DELETE. An empty list results in deletion of all comments. modified_at is optional and defaults to the current server time.'
1010 $ref: '#/definitions/Comment'
1014 description: The RREntry object represents a single record.
1017 - disabled # PatchZone endpoint complains if this is missing
1021 description: 'The content of this record'
1024 description: 'Whether or not this record is disabled'
1027 description: 'If set to true, the server will find the matching reverse zone and create a PTR there. Existing PTR records are replaced. If no matching reverse Zone, an error is thrown. Only valid in client bodies, only valid for A and AAAA types. Not returned by the server.'
1031 description: A comment about an RRSet.
1035 description: 'The actual comment'
1038 description: 'Name of an account that added the comment'
1041 description: 'Timestamp of the last change to the comment'
1045 description: A TSIG key that can be used to authenticate NOTIFYs and AXFRs
1049 description: 'The name of the key'
1052 description: 'The ID for this key, used in the TSIGkey URL endpoint.'
1056 description: 'The algorithm of the TSIG key'
1059 description: 'The Base64 encoded secret key, empty when listing keys. MAY be empty when POSTing to have the server generate the key material'
1062 description: 'Set to "TSIGKey"'
1066 title: ConfigSetting
1070 description: 'set to "ConfigSetting"'
1073 description: 'The name of this setting (e.g. ‘webserver-port’)'
1076 description: 'The value of setting name'
1078 SimpleStatisticItem:
1079 title: SimpleStatisticItem
1084 description: 'Item name'
1087 description: 'Item value'
1090 title: StatisticItem
1094 description: 'Item name'
1097 description: 'set to "StatisticItem"'
1100 description: 'Item value'
1103 title: MapStatisticItem
1107 description: 'Item name'
1110 description: 'Set to "MapStatisticItem"'
1113 description: 'Named values'
1115 $ref: '#/definitions/SimpleStatisticItem'
1118 title: RingStatisticItem
1122 description: 'Item name'
1125 description: 'Set to "RingStatisticItem"'
1128 description: 'Ring size'
1131 description: 'Named values'
1133 $ref: '#/definitions/SimpleStatisticItem'
1136 title: SearchResultZone
1142 description: 'set to "zone"'
1147 title: SearchResultRecord
1157 description: 'set to "record"'
1167 SearchResultComment:
1168 title: SearchResultComment
1176 description: 'set to "comment"'
1182 # FIXME: This is problematic at the moment, because swagger doesn't support this type of mixed response
1185 # - $ref: '#/definitions/SearchResultZone'
1186 # - $ref: '#/definitions/SearchResultRecord'
1187 # - $ref: '#/definitions/SearchResultComment'
1189 # Since we can't do 'anyOf' at the moment, we create a 'superset object'
1201 description: 'set to one of "record, zone, comment"'
1214 $ref: '#/definitions/SearchResult'
1218 description: Represents zone metadata
1222 description: 'Name of the metadata'
1227 description: 'Array with all values for this metadata kind.'
1231 description: 'Describes a DNSSEC cryptographic key'
1235 description: 'set to "Cryptokey"'
1238 description: 'The internal identifier, read only'
1241 enum: [ksk, zsk, csk]
1244 description: 'Whether or not the key is in active use'
1247 description: 'The DNSKEY record for this key'
1252 description: 'An array of DS records for this key'
1255 description: 'The private key in ISC format'
1258 description: 'The name of the algorithm of the key, should be a mnemonic'
1261 description: 'The size of the key'
1265 description: 'Returned when the server encounters an error. Either in client input or internally'
1269 description: 'A human readable error message'
1274 description: 'Optional array of multiple errors encountered during processing'
1279 title: CacheFlushResult
1280 description: 'The result of a cache-flush'
1284 description: 'Amount of entries flushed'
1287 description: 'A message about the result like "Flushed cache"'