Notion API - Public Beta (English)
  1. Databases
Notion API - Public Beta (English)
  • Introduction
  • Integration capabilities
  • Request limits
  • Status codes
  • ENDPOINTS
    • Authentication
      • Authentication
      • Token
    • Blocks
      • Delete a block
      • Append block children
      • Retrieve a block
      • Update a block
      • Retrieve block children
    • Databases
      • Filter database entries
      • Sort database entries
      • Update database properties
      • Retrieve a database
      • Update a database
      • Query a database
    • Pages
      • Archive a page
      • Retrieve a page property item
      • Create a page
      • Retrieve a Page
      • Update Page properties
    • Users
      • List all users
      • Retrieve your token's bot user
      • Retrieve a user
    • Comments
      • Create comment
      • Retrieve comments
    • Search
      • Search optimizations and limitations
      • Search by title
  • OBJECTS
    • Block
    • Comment
    • Unfurl attribute object for Link Previews
    • Page
      • Page
      • Page properties
    • Database
      • Database
      • Database properties
    • User
      • User
      • Comment
    • Other
      • Emoji object
      • File object
      • Parent object
      • Rich text object
  • Versioning
    • Versioning
    • Changes by version
  • ENDPOINTS Copy
    • Authentication
      • Authentication
      • Token
    • Blocks
      • Retrieve a block
      • Update a block
      • Retrieve block children
      • Delete a block
      • Append block children
    • Databases
      • Filter database entries
      • Sort database entries
      • Update database properties
      • Retrieve a database
        GET
      • Update a database
        PATCH
      • Query a database
        POST
      • Create a database
        POST
    • Pages
      • Archive a page
      • Retrieve a Page
      • Update Page properties
      • Retrieve a page property item
      • Create a page
    • Users
      • Retrieve a user
      • List all users
      • Retrieve your token's bot user
    • Comments
      • Create comment
      • Retrieve comments
  1. Databases

Create a database

Developing
POST
https://api.notion.com/v1/databases
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.notion.com/v1/databases' \
--header 'Content-Type: application/json' \
--data-raw '{
    "parent": {
        "type": "string",
        "page_id": "string"
    },
    "icon": {
        "type": "string",
        "emoji": "string"
    },
    "cover": {
        "type": "string",
        "external": {
            "url": "string"
        }
    },
    "title": [
        {
            "type": "string",
            "text": {
                "content": "string",
                "link": null
            }
        }
    ],
    "properties": {
        "Name": {
            "title": {}
        },
        "Description": {
            "rich_text": {}
        },
        "In stock": {
            "checkbox": {}
        },
        "Food group": {
            "select": {
                "options": [
                    {
                        "name": "string",
                        "color": "string"
                    }
                ]
            }
        },
        "Price": {
            "number": {
                "format": "string"
            }
        },
        "Last ordered": {
            "date": {}
        },
        "Meals": {
            "relation": {
                "database_id": "string",
                "single_property": {}
            }
        },
        "Number of meals": {
            "rollup": {
                "rollup_property_name": "string",
                "relation_property_name": "string",
                "function": "string"
            }
        },
        "Store availability": {
            "type": "string",
            "multi_select": {
                "options": [
                    {
                        "name": "string",
                        "color": "string"
                    }
                ]
            }
        },
        "+1": {
            "people": {}
        },
        "Photo": {
            "files": {}
        }
    }
}'
Response Response Example
200 - Success-Create a database
{
    "object": "database",
    "id": "bc1211ca-e3f1-4939-ae34-5260b16f627c",
    "created_time": "2021-07-08T23:50:00.000Z",
    "last_edited_time": "2021-07-08T23:50:00.000Z",
    "icon": {
        "type": "emoji",
        "emoji": "🎉"
    },
    "cover": {
        "type": "external",
        "external": {
            "url": "https://website.domain/images/image.png"
        }
    },
    "url": "https://www.notion.so/bc1211cae3f14939ae34260b16f627c",
    "title": [
        {
            "type": "text",
            "text": {
                "content": "Grocery List",
                "link": null
            },
            "annotations": {
                "bold": false,
                "italic": false,
                "strikethrough": false,
                "underline": false,
                "code": false,
                "color": "default"
            },
            "plain_text": "Grocery List",
            "href": null
        }
    ],
    "properties": {
        "+1": {
            "id": "Wp%3DC",
            "name": "+1",
            "type": "people",
            "people": {}
        },
        "In stock": {
            "id": "fk%5EY",
            "name": "In stock",
            "type": "checkbox",
            "checkbox": {}
        },
        "Price": {
            "id": "evWq",
            "name": "Price",
            "type": "number",
            "number": {
                "format": "dollar"
            }
        },
        "Description": {
            "id": "V}lX",
            "name": "Description",
            "type": "rich_text",
            "rich_text": {}
        },
        "Last ordered": {
            "id": "eVnV",
            "name": "Last ordered",
            "type": "date",
            "date": {}
        },
        "Meals": {
            "id": "%7DWA~",
            "name": "Meals",
            "type": "relation",
            "relation": {
                "database_id": "668d797c-76fa-4934-9b05-ad288df2d136",
                "single_property": {}
            }
        },
        "Number of meals": {
            "id": "Z\\Eh",
            "name": "Number of meals",
            "type": "rollup",
            "rollup": {
                "rollup_property_name": "Name",
                "relation_property_name": "Meals",
                "rollup_property_id": "title",
                "relation_property_id": "mxp^",
                "function": "count"
            }
        },
        "Store availability": {
            "id": "s}Kq",
            "name": "Store availability",
            "type": "multi_select",
            "multi_select": {
                "options": [
                    {
                        "id": "cb79b393-d1c1-4528-b517-c450859de766",
                        "name": "Duc Loi Market",
                        "color": "blue"
                    },
                    {
                        "id": "58aae162-75d4-403b-a793-3bc7308e4cd2",
                        "name": "Rainbow Grocery",
                        "color": "gray"
                    },
                    {
                        "id": "22d0f199-babc-44ff-bd80-a9eae3e3fcbf",
                        "name": "Nijiya Market",
                        "color": "purple"
                    },
                    {
                        "id": "0d069987-ffb0-4347-bde2-8e4068003dbc",
                        "name": "Gus's Community Market",
                        "color": "yellow"
                    }
                ]
            }
        },
        "Photo": {
            "id": "yfiK",
            "name": "Photo",
            "type": "files",
            "files": {}
        },
        "Food group": {
            "id": "CM%3EH",
            "name": "Food group",
            "type": "select",
            "select": {
                "options": [
                    {
                        "id": "6d4523fa-88cb-4ffd-9364-1e39d0f4e566",
                        "name": "🥦Vegetable",
                        "color": "green"
                    },
                    {
                        "id": "268d7e75-de8f-4c4b-8b9d-de0f97021833",
                        "name": "🍎Fruit",
                        "color": "red"
                    },
                    {
                        "id": "1b234a00-dc97-489c-b987-829264cfdfef",
                        "name": "💪Protein",
                        "color": "yellow"
                    }
                ]
            }
        },
        "Name": {
            "id": "title",
            "name": "Name",
            "type": "title",
            "title": {}
        }
    },
    "parent": {
        "type": "page_id",
        "page_id": "98ad959b-2b6a-4774-80ee-00246fb0ea9b"
    },
    "archived": false
}{
    "object": "database",
    "id": "bc1211ca-e3f1-4939-ae34-5260b16f627c",
    "created_time": "2021-07-08T23:50:00.000Z",
    "last_edited_time": "2021-07-08T23:50:00.000Z",
    "icon": {
        "type": "emoji",
        "emoji": "🎉"
    },
    "cover": {
        "type": "external",
        "external": {
            "url": "https://website.domain/images/image.png"
        }
    },
    "url": "https://www.notion.so/bc1211cae3f14939ae34260b16f627c",
    "title": [
        {
            "type": "text",
            "text": {
                "content": "Grocery List",
                "link": null
            },
            "annotations": {
                "bold": false,
                "italic": false,
                "strikethrough": false,
                "underline": false,
                "code": false,
                "color": "default"
            },
            "plain_text": "Grocery List",
            "href": null
        }
    ],
    "properties": {
        "+1": {
            "id": "Wp%3DC",
            "name": "+1",
            "type": "people",
            "people": {}
        },
        "In stock": {
            "id": "fk%5EY",
            "name": "In stock",
            "type": "checkbox",
            "checkbox": {}
        },
        "Price": {
            "id": "evWq",
            "name": "Price",
            "type": "number",
            "number": {
                "format": "dollar"
            }
        },
        "Description": {
            "id": "V}lX",
            "name": "Description",
            "type": "rich_text",
            "rich_text": {}
        },
        "Last ordered": {
            "id": "eVnV",
            "name": "Last ordered",
            "type": "date",
            "date": {}
        },
        "Meals": {
            "id": "%7DWA~",
            "name": "Meals",
            "type": "relation",
            "relation": {
                "database_id": "668d797c-76fa-4934-9b05-ad288df2d136",
                "synced_property_name": "Related to Grocery List (Meals)"
            }
        },
        "Number of meals": {
            "id": "Z\\Eh",
            "name": "Number of meals",
            "type": "rollup",
            "rollup": {
                "rollup_property_name": "Name",
                "relation_property_name": "Meals",
                "rollup_property_id": "title",
                "relation_property_id": "mxp^",
                "function": "count"
            }
        },
        "Store availability": {
            "id": "s}Kq",
            "name": "Store availability",
            "type": "multi_select",
            "multi_select": {
                "options": [
                    {
                        "id": "cb79b393-d1c1-4528-b517-c450859de766",
                        "name": "Duc Loi Market",
                        "color": "blue"
                    },
                    {
                        "id": "58aae162-75d4-403b-a793-3bc7308e4cd2",
                        "name": "Rainbow Grocery",
                        "color": "gray"
                    },
                    {
                        "id": "22d0f199-babc-44ff-bd80-a9eae3e3fcbf",
                        "name": "Nijiya Market",
                        "color": "purple"
                    },
                    {
                        "id": "0d069987-ffb0-4347-bde2-8e4068003dbc",
                        "name": "Gus's Community Market",
                        "color": "yellow"
                    }
                ]
            }
        },
        "Photo": {
            "id": "yfiK",
            "name": "Photo",
            "type": "files",
            "files": {}
        },
        "Food group": {
            "id": "CM%3EH",
            "name": "Food group",
            "type": "select",
            "select": {
                "options": [
                    {
                        "id": "6d4523fa-88cb-4ffd-9364-1e39d0f4e566",
                        "name": "🥦Vegetable",
                        "color": "green"
                    },
                    {
                        "id": "268d7e75-de8f-4c4b-8b9d-de0f97021833",
                        "name": "🍎Fruit",
                        "color": "red"
                    },
                    {
                        "id": "1b234a00-dc97-489c-b987-829264cfdfef",
                        "name": "💪Protein",
                        "color": "yellow"
                    }
                ]
            }
        },
        "Name": {
            "id": "title",
            "name": "Name",
            "type": "title",
            "title": {}
        }
    },
    "parent": {
        "type": "page_id",
        "page_id": "98ad959b-2b6a-4774-80ee-00246fb0ea9b"
    },
    "archived": false,
    "is_inline": false
}

Request

Body Params application/json
parent
object 
required
type
string 
required
page_id
string 
required
icon
object 
required
type
string 
required
emoji
string 
required
cover
object 
required
type
string 
required
external
object 
required
title
array [object {2}] 
required
type
string 
optional
text
object 
optional
properties
object 
required
Name
object 
required
Description
object 
required
In stock
object 
required
Food group
object 
required
Price
object 
required
Last ordered
object 
required
Meals
object 
required
Number of meals
object 
required
Store availability
object 
required
+1
object 
required
Photo
object 
required
Examples

Responses

🟢200OK-Create a database
application/json
Body
object {0}
🟠400Bad Request-Create a database
Modified at 2023-04-28 10:05:47
Previous
Query a database
Next
Archive a page
Built with