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.
Extends
Section titled “Extends”BaseAPI<NotionView,View>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ViewsAPI(
client):ViewsAPI
Defined in: src/api/views.api.ts:146
Parameters
Section titled “Parameters”client
Section titled “client”NotionClient
Returns
Section titled “Returns”ViewsAPI
Overrides
Section titled “Overrides”BaseAPI<NotionView, View>.constructor
Properties
Section titled “Properties”queries
Section titled “queries”
readonlyqueries: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
Section titled “create”create: (
viewId,options?) =>Promise<ViewQueryResult>
Create a new query against a view.
Parameters
Section titled “Parameters”viewId
Section titled “viewId”string
options?
Section titled “options?”CreateViewQueryOptions
Returns
Section titled “Returns”Promise<ViewQueryResult>
https://developers.notion.com/guides/data-apis/working-with-views
delete
Section titled “delete”delete: (
viewId,queryId) =>Promise<void>
Delete a view query.
Parameters
Section titled “Parameters”viewId
Section titled “viewId”string
queryId
Section titled “queryId”string
Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”viewId
Section titled “viewId”string
queryId
Section titled “queryId”string
Returns
Section titled “Returns”Promise<ViewQueryResult>
https://developers.notion.com/guides/data-apis/working-with-views
Methods
Section titled “Methods”create()
Section titled “create()”create(
options):Promise<View>
Defined in: src/api/views.api.ts:198
Create a new view.
Parameters
Section titled “Parameters”options
Section titled “options”CreateViewOptions
Options for creating the view
Returns
Section titled “Returns”Promise<View>
The created view wrapped in a View model
Throws
Section titled “Throws”If not exactly one of database_id/view_id/create_database is provided
https://developers.notion.com/guides/data-apis/working-with-views
delete()
Section titled “delete()”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.
Parameters
Section titled “Parameters”viewId
Section titled “viewId”string
The ID of the view to delete
Returns
Section titled “Returns”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()
Section titled “list()”list(
options):Promise<PaginatedList<View>>
Defined in: src/api/views.api.ts:160
List the views for a database or data source.
Parameters
Section titled “Parameters”options
Section titled “options”ListViewsOptions
Exactly one of database_id/data_source_id, plus pagination
Returns
Section titled “Returns”Promise<PaginatedList<View>>
Paginated list of views
Throws
Section titled “Throws”If neither or both of database_id/data_source_id are provided
https://developers.notion.com/guides/data-apis/working-with-views
retrieve()
Section titled “retrieve()”retrieve(
viewId):Promise<View>
Defined in: src/api/views.api.ts:184
Retrieve a view by ID.
Parameters
Section titled “Parameters”viewId
Section titled “viewId”string
The ID of the view to retrieve
Returns
Section titled “Returns”Promise<View>
The view wrapped in a View model
https://developers.notion.com/guides/data-apis/working-with-views
update()
Section titled “update()”update(
viewId,options):Promise<View>
Defined in: src/api/views.api.ts:221
Update a view’s name, filter, sorts, quick filters, or configuration.
Parameters
Section titled “Parameters”viewId
Section titled “viewId”string
The ID of the view to update
options
Section titled “options”UpdateViewOptions
Options for updating the view
Returns
Section titled “Returns”Promise<View>
The updated view wrapped in a View model
https://developers.notion.com/guides/data-apis/working-with-views