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

# Declare a custom DNS zone for every cluster in the organisation

> The DNS zones every cluster in the organisation serves with the organisation's own external-dns webhook credential, alongside the delegated zone Ankra serves itself. A zone declared here behaves like the generated domain: each cluster - the ones that exist and the ones created later - gets its own external-dns deployment for it, pinned to that zone with its own cluster-derived txt owner id. A cluster's own declaration of the same zone (the per-cluster custom-dns-zones route) takes precedence over the organisation-wide one on that cluster. A zone that overlaps the zone Ankra already serves for the organisation - its delegated zone on the shared platform root, or the whole domain when a custom Ankra domain is registered - is refused with 400.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /api/v1/org/custom-dns-zones
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /api/v1/org/custom-dns-zones:
    post:
      tags:
        - Organisation
      summary: Declare a custom DNS zone for every cluster in the organisation
      description: >-
        The DNS zones every cluster in the organisation serves with the
        organisation's own external-dns webhook credential, alongside the
        delegated zone Ankra serves itself. A zone declared here behaves like
        the generated domain: each cluster - the ones that exist and the ones
        created later - gets its own external-dns deployment for it, pinned to
        that zone with its own cluster-derived txt owner id. A cluster's own
        declaration of the same zone (the per-cluster custom-dns-zones route)
        takes precedence over the organisation-wide one on that cluster. A zone
        that overlaps the zone Ankra already serves for the organisation - its
        delegated zone on the shared platform root, or the whole domain when a
        custom Ankra domain is registered - is refused with 400.
      operationId: add_organisation_custom_dns_zone_token
      parameters:
        - description: PAT organisation override.
          in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganisationCustomDNSZoneCreateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationCustomDNSZoneMutationResponse'
          description: The stored, normalised declaration
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Invalid request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Unauthenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Permission or CSRF check failed
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Resource not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Request validation failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Provider or internal failure
      security:
        - BearerAuth: []
components:
  schemas:
    OrganisationCustomDNSZoneCreateRequest:
      example:
        credential_name: smartoptics-dns
        zone: smartoptics.dev
      properties:
        credential_name:
          type: string
        zone:
          type: string
      required:
        - zone
        - credential_name
      type: object
    OrganisationCustomDNSZoneMutationResponse:
      properties:
        credential_name:
          type: string
        success:
          type: boolean
        zone:
          type: string
      required:
        - success
        - zone
      type: object
    ContractDetailError:
      example:
        detail: Cluster not found
      properties:
        detail:
          oneOf:
            - type: string
            - additionalProperties: true
              properties: {}
              type: object
      required:
        - detail
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: PAT
      scheme: bearer
      type: http

````