---
title: "Handle Get Cvm State"
method: GET
path: "/api/v1/cvms/{cvm_id}/state"
tags: ["CVMs"]
---

# Handle Get Cvm State

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

Get CVM state. Supports two modes:

1. Immediate mode (no target): Returns current state immediately
2. SSE mode (with target): Streams state updates until status matches target or timeout

Example:
    GET /cvms/{cvm_id}/state - Returns current state
    GET /cvms/{cvm_id}/state?target=running - Streams until status becomes 'running'

SSE connection limit: 5 concurrent connections per user

## Path parameters

- `cvm_id` string, required

## Query parameters

- `target` string, nullable — Target status to wait for. If specified, returns SSE stream.
- `interval` integer — Polling interval in seconds (5-30)
- `timeout` integer — Maximum wait time in seconds (10-600)

## Response `200`

Successful Response

- unknown

## Other responses

- `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)
