データベースを更新
PATCH
/v1/databases/{database_id}データベースを更新します。
Requestパラメータ
Pathパラメータ
database_id
string
必須
Notionデータベースの識別子
Headerパラメータ
Notion-Version
string
可選
Request Bodyパラメータapplication/json
properties
object
必須
JSONオブジェクトの形式で、リクエストで変更されるデータベースのプロパティ。既存のプロパティを更新する場合、キーはNotionに表示されるプロパティの名前またはIDであり、値はプロパティスキーマオブジェクトです。新しいプロパティを追加する場合、キーは新しいデータベースプロパティの名前で、値はプロパティスキーマオブジェクトです。
Wine Pairing
object
可選
+1
null
必須
Photo
object
必須
Store availability
object
必須
title
array [object {1}]
必須
Notion UIに表示されるデータベースのタイトルを表すリッチテキストオブジェクトの配列。省略した場合、データベースのタイトルは変更されません。
text
object
可選
description
array [object {1}]
必須
Notion UIに表示されるデータベースの説明を表すリッチテキストオブジェクトの配列。省略された場合、データベースの説明は変更されません。
text
object
可選
例
{
"properties": {
"Wine Pairing": {
"rich_text": {}
}
},
"title": [
{
"text": {
"content": "Ever Better Reading List Title"
}
}
]
}
サンプルコード
Response
成功例(200)
不正なRequest(400)
レコードが存在しない(404)
レート制限(429)
HTTPステータスコード: 200
コンテンツ形式: JSONapplication/json
データ構造
object
string
必須
id
string
必須
created_time
string
必須
last_edited_time
string
必須
parent
object
必須
type
string
必須
page_id
string
必須
icon
object
必須
type
string
必須
emoji
string
必須
cover
object
必須
type
string
必須
external
object
必須
url
string
必須
title
array [object {5}]
必須
type
string
可選
text
object
可選
annotations
object
可選
plain_text
string
可選
href
null
可選
description
array [object {5}]
必須
type
string
可選
text
object
可選
annotations
object
可選
plain_text
string
可選
href
null
可選
properties
object
必須
Name
object
必須
Description
object
必須
In stock
object
必須
Food group
object
必須
Price
object
必須
Cost of next trip
object
必須
Last ordered
object
必須
Meals
object
必須
Number of meals
object
必須
Store availability
object
必須
Photo
object
必須
is_inline
boolean
必須
例200 Success - Update a database
{
"object": "database",
"id": "668d797c-76fa-4934-9b05-ad288df2d136",
"created_time": "2020-03-17T19:10:00.000Z",
"last_edited_time": "2021-08-11T17:26:00.000Z",
"parent": {
"type": "page_id",
"page_id": "48f8fee9-cd79-4180-bc2f-ec0398253067"
},
"icon": {
"type": "emoji",
"emoji": "📝"
},
"cover": {
"type": "external",
"external": {
"url": "https://website.domain/images/image.png"
}
},
"url": "https://www.notion.so/668d797c76fa49349b05ad288df2d136",
"title": [
{
"type": "text",
"text": {
"content": "Today'\''s grocery list",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Today'\''s grocery list",
"href": null
}
],
"description": [
{
"type": "text",
"text": {
"content": "Grocery list for just kale 🥬",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Grocery list for just kale 🥬",
"href": null
}
],
"properties": {
"Name": {
"id": "title",
"name": "Name",
"type": "title",
"title": {}
},
"Description": {
"id": "J@cS",
"name": "Description",
"type": "rich_text",
"rich_text": {}
},
"In stock": {
"id": "{xY`",
"name": "In stock",
"type": "checkbox",
"checkbox": {}
},
"Food group": {
"id": "TJmr",
"name": "Food group",
"type": "select",
"select": {
"options": [
{
"id": "96eb622f-4b88-4283-919d-ece2fbed3841",
"name": "🥦Vegetable",
"color": "green"
},
{
"id": "bb443819-81dc-46fb-882d-ebee6e22c432",
"name": "🍎Fruit",
"color": "red"
},
{
"id": "7da9d1b9-8685-472e-9da3-3af57bdb221e",
"name": "💪Protein",
"color": "yellow"
}
]
}
},
"Price": {
"id": "cU^N",
"name": "Price",
"type": "number",
"number": {
"format": "dollar"
}
},
"Cost of next trip": {
"id": "p:sC",
"name": "Cost of next trip",
"type": "formula",
"formula": {
"value": "if(prop(\"In stock\"), 0, prop(\"Price\"))"
}
},
"Last ordered": {
"id": "]\\R[",
"name": "Last ordered",
"type": "date",
"date": {}
},
"Meals": {
"id": "gqk%60",
"name": "Meals",
"type": "relation",
"relation": {
"database": "668d797c-76fa-4934-9b05-ad288df2d136",
"synced_property_name": null
}
},
"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": "G%7Dji",
"name": "Store availability",
"type": "multi_select",
"multi_select": {
"options": [
[
{
"id": "d209b920-212c-4040-9d4a-bdf349dd8b2a",
"name": "Duc Loi Market",
"color": "blue"
},
{
"id": "70104074-0f91-467b-9787-00d59e6e1e41",
"name": "Rainbow Grocery",
"color": "gray"
},
{
"id": "6c3867c5-d542-4f84-b6e9-a420c43094e7",
"name": "Gus's Community Market",
"color": "yellow"
},
{
"id": "a62fbb5f-fed4-44a4-8cac-cba5f518c1a1",
"name": "The Good Life Grocery",
"color": "orange"
}
]
]
}
}
"Photo": {
"id": "aTIT",
"name": "Photo",
"type": "url",
"url": {}
}
},
"is_inline": false
}
最終更新: 2 years ago