openapi: 3.0.3
info:
  title: IONOS Cloud - DNS API
  version: 1.18.0
  description: |
    Cloud DNS service helps IONOS Cloud customers to automate DNS Zone and Record management.
  termsOfService: https://www.ionos.de/terms-gtc/terms-enterprise-cloud/enterprise-terms/
  contact:
    name: IONOS Cloud Support
    url: https://docs.ionos.com/support/general-information/contact-information
    email: support@cloud.ionos.com

externalDocs:
  url: https://api.ionos.com/docs/cloud/
  description: IONOS Cloud - API documentation

servers:
  - url: https://dns.de-fra.ionos.com
    description: Frankfurt
security:
  - tokenAuth: [ ]
tags:
  - name: Zones
    description: Endpoints related to zones
  - name: SecondaryZones
    description: Endpoints related to secondary zones
  - name: Records
    description: Endpoints related to records
  - name: ZoneFiles
    description: related to zone files
  - name: Quota
    description: related to quotas
  - name: DNSSEC
    description: related to DNSSEC
  - name: ReverseRecords
    description: related to reverse DNS records
paths:
  /zones:
    get:
      operationId: zonesGet
      summary: Retrieve zones
      description: Returns a list of the DNS zones for the customer. Default limit is the first 100 items. Use pagination query parameters for listing more items (up to 1000).
      parameters:
        - name: filter.state
          in: query
          description: Filter used to fetch all zones in a particular state.
          required: false
          schema:
            $ref: "#/components/schemas/ProvisioningState"
        - name: filter.zoneName
          in: query
          description: Filter used to fetch only the zones that contain the specified zone name.
          required: false
          schema:
            type: string
            example: example.com
        - $ref: "#/components/parameters/paginationOffset"
        - $ref: "#/components/parameters/paginationLimit"
      tags:
        - Zones
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ZoneReadList"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'
    post:
      operationId: zonesPost
      summary: Create a zone
      tags:
        - Zones
      description: Creates a new zone with default NS and SOA records.
      requestBody:
        description: zone
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ZoneCreate"
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ZoneRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "500":
          $ref: '#/components/responses/InternalError'
  /secondaryzones:
    get:
      operationId: secondaryzonesGet
      summary: Retrieve secondary zones
      description: Returns a list of the secondary DNS zones for the customer. Default limit is the first 100 items. Use pagination query parameters for listing more items (up to 1000).
      parameters:
        - name: filter.state
          in: query
          description: Filter used to fetch all zones in a particular state.
          required: false
          schema:
            $ref: "#/components/schemas/ProvisioningState"
        - name: filter.zoneName
          in: query
          description: Filter used to fetch only the zones that contain the specified zone name.
          required: false
          schema:
            type: string
            example: example.com
        - $ref: "#/components/parameters/paginationOffset"
        - $ref: "#/components/parameters/paginationLimit"
      tags:
        - SecondaryZones
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SecondaryZoneReadList"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'
    post:
      operationId: secondaryzonesPost
      summary: Create a secondary zone
      tags:
        - SecondaryZones
      description: |
        Creates a new secondary zone with default NS and SOA records.
        Note that Cloud DNS relies on the following Anycast addresses for sending DNS notify messages.
        Make sure to whitelist on your end:
          - IPv4: 212.227.123.25
          - IPv6: 2001:8d8:fe:53::5cd:25
      requestBody:
        description: zone
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SecondaryZoneCreate"
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SecondaryZoneRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "500":
          $ref: '#/components/responses/InternalError'
  /zones/{zoneId}:
    get:
      operationId: zonesFindById
      summary: Retrieve a zone
      tags:
        - Zones
      description: Returns a DNS zone by given ID.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ZoneRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    put:
      operationId: zonesPut
      tags:
        - Zones
      description: |
        Updates or creates a zone for the provided zone ID.
      summary: Update a zone
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      requestBody:
        description: update zone
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ZoneEnsure"
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ZoneRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    delete:
      operationId: zonesDelete
      summary: Delete a zone
      tags:
        - Zones
      description: Deletes the specified zone and all of the records it contains.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBodyResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
  /secondaryzones/{secondaryZoneId}:
    get:
      operationId: secondaryzonesFindById
      summary: Retrieve a secondary zone
      tags:
        - SecondaryZones
      description: Returns a DNS secondary zone by given ID.
      parameters:
        - name: secondaryZoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SecondaryZoneRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    put:
      operationId: secondaryzonesPut
      tags:
        - SecondaryZones
      description: Updates or creates a secondary zone for the provided secondary Zone ID.
      summary: Update a secondary zone
      parameters:
        - name: secondaryZoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      requestBody:
        description: update zone
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SecondaryZoneEnsure"
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SecondaryZoneRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    delete:
      operationId: secondaryzonesDelete
      summary: Delete a secondary zone
      tags:
        - SecondaryZones
      description: Deletes the specified secondary zone.
      parameters:
        - name: secondaryZoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBodyResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
  /secondaryzones/{secondaryZoneId}/axfr:
    get:
      operationId: secondaryzonesAxfrGet
      summary: Get status of zone transfer
      tags:
        - SecondaryZones
      description: |
        Get status of zone transfer. 
        Note that Cloud DNS relies on the following Anycast addresses for sending DNS notify messages.
        Make sure to whitelist on your end:
          - IPv4: 212.227.123.25
          - IPv6: 2001:8d8:fe:53::5cd:25
      parameters:
        - name: secondaryZoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ZoneTransferPrimaryIpsStatus"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    put:
      operationId: secondaryzonesAxfrPut
      summary: Start zone transfer
      tags:
        - SecondaryZones
      description: |
        Initiate zone transfer.
        Note that Cloud DNS relies on the following Anycast addresses for sending DNS notify messages.
        Make sure to whitelist on your end:
          - IPv4: 212.227.123.25
          - IPv6: 2001:8d8:fe:53::5cd:25
      parameters:
        - name: secondaryZoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBodyResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
  /secondaryzones/{secondaryZoneId}/records:
    get:
      operationId: secondaryzonesRecordsGet
      summary: Retrieve records for a secondary zone
      tags:
        - Records
      description: Returns the list of records for a secondary zone. Those are the records created for its primary IPs
      parameters:
        - name: secondaryZoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS secondary zone.
        - $ref: "#/components/parameters/paginationOffset"
        - $ref: "#/components/parameters/paginationLimit"
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SecondaryZoneRecordReadList"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "500":
          $ref: '#/components/responses/InternalError'
  /records:
    get:
      operationId: recordsGet
      summary: Retrieve all records from primary zones
      tags:
        - Records
      description: Returns the list of all records for all customer DNS zones with the possibility to filter them.
      parameters:
        - name: filter.zoneId
          in: query
          schema:
            type: string
            format: uuid
            example: 1d6ca576-7162-4700-8df7-208bbe28fc44
          required: false
          description: Filter used to fetch only the records that contain specified zoneId.
        - name: filter.name
          in: query
          description: Filter used to fetch only the records that contain specified record name.
          required: false
          schema:
            type: string
            example: app
          allowEmptyValue: true
        - name: filter.state
          in: query
          schema:
            $ref: "#/components/schemas/ProvisioningState"
          required: false
          description: Filter used to fetch only the records that are in certain state.
        - name: filter.type
          in: query
          schema:
            $ref: "#/components/schemas/RecordType"
          required: false
          description: Filter used to fetch only the records with specified type.
        - $ref: "#/components/parameters/paginationOffset"
        - $ref: "#/components/parameters/paginationLimit"
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RecordReadList"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "500":
          $ref: '#/components/responses/InternalError'
  /zones/{zoneId}/records:
    post:
      operationId: zonesRecordsPost
      summary: Create a record
      tags:
        - Records
      description: Creates a new record for the DNS zone.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      requestBody:
        description: record
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RecordCreate"
            examples:
              A:
                summary: A record
                value:
                  properties:
                    name: ""
                    type: A
                    content: 192.0.2.1
                    ttl: 3600
                    enabled: true
              AAAA:
                summary: AAAA record
                value:
                  properties:
                    name: ""
                    type: AAAA
                    content: 2001:db8::1
                    ttl: 3600
                    enabled: true
              CNAME:
                summary: CNAME record
                value:
                  properties:
                    name: www
                    type: CNAME
                    content: example.co.uk
                    ttl: 3600
                    enabled: true
              MX:
                summary: MX record
                value:
                  properties:
                    name: ""
                    type: MX
                    content: mail.example.com
                    ttl: 3600
                    priority: 10
                    enabled: true
              TXT:
                summary: TXT record
                value:
                  properties:
                    name: ""
                    type: TXT
                    content: \"v=spf1 include:spf.protection.example.com ip4:192.0.2.1 ip4:198.51.100.1 include:spf.test.net -all\"
                    ttl: 3600
                    priority: 10
                    enabled: true
              SRV:
                summary: SRV record
                value:
                  properties:
                    name: <service>
                    type: SRV
                    content: <weight> <port> sipdir.example.com
                    ttl: 3600
                    priority: 10
                    enabled: true
              NS:
                summary: NS record
                value:
                  properties:
                    name: blog
                    type: NS
                    content: ns1.anotherhost.net
                    ttl: 3600
                    enabled: true
              URI:
                summary: URI record
                value:
                  properties:
                    name: _<service>._<protocol>
                    type: URI
                    content: <priority> <weight> "https://example.com/Example_Homepage.php"
                    ttl: 3600
                    priority: 10
                    enabled: true
              HTTPS:
                summary: HTTPS record
                value:
                  properties:
                    name: ""
                    type: HTTPS
                    content: <svc priority> <target name> <svc parameters>
                    ttl: 3600
                    enabled: true
              CAA:
                summary: CAA record
                value:
                  properties:
                    name: ""
                    type: CAA
                    content: <flags> <tag> \"<value>\"
                    ttl: 3600
                    enabled: true
              TLSA:
                summary: TLSA record
                value:
                  properties:
                    name: _<port>._<protocol>
                    type: TLSA
                    content: "<certificate usage> <selector> <matching type> <certificate association data>"
                    ttl: 3600
                    enabled: true
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RecordRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "409":
          $ref: '#/components/responses/ConflictInRecordCreation'
        "500":
          $ref: '#/components/responses/InternalError'
    get:
      operationId: zonesRecordsGet
      summary: Retrieve records
      tags:
        - Records
      description: Returns the list of records for the specific DNS zone.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RecordReadList"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "500":
          $ref: '#/components/responses/InternalError'
  /zones/{zoneId}/records/{recordId}:
    get:
      operationId: zonesRecordsFindById
      summary: Retrieve a record
      tags:
        - Records
      description: Returns the record with the specified record ID.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
        - name: recordId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the record.
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RecordRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    put:
      operationId: zonesRecordsPut
      summary: Update a record
      tags:
        - Records
      description: Updates or creates a DNS record for the provided record ID.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
        - name: recordId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS record.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RecordEnsure"
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RecordRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/ConflictInRecordCreation'
        "500":
          $ref: '#/components/responses/InternalError'
    delete:
      operationId: zonesRecordsDelete
      summary: Delete a record
      tags:
        - Records
      description: Deletes a specified record from the DNS zone.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
        - name: recordId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the record.
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBodyResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
  /zones/{zoneId}/zonefile:
    get:
      operationId: zonesZonefileGet
      summary: Retrieve a zone file
      tags:
        - ZoneFiles
      description: Returns an exported zone file in BIND format (RFC 1035).
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      responses:
        "200":
          description: Successful operation.
          content:
            text/plain:
              examples:
                '200':
                  value: |
                    ;Zone: example.com
                    ;Exported: Wed Nov 13 10:30:14 UTC 2019

                    $ORIGIN example.com.
                    $TTL 3600

                    @  86400  IN  SOA  ns-de.1and1-dns.de. hostmaster.kundenserver.de. (
                              2017012400  ; serial
                              28800  ; refresh
                              7200  ; retry
                              604800  ; expire
                              600 )  ; minimum
                    autodiscover  7200  IN  CNAME  adsredir.1and1.info.
                    @  7200  IN  NS  ns-de.1and1-dns.org.
                    @  7200  IN  NS  ns-de.1and1-dns.com.
                    @  7200  IN  NS  ns-de.1and1-dns.biz.
                    @  7200  IN  NS  ns-de.1and1-dns.de.
                    _domainconnect  3600  IN  CNAME  _domainconnect.1and1.com.

        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    put:
      operationId: zonesZonefilePut
      summary: Updates a zone with a file
      tags:
        - ZoneFiles
      description: Updates a zone with zone file in BIND format (RFC 1035). All records in the zone are replaced with the ones provided.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      requestBody:
        description: Zone file in BIND format (RFC 1035). In order to support import files from other sources, the bind zone file can contain SOA and NS records, but these records will be ignored.
        required: true
        content:
          text/plain:
            schema:
              type: string
              example: |
                ;Zone: example.com
                ;Exported: Wed Nov 13 10:30:14 UTC 2019
                $ORIGIN example.com.
                $TTL 3600
                @  86400  IN  SOA  ns-de.1and1-dns.de. hostmaster.kundenserver.de. (
                          2017012400  ; serial
                          28800  ; refresh
                          7200  ; retry
                          604800  ; expire
                          600 )  ; minimum
                autodiscover  7200  IN  CNAME  adsredir.1and1.info.
                @  7200  IN  NS  ns-de.1and1-dns.org.
                @  7200  IN  NS  ns-de.1and1-dns.com.
                @  7200  IN  NS  ns-de.1and1-dns.biz.
                @  7200  IN  NS  ns-de.1and1-dns.de.
                www      IN   A  127.0.0.2                
                _domainconnect  3600  IN  CNAME  _domainconnect.1and1.com.
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RecordReadList"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "500":
          $ref: '#/components/responses/InternalError'
  /quota:
    get:
      operationId: quotaGet
      summary: Retrieve resources quota
      description: Get quota details for zones, secondary zones, and records.
      tags:
        - Quota
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Quota"
              example:
                quotaUsage:
                  zones: 200
                  secondaryZones: 50
                  records: 1500
                  reverseRecords: 1000
                quotaLimits:
                  zones: 50000
                  secondaryZones: 100000
                  records: 100000
                  reverseRecords: 100000
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'
  /zones/{zoneId}/keys:
    get:
      operationId: zonesKeysGet
      summary: Retrieve a DNSSEC key
      description: Get DNSSEC keys for your DNS zone.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      tags:
        - DNSSEC
      responses:
        "200":
          description: Success case, dnssec keys returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dnssecKeyReadList'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    post:
      operationId: zonesKeysPost
      description: |
        Enable DNSSEC keys and create associated DNSKEY records for your DNS zone.
      summary: Create a DNSSEC key
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      tags:
        - DNSSEC
      requestBody:
        description: Enable DNSSEC request.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dnssecKeyCreate'
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dnssecKeyReadCreation'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/ConflictErrorDNSSEC'
        "500":
          $ref: '#/components/responses/InternalError'
    delete:
      operationId: zonesKeysDelete
      summary: Delete a DNSSEC key
      description: |
        Disable DNSSEC keys and remove associated DNSKEY records for your DNS zone.
      parameters:
        - name: zoneId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the DNS zone.
      tags:
        - DNSSEC
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBodyResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
  /reverserecords:
    get:
      operationId: reverserecordsGet
      summary: Retrieves existing reverse DNS records
      description: Returns a list of the reverse records of the customer. Default limit is the first 100 items. Use pagination query parameters to list more items.
      tags:
        - ReverseRecords
      parameters:
        - name: filter.recordIp
          in: query
          description: |
            Filter is used to fetch only the reverse records for the specified IPs.
            It's an array of IP records. IP can be any valid IPv4 or IPv6 address.
            Parameter has to be sent in query as many times as values (filter.recordIp=1.2.3.4&filter.recordIp=2.3.4.5)
          required: false
          schema:
            type: array
            items:
              type: string
              uniqueItems: true
        - $ref: "#/components/parameters/paginationOffset"
        - $ref: "#/components/parameters/paginationLimit"
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReverseRecordsReadList"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'
    post:
      operationId: reverserecordsPost
      summary: Create a reverse DNS record
      tags:
        - ReverseRecords
      description: |
        Creates a new reverse DNS record. Reverse DNS is applicable to IPv4 addresses within IP Blocks and IPv6 addresses of the VDC.
      requestBody:
        description: reverserecord
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReverseRecordCreate"
      responses:
        "201":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReverseRecordRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "409":
          $ref: '#/components/responses/ConflictErrorReverseRecords'
        "500":
          $ref: '#/components/responses/InternalError'
  /reverserecords/{reverserecordId}:
    get:
      operationId: reverserecordsFindById
      summary: Retrieve a reverse DNS record
      tags:
        - ReverseRecords
      description: Returns the record with the specified record ID.
      parameters:
        - name: reverserecordId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the reverse DNS record.
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReverseRecordRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
    put:
      operationId: reverserecordsPut
      summary: Update a reverse DNS record
      tags:
        - ReverseRecords
      description: |
        Updates or creates a reverse DNS record for the provided reverse DNS record ID.
      parameters:
        - name: reverserecordId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the reverse DNS record.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReverseRecordEnsure"
      responses:
        "200":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReverseRecordRead"
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "409":
          $ref: '#/components/responses/ConflictErrorReverseRecords'
        "500":
          $ref: '#/components/responses/InternalError'
    delete:
      operationId: reverserecordsDelete
      summary: Delete a reverse DNS record
      description: |
        Deletes a reverse DNS record.
      tags:
        - ReverseRecords
      parameters:
        - name: reverserecordId
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID (UUID) of the reverse DNS record.
      responses:
        "202":
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBodyResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/NotAllowed'
        "404":
          $ref: '#/components/responses/NotFound'
        "500":
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    paginationOffset:
      name: offset
      in: query
      description: The first element (of the total list of elements) to include in the response. Use together with limit for pagination.
      required: false
      schema:
        type: integer
        format: int32
        default: 0
        minimum: 0
    paginationLimit:
      name: limit
      in: query
      description: The maximum number of elements to return. Use together with offset for pagination.
      required: false
      schema:
        type: integer
        format: int32
        default: 100
        minimum: 1
        maximum: 1000
  schemas:
    ZoneTransferPrimaryIpsStatus:
      type: object
      description: |
        Indicates, for secondary zones, the transfer status for each one single IP defined on primaryIps field
      required:
        - type
        - items
      properties:
        type:
          type: string
          enum:
            - collection
        items:
          type: array
          items: {
            $ref: "#/components/schemas/ZoneTransferPrimaryIpStatus"
          }
    ZoneTransferPrimaryIpStatus:
      type: object
      required:
        - primaryIp
        - status
      properties:
        primaryIp:
          type: string
          anyOf:
            - format: ipv4
            - format: ipv6
          example: 1.2.3.4
          description: one single IP from the primaryIps field for secondary zones
        status:
          type: string
          description: Human readable status of the zone transfer status for the IP
        errorMessage:
          type: string
          description: Human readable explanation of the error when status is not ok
          example: Connection with primary nameserver could not be   established
    Quota:
      type: object
      required:
        - quotaUsage
        - quotaLimits
      properties:
        quotaUsage:
          $ref: "#/components/schemas/QuotaDetail"
        quotaLimits:
          $ref: "#/components/schemas/QuotaDetail"
    QuotaDetail:
      type: object
      description: Count of zones and records. This schema is used to show both usage and defined limits (quota)
      required:
        - zones
        - records
        - secondaryZones
        - reverseRecords
      properties:
        zones:
          type: integer
          default: 0
          description: count of the number of zones
        secondaryZones:
          type: integer
          default: 0
          description: count of the number of secondary zones
        records:
          type: integer
          default: 0
          description: count of the number of records
        reverseRecords:
          type: integer
          default: 0
          description: count of the number of reverse DNS records
    ReverseRecordsReadList:
      type: object
      required:
        - id
        - type
        - items
        - href
        - offset
        - limit
        - _links
      properties:
        id:
          type: string
          format: uuid
          example: e74d0d15-f567-4b7b-9069-26ee1f93bae3
          description: ID (UUID) created to identify this action.
        type:
          type: string
          enum:
            - collection
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
        items:
          type: array
          items: {
            $ref: "#/components/schemas/ReverseRecordRead"
          }
        offset:
          $ref: "#/components/schemas/Offset"
        limit:
          $ref: "#/components/schemas/Limit"
        _links:
          $ref: '#/components/schemas/Links'
    ReverseRecordRead:
      type: object
      required:
        - id
        - type
        - href
        - metadata
        - properties
      properties:
        id:
          type: string
          format: uuid
          example: e74d0d15-f567-4b7b-9069-26ee1f93bae3
          description: The reverse DNS record ID (UUID).
        type:
          type: string
          enum:
            - reverserecord
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
        metadata:
          $ref: "#/components/schemas/Metadata"
        properties:
          $ref: '#/components/schemas/ReverseRecord'
    ReverseRecord:
      type: object
      description: The reverse DNS record.
      required:
        - name
        - ip
      properties:
        name:
          type: string
          example: mail.example.com
          description: The reverse DNS record name
        description:
          type: string
          example: The reverse DNS record is used for mail.example.com
          description: Description stored along with the reverse DNS record to describe its usage.
        ip:
          type: string
          anyOf:
            - format: ipv4
            - format: ipv6
          example: 5.6.7.8
          description: Specifies for which IP address the reverse record should be created. The IP addresses needs to be owned by the contract. Accepts IPv4 and IPv6 addresses.
    ReverseRecordCreate:
      type: object
      required:
        - properties
      properties:
        properties:
          $ref: '#/components/schemas/ReverseRecord'
    ReverseRecordEnsure:
      type: object
      required:
        - properties
      properties:
        properties:
          $ref: '#/components/schemas/ReverseRecord'
    CommonZoneReadList:
      type: object
      required:
        - id
        - type
        - href
        - offset
        - limit
        - _links
      properties:
        id:
          type: string
          format: uuid
          example: e74d0d15-f567-4b7b-9069-26ee1f93bae3
          description: ID (UUID) created to identify this action.
        type:
          type: string
          enum:
            - collection
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
        offset:
          $ref: "#/components/schemas/Offset"
        limit:
          $ref: "#/components/schemas/Limit"
        _links:
          $ref: '#/components/schemas/Links'
    ZoneReadList:
      allOf:
        - $ref: "#/components/schemas/CommonZoneReadList"
        - type: object
          description: "List of primary zones"
          required:
            - items
          properties:
            items:
              type: array
              items: {
                $ref: "#/components/schemas/ZoneRead"
              }
    SecondaryZoneReadList:
      allOf:
        - $ref: "#/components/schemas/CommonZoneReadList"
        - type: object
          description: "List of secondary zones"
          required:
            - items
          properties:
            items:
              type: array
              items: {
                $ref: "#/components/schemas/SecondaryZoneRead"
              }
    CommonZoneRead:
      type: object
      required:
        - id
        - type
        - href
        - metadata
      properties:
        id:
          type: string
          format: uuid
          example: e74d0d15-f567-4b7b-9069-26ee1f93bae3
          description: The zone ID (UUID).
        type:
          type: string
          enum:
            - zone
            - secondaryzone
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
        metadata:
          $ref: "#/components/schemas/MetadataWithStateNameservers"
    ZoneRead:
      allOf:
        - $ref: "#/components/schemas/CommonZoneRead"
        - type: object
          required:
            - properties
          properties:
            properties:
              $ref: '#/components/schemas/Zone'
    SecondaryZoneRead:
      allOf:
        - $ref: "#/components/schemas/CommonZoneRead"
        - type: object
          required:
            - properties
          properties:
            properties:
              $ref: '#/components/schemas/SecondaryZone'
      example:
        id: "e74d0d15-f567-4b7b-9069-26ee1f93bae3"
        type: "zone"
        href: "<RESOURCE-URI>"
        metadata:
          lastModifiedDate: "2022-08-21T15:52:53Z"
          createdDate: "2022-08-21T15:52:53Z"
          state: "PROVISIONING"
          resourceURN: "ionos:<product>:<location>:<contract>:<resource-path>"
          nameservers:
            - "nscs.ui-dns.com"
            - "nscs.ui-dns.de"
            - "nscs.ui-dns.org"
            - "nscs.ui-dns.biz"
        properties:
          zoneName: "example.com"
          description: "The hosted zone is used for example.com"
          primaryIps:
            - "1.2.3.4"
            - "5.6.7.8"
    ZoneCreate:
      type: object
      required:
        - properties
      properties:
        properties:
          $ref: '#/components/schemas/Zone'
    ZoneEnsure:
      type: object
      required:
        - properties
      properties:
        properties:
          $ref: '#/components/schemas/Zone'
    EmptyBodyResponse:
      type: object
      example: { }
      properties: { }
    CommonZone:
      type: object
      description: Indicates the fields for a zone to be created
      required:
        - zoneName
      properties:
        zoneName:
          type: string
          example: example.com
          description: The zone name
        description:
          type: string
          example: The hosted zone is used for example.com
          description: The hosted zone is used for...
    Zone:
      allOf:
        - $ref: '#/components/schemas/CommonZone'
        - type: object
          description: Indicates the specific fields for a primary zone. This type of zone is the default one.
          properties:
            enabled:
              description: Users can activate and deactivate zones.
              type: boolean
              default: true
    SecondaryZone:
      allOf:
        - $ref: '#/components/schemas/CommonZone'
        - type: object
          description: Indicates the fields for a secondary zone to be created
          required:
            - primaryIps
          properties:
            primaryIps:
              type: array
              items:
                type: string
                anyOf:
                  - format: ipv4
                  - format: ipv6
              minItems: 1
              uniqueItems: true
              example: ["1.2.3.4","5.6.7.8"]
              description: Indicates IP addresses of primary nameservers for a secondary zone. Accepts IPv4 and IPv6 addresses
    SecondaryZoneCreate:
      type: object
      required:
        - properties
      properties:
        properties:
          $ref: '#/components/schemas/SecondaryZone'
    SecondaryZoneEnsure:
      type: object
      required:
        - properties
      properties:
        properties:
          $ref: '#/components/schemas/SecondaryZone'
    RecordReadList:
      type: object
      required:
        - id
        - type
        - href
        - items
        - offset
        - limit
        - _links
      properties:
        id:
          type: string
          format: uuid
          example: 42b21ce3-6fc7-44af-b0c9-2aaadbf2b333
          description: The resource's unique identifier.
          readOnly: true
        type:
          type: string
          enum:
            - collection
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
        items:
          type: array
          items: {
            $ref: "#/components/schemas/RecordRead"
          }
        offset:
          $ref: "#/components/schemas/Offset"
        limit:
          $ref: "#/components/schemas/Limit"
        _links:
          $ref: '#/components/schemas/Links'
    SecondaryZoneRecordReadList:
      type: object
      required:
        - id
        - type
        - href
        - metadata
        - items
        - offset
        - limit
        - _links
      properties:
        id:
          type: string
          format: uuid
          example: 42b21ce3-6fc7-44af-b0c9-2aaadbf2b333
          description: The resource's unique identifier.
          readOnly: true
        type:
          type: string
          enum:
            - collection
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
        metadata:
          type: object
          required:
            - primaryIps
          description: Shows the specific properties for secondary zones
          properties:
            primaryIps:
              type: array
              items:
                type: string
                anyOf:
                  - format: ipv4
                  - format: ipv6
              minItems: 1
              uniqueItems: true
              example: ["1.2.3.4", "5.6.7.8"]
              description: Indicates IP addresses of primary nameservers for a secondary zone. Accepts IPv4 and IPv6 addresses
        items:
          type: array
          items: {
            $ref: "#/components/schemas/SecondaryZoneRecordRead"
          }
        offset:
          $ref: "#/components/schemas/Offset"
        limit:
          $ref: "#/components/schemas/Limit"
        _links:
          $ref: '#/components/schemas/Links'
    SecondaryZoneRecordRead:
      type: object
      required:
        - type
        - metadata
        - properties
      properties:
        type:
          type: string
          enum:
            - record
        metadata:
          $ref: "#/components/schemas/MetadataForSecondaryZoneRecords"
        properties:
          $ref: "#/components/schemas/Record"
    RecordRead:
      type: object
      required:
        - id
        - type
        - href
        - metadata
        - properties
      properties:
        id:
          type: string
          format: uuid
          example: 90d81ac0-3a30-44d4-95a5-12959effa6ee
          description: The record ID (UUID).
          readOnly: true
        type:
          type: string
          enum:
            - record
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
        metadata:
          $ref: "#/components/schemas/MetadataWithStateFqdnZoneId"
        properties:
          $ref: "#/components/schemas/Record"
    RecordCreate:
      required:
        - properties
      properties:
        properties:
          $ref: "#/components/schemas/Record"
    RecordEnsure:
      type: object
      required:
        - properties
      properties:
        properties:
          $ref: "#/components/schemas/Record"
    Record:
      type: object
      required:
        - name
        - type
        - content
      properties:
        name:
          type: string
          example: app
        type:
          $ref: "#/components/schemas/RecordType"  
        content:
          type: string
          example: 1.2.3.4
        ttl:
          type: integer
          default: 3600
          minimum: 60
          maximum: 604800
          description: Time to live for the record, recommended 3600.
        priority:
          type: integer
          default: 3600
          minimum: 0
          maximum: 65535
          description: Priority value is between 0 and 65535. Priority is mandatory for MX, SRV and URI record types and ignored for all other types.
        enabled:
          type: boolean
          default: true
          description: When true - the record is visible for lookup.
    ProvisioningState:
      type: string
      description: |
        The list of possible provisioning states in which DNS resource could be at the specific time.
        * AVAILABLE - resource exists and is healthy.
        * PROVISIONING - resource is being created or updated.
        * DESTROYING - delete command was issued, the resource is being deleted.
        * FAILED - creation of the resource failed.
      enum: [ PROVISIONING, DESTROYING, AVAILABLE, FAILED ]
    RecordType:
      type: string
      description: Holds supported DNS resource record types. In the DNS context a record is a DNS resource record.
      enum:
        - A
        - AAAA
        - CNAME
        - ALIAS
        - MX
        - NS
        - SRV
        - TXT
        - CAA
        - SSHFP
        - TLSA
        - SMIMEA
        - DS
        - HTTPS
        - SVCB
        - OPENPGPKEY
        - CERT
        - URI
        - RP
        - LOC
    Metadata:
      type: object
      description: Metadata of the resource.
      properties:
        createdDate:
          type: string
          readOnly: true
          format: date-time
          example: 2022-08-21T15:52:53Z
          description: The creation date formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
        createdBy:
          type: string
          description: Unique name of the identity that created the resource.
          readOnly: true
          example: "ionos:iam:cloud:31960002:users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
        createdByUserId:
          type: string
          description: The unique ID of the user who created the resource.
          readOnly: true
          example: 87f9a82e-b28d-49ed-9d04-fba2c0459cd3
        lastModifiedDate:
          type: string
          readOnly: true
          format: date-time
          example: 2022-08-21T15:52:53Z
          description: The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
        lastModifiedBy:
          type: string
          description: Unique name of the identity that created the resource.
          readOnly: true
          example: "ionos:iam:cloud:31960002:users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
        lastModifiedByUserId:
          type: string
          description: The unique ID of the user who last modified the resource.
          readOnly: true
          example: 63cef532-26fe-4a64-a4e0-de7c8a506c90
        resourceURN:
          type: string
          description: Unique name of the resource.
          readOnly: true
          example: "ionos:<product>:<location>:<contract>:<resource-path>"
    MetadataWithStateNameservers:
      allOf:
        - $ref: "#/components/schemas/Metadata"
        - type: object
          required:
            - state
            - nameservers
          properties:
            state:
              $ref: "#/components/schemas/ProvisioningState"
            nameservers:
              type: array
              description: |
                The list of nameservers associated to the zone. 
                Nameservers are different for primary and secondary zones.
                For primary zones it would be:
                - ns-ic.ui-dns.com
                - ns-ic.ui-dns.de
                - ns-ic.ui-dns.org
                - ns-ic.ui-dns.biz
                
                And for secondary zones:
                - nscs.ui-dns.com
                - nscs.ui-dns.de
                - nscs.ui-dns.org
                - nscs.ui-dns.biz
              items:
                type: string
              example:
                - ns-ic.ui-dns.com
                - ns-ic.ui-dns.de
                - ns-ic.ui-dns.org
                - ns-ic.ui-dns.biz
    MetadataWithStateFqdnZoneId:
      allOf:
        - $ref: "#/components/schemas/Metadata"
        - type: object
          required:
            - state
            - fqdn
            - zoneId
          properties:
            state:
              $ref: "#/components/schemas/ProvisioningState"
            fqdn:
              type: string
              readOnly: true
              description: A fully qualified domain name. FQDN consists of two parts - the hostname and the domain name.
              example: app.example.com
            zoneId:
              $ref: "#/components/schemas/zoneId"
    MetadataForSecondaryZoneRecords:
      type: object
      description: Metadata for records of secondary zones.
      required:
        - fqdn
        - zoneId
        - rootName
      properties:
        fqdn:
          type: string
          readOnly: true
          description: A fully qualified domain name. FQDN consists of two parts - the hostname and the domain name.
          example: app.example.com
        zoneId:
          $ref: "#/components/schemas/zoneId"
        rootName:
          type: string
          example: "primary-zone.de"
          description: Indicates the root name (from the primary zone) for the record
    zoneId:
      type: string
      readOnly: true
      format: uuid
      example: a363f30c-4c0c-4552-9a07-298d87f219bf
      description: The ID (UUID) of the DNS zone of which record belongs to.
    Offset:
      type: number
      example: 0
      description: Pagination offset.
      readOnly: true
    Limit:
      type: number
      example: 1000
      description: Pagination limit.
      readOnly: true
    Links:
      description: |
        URLs to navigate the different pages. As of now we always only return a
        single page.
      type: object
      properties:
        prev:
          description: |
            URL (with offset and limit parameters) of the previous page; only
            present if offset is greater than 0.
          type: string
          format: uri
          example: http://PREVIOUS-PAGE-URI
          readOnly: true
        self:
          description: |
            URL (with offset and limit parameters) of the current page.
          type: string
          format: uri
          example: http://THIS-PAGE-URI
          readOnly: true
        next:
          description: |
            URL (with offset and limit parameters) of the next page; only
            present if offset + limit is less than the total number of elements.
          type: string
          format: uri
          example: http://NEXT-PAGE-URI
          readOnly: true
    keyData:
      type: object
      description: |
        Represents the separate components of the RDATA for a DNSKEY.
        The values must conform to the guidelines in [RFC-4034 Section 2.1](https://www.rfc-editor.org/rfc/rfc4034#section-2.1).
      properties:
        flags:
          description: Represents the key's metadata and usage information.
          type: integer
          example: 257
        pubKey:
          description: Represents the public key data in Base64 encoding.
          type: string
          example: AwEAAY6wMNhHk/0+sV44EK4Hj/1f89gQeUC9f49mElA jMWUIHlBviGuzgr0Bvwf/JSk82aWjnVgdI/JJ0Onaqp7Nt66HZVH t/1GT4PG1cceWBYzWREYF8RMoSts/4Ol9YOPc2EHdKfycESD4dAEO ZtlkV07hAFRG0TzaGg+k48MQr8njn/oagThSmeHCfRtCvzgJDicPYXR H4fdoKZCv5v41Qgxd0ZjmbQxB8ls8ZXdVC2iQ2E6pQ3WcTRu8zM 6Xv0BHBGChYiSsTNZB8dHVgL/1CRUGiNRFJEkHvcXWeC2/HSnZJYLU cC/lYmBstn/yD432EkgSIbVDOdxdk0b/ARIrbLc=
    dnssecKey:
      type: object
      properties:
        keyTag:
          type: integer
          example: 49057
        digestAlgorithmMnemonic:
          type: string
          description: |
            A string that denotes the digest algorithm.
            This value must conform to the guidelines in [RFC-8624 Section 3.3](https://datatracker.ietf.org/doc/html/rfc8624#section-3.3).
          example: SHA-1
        digest:
          type: string
          example: CF58B511B2D8EF99263704A112703586E542E4FA
        keyData:
          $ref: '#/components/schemas/keyData'
        composedKeyData:
          description: |
            Represents the composed value of the The RDATA for a DNSKEY.
            The format should be the following: Flags | Protocol | Algorithm | Public Key
            The values must conform to the guidelines in [RFC-4034 Section 2.1](https://www.rfc-editor.org/rfc/rfc4034#section-2.1).
          type: string
          example: 257 3 8 AwEAAY6wMNhHk...RIrbLc=
    algorithm:
      type: string
      description: Algorithm used to generate signing keys (both Key Signing Keys and Zone Signing Keys).
      enum:
        - RSASHA256
      example: RSASHA256
    kskBits:
      type: integer
      description: |
        Key signing key length in bits.
        kskBits >= zskBits
      enum:
        - 1024
        - 2048
        - 4096
      example: 4096
    zskBits:
      type: integer
      description: |
        Zone signing key length in bits.
      enum:
        - 1024
        - 2048
        - 4096
      example: 2048
    keyParameters:
      type: object
      required:
        - algorithm
        - kskBits
        - zskBits
      description: |
        Key parameters used to sign the zone.
      properties:
        algorithm:
          $ref: '#/components/schemas/algorithm'
        kskBits:
          $ref: '#/components/schemas/kskBits'
        zskBits:
          $ref: '#/components/schemas/zskBits'
    nsecParameters:
      type: object
      required:
        - nsecMode
        - nsec3Iterations
        - nsec3SaltBits
      description: |
        Nsec parameters.
      properties:
        nsecMode:
          $ref: '#/components/schemas/nsecMode'
        nsec3Iterations:
          $ref: '#/components/schemas/nsec3Iterations'
        nsec3SaltBits:
          $ref: '#/components/schemas/nsec3SaltBits'
    nsecMode:
      type: string
      description: |
        NSEC mode.
      enum:
        - NSEC
        - NSEC3
      example: NSEC3
    nsec3Iterations:
      type: integer
      description: |
        Number of iterations for NSEC3. (between 0 and 50)
      minimum: 0
      maximum: 50
      example: 21
    nsec3SaltBits:
      type: integer
      description: |
        Salt length in bits for NSEC3. (between 64 and 128, multiples of 8)
      minimum: 64
      maximum: 128
      example: 128
    validity:
      type: integer
      description: |
        Signature validity in days
      minimum: 90
      maximum: 365
      example: 120
    dnssecKeyParameters:
      type: object
      description: |
        Parameters used to sign zone.
      properties:
        keyParameters:
          $ref: '#/components/schemas/keyParameters'
        nsecParameters:
          $ref: '#/components/schemas/nsecParameters'
        validity:
          $ref: '#/components/schemas/validity'
      required:
        - keyParameters
        - nsecParameters
        - validity
    dnssecKeyCreate:
      type: object
      required:
        - properties
      properties:
        properties:
          $ref: '#/components/schemas/dnssecKeyParameters'
    dnssecKeyReadCreation:
      type: object
      required:
        - id
        - type
        - href
        - properties
      properties:
        properties:
          $ref: '#/components/schemas/dnssecKeyParameters'
        id:
          type: string
          example: 98277a78-a6a2-4672-ac9a-a68ca0a8d67a
        type:
          type: string
          enum:
            - dnsseckeys
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
    dnssecKeyReadListProperties:
      type: object
      description: |
        Properties of the key.
      properties:
        keyParameters:
          type: object
          properties:
            algorithm:
              $ref: '#/components/schemas/algorithm'
        nsecParameters:
          type: object
          properties:
            nsecMode:
              $ref: '#/components/schemas/nsecMode'
      required:
        - keyParameters
        - nsecParameters
    dnssecKeyReadList:
      type: object
      properties:
        id:
          type: string
          example: 98277a78-a6a2-4672-ac9a-a68ca0a8d67a
        type:
          type: string
          enum:
            - dnsseckeys
        href:
          type: string
          format: uri
          example: <RESOURCE-URI>
          readOnly: true
        metadata:
          $ref: "#/components/schemas/dnssecKeyReadListMetadata"
        properties:
          $ref: "#/components/schemas/dnssecKeyReadListProperties"
    dnssecKeyReadListMetadata:
      type: object
      description: Metadata of the resource with not state information.
      properties:
        zoneId:
          $ref: "#/components/schemas/zoneId"
        items:
          $ref: "#/components/schemas/dnssecKeyReadListItems"
    dnssecKeyReadListItems:
      type: array
      title: 'List of dnssec keys'
      items:
        $ref: '#/components/schemas/dnssecKey'
    Error:
      type: object
      additionalProperties: false
      properties:
        httpStatus:
          type: integer
          description: |
            HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).
          example: 400
        messages:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              errorCode:
                type: string
                description: |
                  Internal error code.
                example: paas-dns-rest-0123
              message:
                type: string
                description: |
                  Human readable explanation of the issue.
                example: example error message
  securitySchemes:
    tokenAuth:
      type: apiKey
      description: Please provide header value as 'Bearer <token>' and don't forget
        to add 'Bearer' HTTP Authorization Scheme before the token.
      name: Authorization
      in: header
  responses:
    BadRequest:
      description: |
        ### Bad Request
        The request send to the API was malformed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: |
        ### Unauthorized
        The request is missing authorization information or the authorization information provided are expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotAllowed:
      description: |
        ### Not Allowed
        The user issuing the request does not have the needed permissions.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: |
        ### Not Found
        The resource that was requested could not be found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: |
        ### Internal Server Error
        An internal error occurred. We apologize for the inconvenience!
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ConflictErrorDNSSEC:
      description: |
        ### Conflict Error
        You can only have one DNSSEC per zone, and this zone already has one in place.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ConflictErrorReverseRecords:
      description: |
        ### Conflict Error
        This IP is not available to create a reverse DNS record.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ConflictInRecordCreation:
      description: |
        ### Conflict Error
        This record cannot be modified/created because it conflicts with another record.
        This can happen if you try to create a record with the same name and type as an existing record.
        #### Common causes:
          - **CNAME conflicts**:  A CNAME record cannot coexist with other records of the same name according 
        to DNS specifications (RFC 1034 section 3.6.2, RFC 1912 section 2.4)
          - **TXT SPF**: A TXT record cannot have more than one SPF key in the record. Try to join them.
            
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
