> 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 data source

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

Use this API to add an additional [data source](/reference/data-source)  to an existing [database](/reference/database). The `properties` follow the [same structure](/reference/property-object)  as the initial schema passed to `initial_data_source[properties]` in the [Create a database](/reference/database-create6ee911d9) API, but can be managed independently of the `properties` of any sibling data sources.

A standard "table" view is created alongside the new data source. To customize database views, use the Notion app. Managing views is not currently supported in the API.


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

## Request

### Body (application/json)

This endpoint expects an object.

- `parent` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaParent, required) — An object specifying the parent of the new data source to be created.
- `properties` (V1DataSourcesPostRequestBodyContentApplicationJsonSchema, required) — Property schema of the new data source.
- `title` (list of V1DataSourcesPostRequestBodyContentApplicationJsonSchemaTitleItems, optional) — Title of data source as it appears in Notion.
- `icon` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaIcon, optional) — Icon to apply to the data source.

## Response

### 200

200

- `object` (string, optional)
- `id` (string, optional)
- `created_time` (string, optional)
- `last_edited_time` (string, optional)
- `properties` (V1DataSourcesPostResponsesContentApplicationJsonSchema, optional)
- `parent` (V1DataSourcesPostResponsesContentApplicationJsonSchemaParent, optional)
- `database_parent` (V1DataSourcesPostResponsesContentApplicationJsonSchemaDatabaseParent, optional)
- `archived` (boolean, optional, default: true)
- `is_inline` (boolean, optional, default: true)
- `icon` (V1DataSourcesPostResponsesContentApplicationJsonSchemaIcon, optional)
- `cover` (V1DataSourcesPostResponsesContentApplicationJsonSchemaCover, optional)
- `url` (string, optional)
- `title` (list of V1DataSourcesPostResponsesContentApplicationJsonSchemaTitleItems, optional)

## Types

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaParent

An object specifying the parent of the new data source to be created.

- `database_id` (string, required) — The ID of the parent database (with or without dashes), for example, 195de9221179449fab8075a27c979105
- `type` (enum, optional) — Always `database_id`.
  - Allowed values: `"database_id"`

### V1DataSourcesPostRequestBodyContentApplicationJsonSchema

Property schema of the new data source.

- `<propertyIdentifier>` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifier, optional) — Hash map of strings (property identifiers) corresponding to the configuration of each property. The `type` of each property can be omitted, but you must provide a sub-object whose parameter name matches the type, even if it's an empty object. For example, \{"type": "date", "date": \{}} and \{"date": \{}} are both valid values, but \{"type": "date"}\` is not.

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaTitleItems

- `annotations` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaTitleItemsAnnotations, 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"`

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaIcon

Icon to apply to the data source.

- `type` (enum, optional) — The type of icon parameter being provided.
  - Allowed values: `"file_upload"`, `"emoji"`, `"external"`, `"custom_emoji"`
- `emoji` (string, optional) — When `type=emoji`, an emoji character.
- `file_upload` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaIconFileUpload, optional) — When `type=file_upload`, an object containing the `id` of the File Upload.
- `external` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaIconExternal, optional) — When `type=external`, an object containing the external URL.
- `custom_emoji` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaIconCustomEmoji, optional) — When `type=custom_emoji`, an object containing the custom emoji.

### V1DataSourcesPostResponsesContentApplicationJsonSchema

- `+1` (V1DataSourcesPostResponsesContentApplicationJsonSchema1, optional)
- `In stock` (V1DataSourcesPostResponsesContentApplicationJsonSchemaInStock, optional)
- `Price` (V1DataSourcesPostResponsesContentApplicationJsonSchemaPrice, optional)
- `Description` (V1DataSourcesPostResponsesContentApplicationJsonSchemaDescription, optional)
- `Last ordered` (V1DataSourcesPostResponsesContentApplicationJsonSchemaLastOrdered, optional)
- `Meals` (V1DataSourcesPostResponsesContentApplicationJsonSchemaMeals, optional)
- `Number of meals` (V1DataSourcesPostResponsesContentApplicationJsonSchemaNumberOfMeals, optional)
- `Store availability` (V1DataSourcesPostResponsesContentApplicationJsonSchemaStoreAvailability, optional)
- `Photo` (V1DataSourcesPostResponsesContentApplicationJsonSchemaPhoto, optional)
- `Food group` (V1DataSourcesPostResponsesContentApplicationJsonSchemaFoodGroup, optional)
- `Name` (V1DataSourcesPostResponsesContentApplicationJsonSchemaName, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaParent

- `type` (string, optional)
- `database_id` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaDatabaseParent

- `type` (string, optional)
- `page_id` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaIcon

- `type` (string, optional)
- `emoji` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaCover

- `type` (string, optional)
- `external` (V1DataSourcesPostResponsesContentApplicationJsonSchemaCoverExternal, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaTitleItems

- `type` (string, optional)
- `text` (V1DataSourcesPostResponsesContentApplicationJsonSchemaTitleItemsText, optional)
- `annotations` (V1DataSourcesPostResponsesContentApplicationJsonSchemaTitleItemsAnnotations, optional)
- `plain_text` (string, optional)
- `href` (any, optional)

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifier

Hash map of strings (property identifiers) corresponding to the configuration of each property. The `type` of each property can be omitted, but you must provide a sub-object whose parameter name matches the type, even if it's an empty object. For example, \{"type": "date", "date": \{}} and \{"date": \{}} are both valid values, but \{"type": "date"}\` is not.

- `description` (string, optional) — The property's description (optional).
- `type` (enum, optional) — The type of property.
  - Allowed values: `"number"`, `"formula"`, `"select"`, `"multi_select"`, `"status"`, `"relation"`, `"rollup"`, `"unique_id"`, `"title"`, `"rich_text"`, `"url"`, `"people"`, `"files"`, `"email"`, `"phone_number"`, `"date"`, `"checkbox"`, `"created_by"`, `"created_time"`, `"last_edited_by"`, `"last_edited_time"`, `"button"`, `"location"`, `"verification"`, `"last_visited_time"`, `"place"`
- `number` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierNumber, optional)
- `formula` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierFormula, optional)
- `select` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierSelect, optional)
- `multi_select` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierMultiSelect, optional)
- `relation` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierRelation, optional)
- `rollup` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierRollup, optional)
- `unique_id` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierUniqueId, optional)

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaTitleItemsAnnotations

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"`

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaIconFileUpload

When `type=file_upload`, an object containing the `id` of the File Upload.

- `id` (string, required) — ID of a FileUpload object that has the status `uploaded`.

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaIconExternal

When `type=external`, an object containing the external URL.

- `url` (string, required) — The URL of the external file.

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaIconCustomEmoji

When `type=custom_emoji`, an object containing the custom emoji.

- `id` (string, required) — The ID of the custom emoji.
- `name` (string, optional) — The name of the custom emoji.
- `url` (string, optional) — The URL of the custom emoji.

### V1DataSourcesPostResponsesContentApplicationJsonSchema1

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `people` (V1DataSourcesPostResponsesContentApplicationJsonSchema1People, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaInStock

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `checkbox` (V1DataSourcesPostResponsesContentApplicationJsonSchemaInStockCheckbox, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaPrice

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `number` (V1DataSourcesPostResponsesContentApplicationJsonSchemaPriceNumber, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaDescription

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `rich_text` (V1DataSourcesPostResponsesContentApplicationJsonSchemaDescriptionRichText, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaLastOrdered

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `date` (V1DataSourcesPostResponsesContentApplicationJsonSchemaLastOrderedDate, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaMeals

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `relation` (V1DataSourcesPostResponsesContentApplicationJsonSchemaMealsRelation, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaNumberOfMeals

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `rollup` (V1DataSourcesPostResponsesContentApplicationJsonSchemaNumberOfMealsRollup, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaStoreAvailability

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `multi_select` (V1DataSourcesPostResponsesContentApplicationJsonSchemaStoreAvailabilityMultiSelect, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaPhoto

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `files` (V1DataSourcesPostResponsesContentApplicationJsonSchemaPhotoFiles, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaFoodGroup

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `select` (V1DataSourcesPostResponsesContentApplicationJsonSchemaFoodGroupSelect, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaName

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)
- `title` (V1DataSourcesPostResponsesContentApplicationJsonSchemaNameTitle, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaCoverExternal

- `url` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaTitleItemsText

- `content` (string, optional)
- `link` (any, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaTitleItemsAnnotations

- `bold` (boolean, optional, default: true)
- `italic` (boolean, optional, default: true)
- `strikethrough` (boolean, optional, default: true)
- `underline` (boolean, optional, default: true)
- `code` (boolean, optional, default: true)
- `color` (string, optional)

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierNumber

- `format` (enum, optional) — The format of the number property.
  - Allowed values: `"number"`, `"number_with_commas"`, `"percent"`, `"dollar"`, `"australian_dollar"`, `"canadian_dollar"`, `"singapore_dollar"`, `"euro"`, `"pound"`, `"yen"`, `"ruble"`, `"rupee"`, `"won"`, `"yuan"`, `"real"`, `"lira"`, `"rupiah"`, `"franc"`, `"hong_kong_dollar"`, `"new_zealand_dollar"`, `"krona"`, `"norwegian_krone"`, `"mexican_peso"`, `"rand"`, `"new_taiwan_dollar"`, `"danish_krone"`, `"zloty"`, `"baht"`, `"forint"`, `"koruna"`, `"shekel"`, `"chilean_peso"`, `"philippine_peso"`, `"dirham"`, `"colombian_peso"`, `"riyal"`, `"ringgit"`, `"leu"`, `"argentine_peso"`, `"uruguayan_peso"`, `"peruvian_sol"`, ``

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierFormula

- `expression` (string, optional) — A valid Notion formula expression.

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierSelect

- `options` (list of V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierSelectOptionsItems, optional)

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierMultiSelect

- `color` (enum, optional)
  - Allowed values: `"default"`, `"gray"`, `"brown"`, `"orange"`, `"yellow"`, `"green"`, `"blue"`, `"purple"`, `"pink"`, `"red"`, ``
- `description` (string, optional)

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierRelation

- `type` (enum, optional)
  - Allowed values: `"single_property"`, `"dual_property"`
- `single_property` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierRelationSingleProperty, optional) — An empty object `{}`.
- `dual_property` (V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierRelationDualProperty, optional)

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierRollup

- `function` (enum, required)
  - Allowed values: `"count"`, `"count_values"`, `"empty"`, `"not_empty"`, `"unique"`, `"show_unique"`, `"percent_empty"`, `"percent_not_empty"`, `"sum"`, `"average"`, `"median"`, `"min"`, `"max"`, `"range"`, `"earliest_date"`, `"latest_date"`, `"date_range"`, `"checked"`, `"unchecked"`, `"percent_checked"`, `"percent_unchecked"`, `"count_per_group"`, `"percent_per_group"`, `"show_original"`
- `relation_property_name` (string, optional)
- `relation_property_id` (string, optional)
- `rollup_property_name` (string, optional)
- `rollup_property_id` (string, optional)

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierUniqueId

- `prefix` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchema1People

### V1DataSourcesPostResponsesContentApplicationJsonSchemaInStockCheckbox

### V1DataSourcesPostResponsesContentApplicationJsonSchemaPriceNumber

- `format` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaDescriptionRichText

### V1DataSourcesPostResponsesContentApplicationJsonSchemaLastOrderedDate

### V1DataSourcesPostResponsesContentApplicationJsonSchemaMealsRelation

- `database_id` (string, optional)
- `synced_property_name` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaNumberOfMealsRollup

- `rollup_property_name` (string, optional)
- `relation_property_name` (string, optional)
- `rollup_property_id` (string, optional)
- `relation_property_id` (string, optional)
- `function` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaStoreAvailabilityMultiSelect

- `options` (list of V1DataSourcesPostResponsesContentApplicationJsonSchemaStoreAvailabilityMultiSelectOptionsItems, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaPhotoFiles

### V1DataSourcesPostResponsesContentApplicationJsonSchemaFoodGroupSelect

- `options` (list of V1DataSourcesPostResponsesContentApplicationJsonSchemaFoodGroupSelectOptionsItems, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaNameTitle

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierSelectOptionsItems

- `color` (enum, optional)
  - Allowed values: `"default"`, `"gray"`, `"brown"`, `"orange"`, `"yellow"`, `"green"`, `"blue"`, `"purple"`, `"pink"`, `"red"`, ``
- `description` (string, optional)

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierRelationSingleProperty

An empty object `{}`.

### V1DataSourcesPostRequestBodyContentApplicationJsonSchemaPropertyIdentifierRelationDualProperty

- `synced_property_id` (string, optional)
- `synced_property_name` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaStoreAvailabilityMultiSelectOptionsItems

- `id` (string, optional)
- `name` (string, optional)
- `color` (string, optional)

### V1DataSourcesPostResponsesContentApplicationJsonSchemaFoodGroupSelectOptionsItems

- `id` (string, optional)
- `name` (string, optional)
- `color` (string, optional)

## Examples

**Request**

```json
{
  "parent": {
    "database_id": "string"
  }
}
```

**Response**

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

**SDK Code**

```javascript
import { Client } from "@notionhq/client"

const notion = new Client({
  auth: "{ACCESS_TOKEN}",
  notionVersion: "2025-09-03",
})

try {
  const response = await notion.dataSources.create({
    parent: {
      type: "database_id",
      database_id: "6ee911d9-189c-4844-93e8-260c1438b6e4",
    },
    properties: {
      Title: {
        type: "title",
        title: {}
      },
      Count: {
        type: "number",
        number: {}
      }
    },
    title: [
      {
        type: "text",
        text: {content: "New child data source"}
      }
    ]
  })

  const dataSourceId = response.id
  console.log("Successfully created data source with ID:", dataSourceId)

} catch (error) {
  // Handle `APIResponseError`
  console.error(error)
}
```

```python
import requests

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

payload = { "parent": { "database_id": "string" } }
headers = {"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/data_sources"

	payload := strings.NewReader("{\n  \"parent\": {\n    \"database_id\": \"string\"\n  }\n}")

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

	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/data_sources")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parent\": {\n    \"database_id\": \"string\"\n  }\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/data_sources")
  .header("Content-Type", "application/json")
  .body("{\n  \"parent\": {\n    \"database_id\": \"string\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.notion.com/v1/data_sources', [
  'body' => '{
  "parent": {
    "database_id": "string"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["parent": ["database_id": "string"]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.notion.com/v1/data_sources")! 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()
```