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.
Extends
Section titled “Extends”BaseAPI<NotionDataSource,DataSource>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DataSourcesAPI(
client):DataSourcesAPI
Defined in: src/api/dataSources.api.ts:144
Parameters
Section titled “Parameters”client
Section titled “client”NotionClient
Returns
Section titled “Returns”DataSourcesAPI
Overrides
Section titled “Overrides”BaseAPI<NotionDataSource, DataSource>.constructor
Methods
Section titled “Methods”archive()
Section titled “archive()”archive(
dataSourceId):Promise<DataSource>
Defined in: src/api/dataSources.api.ts:323
Move a data source to trash.
Parameters
Section titled “Parameters”dataSourceId
Section titled “dataSourceId”string
The ID of the data source to trash
Returns
Section titled “Returns”Promise<DataSource>
The trashed data source wrapped in a DataSource model
create()
Section titled “create()”create(
options):Promise<DataSource>
Defined in: src/api/dataSources.api.ts:271
Create a new data source under a database.
Parameters
Section titled “Parameters”options
Section titled “options”CreateDataSourceOptions
Options for creating the data source
Returns
Section titled “Returns”Promise<DataSource>
The created data source wrapped in a DataSource model
https://developers.notion.com/reference/create-a-data-source
listTemplates()
Section titled “listTemplates()”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.
Parameters
Section titled “Parameters”dataSourceId
Section titled “dataSourceId”string
The ID of the data source
options?
Section titled “options?”ListDataSourceTemplatesOptions
Options for filtering by name and paginating results
Returns
Section titled “Returns”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()
Section titled “query()”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.
Parameters
Section titled “Parameters”dataSourceId
Section titled “dataSourceId”string
The ID of the data source to query
options?
Section titled “options?”QueryDataSourceOptions
Query options (filter, sorts, pagination)
Returns
Section titled “Returns”Promise<PaginatedList<Page>>
Paginated list of pages from the data source
https://developers.notion.com/reference/query-a-data-source
restore()
Section titled “restore()”restore(
dataSourceId):Promise<DataSource>
Defined in: src/api/dataSources.api.ts:334
Restore a trashed data source.
Parameters
Section titled “Parameters”dataSourceId
Section titled “dataSourceId”string
The ID of the data source to restore
Returns
Section titled “Returns”Promise<DataSource>
The restored data source wrapped in a DataSource model
retrieve()
Section titled “retrieve()”retrieve(
dataSourceId,options?):Promise<DataSource>
Defined in: src/api/dataSources.api.ts:157
Retrieve a data source by ID.
Parameters
Section titled “Parameters”dataSourceId
Section titled “dataSourceId”string
The ID of the data source to retrieve (with or without dashes)
options?
Section titled “options?”RetrieveDataSourceOptions
Options for filtering properties
Returns
Section titled “Returns”Promise<DataSource>
The data source wrapped in a DataSource model
https://developers.notion.com/reference/retrieve-a-data-source
trash()
Section titled “trash()”trash(
dataSourceId):Promise<DataSource>
Defined in: src/api/dataSources.api.ts:302
Move a data source to trash (convenience method).
Parameters
Section titled “Parameters”dataSourceId
Section titled “dataSourceId”string
The ID of the data source to trash
Returns
Section titled “Returns”Promise<DataSource>
The trashed data source wrapped in a DataSource model
untrash()
Section titled “untrash()”untrash(
dataSourceId):Promise<DataSource>
Defined in: src/api/dataSources.api.ts:312
Restore a data source from trash (convenience method).
Parameters
Section titled “Parameters”dataSourceId
Section titled “dataSourceId”string
The ID of the data source to restore from trash
Returns
Section titled “Returns”Promise<DataSource>
The restored data source wrapped in a DataSource model
update()
Section titled “update()”update(
dataSourceId,options):Promise<DataSource>
Defined in: src/api/dataSources.api.ts:288
Update a data source’s properties, title, icon, or status.
Parameters
Section titled “Parameters”dataSourceId
Section titled “dataSourceId”string
The ID of the data source to update
options
Section titled “options”UpdateDataSourceOptions
Options for updating the data source
Returns
Section titled “Returns”Promise<DataSource>
The updated data source wrapped in a DataSource model
https://developers.notion.com/reference/update-a-data-source