---
title: "Update a view"
method: PUT
path: "/views/{viewId}"
tags: ["Views"]
---

# Update a view

`PUT /views/{viewId}`

## Request

- Base URL: `https://public.escape.tech/v3`
- URL: `https://public.escape.tech/v3/views/{viewId}`
- Auth: API key in header `X-ESCAPE-API-KEY`

Update a saved view of the organization. Only the provided fields are changed.

## Path parameters

- `viewId` string, uuid, required: The view ID

## Request body

- object
  - `name` string: The new name of the view
  - `filters` object, nullable: The new filters of the view. Pass null to clear them.
  - `widgets` string[], nullable: The new widget IDs of the view. Pass null to clear them.
  - `columns` string[], nullable: The new column IDs of the view. Pass null to clear them.
  - `groupBy` string[], nullable: The new group-by keys of the view. Pass null to clear them.
  - `sort` object: The new sort of the view
    - `id` string, required: The key to sort by.
    - `direction` 'asc' | 'desc', required: The sort direction.
  - `groupSort` object: The new group sort of the view
    - `id` string, required: The key to sort by.
    - `direction` 'asc' | 'desc', required: The sort direction.

## Response `200`

OK

- object
  - `id` string, uuid, required: The view ID.
  - `name` string, required: The name of the view.
  - `key` string, nullable, required: The managed view key, or null for user-created views.
  - `target` 'ASSETS' | 'EVENTS' | 'INTEGRATIONS' | 'ISSUES' | 'LOCATIONS' | 'PROFILES' | 'SCANS' | 'TARGETS', required: The resource the view applies to.
  - `order` integer, required: The position of the view in the list.
  - `project` object, nullable, required: The project the view is scoped to, if any.
    - `id` string, uuid, required
  - `filters` object, nullable, required: The stored filters of the view.
  - `widgets` string[], required: The stored widget IDs.
  - `columns` string[], required: The stored column IDs.
  - `groupBy` string[], required: The stored group-by keys.
  - `sort` object, nullable, required: The stored sort.
    - `id` string, required: The key to sort by.
    - `direction` 'asc' | 'desc', required: The sort direction.
  - `groupSort` object, nullable, required: The stored group sort.
    - `id` string, required: The key to sort by.
    - `direction` 'asc' | 'desc', required: The sort direction.

## Other responses

- `400`: Bad Request
- `404`: Not found

---

[API](https://skmtc.dev/escape/apis/escape-public-api.md) - [All operations](https://skmtc.dev/escape/apis/escape-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/escape/apis/escape-public-api/revisions/2eab35df40c7?raw)
