Skip to content

DatabasesAPI

Defined in: src/api/databases.api.ts:139

Databases API client for working with Notion databases.

new DatabasesAPI(client): DatabasesAPI

Defined in: src/api/databases.api.ts:146

NotionClient

DatabasesAPI

BaseAPI<NotionDatabase, Database>.constructor

archive(databaseId): Promise<Database>

Defined in: src/api/databases.api.ts:279

Move a database to trash (convenience method).

string

The ID of the database to trash

Promise<Database>

The trashed database wrapped in a Database model


create(options): Promise<Database>

Defined in: src/api/databases.api.ts:213

Create a new database.

CreateDatabaseOptions

Options for creating the database

Promise<Database>

The created database wrapped in a Database model

https://developers.notion.com/reference/create-a-database


query(databaseId, options?): Promise<PaginatedList<Page>>

Defined in: src/api/databases.api.ts:177

Query a database with optional filters and sorts. Returns pages that match the query.

string

The ID of the database to query

QueryDatabaseOptions

Query options (filter, sorts, pagination)

Promise<PaginatedList<Page>>

Paginated list of pages from the database

https://developers.notion.com/reference/post-database-query


restore(databaseId): Promise<Database>

Defined in: src/api/databases.api.ts:268

Restore a trashed database (convenience method).

string

The ID of the database to restore

Promise<Database>

The restored database wrapped in a Database model


retrieve(databaseId, options?): Promise<Database>

Defined in: src/api/databases.api.ts:159

Retrieve a database by ID.

string

The ID of the database to retrieve (with or without dashes)

RetrieveDatabaseOptions

Options for filtering properties

Promise<Database>

The database wrapped in a Database model

https://developers.notion.com/reference/retrieve-a-database


trash(databaseId): Promise<Database>

Defined in: src/api/databases.api.ts:258

Move a database to trash (convenience method).

string

The ID of the database to trash

Promise<Database>

The trashed database wrapped in a Database model


update(databaseId, options): Promise<Database>

Defined in: src/api/databases.api.ts:244

Update a database’s properties, title, description, or trash status.

string

The ID of the database to update

UpdateDatabaseOptions

Options for updating the database

Promise<Database>

The updated database wrapped in a Database model

https://developers.notion.com/reference/update-a-database