//native
/**
* Retrieve Block
* Get a single block by ID. A page ID also works, returning the page as a child_page block.
*/
export async function main(auth: RT.Notion, block_id: string) {
const response = await fetch(`https://api.notion.com/v1/blocks/${block_id}`, {
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
"Notion-Version": "2026-03-11",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 3 days ago