> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create Notion database

> Create a database container and its initial data source.

`notion.createDatabase` create a database container and its initial data source.

## Example

```ts automations/notion-create-database.automation.ts theme={null}
import { automation, onSchedule } from "automate.ax"
import { notion } from "automate.ax/notion"

export default automation("Create Notion database", () => {
  onSchedule({ schedule: "0 9 * * *" })

  notion.createDatabase({
    parent: { type: "page_id", page_id: "page-id" },
    initial_data_source: { properties: {} },
  })
})
```

## Inputs

`parent` is required. Add database metadata and `initial_data_source` to define the first schema; title and presentation fields are optional. Every input accepts a compatible signal, and an optional second argument can select a named account.

## Output

Returns the created full or partial `database` object.

A database is the container; query rows through its data-source ID.
