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

# Update KMS/Gateway URLs

> Update KMS and/or Gateway URLs for this CVM. Requires VMM >= 0.5.7.



## OpenAPI

````yaml /openapi.json patch /api/v1/cvms/{cvm_id}/network-config
openapi: 3.1.0
info:
  title: Phala Cloud API
  version: 0.1.0
servers:
  - url: https://cloud-api.phala.com
security: []
tags:
  - name: CVMs
    description: Confidential Virtual Machine (CVM) lifecycle management on Phala Network
  - name: Apps
    description: App template management and CVM deployment from app blueprints
  - name: Webhooks
    description: Manage webhook endpoints and monitor delivery history
  - name: SSH Keys
    description: SSH public key management for CVM access
  - name: KMS
    description: >-
      Key Management Service — key derivation, on-chain anchoring, and
      inspection
  - name: Instance Types
    description: Available hardware configurations for CVM deployment
  - name: Attestations
    description: Remote attestation and TEE verification endpoints
paths:
  /api/v1/cvms/{cvm_id}/network-config:
    patch:
      tags:
        - CVMs
        - cvms-network-config
      summary: Update KMS/Gateway URLs
      description: Update KMS and/or Gateway URLs for this CVM. Requires VMM >= 0.5.7.
      operationId: handle_update_network_config_api_v1_cvms__cvm_id__network_config_patch
      parameters:
        - name: cvm_id
          in: path
          required: true
          schema:
            type: string
            title: Cvm Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateNetworkConfigRequest'
      responses:
        '200':
          description: Updated network configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NetworkConfigResponse'
        '400':
          description: VMM too old or invalid request
        '403':
          description: Feature not enabled for this workspace
        '404':
          description: CVM not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateNetworkConfigRequest:
      properties:
        kms_urls:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Kms Urls
        gateway_urls:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Gateway Urls
        restart:
          type: boolean
          title: Restart
          description: Restart the CVM after applying changes to reload configuration.
          default: false
      type: object
      title: UpdateNetworkConfigRequest
      description: Partial update for KMS/Gateway URLs. Only set fields are applied.
    NetworkConfigResponse:
      properties:
        kms_urls:
          items:
            type: string
          type: array
          title: Kms Urls
        gateway_urls:
          items:
            type: string
          type: array
          title: Gateway Urls
        ports:
          items:
            $ref: '#/components/schemas/NetworkConfigPortMappingEntry'
          type: array
          title: Ports
      type: object
      title: NetworkConfigResponse
      description: Real-time network configuration from VMM.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    NetworkConfigPortMappingEntry:
      properties:
        host_port:
          type: integer
          maximum: 65535
          minimum: 1
          title: Host Port
        vm_port:
          type: integer
          maximum: 65535
          minimum: 1
          title: Vm Port
        protocol:
          type: string
          pattern: ^(tcp|udp)$
          title: Protocol
          default: tcp
        host_address:
          type: string
          title: Host Address
          default: ''
      type: object
      required:
        - host_port
        - vm_port
      title: NetworkConfigPortMappingEntry
      description: Single port mapping rule returned from VMM network config.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````