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

# Create a view

`POST /views`

Create a view, this can be against an internal or external table.

## Headers

- `x-budibase-app-id` string, required

## Request body

- View — The view to be created/updated.
  - `name` string, required — The name of the view.
  - `tableId` string, required — The ID of the table this view is based on.
  - `type` 'calculation' — The type of view - standard (empty value) or calculation.
  - `primaryDisplay` string — A column used to display rows from this view - usually used when rendered in tables.
  - `query` object — Search parameters for view
    - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
    - `onEmptyFilter` 'all' | 'none' — If no filters match, should the view return all rows, or no rows.
    - `groups` object[] — A grouping of filters to be applied.
      - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
      - `filters` object[] — A list of filters to apply
        - `operator` 'equal' | 'notEqual' | 'empty' | 'notEmpty' | 'fuzzy' | 'string' | 'contains' | 'notContains' | 'containsAny' | 'oneOf' | 'notOneOf' | 'range' — The type of search operation which is being performed.
        - `field` string — The field in the view to perform the search on.
        - `value` union — The value to search for - the type will depend on the operator in use.
          - string
          - number
          - boolean
          - object
      - `groups` object[] — A grouping of filters to be applied.
        - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
        - `filters` object[] — A list of filters to apply
          - `operator` 'equal' | 'notEqual' | 'empty' | 'notEmpty' | 'fuzzy' | 'string' | 'contains' | 'notContains' | 'containsAny' | 'oneOf' | 'notOneOf' | 'range' — The type of search operation which is being performed.
          - `field` string — The field in the view to perform the search on.
          - `value` union — The value to search for - the type will depend on the operator in use.
            - string
            - number
            - boolean
            - object
  - `sort` union
    - object
      - `field` string, required — The field from the table/view schema to sort on.
      - `order` 'ascending' | 'descending' — The order in which to sort.
      - `type` 'string' | 'number' — The type of sort to perform (by number, or by alphabetically).
    - object[]
      - `field` string, required — The field from the table/view schema to sort on.
      - `order` 'ascending' | 'descending' — The order in which to sort.
      - `type` 'string' | 'number' — The type of sort to perform (by number, or by alphabetically).
  - `schema` object, required

## Response `200`

Returns the created view, including the ID which has been generated for it.

- ViewOutput
  - `data` object, required — The view to be created/updated.
    - `name` string, required — The name of the view.
    - `tableId` string, required — The ID of the table this view is based on.
    - `type` 'calculation' — The type of view - standard (empty value) or calculation.
    - `primaryDisplay` string — A column used to display rows from this view - usually used when rendered in tables.
    - `query` object — Search parameters for view
      - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
      - `onEmptyFilter` 'all' | 'none' — If no filters match, should the view return all rows, or no rows.
      - `groups` object[] — A grouping of filters to be applied.
        - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
        - `filters` object[] — A list of filters to apply
          - `operator` 'equal' | 'notEqual' | 'empty' | 'notEmpty' | 'fuzzy' | 'string' | 'contains' | 'notContains' | 'containsAny' | 'oneOf' | 'notOneOf' | 'range' — The type of search operation which is being performed.
          - `field` string — The field in the view to perform the search on.
          - `value` union — The value to search for - the type will depend on the operator in use.
            - string
            - number
            - boolean
            - object
        - `groups` object[] — A grouping of filters to be applied.
          - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
          - `filters` object[] — A list of filters to apply
            - `operator` 'equal' | 'notEqual' | 'empty' | 'notEmpty' | 'fuzzy' | 'string' | 'contains' | 'notContains' | 'containsAny' | 'oneOf' | 'notOneOf' | 'range' — The type of search operation which is being performed.
            - `field` string — The field in the view to perform the search on.
            - `value` union — The value to search for - the type will depend on the operator in use.
              - …
    - `sort` union
      - object
        - `field` string, required — The field from the table/view schema to sort on.
        - `order` 'ascending' | 'descending' — The order in which to sort.
        - `type` 'string' | 'number' — The type of sort to perform (by number, or by alphabetically).
      - object[]
        - `field` string, required — The field from the table/view schema to sort on.
        - `order` 'ascending' | 'descending' — The order in which to sort.
        - `type` 'string' | 'number' — The type of sort to perform (by number, or by alphabetically).
    - `schema` object, required
    - `id` string, required — The ID of the view.

## Changes

> 51 revisions in range; 2 could not be searched.

- **2026-07-28** `9c6f16fc652b` — 4 breaking, 5 warning, 1 info
  - the `sort` request property type/format changed from `object`/`` to ``/``
  - added `subschema #1, subschema #2` to the `data/sort` response property `oneOf` list for the response status `200`
  - the `data/sort` response's property type/format changed from `object`/`` to ``/`` for status `200`
  - removed the required property `data/sort/field` from the response with the `200` status
  - …6 more
- **2026-06-10** `daddd12b5a2f` — 2 warning, 2 info
  - added the new `notOneOf` enum value to the `data/query/groups/items/filters/items/operator` response property for the response status `200`
  - added the new `notOneOf` enum value to the `data/query/groups/items/groups/items/filters/items/operator` response property for the response status `200`
  - added the new `notOneOf` enum value to the request property `query/groups/items/filters/items/operator`
  - added the new `notOneOf` enum value to the request property `query/groups/items/groups/items/filters/items/operator`
- **2024-11-15** `a2256b3493f2` — 24 warning, 6 info
  - removed the request property `query/allOr`
  - removed the request property `query/contains`
  - removed the request property `query/containsAny`
  - removed the request property `query/empty`
  - …26 more
- …earlier changes not shown

[Full history](https://skmtc.dev/budibase/apis/budibase-api/changes/views/post.md)

---

[API](https://skmtc.dev/budibase/apis/budibase-api.md) · [All operations](https://skmtc.dev/budibase/apis/budibase-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/budibase/budibase-api/revisions/9c6f16fc652b/schema)
