Skip to navigation

Update a data source

Updates the data source object — the properties, title, description, or whether it’s in the trash — of a specified data source under a database.

Returns the updated data source object.

Use the parent parameter to move the data source to a different database_id. If you do so, any existing views that refer to the data source in the current database continue to exist, but become linked views. A new standard “table” view for the moved data source is created under the new (destination) database. Use the Notion app to make any further changes to the views; managing views using the API is not currently supported.

Data source properties represent the columns (or schema) of a data source. To update the properties of a data source, use the properties body param with this endpoint. Learn more about data source properties in the data source properties and Update data source properties docs.

To update a relation data source property, share the related database with the integration. Learn more about relations in the data source properties page.

For an overview of how to use the REST API with databases, refer to the Working with databases guide.

How data sources property type changes work

All properties in pages are stored as rich text. Notion will convert that rich text based on the types defined in a data source’s schema. When a type is changed using the API, the data will continue to be available, it is just presented differently.

For example, a multi select property value is represented as a comma-separated list of strings (eg. “1, 2, 3”) and a people property value is represented as a comma-separated list of IDs. These are compatible and the type can be converted.

Note: Not all type changes work. In some cases data will no longer be returned, such as people type → file type.

Interacting with data source rows

This endpoint cannot be used to update data source rows.

To update the properties of a data source row — rather than a column — use the Update page properties endpoint. To add a new row to a database, use the Create a page endpoint.

Developers are encouraged to keep their data source schema size to a maximum of 50KB. To stay within this schema size limit, the number of properties (or columns) added to a data source should be managed.

Data source schema updates that are too large will be blocked by the REST API to help developers keep their data source queries performant.

Errors

Each Public API endpoint can return several possible error codes. See the Error codes section of the Status codes documentation for more information.

The following data source properties cannot be updated via the API
Data source relations must be shared with your integration

To update a data source relation property, the related database must also be shared with your integration.

Path parameters

data_source_idstringRequired
ID of a Notion data source. This is a UUIDv4, with or without dashes.

Headers

Notion-VersionstringRequired

The API version to use for this request. The latest version is <<internalLatestNotionVersion>>.

Request

This endpoint expects an object.
propertiesobjectOptional
titlelist of objectsOptional
iconobjectOptional

Optionally provide a new icon object to update the data source’s icon, or provide null to remove the existing icon.

in_trashbooleanOptional

Pass true to move a data source to the trash, or false to restore it from the trash.

parentobjectOptional
The parent of the data source, when moving it to a different database. If not provided, the parent will not be updated.

Response

200
objectstringOptional
idstringOptional
created_timestringOptional
last_edited_timestringOptional
propertiesobjectOptional
parentobjectOptional
database_parentobjectOptional
archivedbooleanOptionalDefaults to true
is_inlinebooleanOptionalDefaults to true
iconobjectOptional
coverobjectOptional
urlstringOptional
titlelist of objectsOptional

Errors

400
Bad Request Error