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

# Update a DNS zone

> Updates the zone's SOA record. `version` is the version read with the zone.



## OpenAPI

````yaml /api-reference/endpoint/gateway/openapi.json patch /gateway/dns-zone/{zone_id}
openapi: 3.0.3
info:
  title: quiva.ai Gateways API
  description: >-
    quiva.ai Gateway API for managing gateway infrastructure and routing API
    requests.
  version: 1.0.0
  contact:
    name: quiva.ai Support
    email: support@quiva.ai
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Gateways
    description: Gateway management endpoints
  - name: Mappings
    description: Gateway Mapping management endpoints
  - name: Mapping Versions
    description: Gateway Mapping Version management endpoints
  - name: DNS Zones
    description: Custom domain zones managed on the gateway
  - name: DNS Records
    description: Records inside a DNS zone, and the domains a gateway answers on
  - name: Certificates
    description: TLS certificates for a DNS record
paths:
  /gateway/dns-zone/{zone_id}:
    patch:
      tags:
        - DNS Zones
      summary: Update a DNS zone
      description: >-
        Updates the zone's SOA record. `version` is the version read with the
        zone.
      operationId: patchDnsZone
      parameters:
        - name: zone_id
          in: path
          required: true
          description: Zone id, as returned in the zone subject
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                soa:
                  type: object
                  properties:
                    domain:
                      type: string
                      description: Zone domain
                    primary:
                      type: string
                      description: Primary name server
                    email:
                      type: string
                      description: Admin email
                    serial:
                      type: integer
                    refresh:
                      type: integer
                    retry:
                      type: integer
                    expire:
                      type: integer
                version:
                  type: integer
                  description: Zone version the update is based on
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  body:
                    type: object
                    properties:
                      subject:
                        type: string
                        description: Zone subject
                      account_id:
                        type: string
                        description: Owning account
                      domain:
                        type: string
                        description: Zone domain
                      soa:
                        type: object
                        properties:
                          domain:
                            type: string
                            description: Zone domain
                          primary:
                            type: string
                            description: Primary name server
                          email:
                            type: string
                            description: Admin email
                          serial:
                            type: integer
                          refresh:
                            type: integer
                          retry:
                            type: integer
                          expire:
                            type: integer
                      version:
                        type: integer
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Zone or record not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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