---
title: "Attach an interactive terminal to an application workspace"
method: GET
path: "/ai/applications/{application_public_id}/workspace/terminal"
tags: ["AI Applications"]
---

# Attach an interactive terminal to an application workspace

`GET /ai/applications/{application_public_id}/workspace/terminal`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/applications/{application_public_id}/workspace/terminal`
- Auth: HTTP bearer

Upgrades to a WebSocket carrying a PTY in the application's persistent workspace sandbox. Binary frames are raw terminal bytes in both directions; text frames are JSON control (`{"type":"resize","cols":N,"rows":N}`) and events (`ready`, `exit`, `error`). The `thread` query parameter names a terminal thread, which owns its shell: attaching the same thread again resumes the running program. Requires `sandboxes:exec`.

## Path parameters

- `application_public_id` string, required

## Query parameters

- `thread` string, required
- `cols` integer, nullable
- `rows` integer, nullable

## Other responses

- `101`: WebSocket established; PTY attached
- `401`
- `403`
- `404`
- `409`: The workspace sandbox cannot be attached to right now
- `429`: Too many concurrent terminals
- `503`

## Changes

> 77 revisions in range; 1 not diffed.

- **2026-10-14** `9b4ecfa855b0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/applications/:application_public_id/workspace/terminal/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) · [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) · [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/24add76f6317?raw)
