Find a data source ID
SetDATABASE_ID to the ID of the parent database. List its data sources with this command.
data_sources array and set DATA_SOURCE_ID to its id. In Notion, you can also find the ID under Manage data sources in the database settings. Open the data source’s ••• menu and select Copy data source ID.
Retrieve a data source
Fetch the schema (properties, title, parent) for a single data source. See Retrieve a data source for the response shape:Create a data source
To add a data source, pass the parent database ID and define each column inproperties. See Create a data source for the full list of fields.
Query a data source
Usentn datasources query to list pages in a data source:
--filter with the same shape documented in Filter data source entries:
--start-cursor using the next_cursor from the previous response. Add --json for machine-readable output.
To use the query endpoint directly, pass the filter and sort order in the request body.
filter_properties once for each property name or ID you need.
has_more is true, pass next_cursor as start_cursor in the next request. If your query reaches the 10,000-result limit, follow Query large data sources to read the remaining pages.
Update a data source
PATCH updates the title, description, parent, or schema. To add a column, pass it under properties keyed by name:
name or null:
List page templates
List the page templates that show up in a data source’s New dropdown. See List data source templates for the response shape:TEMPLATE_ID to a template ID from the response, then retrieve the page: