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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.page_id | string | Required within parent | The 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. |
query | object | Optional | Additional keys: not allowed |
query.include_transcript | boolean | Optional | Whether 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_version | string | Optional | The 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
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Retrieve a page as markdown — response body |
Referenced models: Retrieve a page as markdown — response body
Schemas
Section titled “Schemas”Retrieve a page as markdown — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
id | string | Required within parent | The ID of the page or block. Format: uuid |
markdown | string | Required within parent | The 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). |
object | string | Required within parent | The type of object, always 'page_markdown'. Must equal: page_markdown |
truncated | boolean | Required within parent | Whether the content was truncated due to exceeding the record count limit. |
unknown_block_ids | array | Required within parent | Block 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[] | string | Each item | Format: uuid |
warnings | array | Optional | Content warnings from a synchronous update. Returned only when there is at least one warning. Maximum items: 100 |
warnings[] | object | Each item | Additional keys: allowed |
warnings[].code | string | Required within parent | The warning category, for example `unsupported_tag` or `no_match`. |
warnings[].message | string | Required within parent | What the request changed, ignored, or could not match. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"}