---
title: "Set console access policy"
method: PATCH
path: "/api/v1/vms/{id}/console-policy"
tags: ["Virtual Machines"]
---

# Set console access policy

`PATCH /api/v1/vms/{id}/console-policy`

## Request

- Base URL: `https://api.rafftechnologies.com`
- URL: `https://api.rafftechnologies.com/api/v1/vms/{id}/console-policy`
- Auth: API key in header `X-API-Key`

Toggle whether the VM's web console (terminal or VNC) asks for a fresh two-factor code
before it opens. Off by default. When on, the dashboard prompts for the authenticator
code (a confirmation unlocks protected consoles for 1 hour), and API keys cannot
open the console. Which members may open the console at all is governed by the
`vm.console` permission.

## Path parameters

- `id` string, uuid, required

## Headers

- `X-Project-ID` string, uuid, required

## Request body

- SetVMConsolePolicyRequest
  - `console_require_mfa` boolean, required: Require a two-factor-verified session to open the web console

## Response `200`

Console policy updated

- SuccessResponse
  - `success` boolean
  - `message` string

## Other responses

- `400`: X-Project-ID header is required for this endpoint
- `401`: Authentication required
- `404`: Resource not found

## Changes

- **2026-09-09** `5aa8dfc0e403`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rafftechnologies/apis/raff-api/changes/api/v1/vms/:id/console-policy/patch.md)

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) - [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rafftechnologies/apis/raff-api/revisions/3d30cde0acb4?raw)
