---
title: "Update PTY session"
method: PUT
path: "/pty/{ptyID}"
---

# Update PTY session

`PUT /pty/{ptyID}`

Update properties of an existing pseudo-terminal (PTY) session.

## Path parameters

- `ptyID` string, required

## Query parameters

- `directory` string
- `workspace` string

## Request body

- object
  - `title` string
  - `size` object
    - `rows` number, required
    - `cols` number, required

## Response `200`

Updated session

- Pty
  - `id` string, required
  - `title` string, required
  - `command` string, required
  - `args` string[], required
  - `cwd` string, required
  - `status` 'running' | 'exited', required
  - `pid` number, required

## Other responses

- `400` — Bad request

## Changes

- **2026-04-25** `0a2d50cb4204` — 1 breaking, 1 info
  - added the pattern `^pty.*` to the `path` request parameter `ptyID`
  - added the new optional `query` request parameter `workspace`
- **2025-12-16** `dc065d96c390` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kaaass/apis/opencode/changes/pty/:ptyID/put.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) · [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kaaass/opencode/revisions/8bb9a15bd144/schema)
