> ## Documentation Index
> Fetch the complete documentation index at: https://developers.aptranet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a zone



## OpenAPI

````yaml /openapi.yaml post /cloud-dns/zones
openapi: 3.1.0
info:
  title: Aptranet API
  version: 1.0.0
  summary: Public Cloud CDN and Cloud DNS control-plane API
  description: |
    Automate project-scoped Aptranet Cloud CDN and Cloud DNS resources.
    Every endpoint requires an active API key access key and its current secret.
  contact:
    name: Aptranet Support
    email: support@aptranet.com
  license:
    name: Proprietary
servers:
  - url: https://api.aptranet.com
    description: Production
security:
  - bearerAuth: []
    apiSecret: []
tags:
  - name: CDN distributions
    description: Create and manage Cloud CDN distributions.
  - name: CDN configuration
    description: Read and replace distribution delivery configuration.
  - name: CDN origin groups
    description: Manage primary, backup, HTTP, and object-storage origins.
  - name: CDN cache tools
    description: Purge and prefetch distribution content.
  - name: CDN analytics
    description: Read traffic, cache, geography, region, and protocol analytics.
  - name: DNS zones
    description: Manage authoritative zones and SOA settings.
  - name: DNS record sets
    description: Manage DNS record sets, routing metadata, and resource records.
  - name: DNS analytics
    description: Read zone query analytics and project DNS checks.
paths:
  /cloud-dns/zones:
    post:
      tags:
        - DNS zones
      summary: Create a zone
      operationId: createDNSZone
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDNSZoneRequest'
            example:
              name: example.com
              hostmaster_email: dns-admin@example.com
              nx_ttl: 300
              refresh: 3600
              retry: 600
      responses:
        '200':
          description: Zone created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedId'
        '201':
          description: Zone created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedId'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    CreateDNSZoneRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Fully qualified zone name without a URL scheme.
        hostmaster_email:
          type: string
          format: email
        nx_ttl:
          type: integer
          minimum: 0
        refresh:
          type: integer
          minimum: 0
        retry:
          type: integer
          minimum: 0
        serial:
          type: integer
          minimum: 0
    CreatedId:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          minimum: 1
    Error:
      type: object
      properties:
        error_code:
          type: string
        error:
          type: string
        error_description:
          type: string
        trace_id:
          type: string
      additionalProperties: true
  responses:
    BadRequest:
      description: The request is invalid or required context is missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication credentials are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: The product is not active or billing requires attention.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The API key is disabled, the secret is wrong, or permission is
        insufficient.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: The requested operation conflicts with current resource state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: The configuration document failed semantic validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Aptranet access key
      description: Access key beginning with `APTRANET_`.
    apiSecret:
      type: apiKey
      in: header
      name: Aptranet-Secret
      description: Current secret paired with the access key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.