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

# Set or rotate the app launch token

> Sets the app's launch token, generating one when the body omits it, and returns the plaintext and its hash once. CVMs keep booting with their current compose: update each CVM's requirements.launch_token_hash to the returned hash before its next boot, or it fails closed. Phala Cloud and the node operator can read the token, so it protects only against parties who know the public compose.



## OpenAPI

````yaml /openapi.json post /api/v1/apps/{app_id}/launch-token
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/apps/{app_id}/launch-token:
    post:
      tags:
        - Apps
        - apps-launch-token
      summary: Set or rotate the app launch token
      description: >-
        Sets the app's launch token, generating one when the body omits it, and
        returns the plaintext and its hash once. CVMs keep booting with their
        current compose: update each CVM's requirements.launch_token_hash to the
        returned hash before its next boot, or it fails closed. Phala Cloud and
        the node operator can read the token, so it protects only against
        parties who know the public compose.
      operationId: set_app_launch_token_api_v1_apps__app_id__launch_token_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            title: App Id
            description: Hex app identifier
          description: Hex app identifier
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/SetLaunchTokenRequest'
                - type: 'null'
              title: Body
      responses:
        '200':
          description: New launch token and hash
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LaunchTokenResponse'
        '401':
          description: Not authenticated
        '403':
          description: No permission to update the app
        '404':
          description: App not found
        '422':
          description: Token shorter than 32 bytes
components:
  schemas:
    SetLaunchTokenRequest:
      properties:
        launch_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Launch Token
          description: >-
            Token to set (at least 32 bytes). Omit to have Phala Cloud generate
            one.
      type: object
      title: SetLaunchTokenRequest
    LaunchTokenResponse:
      properties:
        launch_token:
          type: string
          title: Launch Token
          description: The app's new launch token. Returned only here, once.
        launch_token_hash:
          type: string
          title: Launch Token Hash
          description: >-
            Value for compose_file.requirements.launch_token_hash of every CVM
            of the app
      type: object
      required:
        - launch_token
        - launch_token_hash
      title: LaunchTokenResponse

````

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