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

# Create a view

`POST /api/views`

## Request body

- ViewCreate
  - `decoration` ViewDecoration
    - `emoji` string — Emoji displayed before the view's name.
  - `fields` ViewField[] — List of object's attributes to be displayed in the UI of our applications.
  - `filters` string — The logic used to filter the items to be displayed in the view (as JavaScript code).
  - `name` string — The name of the view.
  - `order_by` string — Name of the object's attribute used to sort the items of the view.
  - `order_dir` 'asc' | 'desc' — Sort direction of the items displayed in the view. Options: `asc` or `desc`.
  - `shared_with_teams` integer[] — IDs of teams this view is shared with.
  - `shared_with_users` integer[] — IDs of users this view is shared with.
  - `slug` string, required — DEPRECATED - URL-compatible name of the view.
  - `type` 'ticket-list' | 'customer-list'
  - `visibility` 'public' | 'shared' | 'private'

## Response `201`

The created view.

- View — A view allows you to filter and sort the tickets of your account according to one or more criteria. For example, you can have a view that displays tickets having the tag `urgent`, or a view that display closed tickets, etc... Views are not like inboxes because a ticket can be present in 1 or more views if this one matches criterias of these views.
  - `id` integer, required — ID of the view.
  - `category` string — Category is an internal, read-only field used to identify system and user views.Example of system views: Trash or Spam. System views cannot be deleted.
  - `created_datetime` string, date-time — When the view was created.
  - `deactivated_datetime` string, date-time — When the view was deactivated.
  - `decoration` ViewDecoration
    - `emoji` string — Emoji displayed before the view's name.
  - `fields` ViewField[] — List of object's attributes to be displayed in the UI of our applications.
  - `filters` string — The logic used to filter the items to be displayed in the view (as JavaScript code).
  - `name` string — The name of the view.
  - `order_by` string — Name of the object's attribute used to sort the items of the view.
  - `order_dir` 'asc' | 'desc' — Sort direction of the items displayed in the view. Options: `asc` or `desc`.
  - `search` string — Text used to search for items matching the query.
  - `shared_with_teams` ViewSharedWithTeam[] — Teams this view is shared with.
    - `id` integer, required — ID of the team.
    - `name` string, required — Name of the team.
    - `decoration` object — Object describing how the team appears on the webpage. Currently only supports `emoji` field that shows before the team's name.
  - `shared_with_users` ViewSharedWithUser[] — Users this view is shared with.
    - `id` integer, required — ID of the user.
    - `name` string, required — Name of the user.
    - `meta` object — User defined JSON field with additional info about the user.
  - `slug` string — DEPRECATED - URL-compatible name of the view.
  - `type` 'ticket-list' | 'customer-list'
  - `uri` string, required — URI of the object (auto-generated)
  - `visibility` 'public' | 'shared' | 'private'

---

[API](https://skmtc.net/gorgias/apis/gorgias-rest-api.md) · [All operations](https://skmtc.net/gorgias/apis/gorgias-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gorgias/gorgias-rest-api/versions/36f2e31f4e81/schema)
