---
title: "Mint a console token"
method: POST
path: "/v1/vms/{id}/console-token"
tags: ["console"]
---

# Mint a console token

`POST /v1/vms/{id}/console-token`

Returns a short-lived token and WebSocket path. Open a WebSocket to
`wss://<host><websocketPath>?session=<token>` to attach to the VM's
serial console. The WebSocket endpoint itself is intentionally not
modeled in this spec because it uses a capability-URL flow (no API key on
upgrade) and a custom binary/text protocol. See `src/fastvm/lib/console.py`
in the Python SDK for a reference client.

## Response `200`

Console token

- ConsoleTokenResponse
  - `token` string, required
  - `expiresInSec` integer, required
  - `websocketPath` string, uri-reference, required — Relative WebSocket path; combine with your API host as `wss://<host><websocketPath>?session=<token>`.

## Other responses

- `401` — Missing or invalid credentials
- `404` — Resource not found
- `409` — VM is not running
- `500` — Internal server error

## Changes

- **2026-04-22** `fdb53b5a79b3` — 1 warning, 5 info
  - deleted the `path` request parameter `id`
  - api operation id `createVMConsoleToken` removed and replaced with `consoleToken`
  - api tag `console` added
  - api tag `Console` removed
  - …2 more

[Change history](https://skmtc.dev/fastvm-org/apis/fastvm-api/changes/v1/vms/:id/console-token/post.md)

---

[API](https://skmtc.dev/fastvm-org/apis/fastvm-api.md) · [All operations](https://skmtc.dev/fastvm-org/apis/fastvm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fastvm-org/fastvm-api/revisions/480d9714a7a5/schema)
