@notionhq/notion-mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +58 -0
- package/bin/cli.mjs +71 -0
- package/package.json +57 -0
- package/scripts/build-cli.js +30 -0
- package/scripts/notion-openapi.json +1032 -0
- package/scripts/start-server.ts +70 -0
- package/src/openapi-mcp-server/README.md +1 -0
- package/src/openapi-mcp-server/auth/index.ts +2 -0
- package/src/openapi-mcp-server/auth/template.ts +24 -0
- package/src/openapi-mcp-server/auth/types.ts +26 -0
- package/src/openapi-mcp-server/client/__tests__/http-client-upload.test.ts +205 -0
- package/src/openapi-mcp-server/client/__tests__/http-client.integration.test.ts +173 -0
- package/src/openapi-mcp-server/client/__tests__/http-client.test.ts +537 -0
- package/src/openapi-mcp-server/client/http-client.ts +192 -0
- package/src/openapi-mcp-server/index.ts +3 -0
- package/src/openapi-mcp-server/mcp/__tests__/proxy.test.ts +270 -0
- package/src/openapi-mcp-server/mcp/proxy.ts +170 -0
- package/src/openapi-mcp-server/openapi/__tests__/file-upload.test.ts +100 -0
- package/src/openapi-mcp-server/openapi/__tests__/parser-multipart.test.ts +602 -0
- package/src/openapi-mcp-server/openapi/__tests__/parser.test.ts +1448 -0
- package/src/openapi-mcp-server/openapi/file-upload.ts +40 -0
- package/src/openapi-mcp-server/openapi/parser.ts +519 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,1032 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Notion API",
|
|
5
|
+
"version": "1"
|
|
6
|
+
},
|
|
7
|
+
"servers": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://api.notion.com"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"components": {
|
|
13
|
+
"securitySchemes": {
|
|
14
|
+
"bearerAuth": {
|
|
15
|
+
"type": "http",
|
|
16
|
+
"scheme": "bearer"
|
|
17
|
+
},
|
|
18
|
+
"basicAuth": {
|
|
19
|
+
"type": "http",
|
|
20
|
+
"scheme": "basic"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"parameters": {
|
|
24
|
+
"notionVersion": {
|
|
25
|
+
"name": "Notion-Version",
|
|
26
|
+
"in": "header",
|
|
27
|
+
"required": true,
|
|
28
|
+
"schema": {
|
|
29
|
+
"enum": ["2022-06-28"]
|
|
30
|
+
},
|
|
31
|
+
"description": "The [API version](https://developers.notion.com/reference/versioning) to use for this request. The latest version is `2022-06-28`."
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"schemas": {
|
|
35
|
+
"pageIdObject": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"properties": {
|
|
38
|
+
"page_id": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["page_id"]
|
|
44
|
+
},
|
|
45
|
+
"databaseIdObject": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"properties": {
|
|
48
|
+
"database_id": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"required": ["database_id"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"security": [
|
|
58
|
+
{
|
|
59
|
+
"bearerAuth": []
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"paths": {
|
|
63
|
+
"/v1/users/{user_id}": {
|
|
64
|
+
"get": {
|
|
65
|
+
"summary": "Retrieve a user",
|
|
66
|
+
"description": "",
|
|
67
|
+
"operationId": "get-user",
|
|
68
|
+
"parameters": [
|
|
69
|
+
{
|
|
70
|
+
"name": "user_id",
|
|
71
|
+
"in": "path",
|
|
72
|
+
"required": true,
|
|
73
|
+
"schema": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"format": "uuid"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"responses": {
|
|
80
|
+
"200": {
|
|
81
|
+
"description": "200",
|
|
82
|
+
"content": {
|
|
83
|
+
"application/json": {
|
|
84
|
+
"examples": {
|
|
85
|
+
"Result": {
|
|
86
|
+
"value": "{\n \"object\": \"user\",\n \"id\": \"d40e767c-d7af-4b18-a86d-55c61f1e39a4\",\n \"type\": \"person\",\n\t\"person\": {\n\t\t\"email\": \"avo@example.org\",\n\t},\n \"name\": \"Avocado Lovelace\",\n \"avatar_url\": \"https://secure.notion-static.com/e6a352a8-8381-44d0-a1dc-9ed80e62b53d.jpg\",\n}"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"400": {
|
|
93
|
+
"description": "400",
|
|
94
|
+
"content": {
|
|
95
|
+
"application/json": {
|
|
96
|
+
"examples": {
|
|
97
|
+
"Result": {
|
|
98
|
+
"value": "{}"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"schema": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"properties": {}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"deprecated": false,
|
|
110
|
+
"security": []
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"/v1/users": {
|
|
114
|
+
"get": {
|
|
115
|
+
"summary": "List all users",
|
|
116
|
+
"operationId": "get-users",
|
|
117
|
+
"parameters": [
|
|
118
|
+
{
|
|
119
|
+
"name": "start_cursor",
|
|
120
|
+
"in": "query",
|
|
121
|
+
"description": "If supplied, this endpoint will return a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results.",
|
|
122
|
+
"schema": {
|
|
123
|
+
"type": "string"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "page_size",
|
|
128
|
+
"in": "query",
|
|
129
|
+
"description": "The number of items from the full list desired in the response. Maximum: 100",
|
|
130
|
+
"schema": {
|
|
131
|
+
"type": "integer",
|
|
132
|
+
"default": 100
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"responses": {
|
|
137
|
+
"400": {
|
|
138
|
+
"description": "400",
|
|
139
|
+
"content": {
|
|
140
|
+
"application/json": {
|
|
141
|
+
"examples": {
|
|
142
|
+
"Result": {
|
|
143
|
+
"value": "{}"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"schema": {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"properties": {}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"deprecated": false
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"/v1/users/me": {
|
|
158
|
+
"get": {
|
|
159
|
+
"summary": "Retrieve your token's bot user",
|
|
160
|
+
"description": "",
|
|
161
|
+
"operationId": "get-self",
|
|
162
|
+
"parameters": [],
|
|
163
|
+
"responses": {
|
|
164
|
+
"200": {
|
|
165
|
+
"description": "200",
|
|
166
|
+
"content": {
|
|
167
|
+
"application/json": {
|
|
168
|
+
"examples": {
|
|
169
|
+
"Result": {
|
|
170
|
+
"value": "{\n \"object\": \"user\",\n \"id\": \"16d84278-ab0e-484c-9bdd-b35da3bd8905\",\n \"name\": \"pied piper\",\n \"avatar_url\": null,\n \"type\": \"bot\",\n \"bot\": {\n \"owner\": {\n \"type\": \"user\",\n \"user\": {\n \"object\": \"user\",\n \"id\": \"5389a034-eb5c-47b5-8a9e-f79c99ef166c\",\n \"name\": \"christine makenotion\",\n \"avatar_url\": null,\n \"type\": \"person\",\n \"person\": {\n \"email\": \"christine@makenotion.com\"\n }\n }\n }\n }\n}"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"schema": {
|
|
174
|
+
"type": "object",
|
|
175
|
+
"properties": {
|
|
176
|
+
"object": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"example": "user"
|
|
179
|
+
},
|
|
180
|
+
"id": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"example": "16d84278-ab0e-484c-9bdd-b35da3bd8905"
|
|
183
|
+
},
|
|
184
|
+
"name": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"example": "pied piper"
|
|
187
|
+
},
|
|
188
|
+
"avatar_url": {},
|
|
189
|
+
"type": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"example": "bot"
|
|
192
|
+
},
|
|
193
|
+
"bot": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"properties": {
|
|
196
|
+
"owner": {
|
|
197
|
+
"type": "object",
|
|
198
|
+
"properties": {
|
|
199
|
+
"type": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"example": "user"
|
|
202
|
+
},
|
|
203
|
+
"user": {
|
|
204
|
+
"type": "object",
|
|
205
|
+
"properties": {
|
|
206
|
+
"object": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"example": "user"
|
|
209
|
+
},
|
|
210
|
+
"id": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"example": "5389a034-eb5c-47b5-8a9e-f79c99ef166c"
|
|
213
|
+
},
|
|
214
|
+
"name": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"example": "christine makenotion"
|
|
217
|
+
},
|
|
218
|
+
"avatar_url": {},
|
|
219
|
+
"type": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"example": "person"
|
|
222
|
+
},
|
|
223
|
+
"person": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"properties": {
|
|
226
|
+
"email": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"example": "christine@makenotion.com"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"deprecated": false,
|
|
245
|
+
"security": []
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"/v1/databases/{database_id}/query": {
|
|
249
|
+
"post": {
|
|
250
|
+
"summary": "Query a database",
|
|
251
|
+
"description": "",
|
|
252
|
+
"operationId": "post-database-query",
|
|
253
|
+
"parameters": [
|
|
254
|
+
{
|
|
255
|
+
"name": "database_id",
|
|
256
|
+
"in": "path",
|
|
257
|
+
"description": "Identifier for a Notion database.",
|
|
258
|
+
"schema": {
|
|
259
|
+
"type": "string"
|
|
260
|
+
},
|
|
261
|
+
"required": true
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "filter_properties",
|
|
265
|
+
"in": "query",
|
|
266
|
+
"description": "A list of page property value IDs associated with the database. Use this param to limit the response to a specific page property value or values for pages that meet the `filter` criteria.",
|
|
267
|
+
"schema": {
|
|
268
|
+
"type": "array",
|
|
269
|
+
"items": {
|
|
270
|
+
"type": "string"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"requestBody": {
|
|
276
|
+
"content": {
|
|
277
|
+
"application/json": {
|
|
278
|
+
"schema": {
|
|
279
|
+
"type": "object",
|
|
280
|
+
"properties": {
|
|
281
|
+
"filter": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"description": "When supplied, limits which pages are returned based on the [filter conditions](ref:post-database-query-filter).",
|
|
284
|
+
"format": "json"
|
|
285
|
+
},
|
|
286
|
+
"sorts": {
|
|
287
|
+
"type": "array",
|
|
288
|
+
"description": "When supplied, orders the results based on the provided [sort criteria](ref:post-database-query-sort).",
|
|
289
|
+
"items": {
|
|
290
|
+
"type": "object",
|
|
291
|
+
"required": ["property", "direction"],
|
|
292
|
+
"properties": {
|
|
293
|
+
"property": {
|
|
294
|
+
"type": "string"
|
|
295
|
+
},
|
|
296
|
+
"direction": {
|
|
297
|
+
"enum": ["ascending", "descending"]
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"start_cursor": {
|
|
303
|
+
"type": "string",
|
|
304
|
+
"description": "When supplied, returns a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results."
|
|
305
|
+
},
|
|
306
|
+
"page_size": {
|
|
307
|
+
"type": "integer",
|
|
308
|
+
"description": "The number of items from the full list desired in the response. Maximum: 100",
|
|
309
|
+
"default": 100
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"responses": {},
|
|
317
|
+
"deprecated": false,
|
|
318
|
+
"security": []
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"/v1/search": {
|
|
322
|
+
"post": {
|
|
323
|
+
"summary": "Search by title",
|
|
324
|
+
"description": "",
|
|
325
|
+
"operationId": "post-search",
|
|
326
|
+
"parameters": [],
|
|
327
|
+
"requestBody": {
|
|
328
|
+
"content": {
|
|
329
|
+
"application/json": {
|
|
330
|
+
"schema": {
|
|
331
|
+
"type": "object",
|
|
332
|
+
"properties": {
|
|
333
|
+
"query": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"description": "The text that the API compares page and database titles against."
|
|
336
|
+
},
|
|
337
|
+
"sort": {
|
|
338
|
+
"type": "object",
|
|
339
|
+
"description": "A set of criteria, `direction` and `timestamp` keys, that orders the results. The **only** supported timestamp value is `\"last_edited_time\"`. Supported `direction` values are `\"ascending\"` and `\"descending\"`. If `sort` is not provided, then the most recently edited results are returned first.",
|
|
340
|
+
"properties": {
|
|
341
|
+
"direction": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"description": "The direction to sort. Possible values include `ascending` and `descending`."
|
|
344
|
+
},
|
|
345
|
+
"timestamp": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"description": "The name of the timestamp to sort against. Possible values include `last_edited_time`."
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"filter": {
|
|
352
|
+
"type": "object",
|
|
353
|
+
"description": "A set of criteria, `value` and `property` keys, that limits the results to either only pages or only databases. Possible `value` values are `\"page\"` or `\"database\"`. The only supported `property` value is `\"object\"`.",
|
|
354
|
+
"properties": {
|
|
355
|
+
"value": {
|
|
356
|
+
"type": "string",
|
|
357
|
+
"description": "The value of the property to filter the results by. Possible values for object type include `page` or `database`. **Limitation**: Currently the only filter allowed is `object` which will filter by type of object (either `page` or `database`)"
|
|
358
|
+
},
|
|
359
|
+
"property": {
|
|
360
|
+
"type": "string",
|
|
361
|
+
"description": "The name of the property to filter by. Currently the only property you can filter by is the object type. Possible values include `object`. Limitation: Currently the only filter allowed is `object` which will filter by type of object (either `page` or `database`)"
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"start_cursor": {
|
|
366
|
+
"type": "string",
|
|
367
|
+
"description": "A `cursor` value returned in a previous response that If supplied, limits the response to results starting after the `cursor`. If not supplied, then the first page of results is returned. Refer to [pagination](https://developers.notion.com/reference/intro#pagination) for more details."
|
|
368
|
+
},
|
|
369
|
+
"page_size": {
|
|
370
|
+
"type": "integer",
|
|
371
|
+
"description": "The number of items from the full list to include in the response. Maximum: `100`.",
|
|
372
|
+
"default": 100,
|
|
373
|
+
"format": "int32"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
"responses": {},
|
|
381
|
+
"deprecated": false,
|
|
382
|
+
"security": []
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
"/v1/blocks/{block_id}/children": {
|
|
386
|
+
"get": {
|
|
387
|
+
"summary": "Retrieve block children",
|
|
388
|
+
"description": "",
|
|
389
|
+
"operationId": "get-block-children",
|
|
390
|
+
"parameters": [
|
|
391
|
+
{
|
|
392
|
+
"name": "block_id",
|
|
393
|
+
"in": "path",
|
|
394
|
+
"description": "Identifier for a [block](ref:block)",
|
|
395
|
+
"schema": {
|
|
396
|
+
"type": "string"
|
|
397
|
+
},
|
|
398
|
+
"required": true
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"name": "start_cursor",
|
|
402
|
+
"in": "query",
|
|
403
|
+
"description": "If supplied, this endpoint will return a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results.",
|
|
404
|
+
"schema": {
|
|
405
|
+
"type": "string"
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"name": "page_size",
|
|
410
|
+
"in": "query",
|
|
411
|
+
"description": "The number of items from the full list desired in the response. Maximum: 100",
|
|
412
|
+
"schema": {
|
|
413
|
+
"type": "integer",
|
|
414
|
+
"format": "int32",
|
|
415
|
+
"default": 100
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"responses": {},
|
|
420
|
+
"deprecated": false,
|
|
421
|
+
"security": []
|
|
422
|
+
},
|
|
423
|
+
"patch": {
|
|
424
|
+
"summary": "Append block children",
|
|
425
|
+
"description": "",
|
|
426
|
+
"operationId": "patch-block-children",
|
|
427
|
+
"parameters": [
|
|
428
|
+
{
|
|
429
|
+
"name": "block_id",
|
|
430
|
+
"in": "path",
|
|
431
|
+
"description": "Identifier for a [block](ref:block). Also accepts a [page](ref:page) ID.",
|
|
432
|
+
"schema": {
|
|
433
|
+
"type": "string"
|
|
434
|
+
},
|
|
435
|
+
"required": true
|
|
436
|
+
}
|
|
437
|
+
],
|
|
438
|
+
"requestBody": {
|
|
439
|
+
"content": {
|
|
440
|
+
"application/json": {
|
|
441
|
+
"schema": {
|
|
442
|
+
"type": "object",
|
|
443
|
+
"required": [
|
|
444
|
+
"children"
|
|
445
|
+
],
|
|
446
|
+
"properties": {
|
|
447
|
+
"children": {
|
|
448
|
+
"type": "array",
|
|
449
|
+
"description": "Child content to append to a container block as an array of [block objects](ref:block)"
|
|
450
|
+
},
|
|
451
|
+
"after": {
|
|
452
|
+
"type": "string",
|
|
453
|
+
"description": "The ID of the existing block that the new block should be appended after."
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
"responses": {},
|
|
461
|
+
"deprecated": false,
|
|
462
|
+
"security": []
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
"/v1/blocks/{block_id}": {
|
|
466
|
+
"get": {
|
|
467
|
+
"summary": "Retrieve a block",
|
|
468
|
+
"description": "",
|
|
469
|
+
"operationId": "retrieve-a-block",
|
|
470
|
+
"parameters": [
|
|
471
|
+
{
|
|
472
|
+
"name": "block_id",
|
|
473
|
+
"in": "path",
|
|
474
|
+
"description": "Identifier for a Notion block",
|
|
475
|
+
"schema": {
|
|
476
|
+
"type": "string"
|
|
477
|
+
},
|
|
478
|
+
"required": true
|
|
479
|
+
}
|
|
480
|
+
],
|
|
481
|
+
"responses": {},
|
|
482
|
+
"deprecated": false,
|
|
483
|
+
"security": []
|
|
484
|
+
},
|
|
485
|
+
"patch": {
|
|
486
|
+
"summary": "Update a block",
|
|
487
|
+
"description": "",
|
|
488
|
+
"operationId": "update-a-block",
|
|
489
|
+
"parameters": [
|
|
490
|
+
{
|
|
491
|
+
"name": "block_id",
|
|
492
|
+
"in": "path",
|
|
493
|
+
"description": "Identifier for a Notion block",
|
|
494
|
+
"schema": {
|
|
495
|
+
"type": "string"
|
|
496
|
+
},
|
|
497
|
+
"required": true
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
"requestBody": {
|
|
501
|
+
"content": {
|
|
502
|
+
"application/json": {
|
|
503
|
+
"schema": {
|
|
504
|
+
"type": "object",
|
|
505
|
+
"properties": {
|
|
506
|
+
"type": {
|
|
507
|
+
"type": "object",
|
|
508
|
+
"description": "The [block object `type`](ref:block#block-object-keys) value with the properties to be updated. Currently only `text` (for supported block types) and `checked` (for `to_do` blocks) fields can be updated.",
|
|
509
|
+
"properties": {}
|
|
510
|
+
},
|
|
511
|
+
"archived": {
|
|
512
|
+
"type": "boolean",
|
|
513
|
+
"description": "Set to true to archive (delete) a block. Set to false to un-archive (restore) a block.",
|
|
514
|
+
"default": true
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
"responses": {},
|
|
522
|
+
"deprecated": false,
|
|
523
|
+
"security": []
|
|
524
|
+
},
|
|
525
|
+
"delete": {
|
|
526
|
+
"summary": "Delete a block",
|
|
527
|
+
"description": "",
|
|
528
|
+
"operationId": "delete-a-block",
|
|
529
|
+
"parameters": [
|
|
530
|
+
{
|
|
531
|
+
"name": "block_id",
|
|
532
|
+
"in": "path",
|
|
533
|
+
"description": "Identifier for a Notion block",
|
|
534
|
+
"schema": {
|
|
535
|
+
"type": "string"
|
|
536
|
+
},
|
|
537
|
+
"required": true
|
|
538
|
+
}
|
|
539
|
+
],
|
|
540
|
+
"responses": {},
|
|
541
|
+
"deprecated": false,
|
|
542
|
+
"security": []
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"/v1/pages/{page_id}": {
|
|
546
|
+
"get": {
|
|
547
|
+
"summary": "Retrieve a page",
|
|
548
|
+
"description": "",
|
|
549
|
+
"operationId": "retrieve-a-page",
|
|
550
|
+
"parameters": [
|
|
551
|
+
{
|
|
552
|
+
"name": "page_id",
|
|
553
|
+
"in": "path",
|
|
554
|
+
"description": "Identifier for a Notion page",
|
|
555
|
+
"schema": {
|
|
556
|
+
"type": "string"
|
|
557
|
+
},
|
|
558
|
+
"required": true
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"name": "filter_properties",
|
|
562
|
+
"in": "query",
|
|
563
|
+
"description": "A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: `?filter_properties=iAk8&filter_properties=b7dh`.",
|
|
564
|
+
"schema": {
|
|
565
|
+
"type": "string"
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
],
|
|
569
|
+
"responses": {},
|
|
570
|
+
"deprecated": false,
|
|
571
|
+
"security": []
|
|
572
|
+
},
|
|
573
|
+
"patch": {
|
|
574
|
+
"summary": "Update page properties",
|
|
575
|
+
"description": "",
|
|
576
|
+
"operationId": "patch-page",
|
|
577
|
+
"parameters": [
|
|
578
|
+
{
|
|
579
|
+
"name": "page_id",
|
|
580
|
+
"in": "path",
|
|
581
|
+
"description": "The identifier for the Notion page to be updated.",
|
|
582
|
+
"schema": {
|
|
583
|
+
"type": "string"
|
|
584
|
+
},
|
|
585
|
+
"required": true
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "Notion-Version",
|
|
589
|
+
"in": "header",
|
|
590
|
+
"description": "The [API version](/reference/versioning) to use for this request. The latest version is `<<latestNotionVersion>>`.",
|
|
591
|
+
"required": true,
|
|
592
|
+
"schema": {
|
|
593
|
+
"type": "string"
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
],
|
|
597
|
+
"requestBody": {
|
|
598
|
+
"content": {
|
|
599
|
+
"application/json": {
|
|
600
|
+
"schema": {
|
|
601
|
+
"type": "object",
|
|
602
|
+
"properties": {
|
|
603
|
+
"properties": {
|
|
604
|
+
"type": "string",
|
|
605
|
+
"description": "The property values to update for the page. The keys are the names or IDs of the property and the values are property values. If a page property ID is not included, then it is not changed.",
|
|
606
|
+
"format": "json"
|
|
607
|
+
},
|
|
608
|
+
"in_trash": {
|
|
609
|
+
"type": "boolean",
|
|
610
|
+
"description": "Set to true to delete a block. Set to false to restore a block.",
|
|
611
|
+
"default": false
|
|
612
|
+
},
|
|
613
|
+
"icon": {
|
|
614
|
+
"type": "string",
|
|
615
|
+
"description": "A page icon for the page. Supported types are [external file object](https://developers.notion.com/reference/file-object) or [emoji object](https://developers.notion.com/reference/emoji-object).",
|
|
616
|
+
"format": "json"
|
|
617
|
+
},
|
|
618
|
+
"cover": {
|
|
619
|
+
"type": "string",
|
|
620
|
+
"description": "A cover image for the page. Only [external file objects](https://developers.notion.com/reference/file-object) are supported.",
|
|
621
|
+
"format": "json"
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
"responses": {},
|
|
629
|
+
"deprecated": false,
|
|
630
|
+
"security": []
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
"/v1/pages": {
|
|
634
|
+
"post": {
|
|
635
|
+
"summary": "Create a page",
|
|
636
|
+
"description": "",
|
|
637
|
+
"operationId": "post-page",
|
|
638
|
+
"parameters": [],
|
|
639
|
+
"requestBody": {
|
|
640
|
+
"content": {
|
|
641
|
+
"application/json": {
|
|
642
|
+
"schema": {
|
|
643
|
+
"type": "object",
|
|
644
|
+
"required": [
|
|
645
|
+
"parent",
|
|
646
|
+
"properties"
|
|
647
|
+
],
|
|
648
|
+
"properties": {
|
|
649
|
+
"parent": {
|
|
650
|
+
"$ref": "#/components/schemas/pageIdObject"
|
|
651
|
+
},
|
|
652
|
+
"properties": {
|
|
653
|
+
"type": "object",
|
|
654
|
+
"properties": {
|
|
655
|
+
"title": {
|
|
656
|
+
"type": "array",
|
|
657
|
+
"items": {
|
|
658
|
+
"type": "object",
|
|
659
|
+
"required": ["text"],
|
|
660
|
+
"properties": {
|
|
661
|
+
"text": {
|
|
662
|
+
"type": "object",
|
|
663
|
+
"required": ["content"],
|
|
664
|
+
"properties": {
|
|
665
|
+
"content": {
|
|
666
|
+
"type": "string",
|
|
667
|
+
"maxLength": 2000
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
"maxItems": 100
|
|
674
|
+
},
|
|
675
|
+
"type": {
|
|
676
|
+
"enum": ["title"]
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
"additionalProperties": false,
|
|
680
|
+
"required": ["title"]
|
|
681
|
+
},
|
|
682
|
+
"children": {
|
|
683
|
+
"type": "array",
|
|
684
|
+
"description": "The content to be rendered on the new page, represented as an array of [block objects](https://developers.notion.com/reference/block).",
|
|
685
|
+
"items": {
|
|
686
|
+
"type": "string"
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
"icon": {
|
|
690
|
+
"type": "string",
|
|
691
|
+
"description": "The icon of the new page. Either an [emoji object](https://developers.notion.com/reference/emoji-object) or an [external file object](https://developers.notion.com/reference/file-object)..",
|
|
692
|
+
"format": "json"
|
|
693
|
+
},
|
|
694
|
+
"cover": {
|
|
695
|
+
"type": "string",
|
|
696
|
+
"description": "The cover image of the new page, represented as a [file object](https://developers.notion.com/reference/file-object).",
|
|
697
|
+
"format": "json"
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
"responses": {},
|
|
705
|
+
"deprecated": false,
|
|
706
|
+
"security": []
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
"/v1/databases": {
|
|
710
|
+
"post": {
|
|
711
|
+
"summary": "Create a database",
|
|
712
|
+
"description": "",
|
|
713
|
+
"operationId": "create-a-database",
|
|
714
|
+
"parameters": [],
|
|
715
|
+
"requestBody": {
|
|
716
|
+
"content": {
|
|
717
|
+
"application/json": {
|
|
718
|
+
"schema": {
|
|
719
|
+
"type": "object",
|
|
720
|
+
"required": [
|
|
721
|
+
"parent",
|
|
722
|
+
"properties"
|
|
723
|
+
],
|
|
724
|
+
"properties": {
|
|
725
|
+
"parent": {
|
|
726
|
+
"type": "string",
|
|
727
|
+
"description": "A [page parent](/reference/database#page-parent)",
|
|
728
|
+
"format": "json"
|
|
729
|
+
},
|
|
730
|
+
"title": {
|
|
731
|
+
"type": "array",
|
|
732
|
+
"description": "Title of database as it appears in Notion. An array of [rich text objects](ref:rich-text)."
|
|
733
|
+
},
|
|
734
|
+
"properties": {
|
|
735
|
+
"type": "string",
|
|
736
|
+
"description": "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).",
|
|
737
|
+
"format": "json"
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
"responses": {
|
|
745
|
+
"200": {
|
|
746
|
+
"description": "200",
|
|
747
|
+
"content": {
|
|
748
|
+
"application/json": {
|
|
749
|
+
"examples": {
|
|
750
|
+
"Result": {
|
|
751
|
+
"value": "{\n \"object\": \"database\",\n \"id\": \"bc1211ca-e3f1-4939-ae34-5260b16f627c\",\n \"created_time\": \"2021-07-08T23:50:00.000Z\",\n \"last_edited_time\": \"2021-07-08T23:50:00.000Z\",\n \"icon\": {\n \"type\": \"emoji\",\n \"emoji\": \"🎉\"\n },\n \"cover\": {\n \"type\": \"external\",\n \"external\": {\n \"url\": \"https://website.domain/images/image.png\"\n }\n },\n \"url\": \"https://www.notion.so/bc1211cae3f14939ae34260b16f627c\",\n \"title\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": \"Grocery List\",\n \"link\": null\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \"Grocery List\",\n \"href\": null\n }\n ],\n \"properties\": {\n \"+1\": {\n \"id\": \"Wp%3DC\",\n \"name\": \"+1\",\n \"type\": \"people\",\n \"people\": {}\n },\n \"In stock\": {\n \"id\": \"fk%5EY\",\n \"name\": \"In stock\",\n \"type\": \"checkbox\",\n \"checkbox\": {}\n },\n \"Price\": {\n \"id\": \"evWq\",\n \"name\": \"Price\",\n \"type\": \"number\",\n \"number\": {\n \"format\": \"dollar\"\n }\n },\n \"Description\": {\n \"id\": \"V}lX\",\n \"name\": \"Description\",\n \"type\": \"rich_text\",\n \"rich_text\": {}\n },\n \"Last ordered\": {\n \"id\": \"eVnV\",\n \"name\": \"Last ordered\",\n \"type\": \"date\",\n \"date\": {}\n },\n \"Meals\": {\n \"id\": \"%7DWA~\",\n \"name\": \"Meals\",\n \"type\": \"relation\",\n \"relation\": {\n \"database_id\": \"668d797c-76fa-4934-9b05-ad288df2d136\",\n \"single_property\": {}\n }\n },\n \"Number of meals\": {\n \"id\": \"Z\\\\Eh\",\n \"name\": \"Number of meals\",\n \"type\": \"rollup\",\n \"rollup\": {\n \"rollup_property_name\": \"Name\",\n \"relation_property_name\": \"Meals\",\n \"rollup_property_id\": \"title\",\n \"relation_property_id\": \"mxp^\",\n \"function\": \"count\"\n }\n },\n \"Store availability\": {\n \"id\": \"s}Kq\",\n \"name\": \"Store availability\",\n \"type\": \"multi_select\",\n \"multi_select\": {\n \"options\": [\n {\n \"id\": \"cb79b393-d1c1-4528-b517-c450859de766\",\n \"name\": \"Duc Loi Market\",\n \"color\": \"blue\"\n },\n {\n \"id\": \"58aae162-75d4-403b-a793-3bc7308e4cd2\",\n \"name\": \"Rainbow Grocery\",\n \"color\": \"gray\"\n },\n {\n \"id\": \"22d0f199-babc-44ff-bd80-a9eae3e3fcbf\",\n \"name\": \"Nijiya Market\",\n \"color\": \"purple\"\n },\n {\n \"id\": \"0d069987-ffb0-4347-bde2-8e4068003dbc\",\n \"name\": \"Gus's Community Market\",\n \"color\": \"yellow\"\n }\n ]\n }\n },\n \"Photo\": {\n \"id\": \"yfiK\",\n \"name\": \"Photo\",\n \"type\": \"files\",\n \"files\": {}\n },\n \"Food group\": {\n \"id\": \"CM%3EH\",\n \"name\": \"Food group\",\n \"type\": \"select\",\n \"select\": {\n \"options\": [\n {\n \"id\": \"6d4523fa-88cb-4ffd-9364-1e39d0f4e566\",\n \"name\": \"🥦Vegetable\",\n \"color\": \"green\"\n },\n {\n \"id\": \"268d7e75-de8f-4c4b-8b9d-de0f97021833\",\n \"name\": \"🍎Fruit\",\n \"color\": \"red\"\n },\n {\n \"id\": \"1b234a00-dc97-489c-b987-829264cfdfef\",\n \"name\": \"💪Protein\",\n \"color\": \"yellow\"\n }\n ]\n }\n },\n \"Name\": {\n \"id\": \"title\",\n \"name\": \"Name\",\n \"type\": \"title\",\n \"title\": {}\n }\n },\n \"parent\": {\n \"type\": \"page_id\",\n \"page_id\": \"98ad959b-2b6a-4774-80ee-00246fb0ea9b\"\n },\n \"archived\": false\n}{\n \"object\": \"database\",\n \"id\": \"bc1211ca-e3f1-4939-ae34-5260b16f627c\",\n \"created_time\": \"2021-07-08T23:50:00.000Z\",\n \"last_edited_time\": \"2021-07-08T23:50:00.000Z\",\n \"icon\": {\n \"type\": \"emoji\",\n \"emoji\": \"🎉\"\n },\n \"cover\": {\n \"type\": \"external\",\n \"external\": {\n \"url\": \"https://website.domain/images/image.png\"\n }\n },\n \"url\": \"https://www.notion.so/bc1211cae3f14939ae34260b16f627c\",\n \"title\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": \"Grocery List\",\n \"link\": null\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \"Grocery List\",\n \"href\": null\n }\n ],\n \"properties\": {\n \"+1\": {\n \"id\": \"Wp%3DC\",\n \"name\": \"+1\",\n \"type\": \"people\",\n \"people\": {}\n },\n \"In stock\": {\n \"id\": \"fk%5EY\",\n \"name\": \"In stock\",\n \"type\": \"checkbox\",\n \"checkbox\": {}\n },\n \"Price\": {\n \"id\": \"evWq\",\n \"name\": \"Price\",\n \"type\": \"number\",\n \"number\": {\n \"format\": \"dollar\"\n }\n },\n \"Description\": {\n \"id\": \"V}lX\",\n \"name\": \"Description\",\n \"type\": \"rich_text\",\n \"rich_text\": {}\n },\n \"Last ordered\": {\n \"id\": \"eVnV\",\n \"name\": \"Last ordered\",\n \"type\": \"date\",\n \"date\": {}\n },\n \"Meals\": {\n \"id\": \"%7DWA~\",\n \"name\": \"Meals\",\n \"type\": \"relation\",\n \"relation\": {\n \"database_id\": \"668d797c-76fa-4934-9b05-ad288df2d136\",\n \"synced_property_name\": \"Related to Grocery List (Meals)\"\n }\n },\n \"Number of meals\": {\n \"id\": \"Z\\\\Eh\",\n \"name\": \"Number of meals\",\n \"type\": \"rollup\",\n \"rollup\": {\n \"rollup_property_name\": \"Name\",\n \"relation_property_name\": \"Meals\",\n \"rollup_property_id\": \"title\",\n \"relation_property_id\": \"mxp^\",\n \"function\": \"count\"\n }\n },\n \"Store availability\": {\n \"id\": \"s}Kq\",\n \"name\": \"Store availability\",\n \"type\": \"multi_select\",\n \"multi_select\": {\n \"options\": [\n {\n \"id\": \"cb79b393-d1c1-4528-b517-c450859de766\",\n \"name\": \"Duc Loi Market\",\n \"color\": \"blue\"\n },\n {\n \"id\": \"58aae162-75d4-403b-a793-3bc7308e4cd2\",\n \"name\": \"Rainbow Grocery\",\n \"color\": \"gray\"\n },\n {\n \"id\": \"22d0f199-babc-44ff-bd80-a9eae3e3fcbf\",\n \"name\": \"Nijiya Market\",\n \"color\": \"purple\"\n },\n {\n \"id\": \"0d069987-ffb0-4347-bde2-8e4068003dbc\",\n \"name\": \"Gus's Community Market\",\n \"color\": \"yellow\"\n }\n ]\n }\n },\n \"Photo\": {\n \"id\": \"yfiK\",\n \"name\": \"Photo\",\n \"type\": \"files\",\n \"files\": {}\n },\n \"Food group\": {\n \"id\": \"CM%3EH\",\n \"name\": \"Food group\",\n \"type\": \"select\",\n \"select\": {\n \"options\": [\n {\n \"id\": \"6d4523fa-88cb-4ffd-9364-1e39d0f4e566\",\n \"name\": \"🥦Vegetable\",\n \"color\": \"green\"\n },\n {\n \"id\": \"268d7e75-de8f-4c4b-8b9d-de0f97021833\",\n \"name\": \"🍎Fruit\",\n \"color\": \"red\"\n },\n {\n \"id\": \"1b234a00-dc97-489c-b987-829264cfdfef\",\n \"name\": \"💪Protein\",\n \"color\": \"yellow\"\n }\n ]\n }\n },\n \"Name\": {\n \"id\": \"title\",\n \"name\": \"Name\",\n \"type\": \"title\",\n \"title\": {}\n }\n },\n \"parent\": {\n \"type\": \"page_id\",\n \"page_id\": \"98ad959b-2b6a-4774-80ee-00246fb0ea9b\"\n },\n \"archived\": false,\n \"is_inline\": false\n}"
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
"deprecated": false,
|
|
759
|
+
"security": []
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
"/v1/databases/{database_id}": {
|
|
763
|
+
"patch": {
|
|
764
|
+
"summary": "Update a database",
|
|
765
|
+
"description": "",
|
|
766
|
+
"operationId": "update-a-database",
|
|
767
|
+
"parameters": [
|
|
768
|
+
{
|
|
769
|
+
"name": "database_id",
|
|
770
|
+
"in": "path",
|
|
771
|
+
"description": "identifier for a Notion database",
|
|
772
|
+
"schema": {
|
|
773
|
+
"type": "string"
|
|
774
|
+
},
|
|
775
|
+
"required": true
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "Notion-Version",
|
|
779
|
+
"in": "header",
|
|
780
|
+
"description": "The [API version](/reference/versioning) to use for this request. The latest version is `<<latestNotionVersion>>`.",
|
|
781
|
+
"required": true,
|
|
782
|
+
"schema": {
|
|
783
|
+
"type": "string"
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
],
|
|
787
|
+
"requestBody": {
|
|
788
|
+
"content": {
|
|
789
|
+
"application/json": {
|
|
790
|
+
"schema": {
|
|
791
|
+
"type": "object",
|
|
792
|
+
"properties": {
|
|
793
|
+
"title": {
|
|
794
|
+
"type": "array",
|
|
795
|
+
"description": "An array of [rich text objects](https://developers.notion.com/reference/rich-text) that represents the title of the database that is displayed in the Notion UI. If omitted, then the database title remains unchanged."
|
|
796
|
+
},
|
|
797
|
+
"description": {
|
|
798
|
+
"type": "array",
|
|
799
|
+
"description": "An array of [rich text objects](https://developers.notion.com/reference/rich-text) that represents the description of the database that is displayed in the Notion UI. If omitted, then the database description remains unchanged."
|
|
800
|
+
},
|
|
801
|
+
"properties": {
|
|
802
|
+
"type": "string",
|
|
803
|
+
"description": "The properties of a database to be changed in the request, in the form of a JSON object. If updating an existing property, then the keys are the names or IDs of the properties as they appear in Notion, and the values are [property schema objects](ref:property-schema-object). If adding a new property, then the key is the name of the new database property and the value is a [property schema object](ref:property-schema-object).",
|
|
804
|
+
"format": "json"
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
},
|
|
811
|
+
"responses": {},
|
|
812
|
+
"deprecated": false,
|
|
813
|
+
"security": []
|
|
814
|
+
},
|
|
815
|
+
"get": {
|
|
816
|
+
"summary": "Retrieve a database",
|
|
817
|
+
"description": "",
|
|
818
|
+
"operationId": "retrieve-a-database",
|
|
819
|
+
"parameters": [
|
|
820
|
+
{
|
|
821
|
+
"name": "database_id",
|
|
822
|
+
"in": "path",
|
|
823
|
+
"description": "An identifier for the Notion database.",
|
|
824
|
+
"schema": {
|
|
825
|
+
"type": "string"
|
|
826
|
+
},
|
|
827
|
+
"required": true
|
|
828
|
+
}
|
|
829
|
+
],
|
|
830
|
+
"responses": {
|
|
831
|
+
"200": {
|
|
832
|
+
"description": "200",
|
|
833
|
+
"content": {
|
|
834
|
+
"application/json": {
|
|
835
|
+
"examples": {
|
|
836
|
+
"Result": {
|
|
837
|
+
"value": "{\n \"object\": \"database\",\n \"id\": \"bc1211ca-e3f1-4939-ae34-5260b16f627c\",\n \"created_time\": \"2021-07-08T23:50:00.000Z\",\n \"last_edited_time\": \"2021-07-08T23:50:00.000Z\",\n \"icon\": {\n \"type\": \"emoji\",\n \"emoji\": \"🎉\"\n },\n \"cover\": {\n \"type\": \"external\",\n \"external\": {\n \"url\": \"https://website.domain/images/image.png\"\n }\n },\n \"url\": \"https://www.notion.so/bc1211cae3f14939ae34260b16f627c\",\n \"title\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": \"Grocery List\",\n \"link\": null\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \"Grocery List\",\n \"href\": null\n }\n ],\n \"description\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": \"Grocery list for just kale 🥬\",\n \"link\": null\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \"Grocery list for just kale 🥬\",\n \"href\": null\n }\n ],\n \"properties\": {\n \"+1\": {\n \"id\": \"Wp%3DC\",\n \"name\": \"+1\",\n \"type\": \"people\",\n \"people\": {}\n },\n \"In stock\": {\n \"id\": \"fk%5EY\",\n \"name\": \"In stock\",\n \"type\": \"checkbox\",\n \"checkbox\": {}\n },\n \"Price\": {\n \"id\": \"evWq\",\n \"name\": \"Price\",\n \"type\": \"number\",\n \"number\": {\n \"format\": \"dollar\"\n }\n },\n \"Description\": {\n \"id\": \"V}lX\",\n \"name\": \"Description\",\n \"type\": \"rich_text\",\n \"rich_text\": {}\n },\n \"Last ordered\": {\n \"id\": \"eVnV\",\n \"name\": \"Last ordered\",\n \"type\": \"date\",\n \"date\": {}\n },\n \"Meals\": {\n \"id\": \"%7DWA~\",\n \"name\": \"Meals\",\n \"type\": \"relation\",\n \"relation\": {\n \"database_id\": \"668d797c-76fa-4934-9b05-ad288df2d136\",\n \"synced_property_name\": \"Related to Grocery List (Meals)\"\n }\n },\n \"Number of meals\": {\n \"id\": \"Z\\\\Eh\",\n \"name\": \"Number of meals\",\n \"type\": \"rollup\",\n \"rollup\": {\n \"rollup_property_name\": \"Name\",\n \"relation_property_name\": \"Meals\",\n \"rollup_property_id\": \"title\",\n \"relation_property_id\": \"mxp^\",\n \"function\": \"count\"\n }\n },\n \"Store availability\": {\n \"id\": \"s}Kq\",\n \"name\": \"Store availability\",\n \"type\": \"multi_select\",\n \"multi_select\": {\n \"options\": [\n {\n \"id\": \"cb79b393-d1c1-4528-b517-c450859de766\",\n \"name\": \"Duc Loi Market\",\n \"color\": \"blue\"\n },\n {\n \"id\": \"58aae162-75d4-403b-a793-3bc7308e4cd2\",\n \"name\": \"Rainbow Grocery\",\n \"color\": \"gray\"\n },\n {\n \"id\": \"22d0f199-babc-44ff-bd80-a9eae3e3fcbf\",\n \"name\": \"Nijiya Market\",\n \"color\": \"purple\"\n },\n {\n \"id\": \"0d069987-ffb0-4347-bde2-8e4068003dbc\",\n \"name\": \"Gus's Community Market\",\n \"color\": \"yellow\"\n }\n ]\n }\n },\n \"Photo\": {\n \"id\": \"yfiK\",\n \"name\": \"Photo\",\n \"type\": \"files\",\n \"files\": {}\n },\n \"Food group\": {\n \"id\": \"CM%3EH\",\n \"name\": \"Food group\",\n \"type\": \"select\",\n \"select\": {\n \"options\": [\n {\n \"id\": \"6d4523fa-88cb-4ffd-9364-1e39d0f4e566\",\n \"name\": \"🥦Vegetable\",\n \"color\": \"green\"\n },\n {\n \"id\": \"268d7e75-de8f-4c4b-8b9d-de0f97021833\",\n \"name\": \"🍎Fruit\",\n \"color\": \"red\"\n },\n {\n \"id\": \"1b234a00-dc97-489c-b987-829264cfdfef\",\n \"name\": \"💪Protein\",\n \"color\": \"yellow\"\n }\n ]\n }\n },\n \"Name\": {\n \"id\": \"title\",\n \"name\": \"Name\",\n \"type\": \"title\",\n \"title\": {}\n }\n },\n \"parent\": {\n \"type\": \"page_id\",\n \"page_id\": \"98ad959b-2b6a-4774-80ee-00246fb0ea9b\"\n },\n \"archived\": false,\n \"is_inline\": false,\n \"public_url\": null\n}"
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
},
|
|
844
|
+
"deprecated": false,
|
|
845
|
+
"security": []
|
|
846
|
+
}
|
|
847
|
+
},
|
|
848
|
+
"/v1/pages/{page_id}/properties/{property_id}": {
|
|
849
|
+
"get": {
|
|
850
|
+
"summary": "Retrieve a page property item",
|
|
851
|
+
"description": "",
|
|
852
|
+
"operationId": "retrieve-a-page-property",
|
|
853
|
+
"parameters": [
|
|
854
|
+
{
|
|
855
|
+
"name": "page_id",
|
|
856
|
+
"in": "path",
|
|
857
|
+
"description": "Identifier for a Notion page",
|
|
858
|
+
"schema": {
|
|
859
|
+
"type": "string"
|
|
860
|
+
},
|
|
861
|
+
"required": true
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"name": "property_id",
|
|
865
|
+
"in": "path",
|
|
866
|
+
"description": "Identifier for a page [property](https://developers.notion.com/reference/page#all-property-values)",
|
|
867
|
+
"schema": {
|
|
868
|
+
"type": "string"
|
|
869
|
+
},
|
|
870
|
+
"required": true
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"name": "page_size",
|
|
874
|
+
"in": "query",
|
|
875
|
+
"description": "For paginated properties. The max number of property item objects on a page. The default size is 100",
|
|
876
|
+
"schema": {
|
|
877
|
+
"type": "integer",
|
|
878
|
+
"format": "int32"
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
"name": "start_cursor",
|
|
883
|
+
"in": "query",
|
|
884
|
+
"description": "For paginated properties.",
|
|
885
|
+
"schema": {
|
|
886
|
+
"type": "string"
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
],
|
|
890
|
+
"responses": {
|
|
891
|
+
"200": {
|
|
892
|
+
"description": "200",
|
|
893
|
+
"content": {
|
|
894
|
+
"application/json": {
|
|
895
|
+
"examples": {
|
|
896
|
+
"Number Property Item": {
|
|
897
|
+
"value": "{\n \"object\": \"property_item\",\n \"id\" \"kjPO\",\n \"type\": \"number\",\n \"number\": 2\n}"
|
|
898
|
+
},
|
|
899
|
+
"Result": {
|
|
900
|
+
"value": "{\n \"object\": \"list\",\n \"results\": [\n {\n \"object\": \"property_item\",\n \"id\" \"kjPO\",\n \"type\": \"rich_text\",\n \"rich_text\": {\n \"type\": \"text\",\n \"text\": {\n \"content\": \"Avocado \",\n \"link\": null\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \"Avocado \",\n \"href\": null\n }\n },\n {\n \"object\": \"property_item\",\n \"id\" \"ijPO\",\n \"type\": \"rich_text\",\n \"rich_text\": {\n \"type\": \"mention\",\n \"mention\": {\n \"type\": \"page\",\n \"page\": {\n \"id\": \"41117fd7-69a5-4694-bc07-c1e3a682c857\"\n }\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \"Lemons\",\n \"href\": \"http://notion.so/41117fd769a54694bc07c1e3a682c857\"\n }\n },\n {\n \"object\": \"property_item\",\n \"id\" \"kjPO\",\n \"type\": \"rich_text\",\n \"rich_text\": {\n \"type\": \"text\",\n \"text\": {\n \"content\": \" Tomato \",\n \"link\": null\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \" Tomato \",\n \"href\": null\n }\n },\n...\n ],\n \"next_cursor\": \"some-next-cursor-value\",\n \"has_more\": true,\n\t\t\"next_url\": \"http://api.notion.com/v1/pages/0e5235bf86aa4efb93aa772cce7eab71/properties/NVv^?start_cursor=some-next-cursor-value&page_size=25\",\n \"property_item\": {\n \"id\": \"NVv^\",\n \"next_url\": null,\n \"type\": \"rich_text\",\n \"rich_text\": {}\n }\n}"
|
|
901
|
+
},
|
|
902
|
+
"Rollup List Property Item": {
|
|
903
|
+
"value": "{\n \"object\": \"list\",\n \"results\": [\n {\n \"object\": \"property_item\",\n \t\"id\": \"dj2l\",\n \"type\": \"relation\",\n \"relation\": {\n \"id\": \"83f92c9d-523d-466e-8c1f-9bc2c25a99fe\"\n }\n },\n {\n \"object\": \"property_item\",\n \t\"id\": \"dj2l\",\n \"type\": \"relation\",\n \"relation\": {\n \"id\": \"45cfb825-3463-4891-8932-7e6d8c170630\"\n }\n },\n {\n \"object\": \"property_item\",\n \t\"id\": \"dj2l\",\n \"type\": \"relation\",\n \"relation\": {\n \"id\": \"1688be1a-a197-4f2a-9688-e528c4b56d94\"\n }\n }\n ],\n \"next_cursor\": \"some-next-cursor-value\",\n \"has_more\": true,\n\t\t\"property_item\": {\n \"id\": \"y}~p\",\n \"next_url\": \"http://api.notion.com/v1/pages/0e5235bf86aa4efb93aa772cce7eab71/properties/y%7D~p?start_cursor=1QaTunT5&page_size=25\",\n \"type\": \"rollup\",\n \"rollup\": {\n \"function\": \"sum\",\n \"type\": \"incomplete\",\n \"incomplete\": {}\n }\n }\n \"type\": \"property_item\"\n}"
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
"deprecated": false,
|
|
911
|
+
"security": []
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
"/v1/comments": {
|
|
915
|
+
"get": {
|
|
916
|
+
"summary": "Retrieve comments",
|
|
917
|
+
"description": "Retrieves a list of un-resolved [Comment objects](ref:comment-object) from a page or block.",
|
|
918
|
+
"operationId": "retrieve-a-comment",
|
|
919
|
+
"parameters": [
|
|
920
|
+
{
|
|
921
|
+
"name": "block_id",
|
|
922
|
+
"in": "query",
|
|
923
|
+
"description": "Identifier for a Notion block or page",
|
|
924
|
+
"required": true,
|
|
925
|
+
"schema": {
|
|
926
|
+
"type": "string"
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"name": "start_cursor",
|
|
931
|
+
"in": "query",
|
|
932
|
+
"description": "If supplied, this endpoint will return a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results.",
|
|
933
|
+
"schema": {
|
|
934
|
+
"type": "string"
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"name": "page_size",
|
|
939
|
+
"in": "query",
|
|
940
|
+
"description": "The number of items from the full list desired in the response. Maximum: 100",
|
|
941
|
+
"schema": {
|
|
942
|
+
"type": "integer",
|
|
943
|
+
"format": "int32"
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
],
|
|
947
|
+
"responses": {
|
|
948
|
+
"200": {
|
|
949
|
+
"description": "200",
|
|
950
|
+
"content": {
|
|
951
|
+
"application/json": {
|
|
952
|
+
"examples": {
|
|
953
|
+
"OK": {
|
|
954
|
+
"value": "{\n \"object\": \"list\",\n \"results\": [\n {\n \"object\": \"comment\",\n \"id\": \"94cc56ab-9f02-409d-9f99-1037e9fe502f\",\n \"parent\": {\n \"type\": \"page_id\",\n \"page_id\": \"5c6a2821-6bb1-4a7e-b6e1-c50111515c3d\"\n },\n \"discussion_id\": \"f1407351-36f5-4c49-a13c-49f8ba11776d\",\n \"created_time\": \"2022-07-15T16:52:00.000Z\",\n \"last_edited_time\": \"2022-07-15T19:16:00.000Z\",\n \"created_by\": {\n \"object\": \"user\",\n \"id\": \"9b15170a-9941-4297-8ee6-83fa7649a87a\"\n },\n \"rich_text\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": \"Single comment\",\n \"link\": null\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \"Single comment\",\n \"href\": null\n }\n ]\n }\n ],\n \"next_cursor\": null,\n \"has_more\": false,\n \"type\": \"comment\",\n \"comment\": {}\n}"
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
"deprecated": false,
|
|
962
|
+
"security": []
|
|
963
|
+
},
|
|
964
|
+
"post": {
|
|
965
|
+
"summary": "Create comment",
|
|
966
|
+
"description": "Creates a comment in a page or existing discussion thread.",
|
|
967
|
+
"operationId": "create-a-comment",
|
|
968
|
+
"requestBody": {
|
|
969
|
+
"content": {
|
|
970
|
+
"application/json": {
|
|
971
|
+
"schema": {
|
|
972
|
+
"type": "object",
|
|
973
|
+
"required": [
|
|
974
|
+
"parent",
|
|
975
|
+
"rich_text"
|
|
976
|
+
],
|
|
977
|
+
"properties": {
|
|
978
|
+
"parent": {
|
|
979
|
+
"type": "object",
|
|
980
|
+
"description": "The page that contains the comment",
|
|
981
|
+
"required": ["page_id"],
|
|
982
|
+
"properties": {
|
|
983
|
+
"page_id": {
|
|
984
|
+
"type": "string",
|
|
985
|
+
"description": "the page ID"
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
"rich_text": {
|
|
990
|
+
"type": "array",
|
|
991
|
+
"items": {
|
|
992
|
+
"type": "object",
|
|
993
|
+
"required": ["text"],
|
|
994
|
+
"properties": {
|
|
995
|
+
"text": {
|
|
996
|
+
"type": "object",
|
|
997
|
+
"required": ["content"],
|
|
998
|
+
"properties": {
|
|
999
|
+
"content": {
|
|
1000
|
+
"type": "string",
|
|
1001
|
+
"description": "The content of the comment"
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
},
|
|
1013
|
+
"responses": {
|
|
1014
|
+
"200": {
|
|
1015
|
+
"description": "200",
|
|
1016
|
+
"content": {
|
|
1017
|
+
"application/json": {
|
|
1018
|
+
"examples": {
|
|
1019
|
+
"Result": {
|
|
1020
|
+
"value": "{\n \"object\": \"comment\",\n \"id\": \"b52b8ed6-e029-4707-a671-832549c09de3\",\n \"parent\": {\n \"type\": \"page_id\",\n \"page_id\": \"5c6a2821-6bb1-4a7e-b6e1-c50111515c3d\"\n },\n \"discussion_id\": \"f1407351-36f5-4c49-a13c-49f8ba11776d\",\n \"created_time\": \"2022-07-15T20:53:00.000Z\",\n \"last_edited_time\": \"2022-07-15T20:53:00.000Z\",\n \"created_by\": {\n \"object\": \"user\",\n \"id\": \"067dee40-6ebd-496f-b446-093c715fb5ec\"\n },\n \"rich_text\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"content\": \"Hello world\",\n \"link\": null\n },\n \"annotations\": {\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"code\": false,\n \"color\": \"default\"\n },\n \"plain_text\": \"Hello world\",\n \"href\": null\n }\n ]\n}"
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
"deprecated": false,
|
|
1028
|
+
"security": []
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
}
|