Overview
Creates a new database as a child of an existing page or in the workspace. Databases are containers that can hold one or more data sources.Parameters
object
required
The parent page or workspace where the database will be created.
array
The title of the database as an array of rich text objects.
array
The description of the database as an array of rich text objects.
boolean
default:"false"
Whether the database should be displayed inline in the parent page.
object
Initial data source configuration for the database.
object
The icon for the database. Can be an emoji, external URL, or file upload.
object
The cover image for the database. Can be an external URL or file upload.
string
Optional authentication token to override the client’s default token for this request.
Response
Returns aDatabaseObjectResponse or PartialDatabaseObjectResponse.
string
Always
database.string
The ID of the database.
array
The title of the database as an array of rich text objects.
array
The description of the database as an array of rich text objects.
object
The parent page or workspace of the database.
boolean
Whether the database is displayed inline in the parent page.
boolean
Whether the database is locked from editing in the Notion app UI.
boolean
Whether the database is in the trash.
string
ISO 8601 timestamp when the database was created.
string
ISO 8601 timestamp when the database was last edited.
array
Array of data source references contained in this database.
object
The icon of the database.
object
The cover image of the database.
string
The URL of the database in Notion.
string
The public URL of the database if it is publicly accessible, otherwise
null.Examples
Create a database in a page
Create a database in workspace
Create an inline database
After creating a database, you can query its data sources using
notion.dataSources.query().