---
title: "PATCH /portfolio/{portfolioId}/views/{viewId}"
method: PATCH
path: "/portfolio/{portfolioId}/views/{viewId}"
tags: ["Views"]
---

# PATCH /portfolio/{portfolioId}/views/{viewId}

`PATCH /portfolio/{portfolioId}/views/{viewId}`

Change a portfolio view's filters, controllers, name or category.

## Path parameters

- `portfolioId` string, required
- `viewId` string, required

## Request body

- ViewUpdateBody
  - `name` string
  - `category` string
  - `filters` ViewFiltersInput — A view's filters, in the same vocabulary the item list endpoints use — so a filter you can pass to list_items works here unchanged, and vice versa. Every list takes ids OR names (names are resolved, and an unknown one is a 422 naming the valid values). An empty list clears that filter. `"-1"` means "items with no value set", the same sentinel the app uses. Portfolio views: `assignee` does not apply, and quarter / sprint / importance are matched by name because a portfolio merges them across its workspaces.
    - `type` string[] — Item types — the view's hierarchy control. e.g. `epic`, `feature`, `story`.
    - `status` string[]
    - `importance` string[]
    - `quarter` string[] — Release / quarter.
    - `sprint` string[]
    - `assignee` string[] — Workspace views only.
    - `labels` string[]
    - `createdBy` string[]
    - `epic` string[] — Ancestor epic ids.
    - `workspace` string[] — Source workspace — mainly useful on portfolio views.
    - `initiative` string[] — Linked portfolio initiative ids.
    - `objectives` string[]
    - `keyResults` string[]
    - `persona` string[]
    - `statusCategory` string[] — Workflow bucket: `open`, `inProgress`, `done`.
    - `startDate` ViewDateRange
      - `from` string — ISO 8601 date.
      - `to` string — ISO 8601 date.
    - `endDate` ViewDateRange
      - `from` string — ISO 8601 date.
      - `to` string — ISO 8601 date.
    - `customFields` ViewCustomFieldFilter[]
      - `id` string, required — Field id from get_workspace_custom_fields / get_portfolio_fields.
      - `values` string[], required — Option ids or labels.
  - `replaceAllFilters` boolean
  - `controllers` ViewControllersInput
    - `sortBy` string — Sort axis, e.g. `status`, `importance`, `hierarchy`, `custom:<fieldId>`.
    - `sortDirection` 'asc' | 'desc'
    - `groupBy` string — Grouping axis. Not available on timeline views.
    - `swimLanesBy` string — Swim-lane axis. Timeline and swimlanes views only.
  - `columns` string[] — Ordered visible columns — table and okr-table only. Replaces the current set outright; there is no per-column merge. Supported because the app changes columns on an existing view through the same call. Without it an agent asked to add one column had to recreate the whole view, which left the original behind as a duplicate.
  - `layout` string[] — Card fields — kanban, timeline and swimlanes only. Replaces the current set.
  - `compactMode` string — Card density, kanban / timeline / swimlanes only: `compact` or `default`.

## Response `200`

The updated view

- ViewDetail
  - `viewId` string, required
  - `name` string, required
  - `viewType` string, required
  - `ownerType` 'personal' | 'workspace', required
  - `category` string
  - `workspaceId` string
  - `portfolioId` string
  - `webUrl` string
  - `controllers` ViewControllers, required
    - `sortBy` string
    - `sortDirection` 'asc' | 'desc'
    - `groupBy` string
    - `swimLanesBy` string
  - `columns` string[]
  - `layout` string[]
  - `compactMode` string — Card density on a card-based view: `compact` or `default`.
  - `filters` RecordStringUnknown, required — Construct a type with a set of properties K of type T
  - `listItemsParams` RecordStringString, required — Construct a type with a set of properties K of type T
  - `listItemsTool` 'list_items' | 'list_portfolio_items' | 'list_feedback_items', required — Which list tool `listItemsParams` belongs to. Feedback views are the reason this is stated rather than assumed — their items are not work items.
  - `unsupportedFilters` UnsupportedFilter[] — Filters the list endpoints cannot reproduce — the result will be wider.
    - `filter` string, required
    - `reason` string, required
  - `raw` WireView — A view exactly as the views service stores it. Unknown props round-trip.
    - `id` string
    - `name` string
    - `categoryId` string
    - `workspaceId` string
    - `personId` string, nullable
    - `ownerType` string
    - `viewType` string
    - `orderIndex` string
    - `category` string, nullable
    - `nameId` string, nullable
    - `description` string, nullable
    - `viewFields` string[], nullable
    - `compactViewFields` string[], nullable
    - `compactMode` string, nullable — Card density on a card-based view; empty string means never set.
    - `groupBy` string, nullable
    - `groupByCustomFieldId` string, nullable
    - `secondaryGroupBy` string, nullable
    - `secondaryGroupByCustomFieldId` string, nullable
    - `sortBy` string, nullable
    - `sortByCustomFieldId` string, nullable
    - `reverse` boolean, nullable
    - `isChanged` boolean
    - `okrHierarchy` string, nullable
    - `fieldFilters` RecordStringUnknown — Construct a type with a set of properties K of type T
    - `filters` RecordStringUnknown — Construct a type with a set of properties K of type T

## Other responses

- `422` — Invalid update

---

[API](https://skmtc.net/craft/apis/craft-io-public-api.md) · [All operations](https://skmtc.net/craft/apis/craft-io-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/craft/craft-io-public-api/revisions/df0d980eb1e3/schema)
