JSON is a text-based format for exchanging structured values through objects, arrays, and primitive values. In Python integrations, nested dictionaries can model JSON-compatible request payloads for REST APIs. section 9.2.2
A practical JSON workflow includes:
- Representing page properties, block content, formatting, and metadata as nested key-value structures. section 9.2.2
- Passing payloads to Notion with Python requests calls and checking returned HTTP status codes. section 9.2.2
- Splitting long text into chunks before sending it because a write operation accepts at most 2,000 characters at once. section 9.2.2
Writing an LLM answer to Notion
A routine creates a page with a JSON-compatible title property, converts text into a paragraph block, and writes the prompt and generated answer in chunks. Failed writes stop the operation, while stored responses remain available for later fact-checking. section 9.2.2
def create_block(content : str) -> dict:
return {
"children": [
{
"object": "block",
"type": "paragraph",
"paragraph": {
"rich_text": [
{
"type": "text",
"text": {
"content": content,
},
}
]
},
},
]
}
Inspect the nested JSON-compatible dictionary used to represent a Notion paragraph block and its rich text content. section 9.2.2


































