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

# Create a view

`POST /views`

Add a new view to the space

## Headers

- `Authorization` string, required
- `X-Disable-Hooks` 'true', required

## Request body

- TypeViewsViewCreate
  - `sheetId` string, required — Sheet ID
  - `name` string, required
  - `config` TypeViewsViewConfig, required — The configuration of a view. Filters, sorting, and search query.
    - `versionId` string — Version ID
    - `commitId` string — Commit ID
    - `sinceVersionId` string — Version ID
    - `sinceCommitId` string — Commit ID
    - `sortField` string — Name of field by which to sort records
    - `sortDirection` 'asc' | 'desc' — Sort direction - asc (ascending) or desc (descending)
    - `filter` 'valid' | 'error' | 'all' | 'none' — Options to filter records
    - `filterField` string — Use this to narrow the valid/error filter results to a specific field
    - `searchValue` string — Search for the given value, returning matching rows. For exact matches, wrap the value in double quotes ("Bob"). To search for null values, send empty double quotes ("")
    - `searchField` string — Use this to narrow the searchValue results to a specific field
    - `ids` TypeCommonsRecordId[] — The Record Ids param (ids) is a list of record ids that can be passed to several record endpoints allowing the user to identify specific records to INCLUDE in the query, or specific records to EXCLUDE, depending on whether or not filters are being applied. When passing a query param that filters the record dataset, such as 'searchValue', or a 'filter' of 'valid' | 'error' | 'all', the 'ids' param will EXCLUDE those records from the filtered results. For basic queries that do not filter the dataset, passing record ids in the 'ids' param will limit the dataset to INCLUDE just those specific records. Maximum of 100 allowed.
    - `pageSize` integer — Number of records to return in a page (default 10,000)
    - `pageNumber` integer — Based on pageSize, which page of records to return (Note - numbers start at 1)
    - `includeCounts` boolean — **DEPRECATED** Use GET /sheets/:sheetId/counts
    - `includeLength` boolean — The length of the record result set, returned as counts.total
    - `includeLinks` boolean — If true, linked records will be included in the results. Defaults to false.
    - `includeMessages` boolean — Include error messages, defaults to false.
    - `for` string — Event ID
    - `q` string — An FFQL query used to filter the result set

## Response `200`

Response with status 200

- TypeViewsViewResponse
  - `data` TypeViewsView, required — A view
    - `id` string, required — View ID
    - `sheetId` string, required — Sheet ID
    - `name` string, required — The name of the view
    - `config` TypeViewsViewConfig, required — The configuration of a view. Filters, sorting, and search query.
      - `versionId` string — Version ID
      - `commitId` string — Commit ID
      - `sinceVersionId` string — Version ID
      - `sinceCommitId` string — Commit ID
      - `sortField` string — Name of field by which to sort records
      - `sortDirection` 'asc' | 'desc' — Sort direction - asc (ascending) or desc (descending)
      - `filter` 'valid' | 'error' | 'all' | 'none' — Options to filter records
      - `filterField` string — Use this to narrow the valid/error filter results to a specific field
      - `searchValue` string — Search for the given value, returning matching rows. For exact matches, wrap the value in double quotes ("Bob"). To search for null values, send empty double quotes ("")
      - `searchField` string — Use this to narrow the searchValue results to a specific field
      - `ids` TypeCommonsRecordId[] — The Record Ids param (ids) is a list of record ids that can be passed to several record endpoints allowing the user to identify specific records to INCLUDE in the query, or specific records to EXCLUDE, depending on whether or not filters are being applied. When passing a query param that filters the record dataset, such as 'searchValue', or a 'filter' of 'valid' | 'error' | 'all', the 'ids' param will EXCLUDE those records from the filtered results. For basic queries that do not filter the dataset, passing record ids in the 'ids' param will limit the dataset to INCLUDE just those specific records. Maximum of 100 allowed.
      - `pageSize` integer — Number of records to return in a page (default 10,000)
      - `pageNumber` integer — Based on pageSize, which page of records to return (Note - numbers start at 1)
      - `includeCounts` boolean — **DEPRECATED** Use GET /sheets/:sheetId/counts
      - `includeLength` boolean — The length of the record result set, returned as counts.total
      - `includeLinks` boolean — If true, linked records will be included in the results. Defaults to false.
      - `includeMessages` boolean — Include error messages, defaults to false.
      - `for` string — Event ID
      - `q` string — An FFQL query used to filter the result set
    - `createdBy` string, required — ID of the actor who created the view

## Other responses

- `400` — Error response with status 400
- `404` — Error response with status 404

---

[API](https://skmtc.net/flatfile/apis/api-reference.md) · [All operations](https://skmtc.net/flatfile/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/flatfile/api-reference/revisions/9d3a9979cd96/schema)
