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

# Get staged CVM changes

> Returns the CVM's staged changes, who staged each one, and the compose hash applying them produces.



## OpenAPI

````yaml /openapi.json get /api/v1/cvms/{cvm_id}/draft
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
    x-mint:
      href: https://cloud.phala.network/api-reference/cvms
  - name: Apps
    description: App template management and CVM deployment from app blueprints
    x-mint:
      href: https://cloud.phala.network/api-reference/apps
  - name: Webhooks
    description: Manage webhook endpoints and monitor delivery history
    x-mint:
      href: https://cloud.phala.network/api-reference/webhooks
  - name: SSH Keys
    description: SSH public key management for CVM access
    x-mint:
      href: https://cloud.phala.network/api-reference/ssh-keys
  - name: KMS
    description: >-
      Key Management Service — key derivation, on-chain anchoring, and
      inspection
    x-mint:
      href: https://cloud.phala.network/api-reference/kms
  - name: Instance Types
    description: Available hardware configurations for CVM deployment
    x-mint:
      href: https://cloud.phala.network/api-reference/instance-types
  - name: Attestations
    description: Remote attestation and TEE verification endpoints
    x-mint:
      href: https://cloud.phala.network/api-reference/attestations
paths:
  /api/v1/cvms/{cvm_id}/draft:
    get:
      tags:
        - CVMs
        - cvms-draft
      summary: Get staged CVM changes
      description: >-
        Returns the CVM's staged changes, who staged each one, and the compose
        hash applying them produces.
      operationId: get_cvm_draft_api_v1_cvms__cvm_id__draft_get
      parameters:
        - name: cvm_id
          in: path
          required: true
          schema:
            type: string
            title: Cvm Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CvmDraftResponse'
        '404':
          description: 'ERR-03-052: the CVM has no staged changes'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CvmDraftResponse:
      properties:
        base_compose_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Compose Hash
          description: The CVM's compose hash when the first change was staged
        current_compose_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Compose Hash
          description: >-
            The CVM's compose hash now; apply is rejected while it differs from
            the base
        preview_compose_hash:
          type: string
          title: Preview Compose Hash
          description: >-
            The compose hash the CVM runs after apply. For contract-owned KMS,
            register it on-chain before applying.
        patch:
          additionalProperties: true
          type: object
          title: Patch
          description: >-
            The one PATCH /cvms/{cvm_id} body the apply sends: the entries
            applied in order to the CVM's current compose
        entries:
          items:
            $ref: '#/components/schemas/CvmDraftEntry'
          type: array
          title: Entries
          description: The staged patches, oldest first
      type: object
      required:
        - base_compose_hash
        - current_compose_hash
        - preview_compose_hash
        - patch
        - entries
      title: CvmDraftResponse
      description: The CVM's staged changes and the compose hash applying them produces.
    StructuredErrorResponse:
      properties:
        error_code:
          type: string
          title: Error Code
        message:
          type: string
          title: Message
        details:
          anyOf:
            - items:
                $ref: '#/components/schemas/ErrorDetail'
              type: array
            - type: 'null'
          title: Details
        suggestions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Suggestions
        links:
          anyOf:
            - items:
                $ref: '#/components/schemas/ErrorLink'
              type: array
            - type: 'null'
          title: Links
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
      type: object
      required:
        - error_code
        - message
      title: StructuredErrorResponse
      description: OpenAPI shape for the global structured-error HTTP envelope.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CvmDraftEntry:
      properties:
        user_id:
          type: string
          pattern: ^usr_.+
          format: hashid
          title: HashedId[users]
          description: A hashed identifier that maps to an internal database ID
          examples:
            - usr_0123abcd
        username:
          type: string
          title: Username
        staged_at:
          type: string
          format: date-time
          title: Staged At
        patch:
          additionalProperties: true
          type: object
          title: Patch
      type: object
      required:
        - user_id
        - username
        - staged_at
        - patch
      title: CvmDraftEntry
      description: 'One staged patch: who sent it, when, and what it was.'
    ErrorDetail:
      properties:
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        value:
          anyOf:
            - {}
            - type: 'null'
          title: Value
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
      type: object
      title: ErrorDetail
      description: Detailed information about a specific aspect of the error.
    ErrorLink:
      properties:
        url:
          type: string
          title: Url
        label:
          type: string
          title: Label
      type: object
      required:
        - url
        - label
      title: ErrorLink
      description: A helpful link related to the error.
    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

````

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