Skip to main content

Method

Creates a new data source within a parent database. Data sources are structured data containers that can be queried and managed independently.

Parameters

object
required
The parent database where the data source will be created.
string
default:"database_id"
Always database_id
string
required
The ID of the parent database (with or without dashes)
Record<string, PropertyConfiguration>
required
Property schema of the data source. Each key is a property name, and each value is a property configuration object.Supported property types:
  • title - Title property (required for data sources)
  • rich_text - Rich text content
  • number - Numeric values
  • select - Single select from options
  • multi_select - Multiple selections
  • date - Date or date range
  • people - User references
  • files - File attachments
  • checkbox - Boolean values
  • url - URL strings
  • email - Email addresses
  • phone_number - Phone numbers
  • formula - Calculated values
  • relation - Relations to other data sources
  • rollup - Aggregate values from relations
  • created_time - Automatic creation timestamp
  • created_by - Automatic creator reference
  • last_edited_time - Automatic edit timestamp
  • last_edited_by - Automatic editor reference
RichTextItemRequest[]
Title of the data source as it appears in Notion. Array of rich text objects.
PageIconRequest | null
Icon for the data source. Can be an emoji, external URL, or file upload.
string
Bearer token for authentication. Overrides the client-level auth if provided.

Response

Returns a DataSourceObjectResponse or PartialDataSourceObjectResponse.
string
Always "data_source"
string
The unique identifier of the data source
RichTextItemResponse[]
The title of the data source
RichTextItemResponse[]
The description of the data source
object
The parent of the data source (database or another data source)
Record<string, DatabasePropertyConfigResponse>
The property schema of the data source
string
ISO 8601 timestamp when the data source was created
string
ISO 8601 timestamp when the data source was last edited
PartialUserObjectResponse
The user who created the data source
PartialUserObjectResponse
The user who last edited the data source
PageIconResponse | null
The icon of the data source
PageCoverResponse | null
The cover image of the data source
string
The Notion URL of the data source
boolean
Whether the data source is archived
boolean
Whether the data source is in the trash

Example