v1

latestOpenAPI 3.1.02026-07-24111290748.0 KB
Views

Create a view

post/api/views

Request body

fieldsViewField[]

List of object's attributes to be displayed in the UI of our applications.

filtersstring

The logic used to filter the items to be displayed in the view (as JavaScript code).

namestring

The name of the view.

order_bystring

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_teamsinteger[]

IDs of teams this view is shared with.

shared_with_usersinteger[]

IDs of users this view is shared with.

slugstring required

DEPRECATED - URL-compatible name of the view.

type'ticket-list' | 'customer-list'
visibility'public' | 'shared' | 'private'

Example request

{
  "decoration": {
    "emoji": "🙏"
  },
  "fields": [
    "id",
    "details",
    "tags"
  ],
  "filters": "eq(ticket.assignee_user.id, '{{current_user.id}}') && eq(ticket.status, 'open')",
  "name": "My view",
  "order_by": "updated_datetime",
  "order_dir": "desc",
  "shared_with_teams": [
    1,
    2
  ],
  "shared_with_users": [
    1,
    2
  ],
  "slug": "my-tickets"
}

Response

The created view.

idinteger required

ID of the view.

categorystring

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_datetimestring date-time

When the view was created.

deactivated_datetimestring date-time

When the view was deactivated.

fieldsViewField[]

List of object's attributes to be displayed in the UI of our applications.

filtersstring

The logic used to filter the items to be displayed in the view (as JavaScript code).

namestring

The name of the view.

order_bystring

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.

searchstring

Text used to search for items matching the query.

slugstring

DEPRECATED - URL-compatible name of the view.

type'ticket-list' | 'customer-list'
uristring required

URI of the object (auto-generated)

visibility'public' | 'shared' | 'private'

Example response

{
  "id": 123,
  "category": "user",
  "created_datetime": "2019-11-23T15:59:41.966927",
  "deactivated_datetime": "2020-01-30T11:04:34.345123",
  "decoration": {
    "emoji": "🙏"
  },
  "fields": [
    "id",
    "details",
    "tags"
  ],
  "filters": "eq(ticket.assignee_user.id, '{{current_user.id}}') && eq(ticket.status, 'open')",
  "name": "My view",
  "order_by": "updated_datetime",
  "order_dir": "desc",
  "search": "where is my order?",
  "shared_with_teams": [
    {
      "id": 123,
      "name": "Warehouse team"
    }
  ],
  "shared_with_users": [
    {
      "id": 1,
      "name": "John Smith",
      "meta": {
        "profile_picture_url": null
      }
    }
  ],
  "slug": "my-tickets",
  "uri": "/api/views/123/"
}