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. Returns a list of BaseStatisticItem derived elements.'
393 operationId: getStats
400 description: The id of the server to retrieve
404 description: List of Statistic Items
408 # these can be commented because the swagger code generator fails on them
411 # or something like that
412 - $ref: '#/definitions/StatisticItem'
413 - $ref: '#/definitions/MapStatisticItem'
414 - $ref: '#/definitions/RingStatisticItem'
416 '/servers/{server_id}/search-data':
418 summary: 'Search the data inside PowerDNS'
419 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.'
420 operationId: searchData
427 description: The id of the server to retrieve
432 description: 'The string to search for'
437 description: 'Maximum number of entries to return'
442 description: 'Type of data to search for, one of “all”, “zone”, “record”, “comment”'
446 description: Returns a JSON array with results
448 $ref: '#/definitions/SearchResults'
450 '/servers/{server_id}/zones/{zone_id}/metadata':
452 summary: Get all the MetaData associated with the zone.
453 operationId: listMetadata
460 description: The id of the server to retrieve
466 description: The id of the zone to retrieve
469 description: List of Metadata objects
473 $ref: '#/definitions/Metadata'
475 summary: 'Creates a set of metadata entries'
476 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.'
477 operationId: createMetadata
484 description: The id of the server to retrieve
491 description: List of metadata to add/create
497 $ref: '#/definitions/Metadata'
502 '/servers/{server_id}/zones/{zone_id}/metadata/{metadata_kind}':
504 summary: Get the content of a single kind of domain metadata as a list of MetaData objects.
505 operationId: getMetadata
512 description: The id of the server to retrieve
518 description: The id of the zone to retrieve
519 - name: metadata_kind
526 description: List of Metadata objects
528 $ref: '#/definitions/Metadata'
530 summary: 'Modify the content of a single kind of domain metadata.'
531 operationId: modifyMetadata
538 description: The id of the server to retrieve
544 - name: metadata_kind
545 description: The kind of metadata
550 description: metadata to add/create
554 $ref: '#/definitions/Metadata'
559 summary: 'Delete all items of a single kind of domain metadata.'
560 operationId: deleteMetadata
567 description: The id of the server to retrieve
573 description: The id of the zone to retrieve
574 - name: metadata_kind
583 '/servers/{server_id}/zones/{zone_id}/cryptokeys':
585 summary: 'Get all CryptoKeys for a zone, except the privatekey'
586 operationId: listCryptokeys
593 description: The id of the server to retrieve
599 description: The id of the zone to retrieve
602 description: List of Cryptokey objects
606 $ref: '#/definitions/Cryptokey'
608 summary: 'Creates a Cryptokey'
609 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.'
610 operationId: createCryptokey
617 description: The id of the server to retrieve
624 description: Add a Cryptokey
628 $ref: '#/definitions/Cryptokey'
633 $ref: '#/definitions/Cryptokey'
635 '/servers/{server_id}/zones/{zone_id}/cryptokeys/{cryptokey_id}':
637 summary: 'Returns all data about the CryptoKey, including the privatekey.'
638 operationId: getCryptokey
645 description: The id of the server to retrieve
651 description: The id of the zone to retrieve
656 description: 'The id value of the CryptoKey'
659 description: Cryptokey
661 $ref: '#/definitions/Cryptokey'
663 summary: 'This method (de)activates a key from zone_name specified by cryptokey_id'
664 operationId: modifyCryptokey
671 description: The id of the server to retrieve
678 description: Cryptokey to manipulate
683 description: the Cryptokey
687 $ref: '#/definitions/Cryptokey'
692 description: 'Returned when something is wrong with the content of the request. Contains an error message'
694 summary: 'This method deletes a key specified by cryptokey_id.'
695 operationId: deleteCryptokey
702 description: The id of the server to retrieve
708 description: The id of the zone to retrieve
713 description: 'The id value of the Cryptokey'
718 description: 'Returned when something is wrong with the content of the request. Contains an error message'
720 '/servers/{server_id}/tsigkeys':
725 description: 'The id of the server'
728 summary: 'Get all TSIGKeys on the server, except the actual key'
729 operationId: listTSIGKeys
734 description: List of TSIGKey objects
738 $ref: '#/definitions/TSIGKey'
740 description: 'Internal Server Error, keys could not be retrieved. Contains error message'
742 $ref: '#/definitions/Error'
744 summary: 'Add a TSIG key'
745 description: 'This methods add a new TSIGKey. The actual key can be generated by the server or be provided by the client'
746 operationId: createTSIGKey
751 description: The TSIGKey to add
755 $ref: '#/definitions/TSIGKey'
760 $ref: '#/definitions/TSIGKey'
762 description: 'Conflict. A key with this name already exists'
764 $ref: '#/definitions/Error'
766 description: 'Unprocessable Entry, the TSIGKey provided has issues.'
768 $ref: '#/definitions/Error'
770 description: 'Internal Server Error. There was a problem creating the key'
772 $ref: '#/definitions/Error'
774 '/servers/{server_id}/tsigkeys/{tsigkey_id}':
779 description: 'The id of the server to retrieve the key from'
784 description: 'The id of the TSIGkey. Should match the "id" field in the TSIGKey object'
787 summary: 'Get a specific TSIGKeys on the server, including the actual key'
788 operationId: getTSIGKey
795 $ref: '#/definitions/TSIGKey'
797 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
799 $ref: '#/definitions/Error'
801 description: 'Internal Server Error, keys could not be retrieved. Contains error message'
803 $ref: '#/definitions/Error'
806 The TSIGKey at tsigkey_id can be changed in multiple ways:
807 * Changing the Name, this will remove the key with tsigkey_id after adding.
808 * Changing the Algorithm
810 Only the relevant fields have to be provided in the request body.
811 operationId: putTSIGKey
816 description: A (possibly stripped down) TSIGKey object with the new values
818 $ref: '#/definitions/TSIGKey'
823 description: OK. TSIGKey is changed.
825 $ref: '#/definitions/TSIGKey'
827 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
829 $ref: '#/definitions/Error'
831 description: 'Internal Server Error. Contains error message'
833 $ref: '#/definitions/Error'
835 summary: 'Delete the TSIGKey with tsigkey_id'
836 operationId: deleteTSIGKey
841 description: 'OK, key was deleted'
843 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
845 $ref: '#/definitions/Error'
847 description: 'Internal Server Error. Contains error message'
849 $ref: '#/definitions/Error'
857 description: 'Set to “Server”'
860 description: 'The id of the server, “localhost”'
863 description: '“recursor” for the PowerDNS Recursor and “authoritative” for the Authoritative Server'
866 description: 'The version of the server software'
869 description: 'The API endpoint for this server'
872 description: 'The API endpoint for this server’s configuration'
875 description: 'The API endpoint for this server’s zones'
880 $ref: '#/definitions/Server'
884 description: This represents an authoritative DNS Zone.
888 description: 'Opaque zone id (string), assigned by the server, should not be interpreted by the application. Guaranteed to be safe for embedding in URLs.'
891 description: 'Name of the zone (e.g. “example.com.”) MUST have a trailing dot'
894 description: 'Set to “Zone”'
897 description: 'API endpoint for this zone'
904 description: 'Zone kind, one of “Native”, “Master”, “Slave”'
908 $ref: '#/definitions/RRSet'
909 description: 'RRSets in this zone'
912 description: 'The SOA serial number'
915 description: 'The SOA serial notifications have been sent out for'
920 description: ' List of IP addresses configured as a master for this zone (“Slave” type zones only)'
923 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)'
926 description: 'The NSEC3PARAM record'
929 description: 'Whether or not the zone uses NSEC3 narrow'
932 description: 'Whether or not the zone is pre-signed'
935 description: 'The SOA-EDIT metadata item'
938 description: 'The SOA-EDIT-API metadata item'
941 description: ' Whether or not the zone will be rectified on data changes via the API'
944 description: 'MAY contain a BIND-style zone file when creating a zone'
947 description: 'MAY be set. Its value is defined by local policy'
952 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.'
957 description: 'The id of the TSIG keys used for master operation in this zone'
959 url: 'https://doc.powerdns.com/authoritative/tsig.html#provisioning-outbound-axfr-access'
964 description: 'The id of the TSIG keys used for slave operation in this zone'
966 url: 'https://doc.powerdns.com/authoritative/tsig.html#provisioning-signed-notification-and-axfr-requests'
971 $ref: '#/definitions/Zone'
975 description: This represents a Resource Record Set (all records with the same name and type).
985 description: 'Name for record set (e.g. “www.powerdns.com.”)'
988 description: 'Type of this record (e.g. “A”, “PTR”, “MX”)'
991 description: 'DNS TTL of the records, in seconds. MUST NOT be included when changetype is set to “DELETE”.'
994 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.'
997 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).'
999 $ref: '#/definitions/Record'
1002 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.'
1004 $ref: '#/definitions/Comment'
1008 description: The RREntry object represents a single record.
1011 - disabled # PatchZone endpoint complains if this is missing
1015 description: 'The content of this record'
1018 description: 'Whether or not this record is disabled'
1021 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.'
1025 description: A comment about an RRSet.
1029 description: 'The actual comment'
1032 description: 'Name of an account that added the comment'
1035 description: 'Timestamp of the last change to the comment'
1039 description: A TSIG key that can be used to authenticate NOTIFYs and AXFRs
1043 description: 'The name of the key'
1046 description: 'The ID for this key, used in the TSIGkey URL endpoint.'
1050 description: 'The algorithm of the TSIG key'
1053 description: 'The Base64 encoded secret key, empty when listing keys. MAY be empty when POSTing to have the server generate the key material'
1056 description: 'Set to "TSIGKey"'
1060 title: ConfigSetting
1064 description: 'set to "ConfigSetting"'
1067 description: 'The name of this setting (e.g. ‘webserver-port’)'
1070 description: 'The value of setting name'
1073 title: BaseStatisticItem
1077 description: 'The name of this item (e.g. ‘uptime’)'
1080 title: StatisticItem
1082 - $ref: "#/definitions/BaseStatisticItem"
1085 enum: [StatisticItem]
1086 description: 'set to "StatisticItem"'
1089 description: 'The value of item'
1092 title: MapStatisticItem
1094 - $ref: "#/definitions/BaseStatisticItem"
1097 enum: [MapStatisticItem]
1098 description: 'set to "MapStatisticItem"'
1101 description: 'named statistic values'
1107 description: 'item name'
1110 description: 'item value'
1113 title: RingStatisticItem
1115 - $ref: "#/definitions/BaseStatisticItem"
1118 enum: [RingStatisticItem]
1119 description: 'set to "RingStatisticItem"'
1122 description: 'for RingStatisticItem objects, the size of the ring'
1125 description: 'named ring statistic values'
1131 description: 'item name'
1134 description: 'item value'
1137 title: SearchResultZone
1143 description: 'set to "zone"'
1148 title: SearchResultRecord
1158 description: 'set to "record"'
1168 SearchResultComment:
1169 title: SearchResultComment
1177 description: 'set to "comment"'
1183 # FIXME: This is problematic at the moment, because swagger doesn't support this type of mixed response
1186 # - $ref: '#/definitions/SearchResultZone'
1187 # - $ref: '#/definitions/SearchResultRecord'
1188 # - $ref: '#/definitions/SearchResultComment'
1190 # Since we can't do 'anyOf' at the moment, we create a 'superset object'
1202 description: 'set to one of "record, zone, comment"'
1215 $ref: '#/definitions/SearchResult'
1219 description: Represents zone metadata
1223 description: 'Name of the metadata'
1228 description: 'Array with all values for this metadata kind.'
1232 description: 'Describes a DNSSEC cryptographic key'
1236 description: 'set to "Cryptokey"'
1239 description: 'The internal identifier, read only'
1242 enum: [ksk, zsk, csk]
1245 description: 'Whether or not the key is in active use'
1248 description: 'The DNSKEY record for this key'
1253 description: 'An array of DS records for this key'
1256 description: 'The private key in ISC format'
1259 description: 'The name of the algorithm of the key, should be a mnemonic'
1262 description: 'The size of the key'
1266 descripton: 'Returned when the server encounters an error. Either in client input or internally'
1270 description: 'A human readable error message'
1276 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"'