File Upload Integration¶
How uploaded files connect to pages, data sources, databases and blocks.
Related docs: Pages · Database · Resolver
Page assets (icon & cover)¶
from notionary import NotionPage
page = await NotionPage.from_id("your-page-id")
# Set icon from existing upload id
await page.set_icon_from_file_upload(response.id)
# Set cover image from existing upload id
await page.set_cover_image_from_file_upload(response.id)
# Direct upload from disk + apply
await page.set_icon_from_file(Path("./assets/icon.png"))
await page.set_cover_image_from_file(Path("./assets/cover.jpg"))
# From bytes
await page.set_icon_from_bytes(icon_bytes, filename="spark.png")
await page.set_cover_image_from_bytes(cover_bytes, filename="gradient.png")
Data source / database metadata¶
Pattern mirrors pages; you can set cover or icon where supported.