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

# [Domains] Attach DNS zone to domain

> Associate a DNS zone with a domain. This links the domain to an existing DNS zone for unified management. When attached, the domain's nameservers can be automatically configured to point to the zone's authoritative servers. The DNS zone must already exist and belong to the same project.



## OpenAPI

````yaml https://api.onetsolutions.net/schema put /v1/organizations/{organization_id}/projects/{project_id}/domains/{id}/dns-zone
openapi: 3.0.3
info:
  title: OnetSolutions API
  version: v1 (v1)
  description: >

    ## Overview


    The OnetSolutions API provides programmatic access to manage your cloud
    infrastructure, domains, and web hosting services.


    ## Authentication


    All API requests require authentication using one of the following methods:


    - **JWT Token**: Obtain a token via login endpoints and include it in the
    `Authorization: Bearer <token>` header

    - **API Key**: Generate an API key from your account settings and use it as
    `Authorization: Bearer sk-onetsolutions-...`


    ## Rate Limiting


    API requests are rate-limited to ensure fair usage:

    - **Standard**: 1000 requests per minute

    - **Burst**: 100 requests per second


    ## Pagination


    List endpoints return paginated results. Use `page` and `page_size` query
    parameters.


    ## Error Handling


    The API uses standard HTTP status codes:

    - `200` Success

    - `201` Created

    - `400` Bad Request

    - `401` Unauthorized

    - `403` Forbidden

    - `404` Not Found

    - `429` Too Many Requests
servers:
  - url: https://api.onetsolutions.net
    description: Production
security: []
tags:
  - name: Authentication
    description: >-
      Login, passwordless authentication, MFA, OAuth providers, and token
      management.
  - name: Organizations
    description: >-
      Organization management, members, roles, modules, audit logs, and
      notification settings.
  - name: Projects
    description: Project management, team members, and project-scoped resources.
  - name: Compute
    description: >-
      Cloud instances, volumes, snapshots, backups, VPCs, firewalls, SSH keys,
      uptime monitors, and instance tasks.
  - name: Domains
    description: >-
      Domain availability, registration, transfers, DNS zones, DNS records, and
      TLD information.
  - name: Web Hosting
    description: >-
      cPanel-based web hosting, emails, databases, subdomains, FTP accounts,
      addon domains, and SSL certificates.
paths:
  /v1/organizations/{organization_id}/projects/{project_id}/domains/{id}/dns-zone:
    put:
      tags:
        - Domains
      summary: '[Domains] Attach DNS zone to domain'
      description: >-
        Associate a DNS zone with a domain. This links the domain to an existing
        DNS zone for unified management. When attached, the domain's nameservers
        can be automatically configured to point to the zone's authoritative
        servers. The DNS zone must already exist and belong to the same project.
      operationId: attach_domain_dns_zone
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: The unique identifier (UUID) of the domain
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Domain'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Domain'
          description: DNS zone attached to domain successfully
        '400':
          description: Invalid DNS zone or zone name does not match domain
        '401':
          description: Authentication credentials were not provided or are invalid
        '403':
          description: You do not have permission to modify this domain
        '404':
          description: Domain or DNS zone not found
        '409':
          description: Domain already has a DNS zone attached
      security:
        - BearerAuth: []
components:
  schemas:
    Domain:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        legacy_id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
        sld:
          type: string
          readOnly: true
        tld:
          type: string
          readOnly: true
        tld_info:
          allOf:
            - $ref: '#/components/schemas/TLD'
          readOnly: true
        status:
          enum:
            - pending
            - registering
            - active
            - expired
            - expiring_soon
            - suspended
            - transferring_in
            - transferring_out
            - pending_delete
            - deleted
            - failed
          type: string
          description: |-
            * `pending` - pending
            * `registering` - registering
            * `active` - active
            * `expired` - expired
            * `expiring_soon` - expiring soon
            * `suspended` - suspended
            * `transferring_in` - transferring in
            * `transferring_out` - transferring out
            * `pending_delete` - pending delete
            * `deleted` - deleted
            * `failed` - failed
          x-spec-enum-id: be42ed3d4dbabfa0
          readOnly: true
        registration_date:
          type: string
          format: date
          readOnly: true
          nullable: true
        expiration_date:
          type: string
          format: date
          readOnly: true
          nullable: true
        auto_renew:
          type: boolean
          readOnly: true
        whois_privacy:
          type: boolean
          readOnly: true
        is_locked:
          type: boolean
          readOnly: true
        nameservers:
          readOnly: true
        billing_cycle:
          type: integer
          readOnly: true
        next_billing_date:
          type: string
          format: date
          readOnly: true
          nullable: true
        dns_zone:
          allOf:
            - $ref: '#/components/schemas/DNSZoneList'
          readOnly: true
        website_preview:
          allOf:
            - $ref: '#/components/schemas/WebsitePreview'
          readOnly: true
        registrant_first_name:
          type: string
          readOnly: true
        registrant_last_name:
          type: string
          readOnly: true
        registrant_organization:
          type: string
          readOnly: true
        registrant_email:
          type: string
          format: email
          readOnly: true
        registrant_phone:
          type: string
          readOnly: true
        registrant_address_1:
          type: string
          readOnly: true
        registrant_address_2:
          type: string
          readOnly: true
        registrant_city:
          type: string
          readOnly: true
        registrant_state:
          type: string
          readOnly: true
        registrant_postcode:
          type: string
          readOnly: true
        registrant_country:
          type: string
          readOnly: true
        admin_first_name:
          type: string
          readOnly: true
        admin_last_name:
          type: string
          readOnly: true
        admin_organization:
          type: string
          readOnly: true
        admin_email:
          type: string
          format: email
          readOnly: true
        admin_phone:
          type: string
          readOnly: true
        admin_address_1:
          type: string
          readOnly: true
        admin_address_2:
          type: string
          readOnly: true
        admin_city:
          type: string
          readOnly: true
        admin_state:
          type: string
          readOnly: true
        admin_postcode:
          type: string
          readOnly: true
        admin_country:
          type: string
          readOnly: true
        tech_first_name:
          type: string
          readOnly: true
        tech_last_name:
          type: string
          readOnly: true
        tech_organization:
          type: string
          readOnly: true
        tech_email:
          type: string
          format: email
          readOnly: true
        tech_phone:
          type: string
          readOnly: true
        tech_address_1:
          type: string
          readOnly: true
        tech_address_2:
          type: string
          readOnly: true
        tech_city:
          type: string
          readOnly: true
        tech_state:
          type: string
          readOnly: true
        tech_postcode:
          type: string
          readOnly: true
        tech_country:
          type: string
          readOnly: true
        is_active:
          type: boolean
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - admin_address_1
        - admin_address_2
        - admin_city
        - admin_country
        - admin_email
        - admin_first_name
        - admin_last_name
        - admin_organization
        - admin_phone
        - admin_postcode
        - admin_state
        - auto_renew
        - billing_cycle
        - created
        - dns_zone
        - expiration_date
        - id
        - is_active
        - is_locked
        - legacy_id
        - modified
        - name
        - nameservers
        - next_billing_date
        - registrant_address_1
        - registrant_address_2
        - registrant_city
        - registrant_country
        - registrant_email
        - registrant_first_name
        - registrant_last_name
        - registrant_organization
        - registrant_phone
        - registrant_postcode
        - registrant_state
        - registration_date
        - sld
        - status
        - tech_address_1
        - tech_address_2
        - tech_city
        - tech_country
        - tech_email
        - tech_first_name
        - tech_last_name
        - tech_organization
        - tech_phone
        - tech_postcode
        - tech_state
        - tld
        - tld_info
        - website_preview
        - whois_privacy
    TLD:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        tld:
          type: string
          maxLength: 63
        display_name:
          type: string
          maxLength: 100
        category:
          enum:
            - generic
            - country
            - new
            - premium
          type: string
          description: |-
            * `generic` - generic
            * `country` - country
            * `new` - new
            * `premium` - premium
          x-spec-enum-id: b2fdc0e367c310e1
        is_active:
          type: boolean
        is_registration_available:
          type: boolean
        is_transfer_available:
          type: boolean
        whois_privacy_available:
          type: boolean
        whois_privacy_price:
          type: string
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
        transfer_lock_available:
          type: boolean
        min_registration_years:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
        max_registration_years:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
        pricing:
          type: array
          items:
            $ref: '#/components/schemas/TLDPricing'
          readOnly: true
      required:
        - category
        - display_name
        - id
        - pricing
        - tld
    DNSZoneList:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        zone_name:
          type: string
          readOnly: true
        mode:
          enum:
            - onetsolutions
            - client
          type: string
          description: |-
            * `onetsolutions` - onetsolutions
            * `client` - client
          x-spec-enum-id: 34fe6d7cecda02f7
          readOnly: true
        cloudflare_nameservers:
          readOnly: true
        is_active:
          type: boolean
          readOnly: true
        is_verified:
          type: boolean
          readOnly: true
        record_count:
          type: integer
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - cloudflare_nameservers
        - created
        - id
        - is_active
        - is_verified
        - mode
        - modified
        - record_count
        - zone_name
    WebsitePreview:
      type: object
      properties:
        url:
          type: string
          format: uri
          readOnly: true
        http_status:
          type: integer
          readOnly: true
          nullable: true
        page_title:
          type: string
          readOnly: true
        meta_description:
          type: string
          readOnly: true
        favicon_url:
          type: string
          format: uri
          readOnly: true
        thumbnail_url:
          type: string
          format: uri
          readOnly: true
        ssl_status:
          enum:
            - valid
            - expired
            - invalid
            - none
            - unknown
          type: string
          description: |-
            * `valid` - Valid
            * `expired` - Expired
            * `invalid` - Invalid
            * `none` - No SSL
            * `unknown` - Unknown
          x-spec-enum-id: 4ae8d4d9c42dd29d
          readOnly: true
        ssl_issuer:
          type: string
          readOnly: true
        ssl_issued_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        ssl_expires_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_check_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_successful_check_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        error_message:
          type: string
          readOnly: true
      required:
        - error_message
        - favicon_url
        - http_status
        - last_check_at
        - last_successful_check_at
        - meta_description
        - page_title
        - ssl_expires_at
        - ssl_issued_at
        - ssl_issuer
        - ssl_status
        - thumbnail_url
        - url
    TLDPricing:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        years:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
        registration_price:
          type: string
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
        renewal_price:
          type: string
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
        transfer_price:
          type: string
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
      required:
        - id
        - registration_price
        - renewal_price
        - transfer_price
        - years
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: >-
        Use `Authorization: Bearer <token>` header. Token can be a JWT token or
        an API key (format: `sk-onetsolutions-...`).

````