> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://notion.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://notion.ferndocs.com/_mcp/server.

# Create a database

POST https://api.notion.com/v1/databases/
Content-Type: application/json

This page describes the API for versions up to and including `2022-06-28`. In the new `2025-09-03` version, the concepts of databases and data sources were split up, as described in [Upgrading to 2025-09-03](/docs/upgrade-guide-2025-09-03).

Refer to the new APIs instead:

* [Create a database](/reference/database-create)
* [Create a data source](/reference/create-a-data-source)

Creates a database as a subpage in the specified parent page, with the specified `properties` schema. Currently, the parent of a new database must be a Notion page or a [wiki database](https://www.notion.so/help/wikis-and-verified-pages).

This endpoint requires an integration to have insert content capabilities. Attempting to call this API without insert content capabilities will return an HTTP response with a 403 status code. For more information on integration capabilities, see the [capabilities guide](/reference/capabilities).

Creating new `status` database properties is currently not supported.

### Errors

Returns a 404 if the specified parent page does not exist, or if the integration does not have access to the parent page.

Returns a 400 if the request is incorrectly formatted, or a 429 HTTP response if the request exceeds the [request limits](/reference/request-limits).

*Note: Each Public API endpoint can return several possible error codes. See the [Error codes section](https://developers.notion.com/reference/status-codes#error-codes) of the Status codes documentation for more information.*

Reference: https://notion.ferndocs.com/reference/create-a-database

## Request

### Headers

- `Notion-Version` (string, required) — The [API version](/reference/versioning) to use for this request. The latest version is `<<latestNotionVersion>>`.

### Body (application/json)

This endpoint expects an object.

- `parent` (V1DatabasesPostRequestBodyContentApplicationJsonSchemaParent, required) — A [page parent](/reference/database#page-parent)
- `properties` (string, required) — Property schema of database. The keys are the names of properties as they appear in Notion and the values are [property schema objects](https://developers.notion.com/reference/property-schema-object).
- `title` (list of V1DatabasesPostRequestBodyContentApplicationJsonSchemaTitleItems, optional) — Title of database as it appears in Notion. An array of [rich text objects](ref:rich-text).

## Response

### 200

200

## Errors

### 400 Bad Request Error

400

## Types

### V1DatabasesPostRequestBodyContentApplicationJsonSchemaParent

The parent page or workspace where the database will be created.

- `type` (enum, required) — The type of parent under which to create the database. Either "page_id" or "workspace".
  - Allowed values: `"page_id"`, `"workspace"`
- `page_id` (string, optional) — ID of the new database's parent page, when `type=page_id`. This is a UUIDv4, with or without dashes.
- `workspace` (enum, optional) — Always `true` when `type=workspace`.
  - Allowed values: `true`

### V1DatabasesPostRequestBodyContentApplicationJsonSchemaTitleItems

- `annotations` (V1DatabasesPostRequestBodyContentApplicationJsonSchemaTitleItemsAnnotations, optional) — The styling for the rich text.
- `plain_text` (string, optional) — The plain text content of the rich text object, without any styling.
- `href` (string, optional) — A URL that the rich text object links to or mentions.
- `type` (enum, optional)
  - Allowed values: `"text"`, `"mention"`, `"equation"`

### V1DatabasesPostRequestBodyContentApplicationJsonSchemaTitleItemsAnnotations

The styling for the rich text.

- `bold` (boolean, optional, default: false) — Whether the text is formatted as bold.
- `italic` (boolean, optional, default: false) — Whether the text is formatted as italic.
- `strikethrough` (boolean, optional, default: false) — Whether the text is formatted with a strikethrough.
- `underline` (boolean, optional, default: false) — Whether the text is formatted with an underline.
- `code` (boolean, optional, default: false) — Whether the text is formatted as code.
- `color` (enum, optional, default: "default") — The color of the text.
  - Allowed values: `"default"`, `"gray"`, `"brown"`, `"orange"`, `"yellow"`, `"green"`, `"blue"`, `"purple"`, `"pink"`, `"red"`, `"default_background"`, `"gray_background"`, `"brown_background"`, `"orange_background"`, `"yellow_background"`, `"green_background"`, `"blue_background"`, `"purple_background"`, `"pink_background"`, `"red_background"`

## Examples

**Request**

```json
{
  "parent": {
    "type": "\"page_id\""
  },
  "properties": "string"
}
```

**Response**

```json
{}
```

**SDK Code**

```javascript Notion SDK for JavaScript
const { Client } = require('@notionhq/client');

const notion = new Client({ auth: process.env.NOTION_API_KEY });

(async () => {
  const response = await notion.databases.create({
      parent: {
        type: "page_id",
        page_id: "98ad959b-2b6a-4774-80ee-00246fb0ea9b",
      },
      icon: {
        type: "emoji",
        emoji: "📝",
      },
      cover: {
        type: "external",
        external: {
          url: "https://website.domain/images/image.png",
        },
      },
      title: [
        {
          type: "text",
          text: {
            content: "Grocery List",
            link: null,
          },
        },
      ],
      properties: {
        Name: {
          title: {},
        },
        Description: {
          rich_text: {},
        },
        "In stock": {
          checkbox: {},
        },
        "Food group": {
          select: {
            options: [
              {
                name: "🥦Vegetable",
                color: "green",
              },
              {
                name: "🍎Fruit",
                color: "red",
              },
              {
                name: "💪Protein",
                color: "yellow",
              },
            ],
          },
        },
        Price: {
          number: {
            format: "dollar",
          },
        },
        "Last ordered": {
          date: {},
        },
        Meals: {
          relation: {
            database_id: "668d797c-76fa-4934-9b05-ad288df2d136",
            single_property: {},
          },
        },
        "Number of meals": {
          rollup: {
            rollup_property_name: "Name",
            relation_property_name: "Meals",
            function: "count",
          },
        },
        "Store availability": {
          type: "multi_select",
          multi_select: {
            options: [
              {
                name: "Duc Loi Market",
                color: "blue",
              },
              {
                name: "Rainbow Grocery",
                color: "gray",
              },
              {
                name: "Nijiya Market",
                color: "purple",
              },
              {
                name: "Gus'''s Community Market",
                color: "yellow",
              },
            ],
          },
        },
        "+1": {
          people: {},
        },
        Photo: {
          files: {},
        },
      },
    });
  console.log(response);
})();
```

```python
import requests

url = "https://api.notion.com/v1/databases/"

payload = {
    "parent": { "type": "\"page_id\"" },
    "properties": "string"
}
headers = {
    "Notion-Version": "Notion-Version",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.notion.com/v1/databases/"

	payload := strings.NewReader("{\n  \"parent\": {\n    \"type\": \"\\\"page_id\\\"\"\n  },\n  \"properties\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Notion-Version", "Notion-Version")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.notion.com/v1/databases/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Notion-Version"] = 'Notion-Version'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parent\": {\n    \"type\": \"\\\"page_id\\\"\"\n  },\n  \"properties\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.notion.com/v1/databases/")
  .header("Notion-Version", "Notion-Version")
  .header("Content-Type", "application/json")
  .body("{\n  \"parent\": {\n    \"type\": \"\\\"page_id\\\"\"\n  },\n  \"properties\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.notion.com/v1/databases/', [
  'body' => '{
  "parent": {
    "type": "\\"page_id\\""
  },
  "properties": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'Notion-Version' => 'Notion-Version',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.notion.com/v1/databases/");
var request = new RestRequest(Method.POST);
request.AddHeader("Notion-Version", "Notion-Version");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"parent\": {\n    \"type\": \"\\\"page_id\\\"\"\n  },\n  \"properties\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Notion-Version": "Notion-Version",
  "Content-Type": "application/json"
]
let parameters = [
  "parent": ["type": "\"page_id\""],
  "properties": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.notion.com/v1/databases/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```