> ## 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.

# Refresh CVM instance ID

> Resolve and persist instance_id for a CVM. Default behavior only backfills missing values.



## OpenAPI

````yaml /openapi.json patch /api/v1/cvms/{cvm_id}/instance-id
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}/instance-id:
    patch:
      tags:
        - CVMs
      summary: Refresh CVM instance ID
      description: >-
        Resolve and persist instance_id for a CVM. Default behavior only
        backfills missing values.
      operationId: handle_refresh_cvm_instance_id_api_v1_cvms__cvm_id__instance_id_patch
      parameters:
        - name: cvm_id
          in: path
          required: true
          schema:
            type: string
            title: Cvm Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstanceIdRefreshRequest'
              default:
                overwrite: false
                dry_run: false
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstanceIdRefreshResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    InstanceIdRefreshRequest:
      properties:
        overwrite:
          type: boolean
          title: Overwrite
          description: Overwrite existing instance_id when different
          default: false
        dry_run:
          type: boolean
          title: Dry Run
          description: Preview changes without persisting
          default: false
      type: object
      title: InstanceIdRefreshRequest
    InstanceIdRefreshResult:
      properties:
        cvm_id:
          type: integer
          title: Cvm Id
        identifier:
          type: string
          title: Identifier
        status:
          type: string
          enum:
            - updated
            - unchanged
            - skipped
            - conflict
            - error
          title: Status
        old_instance_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Old Instance Id
        new_instance_id:
          anyOf:
            - type: string
            - type: 'null'
          title: New Instance Id
        source:
          type: string
          enum:
            - teepod_state
            - teepod_info
            - gateway
            - none
          title: Source
          default: none
        verified_with_gateway:
          type: boolean
          title: Verified With Gateway
          default: false
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
      type: object
      required:
        - cvm_id
        - identifier
        - status
      title: InstanceIdRefreshResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````