---
title: "List CVM operations"
method: GET
path: "/api/v1/cvms/{cvm_id}/operations"
tags: ["CVMs"]
---

# List CVM operations

`GET /api/v1/cvms/{cvm_id}/operations`

Returns operation records grouped by correlation_id. Only includes events with correlation_id (new format since 2024-01). Error messages are sanitized for non-admin users.

## Path parameters

- `cvm_id` string, required

## Query parameters

- `cursor` string, nullable — Opaque cursor from previous response
- `limit` integer — Page size
- `start_time` string, date-time, nullable — Include operations started after this UTC time
- `end_time` string, date-time, nullable — Include operations started before this UTC time
- `operation_types` string[], nullable — Filter by operation types (e.g. compose_update, power_on)

## Response `200`

Paginated operation records

- PaginatedCvmOperationsResponse — Cursor-paginated list of CVM operations.
  - `items` CvmOperationResponse[], required — Operations ordered by started_at DESC
    - `correlation_id` string, required — Unique ID linking all events in this operation
    - `operation_type` string, required — Type: compose_update, power_on, resize, etc.
    - `target_state` string, required — Expected CVM state after completion
    - `triggered_by` integer, required — User ID who initiated the operation
    - `triggered_by_username` string, nullable — Username if available
    - `triggered_by_email` string, nullable — Email if available
    - `started_at` string, date-time, required — UTC timestamp of first event
    - `completed_at` string, date-time, nullable — UTC timestamp of last event
    - `duration_ms` integer, nullable — Total duration from start to completion
    - `status` string, required — Current status: completed, in_progress, or failed
    - `error_message` string, nullable — Failure reason (sanitized for non-admins)
    - `sub_operations` string[], required — Ordered list of sub-operation types
    - `events` OperationEventDetail[], required — Chronological event timeline
      - `event_type` string, required — Event type identifier (e.g. instance.power_on.start)
      - `timestamp` string, date-time, required — UTC timestamp when event occurred
      - `state` string, required — CVM state at event time (e.g. running, stopped)
    - `instance_name` string, required — CVM name at operation time
    - `compose_hash` string, nullable — Hash identifying compose configuration
  - `next_cursor` string, nullable — Opaque cursor for next page, null if last page
  - `total` integer, required — Approximate total count (not exact for performance)

## Other responses

- `401` — Authentication required
- `403` — CVM not in workspace
- `404` — CVM not found
- `422` — Validation Error

---

[API](https://skmtc.net/phala/apis/phala-cloud-api.md) · [All operations](https://skmtc.net/phala/apis/phala-cloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phala/phala-cloud-api/versions/83c6ae62e860/schema)
