Skip to content

Notion: Retrieve a page as markdown

Notion pages.retrievePageMarkdown: arguments, response, policy and SDK examples.

← Pages operations · Get started

Operation notion.retrieve_page_markdown

Provider route: GET /v1/pages/{page_id}/markdown. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/notion with npm, or alter-sdk-notion with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { NotionIntegration } from "@alter-ai/notion";
async function execute(input: Parameters<NotionIntegration["pages"]["retrievePageMarkdown"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new NotionIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.pages.retrievePageMarkdown(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_notion import NotionIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = NotionIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.pages.retrieve_page_markdown(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.page_idstringRequired within parentThe ID of the page (or block) to retrieve as markdown. Non-navigable block IDs from truncated responses can be passed here to fetch their subtrees.
queryobjectOptionalAdditional keys: not allowed
query.include_transcriptbooleanOptionalWhether to include meeting note transcripts. Defaults to false. When true, full transcripts are included; when false, a placeholder with the meeting note URL is shown instead.
query.markdown_versionstringOptionalThe Markdown syntax to use. `v2` is [Notion-flavored Markdown](/guides/data-apis/notion-flavored-markdown) and is recommended. `v1` is enhanced markdown. It’s deprecated. It’s the default on current Notion-Versions. The next Notion-Version rejects `v1` with a `400` `validation_error`.
One of: v1, v2

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Retrieve a page as markdown — response body

Referenced models: Retrieve a page as markdown — response body

Retrieve a page as markdown — response body
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
idstringRequired within parentThe ID of the page or block.
Format: uuid
markdownstringRequired within parentThe page content as Markdown, in the syntax set by `markdown_version`: Notion-flavored Markdown (`v2`, recommended) or enhanced markdown (`v1`, deprecated, the default on current Notion-Versions).
objectstringRequired within parentThe type of object, always 'page_markdown'.
Must equal: page_markdown
truncatedbooleanRequired within parentWhether the content was truncated due to exceeding the record count limit.
unknown_block_idsarrayRequired within parentBlock IDs that could not be loaded (appeared as <unknown> tags in the markdown). Pass these IDs back to this endpoint to fetch their content separately.
Maximum items: 100
unknown_block_ids[]stringEach itemFormat: uuid
warningsarrayOptionalContent warnings from a synchronous update. Returned only when there is at least one warning.
Maximum items: 100
warnings[]objectEach itemAdditional keys: allowed
warnings[].codestringRequired within parentThe warning category, for example `unsupported_tag` or `no_match`.
warnings[].messagestringRequired within parentWhat the request changed, ignored, or could not match.

SDK function policy ID: notion.retrieve_page_markdown. Catalog operation: retrieve_page_markdown. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Notion-Version": "2026-03-11"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.