---
title: "Create a view"
method: POST
path: "/views"
tags: ["Views"]
---

# Create a view

`POST /views`

## Request

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

Create a saved view for the organization.

## Request body

- object
  - `name` string, required: The name of the view
  - `target` 'ASSETS' | 'EVENTS' | 'INTEGRATIONS' | 'ISSUES' | 'LOCATIONS' | 'PROFILES' | 'SCANS' | 'TARGETS', required: The resource the view applies to
  - `projectId` string, uuid: The project to scope the view to
  - `filters` object, nullable: The filters of the view, in the shape of the target where-input
  - `widgets` string[]: The widget IDs of the view
  - `columns` string[]: The column IDs of the view
  - `groupBy` string[]: The group-by keys of the view
  - `sort` object: The sort of the view
    - `id` string, required: The key to sort by.
    - `direction` 'asc' | 'desc', required: The sort direction.
  - `groupSort` object: The 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

---

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