Create database
Creates a database
Function CreateDatabase(Val Token, Val Parent, Val Title, Val Properties = "") Export
Parameter | CLI option | Type | Required | Description |
---|---|---|---|---|
Token | --token | String | ✔ | Token |
Parent | --page | String | ✔ | Parent page ID |
Title | --title | String | ✔ | Database title |
Properties | --props | Structure Of String | ✖ | Database properties |
Returns: Map Of KeyAndValue - serialized JSON response from Notion
1C:Enterprise/OneScript code example
Token = "secret_9RsfMrRMqZwqp0Zl0B...";
Parent = "5dd94c34fab04bff986b7511c0779f77";
Title = "TestTitle";
Properties = New Map;
Properties.Insert("Name" , "title");
Properties.Insert("Description" , "rich_text");
Properties.Insert("Number" , "number");
Properties.Insert("CreationDate", "date");
Properties.Insert("Image" , "files");
Properties.Insert("Active" , "checkbox");
Properties.Insert("Website" , "url");
Properties.Insert("Email" , "email");
Properties.Insert("Phone" , "phone_number");
Properties.Insert("User" , "people");
ValueSelection = New Map;
ValueSelection.Insert("New" , "green");
ValueSelection.Insert("InProgress" , "yellow");
ValueSelection.Insert("Remote" , "red");
Properties.Insert("Status", ValueSelection);
Result = OPI_Notion.CreateDatabase(Token, Parent, Title, Properties);
- Bash
- CMD/Bat
oint notion CreateDatabase \
--token "***" \
--page "5dd94c34fab04bff986b7511c0779f77" \
--title "TestTitle" \
--props "{'Name':'title','Description':'rich_text','Number':'number','CreationDate':'date','Image':'files','Active':'checkbox','Website':'url','Email':'email','Phone':'phone_number','User':'people','Status':{'New':'green','InProgress':'yellow','Remote':'red'}}"
oint notion CreateDatabase ^
--token "***" ^
--page "5dd94c34fab04bff986b7511c0779f77" ^
--title "TestTitle" ^
--props "{'Name':'title','Description':'rich_text','Number':'number','CreationDate':'date','Image':'files','Active':'checkbox','Website':'url','Email':'email','Phone':'phone_number','User':'people','Status':{'New':'green','InProgress':'yellow','Remote':'red'}}"
Result
{
"object": "database",
"id": "26f82aa7-fc4e-8100-8c40-ec5a1dfa460e",
"cover": null,
"icon": null,
"created_time": "2025-09-15T22:34:00Z",
"created_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_time": "2025-09-15T22:34:00Z",
"title": [
{
"type": "text",
"text": {
"content": "TestTitle",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "TestTitle",
"href": null
}
],
"description": [],
"is_inline": false,
"properties": {
"Email": {
"id": "%3AGLR",
"name": "Email",
"description": null,
"type": "email",
"email": {}
},
"User": {
"id": "%40lUr",
"name": "User",
"description": null,
"type": "people",
"people": {}
},
"Description": {
"id": "OQ_%60",
"name": "Description",
"description": null,
"type": "rich_text",
"rich_text": {}
},
"Status": {
"id": "Qt%5EW",
"name": "Status",
"description": null,
"type": "select",
"select": {
"options": [
{
"id": "d6f95a10-9a0e-492a-84a9-762c1e53901d",
"name": "New",
"color": "green",
"description": null
},
{
"id": "06d8c6ba-4e47-49cf-a961-982919bdf175",
"name": "InProgress",
"color": "yellow",
"description": null
},
{
"id": "996d1095-8156-494a-b27b-71979d9a61c5",
"name": "Remote",
"color": "red",
"description": null
}
]
}
},
"Website": {
"id": "VR%7D%3B",
"name": "Website",
"description": null,
"type": "url",
"url": {}
},
"Number": {
"id": "%5DJaU",
"name": "Number",
"description": null,
"type": "number",
"number": {
"format": "number"
}
},
"CreationDate": {
"id": "%5EeGi",
"name": "CreationDate",
"description": null,
"type": "date",
"date": {}
},
"Phone": {
"id": "bX%3CC",
"name": "Phone",
"description": null,
"type": "phone_number",
"phone_number": {}
},
"Image": {
"id": "h%3D%3Bs",
"name": "Image",
"description": null,
"type": "files",
"files": {}
},
"Active": {
"id": "~Y%3Cb",
"name": "Active",
"description": null,
"type": "checkbox",
"checkbox": {}
},
"Name": {
"id": "title",
"name": "Name",
"description": null,
"type": "title",
"title": {}
}
},
"parent": {
"type": "page_id",
"page_id": "5dd94c34-fab0-4bff-986b-7511c0779f77"
},
"url": "https://www.notion.so/26f82aa7fc4e81008c40ec5a1dfa460e",
"public_url": null,
"archived": false,
"in_trash": false,
"request_id": "9dffcc70-7f83-4abc-9a3e-84772ce85879"
}