---
title: "Change a workbench's view keys"
method: PATCH
path: "/v1/workbenches/{id}/view"
tags: ["Workbenches"]
---

# Change a workbench's view keys

`PATCH /v1/workbenches/{id}/view`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/workbenches/{id}/view`
- Auth: HTTP bearer

Changes the view keys the body names in the workbench's view (its last-used working
state: selection, zoom, layout): a key given replaces its value, `null` removes it,
and every key not named stays, so writers that each hold their own keys never erase
each other's. The content is untouched and the revision does not advance. Mirrors
`workbench_update_view`. A write from outside the person's door meets the kind's
check on each view key its surface declares that the write sets (a code workbench's
tabs, a section, a test, a clip, a layer), against the view it lands as; a value the
key does not take is `invalid_view`, naming what it takes.

## Path parameters

- `id` string, required

## Request body

- WireWorkbenchViewUpdateRequest
  - `view` object, required: The view keys to change. A key given replaces its value, `null` removes it, and every key not named stays.
  - `expectedRevision` integer

## Response `200`

The updated workbench

- WireWorkbench: One workbench: the container for one feature's content and working state, owned by a project and addressed by its Asset id. `kind` is an open, namespaced id; a kind a client does not know is shown as an unsupported workbench kind. Unknown fields are tolerated and must be carried.
  - `id` string, required: The workbench's Asset id.
  - `kind` string, required: Namespaced kind id, such as `piper.image`.
  - `projectId` string, required
  - `name` string, required
  - `revision` integer, required: Write counter, 1 at creation, advanced by every change; compared with `expectedRevision`.
  - `createdAt` string, required
  - `updatedAt` string, required
  - `content` object, required: The kind's durable data.
  - `view` object, required: The kind's last-used working state.

## Other responses

- `400`: A malformed body, or `invalid_view`
- `404`: No workbench with that id
- `409`: `revision_conflict`: the workbench is no longer at `expectedRevision`. Nothing changed; read it again and retry.

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
