Skip to content

ViewsAPI

Defined in: src/api/views.api.ts:139

Views API client for working with Notion views.

Views control how a database/data source’s rows are displayed (table, board, calendar, etc.). Requires API version 2025-09-03 or later.

new ViewsAPI(client): ViewsAPI

Defined in: src/api/views.api.ts:146

NotionClient

ViewsAPI

BaseAPI<NotionView, View>.constructor

readonly queries: object

Defined in: src/api/views.api.ts:251

Sub-resource to query a view’s rows. View queries are non-standard. Each query returns a total_count and an expires_at value. The query result expires about 15 minutes after creation.

create: (viewId, options?) => Promise<ViewQueryResult>

Create a new query against a view.

string

CreateViewQueryOptions

Promise<ViewQueryResult>

https://developers.notion.com/guides/data-apis/working-with-views

delete: (viewId, queryId) => Promise<void>

Delete a view query.

string

string

Promise<void>

https://developers.notion.com/guides/data-apis/working-with-views

get: (viewId, queryId) => Promise<ViewQueryResult>

Retrieve the results of a previously created view query.

string

string

Promise<ViewQueryResult>

https://developers.notion.com/guides/data-apis/working-with-views

create(options): Promise<View>

Defined in: src/api/views.api.ts:198

Create a new view.

CreateViewOptions

Options for creating the view

Promise<View>

The created view wrapped in a View model

If not exactly one of database_id/view_id/create_database is provided

https://developers.notion.com/guides/data-apis/working-with-views


delete(viewId): Promise<{ id: string; object: "view"; parent: { database_id: string; type: "database_id"; }; type: "map" | "table" | "list" | "board" | "calendar" | "timeline" | "gallery" | "form" | "chart" | "dashboard"; }>

Defined in: src/api/views.api.ts:237

Delete a view.

Notion’s delete-view response differs from other delete methods. It includes only object/id/parent/type, not the full view shape. This method returns the raw parsed result instead of a full View model.

string

The ID of the view to delete

Promise<{ id: string; object: "view"; parent: { database_id: string; type: "database_id"; }; type: "map" | "table" | "list" | "board" | "calendar" | "timeline" | "gallery" | "form" | "chart" | "dashboard"; }>

The partial view object returned by the API

https://developers.notion.com/guides/data-apis/working-with-views


list(options): Promise<PaginatedList<View>>

Defined in: src/api/views.api.ts:160

List the views for a database or data source.

ListViewsOptions

Exactly one of database_id/data_source_id, plus pagination

Promise<PaginatedList<View>>

Paginated list of views

If neither or both of database_id/data_source_id are provided

https://developers.notion.com/guides/data-apis/working-with-views


retrieve(viewId): Promise<View>

Defined in: src/api/views.api.ts:184

Retrieve a view by ID.

string

The ID of the view to retrieve

Promise<View>

The view wrapped in a View model

https://developers.notion.com/guides/data-apis/working-with-views


update(viewId, options): Promise<View>

Defined in: src/api/views.api.ts:221

Update a view’s name, filter, sorts, quick filters, or configuration.

string

The ID of the view to update

UpdateViewOptions

Options for updating the view

Promise<View>

The updated view wrapped in a View model

https://developers.notion.com/guides/data-apis/working-with-views