---
sidebar_position: 1
description: Create block and other functions to work with Notion in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Notion]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Create block
 Creates a new block based on an existing block



`Function CreateBlock(Val Token, Val Parent, Val Block, Val InsertAfter = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Token |
  | Parent | --page | String | &#x2714; | Parent block or page ID |
  | Block | --block | String, Map Of KeyAndValue | &#x2714; | Block ID or block sample itself |
  | InsertAfter | --prev | String | &#x2716; | Block ID after which to insert the new one |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Notion



```bsl title="1C:Enterprise/OneScript code example"
    Token  = "secret_9RsfMrRMqZwqp0Zl0B...";
    Parent = "5dd94c34fab04bff986b7511c0779f77";
    Block  = "d7021bdd15b944ababcb02bd2b1a5f6a";

    BlockData = OPI_Notion.ReturnBlock(Token, Block);
    Result    = OPI_Notion.CreateBlock(Token, Parent, BlockData);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint notion CreateBlock \
             --token "***" \
             --page "5dd94c34fab04bff986b7511c0779f77" \
             --block "{'object':'block','parent':{'type':'page_id','page_id':'5dd94c34-fab0-4bff-986b-7511c0779f77'},'in_trash':true,'type':'to_do','to_do':{'rich_text':[{'type':'text','text':{'content':'YoYO','link':null},'annotations':{'bold':false,'italic':false,'strikethrough':false,'underline':false,'code':false,'color':'default'},'plain_text':'YoYO','href':null}],'checked':false,'color':'default'}}"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint notion CreateBlock ^
             --token "***" ^
             --page "5dd94c34fab04bff986b7511c0779f77" ^
             --block "{'object':'block','parent':{'type':'page_id','page_id':'5dd94c34-fab0-4bff-986b-7511c0779f77'},'in_trash':true,'type':'to_do','to_do':{'rich_text':[{'type':'text','text':{'content':'YoYO','link':null},'annotations':{'bold':false,'italic':false,'strikethrough':false,'underline':false,'code':false,'color':'default'},'plain_text':'YoYO','href':null}],'checked':false,'color':'default'}}"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "object": "list",
 "results": [
  {
   "object": "block",
   "id": "2c582aa7-fc4e-8153-8786-f20303320755",
   "parent": {
    "type": "page_id",
    "page_id": "5dd94c34-fab0-4bff-986b-7511c0779f77"
   },
   "created_time": "2025-12-10T19:37:00Z",
   "last_edited_time": "2025-12-10T19:37:00Z",
   "created_by": {
    "object": "user",
    "id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
   },
   "last_edited_by": {
    "object": "user",
    "id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
   },
   "has_children": false,
   "archived": false,
   "in_trash": false,
   "type": "to_do",
   "to_do": {
    "rich_text": [
     {
      "type": "text",
      "text": {
       "content": "YoYO",
       "link": null
      },
      "annotations": {
       "bold": false,
       "italic": false,
       "strikethrough": false,
       "underline": false,
       "code": false,
       "color": "default"
      },
      "plain_text": "YoYO",
      "href": null
     }
    ],
    "checked": false,
    "color": "default"
   }
  }
 ],
 "next_cursor": null,
 "has_more": false,
 "type": "block",
 "block": {},
 "request_id": "1516243a-797e-4247-ad40-11f64f48bbca"
}
```
