Skip to main content
App methods provide read access to your Phala Cloud applications. An “app” is a logical grouping that can contain one or more CVMs (e.g., the primary instance and its replicas).

GetAppList

GET /apps Returns all applications for the authenticated user.
func (c *Client) GetAppList(ctx context.Context) (*GetAppListResponse, error)
Returns: *GetAppListResponse containing:
FieldTypeDescription
DstackApps[]AppInfoList of applications
PageintCurrent page
PageSizeintItems per page
TotalintTotal number of apps
TotalPagesintTotal number of pages
apps, err := client.GetAppList(ctx)
if err != nil {
	log.Fatal(err)
}
for _, app := range apps.DstackApps {
	fmt.Printf("%s%s (%d CVMs)\n", app.AppID, app.Name, app.CVMCount)
}

GetAppInfo

GET /apps/{appId} Returns detailed information about a specific application, including its current CVM and profile.
func (c *Client) GetAppInfo(ctx context.Context, appID string) (*AppInfo, error)
Parameters:
FieldTypeRequiredDescription
appIDstringYesApplication identifier
Returns: *AppInfo with these key fields:
FieldTypeDescription
IDstringInternal ID
NamestringApp name
AppIDstringPublic app ID
KMSTypestringKMS type (e.g., "phala")
CurrentCVM*CVMInfoCurrently active CVM
CVMs[]CVMInfoAll CVMs under this app
CVMCountintNumber of CVMs
Profile*AppProfileDisplay name, avatar, description
app, err := client.GetAppInfo(ctx, "app-abc123")
if err != nil {
	log.Fatal(err)
}
fmt.Printf("App: %s, KMS: %s, CVMs: %d\n", app.Name, app.KMSType, app.CVMCount)

GetAppCVMs

GET /apps/{appId}/cvms Returns all CVMs associated with an application. This is useful for apps that have replicas or multiple deployments.
func (c *Client) GetAppCVMs(ctx context.Context, appID string) ([]GenericObject, error)
Parameters:
FieldTypeRequiredDescription
appIDstringYesApplication identifier
Returns: []GenericObject — a slice of CVM data as generic maps.
cvms, err := client.GetAppCVMs(ctx, "app-abc123")
if err != nil {
	log.Fatal(err)
}
fmt.Printf("Found %d CVMs\n", len(cvms))

GetAppRevisions

GET /apps/{appId}/revisions Returns the revision history for an application. Each revision represents a configuration change (deploy, update, restart, etc.).
func (c *Client) GetAppRevisions(ctx context.Context, appID string, opts *PaginationOptions) (*AppRevisionsResponse, error)
Parameters:
FieldTypeRequiredDescription
appIDstringYesApplication identifier
opts*PaginationOptionsNoPagination (pass nil for defaults)
PaginationOptions fields:
FieldTypeDescription
Page*intPage number
PageSize*intItems per page
Returns: *AppRevisionsResponse containing:
FieldTypeDescription
Revisions[]AppRevisionList of revisions
TotalintTotal revisions
PageintCurrent page
PageSizeintItems per page
TotalPagesintTotal pages
revisions, err := client.GetAppRevisions(ctx, "app-abc123", &phala.PaginationOptions{
	Page:     phala.Int(1),
	PageSize: phala.Int(10),
})
if err != nil {
	log.Fatal(err)
}
for _, rev := range revisions.Revisions {
	fmt.Printf("[%s] %s%s\n", rev.CreatedAt, rev.OperationType, rev.ComposeHash)
}

GetAppRevisionDetail

GET /apps/{appId}/revisions/{revisionId} Returns detailed information about a specific revision, including the full compose file and encrypted environment variables at that point in time.
func (c *Client) GetAppRevisionDetail(ctx context.Context, appID, revisionID string) (*AppRevisionDetail, error)
Parameters:
FieldTypeRequiredDescription
appIDstringYesApplication identifier
revisionIDstringYesRevision identifier
Returns: *AppRevisionDetail
detail, err := client.GetAppRevisionDetail(ctx, "app-abc123", "rev-xyz789")
if err != nil {
	log.Fatal(err)
}
fmt.Printf("Operation: %s, Compose hash: %s\n", detail.OperationType, detail.ComposeHash)

GetAppAttestation

GET /apps/{appId}/attestations Returns TEE attestation data for an application, including certificates and TCB info.
func (c *Client) GetAppAttestation(ctx context.Context, appID string) (*AppAttestationResponse, error)
Parameters:
FieldTypeRequiredDescription
appIDstringYesApplication identifier
Returns: *AppAttestationResponse (generic map)
attestation, err := client.GetAppAttestation(ctx, "app-abc123")
if err != nil {
	log.Fatal(err)
}

GetAppDeviceAllowlist

GET /apps/{appId}/device-allowlist Returns the device allowlist for an on-chain KMS application. This shows which TEE devices are authorized to run the app.
func (c *Client) GetAppDeviceAllowlist(ctx context.Context, appID string) (*DeviceAllowlistResponse, error)
Parameters:
FieldTypeRequiredDescription
appIDstringYesApplication identifier
Returns: *DeviceAllowlistResponse containing:
FieldTypeDescription
IsOnchainKMSboolWhether the app uses on-chain KMS
AllowAnyDevice*boolWhether any device is allowed
ChainID*intBlockchain chain ID
AppContractAddress*stringOn-chain app contract address
Devices[]DeviceAllowlistItemList of allowed devices
allowlist, err := client.GetAppDeviceAllowlist(ctx, "app-abc123")
if err != nil {
	log.Fatal(err)
}
if allowlist.IsOnchainKMS {
	fmt.Printf("On-chain KMS, %d devices allowed\n", len(allowlist.Devices))
}

GetAppFilterOptions

GET /apps/filter-options Returns available filter options for the app list endpoint. Useful for building UI filters.
func (c *Client) GetAppFilterOptions(ctx context.Context) (*AppFilterOptions, error)
Returns: *AppFilterOptions (generic map)
filters, err := client.GetAppFilterOptions(ctx)