Skip to main content
The Client class is the main entry point for interacting with the Notion API. It provides namespaced access to all API endpoints and handles authentication, retries, and error handling.

Constructor

Creates a new Notion API client instance.
ClientOptions
Configuration options for the client. See ClientOptions for details.

Example

Properties

blocks

Namespace for block-related operations.

pages

Namespace for page-related operations.

databases

Namespace for database-related operations.

dataSources

Namespace for data source-related operations.

users

Namespace for user-related operations.

comments

Namespace for comment-related operations.

fileUploads

Namespace for file upload operations.

oauth

Namespace for OAuth operations.

Methods

Searches across all pages and databases in the workspace.
SearchParameters
required
Search parameters including query text and filters.

request

Sends a raw HTTP request to the Notion API. This is a low-level method used internally by all endpoint methods.
RequestParameters
required
Request configuration including path, method, query parameters, and body.
string
required
The API endpoint path (without the base URL or version prefix).
'get' | 'post' | 'patch' | 'delete'
required
The HTTP method to use.
Record<string, string | number | boolean | string[]>
Query parameters to append to the URL.
Record<string, unknown>
Request body to send as JSON.
Record<string, string | FileParam>
Form data parameters for file uploads.
Record<string, string>
Additional headers to include in the request.
string | { client_id: string; client_secret: string }
Override the client-level authentication for this request.

Static Properties

defaultNotionVersion

The default Notion API version used by the client.