Overview
Databases are collections of pages in a Notion workspace that can be filtered, sorted, and organized as needed. They allow users to create and manipulate structured data in Notion. Integrations can be used to help users sync databases with external systems or build workflows around Notion databases. In this guide, you’ll learn:How databases are represented in the API.
How to add items to a database.
How to find items within databases.
Additional types of databases
In addition to regular Notion databases, there are two other types of databases to be aware of. Neither of these database types are currently supported by the Public API.Linked databases
Notion offers linked databases as a way of showing databases in multiple places. You can identify them by a ↗ next to the database title which, when clicked, takes you to the source database.
Wiki databases
Wiki databases are a special category of databases that allow Workspace Owners to organize child pages and databases with a homepage view. Wiki database pages can be verified by the Workspace Owner with an optional expiration date for the verification. Pages in a wiki database will have averification property that can be set through your Notion workspace. See directions for creating wikis and verifying pages in our Help Center.
Wiki databases can currently only be created through your Notion workspace directly (i.e., not Notion’s API). Ability to retrieve wiki databases in the API may be limited, and you can’t add multiple data sources to a wiki database.
To learn more about creating and working with wiki databases, see the following Help Center articles:
Structure
Database objects, and their data source children, describe a part of what a user sees in Notion when they open a database. See our documentation on database objects, data source objects, and data source properties for a complete description. Databases contain a list of data sources (IDs and names). In turn, each data source can be retrieved and managed separately and acts as the parent for pages (rows of data) that live under them.properties object.
TerminologyThe columns of a Notion data source are referred to as its “properties” or “schema”.The rows of a data source are individual Pages that live under it and each contain page properties (keys and values that conform to the data source’s schema) and content (what you see in the body of the page in the Notion app).
Database properties

properties section of an example database object.
properties defined. Each key is the property name and each value is a property object. Here are some key takeaways:
- The
"title"type is special. Every database has exactly one property with the"title"type. Properties of this type refer to the page title for each item in the database. In this example, the Grocery item property has this type. - The value of
typecorresponds to another key in the property object. Each property object has a nested property named the same as itstypevalue. For example, Last ordered has the type"date", and it also has adateproperty. This pattern is used throughout the Notion API on many objects and we call it type-specific data. - Certain property object types have additional configuration. In this example, Price has the type
"number". Number property objects have additional configuration inside thenumberproperty. In this example, theformatconfiguration is set to"dollar"to control the appearance of page property values in this column.
Iterate over a database object
A query to Retrieve a database returns a database object. You can iterate over theproperties object in the response to list information about each property. For example:
Adding pages to a data source
Pages are used as items inside a database, and each page’s properties must conform to its parent database’s schema. In other words, if you’re viewing a database as a table, a page’s properties define all the values in a single row.The page properties that are valid depend on the page’s parent object.If you are creating a page in a database, the page properties must match the properties of the database. If you are creating a page that is not a child of a database,
title is the only property that can be set.parent and properties.
When adding a page to a database, the parent parameter must be a database parent. We can build this object for the example database above:
PermissionsBefore an integration can create a page within another page, it needs access to the page parent. To share a page with an integration, click the ••• menu at the top right of a page, scroll to
Add connections, and use the search bar to find and select the integration from the dropdown list.Where can I find my database and data source’s IDs?
- Open the database as a full page in Notion.
- Use the
Sharemenu toCopy link. - Now paste the link in your text editor so you can take a closer look. The URL uses the following format:
-
Find the part that corresponds to
{database_id}in the URL you pasted. It is a 36 character long string. This value is your database ID. - Note that when you receive the database ID from the API, e.g. the search endpoint, it will contain hyphens in the UUIDv4 format. You may use either the hyphenated or un-hyphenated ID when calling the API.
-
To get the data source ID, either use the Retrieve a database endpoint first and check the
data_sourcesarray, or use the overflow menu under “Manage data sources” to copy it from the Notion app:

properties parameter is an object that uses property names or IDs as keys, and property value objects as values. In order to create this parameter correctly, you refer to the property objects in the database’s schema as a blueprint. We can build this object for the example database above too:
Building a property value object in codeBuilding the property value object manually, as described in this guide, is only helpful when you’re working with one specific database that you know about ahead of time.In order to build an integration that works with any database a user picks, and to remain flexible as the user’s chosen database inevitably changes in the future, use the Retrieve a database endpoint, followed by Retrieve a data source. Your integration can call this endpoint to get a current data source schema, and then create the
properties parameter in code based on that schema.parent and properties parameters, we create a page by sending a request to the endpoint.
id). If you’re connecting Notion to an external system, it’s a good idea to store the page ID. If you want to update the page properties later, you can use the ID with the Update page properties endpoint.
Using a templateWhen creating a page in the API, instead of populating the content manually, you can specify a data source template to apply.Learn more about database templates in our Help Center, and then refer to the Creating pages from templates developer guide to get started.
Finding pages in a data source
Pages can be read from a data source using the Query a data source endpoint. This endpoint allows you to find pages based on criteria such as “which page has the most recent Last ordered date”. Some data sources are very large and this endpoint also allows you to get the results in a specific order, and get the results in smaller batches.Getting a specific pageIf you’re looking for one specific page and already have its page ID, you don’t need to query a database to find it. Instead, use the Retrieve a page endpoint.
Filtering data source pages
The criteria used to find pages are called filters. Filters can describe simple conditions (i.e. “Tag includes Urgent”) or more complex conditions (i.e. “Tag includes Urgent AND Due date is within the next week AND Assignee equals Cassandra Vasquez”). These complex conditions are called compound filters because they use “and” or “or” to join multiple single property conditions together.Finding all pages in a data sourceIn order to find all the pages in a data source, send a request to the query a database without a
filter parameter."date". This means we can build a filter for the Last ordered property using any condition for the "date" type. The following filter object matches pages where the Last ordered date is in the past week:
start_cursor and page_size parameters to get more than 100 results.
Sorting data source pages
In this case, the individual pages we requested are in the"results" array. What if our integration (or its users) cared most about pages that were created recently? It would be helpful if the results were ordered so that the most recently created page was first, especially if the results didn’t fit into one paginated response.
The sort parameter is used to order results by individual properties or by timestamps. This parameter can be assigned an array of sort object.
The time which a page was created is not a page property (properties that conform to the data source schema). Instead, it’s a property that every page has, and it’s one of two kinds of timestamps. It is called the "created_time" timestamp. Let’s build a sort object that orders results so the most recently created page is first:
Conclusion
Understanding data source schemas, made from a collection of properties, is key to working with Notion databases. This enables you to add, query for, and manage pages to a data source. You’re ready to help users take advantage of Notion’s flexible and extensible data source interface to work with more kinds of data. There’s more to learn and do with data sources in the resources below.Next steps
- This guide explains working with page properties. Take a look at working with page content.
- Explore the database object and data source object to see their other attributes available in the API.
- Learn about the other page property value types. In particular, try to do more with rich text.
- Learn more about pagination.