Skip to content

PagesAPI

Defined in: src/api/pages.api.ts:163

Pages API client for working with Notion pages.

new PagesAPI(client): PagesAPI

Defined in: src/api/pages.api.ts:170

NotionClient

PagesAPI

BaseAPI<NotionPage, Page>.constructor

archive(pageId): Promise<Page>

Defined in: src/api/pages.api.ts:311

Move a page to trash (convenience method).

string

The ID of the page to trash

Promise<Page>

The trashed page wrapped in a Page model


create(options): Promise<Page>

Defined in: src/api/pages.api.ts:199

Create a new page.

CreatePageOptions

Options for creating the page

Promise<Page>

The created page wrapped in a Page model

https://developers.notion.com/reference/post-page


getMarkdown(pageId, options?): Promise<{ id: string; markdown: string; object: "page_markdown"; truncated: boolean; unknown_block_ids: string[]; }>

Defined in: src/api/pages.api.ts:217

Retrieve a page’s content as markdown.

string

The ID of the page to retrieve

GetPageMarkdownOptions

Options for retrieving the markdown content

Promise<{ id: string; markdown: string; object: "page_markdown"; truncated: boolean; unknown_block_ids: string[]; }>

The page’s markdown content

https://developers.notion.com/guides/data-apis/working-with-markdown-content


move(pageId, parent): Promise<Page>

Defined in: src/api/pages.api.ts:280

Move a page to a new parent page or data source.

string

The ID of the page to move

MovePageParent

The new parent (a page or a data source)

Promise<Page>

The moved page wrapped in a Page model

https://developers.notion.com/reference/move-page


restore(pageId): Promise<Page>

Defined in: src/api/pages.api.ts:300

Restore a trashed page (convenience method).

string

The ID of the page to restore

Promise<Page>

The restored page wrapped in a Page model


retrieve(pageId, options?): Promise<Page>

Defined in: src/api/pages.api.ts:183

Retrieve a page by ID.

string

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

RetrievePageOptions

Options for filtering properties

Promise<Page>

The page wrapped in a Page model

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


trash(pageId): Promise<Page>

Defined in: src/api/pages.api.ts:290

Move a page to trash (convenience method).

string

The ID of the page to trash

Promise<Page>

The trashed page wrapped in a Page model


update(pageId, options): Promise<Page>

Defined in: src/api/pages.api.ts:267

Update a page’s properties, icon, cover, or trash status.

string

The ID of the page to update

UpdatePageOptions

Options for updating the page

Promise<Page>

The updated page wrapped in a Page model

https://developers.notion.com/reference/patch-page


updateMarkdown(pageId, options): Promise<{ created_time: string; error?: { code: string; message: string; object: "error"; status: number; }; id: string; object: "async_task"; operation: { name: string; surface: "rest" | "mcp"; }; poll_after_seconds?: number; result?: unknown; status: "queued" | "running" | "retrying" | "succeeded" | "failed"; status_url: string; } | { id: string; markdown: string; object: "page_markdown"; truncated: boolean; unknown_block_ids: string[]; }>

Defined in: src/api/pages.api.ts:245

Update a page’s content as markdown.

Set allow_async: true to allow asynchronous processing for large writes. In that case, the API returns an async_task handle instead of the completed content. Poll the task with notion.asyncTasks.poll(task.id).

string

The ID of the page to update

UpdatePageMarkdownOptions

The markdown update to apply

Promise<{ created_time: string; error?: { code: string; message: string; object: "error"; status: number; }; id: string; object: "async_task"; operation: { name: string; surface: "rest" | "mcp"; }; poll_after_seconds?: number; result?: unknown; status: "queued" | "running" | "retrying" | "succeeded" | "failed"; status_url: string; } | { id: string; markdown: string; object: "page_markdown"; truncated: boolean; unknown_block_ids: string[]; }>

The updated markdown content, or an async task handle if processed asynchronously

https://developers.notion.com/guides/data-apis/working-with-markdown-content