---
title: "Open an interactive terminal."
method: GET
path: "/v1/machines/{id}/exec/interactive"
tags: ["machines"]
---

# Open an interactive terminal.

`GET /v1/machines/{id}/exec/interactive`

## Request

- Base URL: `https://api.smolmachines.com`
- URL: `https://api.smolmachines.com/v1/machines/{id}/exec/interactive`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/smolmachines/apis/smolfleet-api/docs/v1/machines/:id/exec/interactive/get.ts> (a function with typed inputs; its response is checked against the schema)

Upgrades to a WebSocket running a program on a pseudo-terminal in the machine. Requires the `machine:exec` scope.

## Path parameters

- `id` string, required

## Query parameters

- `cmd` string
- `cols` integer
- `rows` integer
- `access_token` string
- `smol_tenant` string

## Other responses

- `101`: Switching to a terminal WebSocket, started on the machine (a stopped machine is started first). Client to machine: binary frames are keystrokes; a text frame `{"type":"resize","cols":N,"rows":N}` resizes the terminal; `{"type":"stdin","data":"..."}` and any other text frame are typed as input. Machine to client: binary frames are terminal output; a final text frame `{"type":"exit","code":N}` precedes the close. Closing the socket ends the program. The server pings every 30 seconds and ends a session whose client has not answered for 90 seconds; a connection lasts at most one hour, so long sessions should reconnect into a terminal multiplexer.
- `401`: Missing or invalid credentials
- `403`: Key lacks the required scope
- `404`: Not found
- `429`: Rate limited; retry after the Retry-After header
- `500`: Internal error
- `502`: The machine's terminal could not be reached

## Changes

- **2026-10-16** `bc31fc04a568`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/smolmachines/apis/smolfleet-api/changes/v1/machines/:id/exec/interactive/get.md)

---

[API](https://skmtc.dev/smolmachines/apis/smolfleet-api.md) - [All operations](https://skmtc.dev/smolmachines/apis/smolfleet-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smolmachines/apis/smolfleet-api/revisions/bc31fc04a568?raw)
