Skip to main content
Workspace methods let you query your team workspaces and their associated resources. A workspace is a shared environment where team members collaborate on CVM deployments. Each workspace has its own nodes, quotas, and billing.

ListWorkspaces

GET /workspaces Returns all workspaces accessible to the authenticated user.
func (c *Client) ListWorkspaces(ctx context.Context) (*ListWorkspacesResponse, error)
Returns: *ListWorkspacesResponse (generic map containing workspace data)
workspaces, err := client.ListWorkspaces(ctx)
if err != nil {
	log.Fatal(err)
}

GetWorkspace

GET /workspaces/{slug} Returns detailed information about a specific workspace, identified by its slug.
func (c *Client) GetWorkspace(ctx context.Context, slug string) (*Workspace, error)
Parameters:
FieldTypeRequiredDescription
slugstringYesWorkspace slug (e.g., "my-team")
Returns: *Workspace containing:
FieldTypeDescription
IDstringWorkspace ID
NamestringDisplay name
Slug*stringURL-friendly slug
TierstringSubscription tier
Avatar*stringAvatar URL
ws, err := client.GetWorkspace(ctx, "my-team")
if err != nil {
	log.Fatal(err)
}
fmt.Printf("Workspace: %s (tier: %s)\n", ws.Name, ws.Tier)

GetWorkspaceNodes

GET /workspaces/{slug}/nodes Returns TEE nodes available to a workspace, with optional pagination.
func (c *Client) GetWorkspaceNodes(ctx context.Context, slug string, opts *PaginationOptions) (*WorkspaceNodes, error)
Parameters:
FieldTypeRequiredDescription
slugstringYesWorkspace slug
opts*PaginationOptionsNoPagination (pass nil for defaults)
Returns: *WorkspaceNodes (generic map)
nodes, err := client.GetWorkspaceNodes(ctx, "my-team", &phala.PaginationOptions{
	Page:     phala.Int(1),
	PageSize: phala.Int(20),
})
if err != nil {
	log.Fatal(err)
}

GetWorkspaceQuotas

GET /workspaces/{slug}/quotas Returns resource quotas and current usage for a workspace. Use this to check how much capacity is available before provisioning new CVMs.
func (c *Client) GetWorkspaceQuotas(ctx context.Context, slug string) (*WorkspaceQuotas, error)
Parameters:
FieldTypeRequiredDescription
slugstringYesWorkspace slug
Returns: *WorkspaceQuotas (generic map)
quotas, err := client.GetWorkspaceQuotas(ctx, "my-team")
if err != nil {
	log.Fatal(err)
}