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

# POST /portfolio/{portfolioId}/views

`POST /portfolio/{portfolioId}/views`

Create a portfolio view and return a link that opens it.

## Path parameters

- `portfolioId` string, required

## Request body

- ViewCreateBody
  - `name` string, required
  - `viewType` string — One of table, kanban, timeline, swimlanes, okr-table. Defaults to table.
  - `ownerType` 'personal' | 'workspace' — `personal` (default) or `workspace`. Workspace views need admin rights.
  - `category` string — Category name from the list endpoint. Required for workspace views.
  - `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.
  - `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[] — Visible columns, table and okr-table only.
  - `layout` string[] — Card fields, kanban / timeline / swimlanes only.
  - `compactMode` string — Card density, kanban / timeline / swimlanes only: `compact` or `default`.

## Response `200`

The created 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 view

---

[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)
