> ## 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 CVM attestation

> Returns TEE attestation data including TCB info, app certificates and the certificate chain. Requires workspace READ on the CVM.



## OpenAPI

````yaml /openapi.json get /api/v1/cvms/{cvm_id}/attestation
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}/attestation:
    get:
      tags:
        - CVMs
      summary: Get CVM attestation
      description: >-
        Returns TEE attestation data including TCB info, app certificates and
        the certificate chain. Requires workspace READ on the CVM.
      operationId: handle_get_cvm_attestation_api_v1_cvms__cvm_id__attestation_get
      parameters:
        - name: cvm_id
          in: path
          required: true
          schema:
            type: string
            title: Cvm Id
      responses:
        '200':
          description: >-
            Attestation report. The error field can be set while the CVM is
            online: the guest agent could not be read, or its answer was
            incomplete.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CvmAttestation'
        '401':
          description: Authentication required
        '404':
          description: CVM not found, or in another workspace
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CvmAttestation:
      properties:
        is_online:
          type: boolean
          title: Is Online
        is_public:
          type: boolean
          title: Is Public
          default: true
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        app_certificates:
          anyOf:
            - items:
                $ref: '#/components/schemas/Certificate'
              type: array
            - type: 'null'
          title: App Certificates
        app_certificate_chain_pem:
          anyOf:
            - type: string
            - type: 'null'
          title: App Certificate Chain Pem
          description: >-
            Certificate chain the guest agent's app certificate was issued with,
            as PEM. The guest agent issues it once and caches it across
            requests, so it is not a fresh quote and not proof for this request.
            The leaf quote's report_data is SHA512(ASCII("ratls-cert:") || DER
            SubjectPublicKeyInfo of the leaf) and binds no caller nonce. In KMS
            mode the chain is issued by the KMS, so verify it against a KMS root
            you trust independently, not the root shipped in the chain; a local
            CA can also issue it. In dstack versions that write it, the leaf's
            1.3.6.1.4.1.62397.1.8 extension carries the quote, the trimmed TDX
            runtime events and, if present, the embedded vm_config; older
            certificates carry the quote and event log in 1.3.6.1.4.1.62397.1.1
            and 1.3.6.1.4.1.62397.1.2. The event log in tcb_info is read
            separately and is not the log of this certificate.
        tcb_info:
          anyOf:
            - $ref: '#/components/schemas/TcbInfo'
            - type: 'null'
        compose_file:
          anyOf:
            - type: string
            - type: 'null'
          title: Compose File
      type: object
      required:
        - is_online
      title: CvmAttestation
      description: Model representing CVM attestation information
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Certificate:
      properties:
        subject:
          $ref: '#/components/schemas/CertificateSubject'
        issuer:
          $ref: '#/components/schemas/CertificateIssuer'
        serial_number:
          type: string
          title: Serial Number
        not_before:
          type: string
          format: date-time
          title: Not Before
        not_after:
          type: string
          format: date-time
          title: Not After
        version:
          type: string
          title: Version
        fingerprint:
          type: string
          title: Fingerprint
        signature_algorithm:
          type: string
          title: Signature Algorithm
        sans:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Sans
        is_ca:
          type: boolean
          title: Is Ca
          default: false
        position_in_chain:
          anyOf:
            - type: integer
            - type: 'null'
          title: Position In Chain
        quote:
          anyOf:
            - type: string
            - type: 'null'
          title: Quote
        app_id:
          anyOf:
            - type: string
            - type: 'null'
          title: App Id
        cert_usage:
          anyOf:
            - type: string
            - type: 'null'
          title: Cert Usage
      type: object
      required:
        - subject
        - issuer
        - serial_number
        - not_before
        - not_after
        - version
        - fingerprint
        - signature_algorithm
      title: Certificate
    TcbInfo:
      properties:
        mrtd:
          anyOf:
            - type: string
            - type: 'null'
          title: Mrtd
        rootfs_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Rootfs Hash
        rtmr0:
          anyOf:
            - type: string
            - type: 'null'
          title: Rtmr0
        rtmr1:
          anyOf:
            - type: string
            - type: 'null'
          title: Rtmr1
        rtmr2:
          anyOf:
            - type: string
            - type: 'null'
          title: Rtmr2
        rtmr3:
          anyOf:
            - type: string
            - type: 'null'
          title: Rtmr3
        event_log:
          items:
            $ref: '#/components/schemas/EventLog'
          type: array
          title: Event Log
        app_compose:
          type: string
          title: App Compose
      type: object
      required:
        - event_log
        - app_compose
      title: TcbInfo
    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
    CertificateSubject:
      properties:
        common_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Common Name
          description: Certificate subject common name
        organization:
          anyOf:
            - type: string
            - type: 'null'
          title: Organization
          description: Organization name
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Country code
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: State or province
        locality:
          anyOf:
            - type: string
            - type: 'null'
          title: Locality
          description: Locality name
      type: object
      title: CertificateSubject
    CertificateIssuer:
      properties:
        common_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Common Name
          description: Issuer common name
        organization:
          anyOf:
            - type: string
            - type: 'null'
          title: Organization
          description: Issuer organization
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Issuer country code
      type: object
      title: CertificateIssuer
    EventLog:
      properties:
        imr:
          type: integer
          title: Imr
        event_type:
          type: integer
          title: Event Type
        digest:
          type: string
          title: Digest
        event:
          type: string
          title: Event
        event_payload:
          type: string
          title: Event Payload
      type: object
      required:
        - imr
        - event_type
        - digest
        - event
        - event_payload
      title: EventLog

````

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