Skip to content

DataSourcesAPI

Defined in: src/api/dataSources.api.ts:138

Data Sources API client for working with Notion data sources.

Data sources are individual tables of data that live under a Notion database. As of API version 2025-09-03, data sources have their own API endpoints.

new DataSourcesAPI(client): DataSourcesAPI

Defined in: src/api/dataSources.api.ts:144

NotionClient

DataSourcesAPI

BaseAPI<NotionDataSource, DataSource>.constructor

archive(dataSourceId): Promise<DataSource>

Defined in: src/api/dataSources.api.ts:323

Move a data source to trash.

string

The ID of the data source to trash

Promise<DataSource>

The trashed data source wrapped in a DataSource model


create(options): Promise<DataSource>

Defined in: src/api/dataSources.api.ts:271

Create a new data source under a database.

CreateDataSourceOptions

Options for creating the data source

Promise<DataSource>

The created data source wrapped in a DataSource model

https://developers.notion.com/reference/create-a-data-source


listTemplates(dataSourceId, options?): Promise<{ has_more: boolean; next_cursor: string | null; templates: object[]; }>

Defined in: src/api/dataSources.api.ts:174

List the templates available for a data source.

string

The ID of the data source

ListDataSourceTemplatesOptions

Options for filtering by name and paginating results

Promise<{ has_more: boolean; next_cursor: string | null; templates: object[]; }>

The list of templates, along with pagination metadata

https://developers.notion.com/reference/list-data-source-templates


query(dataSourceId, options?): Promise<PaginatedList<Page>>

Defined in: src/api/dataSources.api.ts:203

Query a data source with optional filters and sorts. Returns pages that match the query.

string

The ID of the data source to query

QueryDataSourceOptions

Query options (filter, sorts, pagination)

Promise<PaginatedList<Page>>

Paginated list of pages from the data source

https://developers.notion.com/reference/query-a-data-source


restore(dataSourceId): Promise<DataSource>

Defined in: src/api/dataSources.api.ts:334

Restore a trashed data source.

string

The ID of the data source to restore

Promise<DataSource>

The restored data source wrapped in a DataSource model


retrieve(dataSourceId, options?): Promise<DataSource>

Defined in: src/api/dataSources.api.ts:157

Retrieve a data source by ID.

string

The ID of the data source to retrieve (with or without dashes)

RetrieveDataSourceOptions

Options for filtering properties

Promise<DataSource>

The data source wrapped in a DataSource model

https://developers.notion.com/reference/retrieve-a-data-source


trash(dataSourceId): Promise<DataSource>

Defined in: src/api/dataSources.api.ts:302

Move a data source to trash (convenience method).

string

The ID of the data source to trash

Promise<DataSource>

The trashed data source wrapped in a DataSource model


untrash(dataSourceId): Promise<DataSource>

Defined in: src/api/dataSources.api.ts:312

Restore a data source from trash (convenience method).

string

The ID of the data source to restore from trash

Promise<DataSource>

The restored data source wrapped in a DataSource model


update(dataSourceId, options): Promise<DataSource>

Defined in: src/api/dataSources.api.ts:288

Update a data source’s properties, title, icon, or status.

string

The ID of the data source to update

UpdateDataSourceOptions

Options for updating the data source

Promise<DataSource>

The updated data source wrapped in a DataSource model

https://developers.notion.com/reference/update-a-data-source