@mieubrisse/notion-mcp-server 2.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.
Files changed (36) hide show
  1. package/.devcontainer/devcontainer.json +4 -0
  2. package/.dockerignore +3 -0
  3. package/.github/pull_request_template.md +8 -0
  4. package/.github/workflows/ci.yml +42 -0
  5. package/Dockerfile +36 -0
  6. package/LICENSE +7 -0
  7. package/README.md +412 -0
  8. package/docker-compose.yml +6 -0
  9. package/docs/images/connections.png +0 -0
  10. package/docs/images/integration-access.png +0 -0
  11. package/docs/images/integrations-capabilities.png +0 -0
  12. package/docs/images/integrations-creation.png +0 -0
  13. package/docs/images/page-access-edit.png +0 -0
  14. package/package.json +63 -0
  15. package/scripts/build-cli.js +30 -0
  16. package/scripts/notion-openapi.json +2238 -0
  17. package/scripts/start-server.ts +243 -0
  18. package/src/init-server.ts +50 -0
  19. package/src/openapi-mcp-server/README.md +3 -0
  20. package/src/openapi-mcp-server/auth/index.ts +2 -0
  21. package/src/openapi-mcp-server/auth/template.ts +24 -0
  22. package/src/openapi-mcp-server/auth/types.ts +26 -0
  23. package/src/openapi-mcp-server/client/__tests__/http-client-upload.test.ts +205 -0
  24. package/src/openapi-mcp-server/client/__tests__/http-client.integration.test.ts +282 -0
  25. package/src/openapi-mcp-server/client/__tests__/http-client.test.ts +537 -0
  26. package/src/openapi-mcp-server/client/http-client.ts +198 -0
  27. package/src/openapi-mcp-server/client/polyfill-headers.ts +42 -0
  28. package/src/openapi-mcp-server/index.ts +3 -0
  29. package/src/openapi-mcp-server/mcp/__tests__/proxy.test.ts +479 -0
  30. package/src/openapi-mcp-server/mcp/proxy.ts +250 -0
  31. package/src/openapi-mcp-server/openapi/__tests__/file-upload.test.ts +100 -0
  32. package/src/openapi-mcp-server/openapi/__tests__/parser-multipart.test.ts +602 -0
  33. package/src/openapi-mcp-server/openapi/__tests__/parser.test.ts +1448 -0
  34. package/src/openapi-mcp-server/openapi/file-upload.ts +40 -0
  35. package/src/openapi-mcp-server/openapi/parser.ts +529 -0
  36. package/tsconfig.json +26 -0
@@ -0,0 +1,2238 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Notion API",
5
+ "version": "2.0.0",
6
+ "description": "Notion API 2025-09-03 - Data Source Edition. Breaking change: Database endpoints replaced with data source endpoints.",
7
+ "license": {
8
+ "name": "MIT",
9
+ "url": "https://github.com/makenotion/notion-sdk-js/blob/main/LICENSE"
10
+ }
11
+ },
12
+ "servers": [
13
+ {
14
+ "url": "https://api.notion.com"
15
+ }
16
+ ],
17
+ "components": {
18
+ "securitySchemes": {
19
+ "bearerAuth": {
20
+ "type": "http",
21
+ "scheme": "bearer"
22
+ },
23
+ "basicAuth": {
24
+ "type": "http",
25
+ "scheme": "basic"
26
+ }
27
+ },
28
+ "parameters": {
29
+ "notionVersion": {
30
+ "name": "Notion-Version",
31
+ "in": "header",
32
+ "required": false,
33
+ "schema": {
34
+ "type": "string",
35
+ "default": "2025-09-03"
36
+ },
37
+ "description": "The Notion API version"
38
+ }
39
+ },
40
+ "schemas": {
41
+ "richTextRequest": {
42
+ "type": "object",
43
+ "required": [
44
+ "text"
45
+ ],
46
+ "properties": {
47
+ "text": {
48
+ "type": "object",
49
+ "required": [
50
+ "content"
51
+ ],
52
+ "properties": {
53
+ "content": {
54
+ "type": "string"
55
+ },
56
+ "link": {
57
+ "type": [
58
+ "object",
59
+ "null"
60
+ ],
61
+ "properties": {
62
+ "url": {
63
+ "type": "string"
64
+ }
65
+ },
66
+ "required": [
67
+ "url"
68
+ ]
69
+ }
70
+ },
71
+ "additionalProperties": false
72
+ },
73
+ "type": {
74
+ "enum": [
75
+ "text"
76
+ ],
77
+ "type": "string"
78
+ }
79
+ },
80
+ "additionalProperties": false
81
+ },
82
+ "pageIdParentRequest": {
83
+ "type": "object",
84
+ "properties": {
85
+ "page_id": {
86
+ "type": "string",
87
+ "format": "uuid"
88
+ }
89
+ },
90
+ "required": [
91
+ "page_id"
92
+ ]
93
+ },
94
+ "dataSourceIdParentRequest": {
95
+ "type": "object",
96
+ "properties": {
97
+ "type": {
98
+ "type": "string",
99
+ "const": "database_id"
100
+ },
101
+ "database_id": {
102
+ "type": "string",
103
+ "format": "uuid"
104
+ }
105
+ },
106
+ "required": [
107
+ "database_id"
108
+ ]
109
+ },
110
+ "parentRequest": {
111
+ "oneOf": [
112
+ {
113
+ "$ref": "#/components/schemas/pageIdParentRequest"
114
+ },
115
+ {
116
+ "$ref": "#/components/schemas/dataSourceIdParentRequest"
117
+ },
118
+ {
119
+ "type": "object",
120
+ "properties": {
121
+ "type": {
122
+ "const": "workspace"
123
+ }
124
+ },
125
+ "required": [
126
+ "type"
127
+ ]
128
+ }
129
+ ]
130
+ },
131
+ "movePageParentRequest": {
132
+ "oneOf": [
133
+ {
134
+ "type": "object",
135
+ "properties": {
136
+ "type": {
137
+ "const": "page_id"
138
+ },
139
+ "page_id": {
140
+ "type": "string",
141
+ "format": "uuid"
142
+ }
143
+ },
144
+ "required": [
145
+ "type",
146
+ "page_id"
147
+ ]
148
+ },
149
+ {
150
+ "type": "object",
151
+ "properties": {
152
+ "type": {
153
+ "const": "database_id"
154
+ },
155
+ "database_id": {
156
+ "type": "string",
157
+ "format": "uuid"
158
+ }
159
+ },
160
+ "required": [
161
+ "type",
162
+ "database_id"
163
+ ]
164
+ },
165
+ {
166
+ "type": "object",
167
+ "properties": {
168
+ "type": {
169
+ "const": "workspace"
170
+ }
171
+ },
172
+ "required": [
173
+ "type"
174
+ ]
175
+ }
176
+ ]
177
+ },
178
+ "sortObject": {
179
+ "type": "object",
180
+ "required": [
181
+ "property",
182
+ "direction"
183
+ ],
184
+ "properties": {
185
+ "property": {
186
+ "type": "string"
187
+ },
188
+ "direction": {
189
+ "enum": [
190
+ "ascending",
191
+ "descending"
192
+ ],
193
+ "type": "string"
194
+ }
195
+ }
196
+ },
197
+ "paragraphBlockRequest": {
198
+ "type": "object",
199
+ "properties": {
200
+ "paragraph": {
201
+ "type": "object",
202
+ "properties": {
203
+ "rich_text": {
204
+ "type": "array",
205
+ "items": {
206
+ "$ref": "#/components/schemas/richTextRequest"
207
+ },
208
+ "maxItems": 100
209
+ }
210
+ },
211
+ "additionalProperties": false,
212
+ "required": [
213
+ "rich_text"
214
+ ]
215
+ },
216
+ "type": {
217
+ "enum": [
218
+ "paragraph"
219
+ ],
220
+ "type": "string"
221
+ }
222
+ },
223
+ "additionalProperties": false
224
+ },
225
+ "bulletedListItemBlockRequest": {
226
+ "type": "object",
227
+ "properties": {
228
+ "bulleted_list_item": {
229
+ "type": "object",
230
+ "properties": {
231
+ "rich_text": {
232
+ "type": "array",
233
+ "items": {
234
+ "$ref": "#/components/schemas/richTextRequest"
235
+ },
236
+ "maxItems": 100
237
+ }
238
+ },
239
+ "additionalProperties": false,
240
+ "required": [
241
+ "rich_text"
242
+ ]
243
+ },
244
+ "type": {
245
+ "enum": [
246
+ "bulleted_list_item"
247
+ ],
248
+ "type": "string"
249
+ }
250
+ },
251
+ "additionalProperties": false
252
+ },
253
+ "blockObjectRequest": {
254
+ "anyOf": [
255
+ {
256
+ "$ref": "#/components/schemas/paragraphBlockRequest"
257
+ },
258
+ {
259
+ "$ref": "#/components/schemas/bulletedListItemBlockRequest"
260
+ }
261
+ ]
262
+ }
263
+ }
264
+ },
265
+ "security": [
266
+ {
267
+ "bearerAuth": []
268
+ }
269
+ ],
270
+ "tags": [
271
+ {
272
+ "name": "Data sources",
273
+ "description": "Data source endpoints for querying and managing databases"
274
+ },
275
+ {
276
+ "name": "Pages",
277
+ "description": "Page endpoints for creating and managing pages"
278
+ },
279
+ {
280
+ "name": "Blocks",
281
+ "description": "Block endpoints for managing page content"
282
+ },
283
+ {
284
+ "name": "Users",
285
+ "description": "User endpoints"
286
+ },
287
+ {
288
+ "name": "Search",
289
+ "description": "Search endpoints"
290
+ },
291
+ {
292
+ "name": "Comments",
293
+ "description": "Comment endpoints"
294
+ }
295
+ ],
296
+ "paths": {
297
+ "/v1/users/{user_id}": {
298
+ "get": {
299
+ "summary": "Retrieve a user",
300
+ "description": "",
301
+ "operationId": "get-user",
302
+ "parameters": [
303
+ {
304
+ "name": "user_id",
305
+ "in": "path",
306
+ "required": true,
307
+ "schema": {
308
+ "type": "string",
309
+ "format": "uuid"
310
+ }
311
+ },
312
+ {
313
+ "$ref": "#/components/parameters/notionVersion"
314
+ }
315
+ ],
316
+ "responses": {
317
+ "200": {
318
+ "description": "200",
319
+ "content": {
320
+ "application/json": {
321
+ "examples": {}
322
+ }
323
+ }
324
+ },
325
+ "400": {
326
+ "description": "400",
327
+ "content": {
328
+ "application/json": {
329
+ "examples": {
330
+ "Result": {
331
+ "value": {}
332
+ }
333
+ },
334
+ "schema": {
335
+ "type": "object",
336
+ "properties": {}
337
+ }
338
+ }
339
+ }
340
+ }
341
+ },
342
+ "deprecated": false,
343
+ "security": []
344
+ }
345
+ },
346
+ "/v1/users": {
347
+ "get": {
348
+ "summary": "List all users",
349
+ "operationId": "get-users",
350
+ "parameters": [
351
+ {
352
+ "name": "start_cursor",
353
+ "in": "query",
354
+ "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.",
355
+ "schema": {
356
+ "type": "string"
357
+ }
358
+ },
359
+ {
360
+ "name": "page_size",
361
+ "in": "query",
362
+ "description": "The number of items from the full list desired in the response. Maximum: 100",
363
+ "schema": {
364
+ "type": "integer",
365
+ "default": 100
366
+ }
367
+ },
368
+ {
369
+ "$ref": "#/components/parameters/notionVersion"
370
+ }
371
+ ],
372
+ "responses": {
373
+ "400": {
374
+ "description": "400",
375
+ "content": {
376
+ "application/json": {
377
+ "examples": {
378
+ "Result": {
379
+ "value": {}
380
+ }
381
+ },
382
+ "schema": {
383
+ "type": "object",
384
+ "properties": {}
385
+ }
386
+ }
387
+ }
388
+ },
389
+ "200": {
390
+ "description": "Successful response",
391
+ "content": {
392
+ "application/json": {
393
+ "schema": {
394
+ "type": "object"
395
+ }
396
+ }
397
+ }
398
+ }
399
+ },
400
+ "deprecated": false
401
+ }
402
+ },
403
+ "/v1/users/me": {
404
+ "get": {
405
+ "summary": "Retrieve your token's bot user",
406
+ "description": "",
407
+ "operationId": "get-self",
408
+ "parameters": [
409
+ {
410
+ "$ref": "#/components/parameters/notionVersion"
411
+ }
412
+ ],
413
+ "responses": {
414
+ "200": {
415
+ "description": "200",
416
+ "content": {
417
+ "application/json": {
418
+ "examples": {
419
+ "Result": {
420
+ "value": {
421
+ "object": "user",
422
+ "id": "16d84278-ab0e-484c-9bdd-b35da3bd8905",
423
+ "name": "pied piper",
424
+ "avatar_url": null,
425
+ "type": "bot",
426
+ "bot": {
427
+ "owner": {
428
+ "type": "user",
429
+ "user": {
430
+ "object": "user",
431
+ "id": "5389a034-eb5c-47b5-8a9e-f79c99ef166c",
432
+ "name": "christine makenotion",
433
+ "avatar_url": null,
434
+ "type": "person",
435
+ "person": {
436
+ "email": "christine@makenotion.com"
437
+ }
438
+ }
439
+ }
440
+ }
441
+ }
442
+ }
443
+ },
444
+ "schema": {
445
+ "type": "object",
446
+ "properties": {
447
+ "object": {
448
+ "type": "string",
449
+ "example": "user"
450
+ },
451
+ "id": {
452
+ "type": "string",
453
+ "example": "16d84278-ab0e-484c-9bdd-b35da3bd8905"
454
+ },
455
+ "name": {
456
+ "type": "string",
457
+ "example": "pied piper"
458
+ },
459
+ "avatar_url": {},
460
+ "type": {
461
+ "type": "string",
462
+ "example": "bot"
463
+ },
464
+ "bot": {
465
+ "type": "object",
466
+ "properties": {
467
+ "owner": {
468
+ "type": "object",
469
+ "properties": {
470
+ "type": {
471
+ "type": "string",
472
+ "example": "user"
473
+ },
474
+ "user": {
475
+ "type": "object",
476
+ "properties": {
477
+ "object": {
478
+ "type": "string",
479
+ "example": "user"
480
+ },
481
+ "id": {
482
+ "type": "string",
483
+ "example": "5389a034-eb5c-47b5-8a9e-f79c99ef166c"
484
+ },
485
+ "name": {
486
+ "type": "string",
487
+ "example": "christine makenotion"
488
+ },
489
+ "avatar_url": {},
490
+ "type": {
491
+ "type": "string",
492
+ "example": "person"
493
+ },
494
+ "person": {
495
+ "type": "object",
496
+ "properties": {
497
+ "email": {
498
+ "type": "string",
499
+ "example": "christine@makenotion.com"
500
+ }
501
+ }
502
+ }
503
+ }
504
+ }
505
+ }
506
+ }
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
512
+ }
513
+ },
514
+ "400": {
515
+ "description": "Bad request",
516
+ "content": {
517
+ "application/json": {
518
+ "schema": {
519
+ "type": "object",
520
+ "properties": {
521
+ "object": {
522
+ "type": "string",
523
+ "example": "error"
524
+ },
525
+ "status": {
526
+ "type": "integer",
527
+ "example": 400
528
+ },
529
+ "code": {
530
+ "type": "string"
531
+ },
532
+ "message": {
533
+ "type": "string"
534
+ }
535
+ }
536
+ }
537
+ }
538
+ }
539
+ }
540
+ },
541
+ "deprecated": false,
542
+ "security": []
543
+ }
544
+ },
545
+ "/v1/search": {
546
+ "post": {
547
+ "summary": "Search by title",
548
+ "description": "",
549
+ "operationId": "post-search",
550
+ "parameters": [
551
+ {
552
+ "$ref": "#/components/parameters/notionVersion"
553
+ }
554
+ ],
555
+ "requestBody": {
556
+ "content": {
557
+ "application/json": {
558
+ "schema": {
559
+ "type": "object",
560
+ "properties": {
561
+ "query": {
562
+ "type": "string",
563
+ "description": "The text that the API compares page and database titles against."
564
+ },
565
+ "sort": {
566
+ "type": "object",
567
+ "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.",
568
+ "properties": {
569
+ "direction": {
570
+ "type": "string",
571
+ "description": "The direction to sort. Possible values include `ascending` and `descending`."
572
+ },
573
+ "timestamp": {
574
+ "type": "string",
575
+ "description": "The name of the timestamp to sort against. Possible values include `last_edited_time`."
576
+ }
577
+ }
578
+ },
579
+ "filter": {
580
+ "type": "object",
581
+ "description": "A set of criteria, `value` and `property` keys, that limits the results to either only pages or only data sources. Possible `value` values are `\"page\"` or `\"data_source\"`. The only supported `property` value is `\"object\"`.",
582
+ "properties": {
583
+ "value": {
584
+ "type": "string",
585
+ "description": "The value of the property to filter the results by. Possible values for object type include `page` or `data_source`. **Limitation**: Currently the only filter allowed is `object` which will filter by type of object (either `page` or `data_source`)",
586
+ "enum": [
587
+ "page",
588
+ "data_source"
589
+ ]
590
+ },
591
+ "property": {
592
+ "type": "string",
593
+ "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 `data_source`)"
594
+ }
595
+ }
596
+ },
597
+ "start_cursor": {
598
+ "type": "string",
599
+ "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."
600
+ },
601
+ "page_size": {
602
+ "type": "integer",
603
+ "description": "The number of items from the full list to include in the response. Maximum: `100`.",
604
+ "default": 100,
605
+ "format": "int32"
606
+ }
607
+ }
608
+ }
609
+ }
610
+ }
611
+ },
612
+ "responses": {
613
+ "200": {
614
+ "description": "Successful response",
615
+ "content": {
616
+ "application/json": {
617
+ "schema": {
618
+ "type": "object"
619
+ }
620
+ }
621
+ }
622
+ },
623
+ "400": {
624
+ "description": "Bad request",
625
+ "content": {
626
+ "application/json": {
627
+ "schema": {
628
+ "type": "object",
629
+ "properties": {
630
+ "object": {
631
+ "type": "string",
632
+ "example": "error"
633
+ },
634
+ "status": {
635
+ "type": "integer",
636
+ "example": 400
637
+ },
638
+ "code": {
639
+ "type": "string"
640
+ },
641
+ "message": {
642
+ "type": "string"
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+ }
649
+ },
650
+ "deprecated": false,
651
+ "security": []
652
+ }
653
+ },
654
+ "/v1/blocks/{block_id}/children": {
655
+ "get": {
656
+ "summary": "Retrieve block children",
657
+ "description": "",
658
+ "operationId": "get-block-children",
659
+ "parameters": [
660
+ {
661
+ "name": "block_id",
662
+ "in": "path",
663
+ "description": "Identifier for a [block](ref:block)",
664
+ "schema": {
665
+ "type": "string"
666
+ },
667
+ "required": true
668
+ },
669
+ {
670
+ "name": "start_cursor",
671
+ "in": "query",
672
+ "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.",
673
+ "schema": {
674
+ "type": "string"
675
+ }
676
+ },
677
+ {
678
+ "name": "page_size",
679
+ "in": "query",
680
+ "description": "The number of items from the full list desired in the response. Maximum: 100",
681
+ "schema": {
682
+ "type": "integer",
683
+ "format": "int32",
684
+ "default": 100
685
+ }
686
+ },
687
+ {
688
+ "$ref": "#/components/parameters/notionVersion"
689
+ }
690
+ ],
691
+ "responses": {
692
+ "200": {
693
+ "description": "Successful response",
694
+ "content": {
695
+ "application/json": {
696
+ "schema": {
697
+ "type": "object"
698
+ }
699
+ }
700
+ }
701
+ },
702
+ "400": {
703
+ "description": "Bad request",
704
+ "content": {
705
+ "application/json": {
706
+ "schema": {
707
+ "type": "object",
708
+ "properties": {
709
+ "object": {
710
+ "type": "string",
711
+ "example": "error"
712
+ },
713
+ "status": {
714
+ "type": "integer",
715
+ "example": 400
716
+ },
717
+ "code": {
718
+ "type": "string"
719
+ },
720
+ "message": {
721
+ "type": "string"
722
+ }
723
+ }
724
+ }
725
+ }
726
+ }
727
+ }
728
+ },
729
+ "deprecated": false,
730
+ "security": []
731
+ },
732
+ "patch": {
733
+ "summary": "Append block children",
734
+ "description": "",
735
+ "operationId": "patch-block-children",
736
+ "parameters": [
737
+ {
738
+ "name": "block_id",
739
+ "in": "path",
740
+ "description": "Identifier for a [block](ref:block). Also accepts a [page](ref:page) ID.",
741
+ "schema": {
742
+ "type": "string"
743
+ },
744
+ "required": true
745
+ },
746
+ {
747
+ "$ref": "#/components/parameters/notionVersion"
748
+ }
749
+ ],
750
+ "requestBody": {
751
+ "content": {
752
+ "application/json": {
753
+ "schema": {
754
+ "type": "object",
755
+ "required": [
756
+ "children"
757
+ ],
758
+ "properties": {
759
+ "children": {
760
+ "type": "array",
761
+ "items": {
762
+ "$ref": "#/components/schemas/blockObjectRequest"
763
+ },
764
+ "description": "Child content to append to a container block as an array of [block objects](ref:block)"
765
+ },
766
+ "after": {
767
+ "type": "string",
768
+ "description": "The ID of the existing block that the new block should be appended after."
769
+ }
770
+ }
771
+ }
772
+ }
773
+ }
774
+ },
775
+ "responses": {
776
+ "200": {
777
+ "description": "Successful response",
778
+ "content": {
779
+ "application/json": {
780
+ "schema": {
781
+ "type": "object"
782
+ }
783
+ }
784
+ }
785
+ },
786
+ "400": {
787
+ "description": "Bad request",
788
+ "content": {
789
+ "application/json": {
790
+ "schema": {
791
+ "type": "object",
792
+ "properties": {
793
+ "object": {
794
+ "type": "string",
795
+ "example": "error"
796
+ },
797
+ "status": {
798
+ "type": "integer",
799
+ "example": 400
800
+ },
801
+ "code": {
802
+ "type": "string"
803
+ },
804
+ "message": {
805
+ "type": "string"
806
+ }
807
+ }
808
+ }
809
+ }
810
+ }
811
+ }
812
+ },
813
+ "deprecated": false,
814
+ "security": []
815
+ }
816
+ },
817
+ "/v1/blocks/{block_id}": {
818
+ "get": {
819
+ "summary": "Retrieve a block",
820
+ "description": "",
821
+ "operationId": "retrieve-a-block",
822
+ "parameters": [
823
+ {
824
+ "name": "block_id",
825
+ "in": "path",
826
+ "description": "Identifier for a Notion block",
827
+ "schema": {
828
+ "type": "string"
829
+ },
830
+ "required": true
831
+ },
832
+ {
833
+ "$ref": "#/components/parameters/notionVersion"
834
+ }
835
+ ],
836
+ "responses": {
837
+ "200": {
838
+ "description": "Successful response",
839
+ "content": {
840
+ "application/json": {
841
+ "schema": {
842
+ "type": "object"
843
+ }
844
+ }
845
+ }
846
+ },
847
+ "400": {
848
+ "description": "Bad request",
849
+ "content": {
850
+ "application/json": {
851
+ "schema": {
852
+ "type": "object",
853
+ "properties": {
854
+ "object": {
855
+ "type": "string",
856
+ "example": "error"
857
+ },
858
+ "status": {
859
+ "type": "integer",
860
+ "example": 400
861
+ },
862
+ "code": {
863
+ "type": "string"
864
+ },
865
+ "message": {
866
+ "type": "string"
867
+ }
868
+ }
869
+ }
870
+ }
871
+ }
872
+ }
873
+ },
874
+ "deprecated": false,
875
+ "security": []
876
+ },
877
+ "patch": {
878
+ "summary": "Update a block",
879
+ "description": "",
880
+ "operationId": "update-a-block",
881
+ "parameters": [
882
+ {
883
+ "name": "block_id",
884
+ "in": "path",
885
+ "description": "Identifier for a Notion block",
886
+ "schema": {
887
+ "type": "string"
888
+ },
889
+ "required": true
890
+ },
891
+ {
892
+ "$ref": "#/components/parameters/notionVersion"
893
+ }
894
+ ],
895
+ "requestBody": {
896
+ "content": {
897
+ "application/json": {
898
+ "schema": {
899
+ "type": "object",
900
+ "properties": {
901
+ "type": {
902
+ "type": "object",
903
+ "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.",
904
+ "properties": {}
905
+ },
906
+ "archived": {
907
+ "type": "boolean",
908
+ "description": "Set to true to archive (delete) a block. Set to false to un-archive (restore) a block.",
909
+ "default": true
910
+ }
911
+ }
912
+ }
913
+ }
914
+ }
915
+ },
916
+ "responses": {
917
+ "200": {
918
+ "description": "Successful response",
919
+ "content": {
920
+ "application/json": {
921
+ "schema": {
922
+ "type": "object"
923
+ }
924
+ }
925
+ }
926
+ },
927
+ "400": {
928
+ "description": "Bad request",
929
+ "content": {
930
+ "application/json": {
931
+ "schema": {
932
+ "type": "object",
933
+ "properties": {
934
+ "object": {
935
+ "type": "string",
936
+ "example": "error"
937
+ },
938
+ "status": {
939
+ "type": "integer",
940
+ "example": 400
941
+ },
942
+ "code": {
943
+ "type": "string"
944
+ },
945
+ "message": {
946
+ "type": "string"
947
+ }
948
+ }
949
+ }
950
+ }
951
+ }
952
+ }
953
+ },
954
+ "deprecated": false,
955
+ "security": []
956
+ },
957
+ "delete": {
958
+ "summary": "Delete a block",
959
+ "description": "",
960
+ "operationId": "delete-a-block",
961
+ "parameters": [
962
+ {
963
+ "name": "block_id",
964
+ "in": "path",
965
+ "description": "Identifier for a Notion block",
966
+ "schema": {
967
+ "type": "string"
968
+ },
969
+ "required": true
970
+ },
971
+ {
972
+ "$ref": "#/components/parameters/notionVersion"
973
+ }
974
+ ],
975
+ "responses": {
976
+ "200": {
977
+ "description": "Successful response",
978
+ "content": {
979
+ "application/json": {
980
+ "schema": {
981
+ "type": "object"
982
+ }
983
+ }
984
+ }
985
+ },
986
+ "400": {
987
+ "description": "Bad request",
988
+ "content": {
989
+ "application/json": {
990
+ "schema": {
991
+ "type": "object",
992
+ "properties": {
993
+ "object": {
994
+ "type": "string",
995
+ "example": "error"
996
+ },
997
+ "status": {
998
+ "type": "integer",
999
+ "example": 400
1000
+ },
1001
+ "code": {
1002
+ "type": "string"
1003
+ },
1004
+ "message": {
1005
+ "type": "string"
1006
+ }
1007
+ }
1008
+ }
1009
+ }
1010
+ }
1011
+ }
1012
+ },
1013
+ "deprecated": false,
1014
+ "security": []
1015
+ }
1016
+ },
1017
+ "/v1/pages/{page_id}": {
1018
+ "get": {
1019
+ "summary": "Retrieve a page",
1020
+ "description": "",
1021
+ "operationId": "retrieve-a-page",
1022
+ "parameters": [
1023
+ {
1024
+ "name": "page_id",
1025
+ "in": "path",
1026
+ "description": "Identifier for a Notion page",
1027
+ "schema": {
1028
+ "type": "string"
1029
+ },
1030
+ "required": true
1031
+ },
1032
+ {
1033
+ "name": "filter_properties",
1034
+ "in": "query",
1035
+ "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`.",
1036
+ "schema": {
1037
+ "type": "string"
1038
+ }
1039
+ },
1040
+ {
1041
+ "$ref": "#/components/parameters/notionVersion"
1042
+ }
1043
+ ],
1044
+ "responses": {
1045
+ "200": {
1046
+ "description": "Successful response",
1047
+ "content": {
1048
+ "application/json": {
1049
+ "schema": {
1050
+ "type": "object"
1051
+ }
1052
+ }
1053
+ }
1054
+ },
1055
+ "400": {
1056
+ "description": "Bad request",
1057
+ "content": {
1058
+ "application/json": {
1059
+ "schema": {
1060
+ "type": "object",
1061
+ "properties": {
1062
+ "object": {
1063
+ "type": "string",
1064
+ "example": "error"
1065
+ },
1066
+ "status": {
1067
+ "type": "integer",
1068
+ "example": 400
1069
+ },
1070
+ "code": {
1071
+ "type": "string"
1072
+ },
1073
+ "message": {
1074
+ "type": "string"
1075
+ }
1076
+ }
1077
+ }
1078
+ }
1079
+ }
1080
+ }
1081
+ },
1082
+ "deprecated": false,
1083
+ "security": []
1084
+ },
1085
+ "patch": {
1086
+ "summary": "Update page properties",
1087
+ "description": "",
1088
+ "operationId": "patch-page",
1089
+ "parameters": [
1090
+ {
1091
+ "name": "page_id",
1092
+ "in": "path",
1093
+ "description": "The identifier for the Notion page to be updated.",
1094
+ "schema": {
1095
+ "type": "string"
1096
+ },
1097
+ "required": true
1098
+ },
1099
+ {
1100
+ "$ref": "#/components/parameters/notionVersion"
1101
+ }
1102
+ ],
1103
+ "requestBody": {
1104
+ "content": {
1105
+ "application/json": {
1106
+ "schema": {
1107
+ "type": "object",
1108
+ "properties": {
1109
+ "properties": {
1110
+ "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.",
1111
+ "type": "object",
1112
+ "properties": {
1113
+ "title": {
1114
+ "type": "array",
1115
+ "items": {
1116
+ "type": "object",
1117
+ "properties": {
1118
+ "text": {
1119
+ "type": "object",
1120
+ "properties": {
1121
+ "content": {
1122
+ "type": "string"
1123
+ },
1124
+ "link": {
1125
+ "type": [
1126
+ "object",
1127
+ "null"
1128
+ ],
1129
+ "properties": {
1130
+ "url": {
1131
+ "type": "string"
1132
+ }
1133
+ },
1134
+ "required": [
1135
+ "url"
1136
+ ]
1137
+ }
1138
+ },
1139
+ "additionalProperties": false,
1140
+ "required": [
1141
+ "content"
1142
+ ]
1143
+ },
1144
+ "type": {
1145
+ "enum": [
1146
+ "text"
1147
+ ],
1148
+ "type": "string"
1149
+ }
1150
+ },
1151
+ "additionalProperties": false,
1152
+ "required": [
1153
+ "text"
1154
+ ]
1155
+ },
1156
+ "maxItems": 100
1157
+ },
1158
+ "type": {
1159
+ "enum": [
1160
+ "title"
1161
+ ],
1162
+ "type": "string"
1163
+ }
1164
+ },
1165
+ "additionalProperties": false,
1166
+ "required": [
1167
+ "title"
1168
+ ]
1169
+ },
1170
+ "in_trash": {
1171
+ "type": "boolean",
1172
+ "description": "Set to true to delete a block. Set to false to restore a block.",
1173
+ "default": false
1174
+ },
1175
+ "archived": {
1176
+ "type": "boolean"
1177
+ },
1178
+ "icon": {
1179
+ "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).",
1180
+ "type": "object",
1181
+ "properties": {
1182
+ "emoji": {
1183
+ "type": "string"
1184
+ }
1185
+ },
1186
+ "additionalProperties": false,
1187
+ "required": [
1188
+ "emoji"
1189
+ ]
1190
+ },
1191
+ "cover": {
1192
+ "type": "object",
1193
+ "description": "A cover image for the page. Only [external file objects](https://developers.notion.com/reference/file-object) are supported.",
1194
+ "properties": {
1195
+ "external": {
1196
+ "type": "object",
1197
+ "properties": {
1198
+ "url": {
1199
+ "type": "string"
1200
+ }
1201
+ },
1202
+ "additionalProperties": false,
1203
+ "required": [
1204
+ "url"
1205
+ ]
1206
+ },
1207
+ "type": {
1208
+ "enum": [
1209
+ "external"
1210
+ ],
1211
+ "type": "string"
1212
+ }
1213
+ },
1214
+ "required": [
1215
+ "external"
1216
+ ],
1217
+ "additionalProperties": false
1218
+ }
1219
+ }
1220
+ }
1221
+ }
1222
+ }
1223
+ },
1224
+ "responses": {
1225
+ "200": {
1226
+ "description": "Successful response",
1227
+ "content": {
1228
+ "application/json": {
1229
+ "schema": {
1230
+ "type": "object"
1231
+ }
1232
+ }
1233
+ }
1234
+ },
1235
+ "400": {
1236
+ "description": "Bad request",
1237
+ "content": {
1238
+ "application/json": {
1239
+ "schema": {
1240
+ "type": "object",
1241
+ "properties": {
1242
+ "object": {
1243
+ "type": "string",
1244
+ "example": "error"
1245
+ },
1246
+ "status": {
1247
+ "type": "integer",
1248
+ "example": 400
1249
+ },
1250
+ "code": {
1251
+ "type": "string"
1252
+ },
1253
+ "message": {
1254
+ "type": "string"
1255
+ }
1256
+ }
1257
+ }
1258
+ }
1259
+ }
1260
+ }
1261
+ },
1262
+ "deprecated": false,
1263
+ "security": []
1264
+ }
1265
+ },
1266
+ "/v1/pages": {
1267
+ "post": {
1268
+ "summary": "Create a page",
1269
+ "description": "",
1270
+ "operationId": "post-page",
1271
+ "parameters": [
1272
+ {
1273
+ "$ref": "#/components/parameters/notionVersion"
1274
+ }
1275
+ ],
1276
+ "requestBody": {
1277
+ "content": {
1278
+ "application/json": {
1279
+ "schema": {
1280
+ "type": "object",
1281
+ "required": [
1282
+ "parent",
1283
+ "properties"
1284
+ ],
1285
+ "properties": {
1286
+ "parent": {
1287
+ "$ref": "#/components/schemas/parentRequest"
1288
+ },
1289
+ "properties": {
1290
+ "type": "object",
1291
+ "properties": {
1292
+ "title": {
1293
+ "type": "array",
1294
+ "items": {
1295
+ "type": "object",
1296
+ "required": [
1297
+ "text"
1298
+ ],
1299
+ "properties": {
1300
+ "text": {
1301
+ "type": "object",
1302
+ "required": [
1303
+ "content"
1304
+ ],
1305
+ "properties": {
1306
+ "content": {
1307
+ "type": "string"
1308
+ }
1309
+ }
1310
+ }
1311
+ }
1312
+ },
1313
+ "maxItems": 100
1314
+ },
1315
+ "type": {
1316
+ "enum": [
1317
+ "title"
1318
+ ],
1319
+ "type": "string"
1320
+ }
1321
+ },
1322
+ "additionalProperties": false,
1323
+ "required": [
1324
+ "title"
1325
+ ]
1326
+ },
1327
+ "children": {
1328
+ "type": "array",
1329
+ "description": "The content to be rendered on the new page, represented as an array of [block objects](https://developers.notion.com/reference/block).",
1330
+ "items": {
1331
+ "type": "string"
1332
+ }
1333
+ },
1334
+ "icon": {
1335
+ "type": "string",
1336
+ "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)..",
1337
+ "format": "json"
1338
+ },
1339
+ "cover": {
1340
+ "type": "string",
1341
+ "description": "The cover image of the new page, represented as a [file object](https://developers.notion.com/reference/file-object).",
1342
+ "format": "json"
1343
+ }
1344
+ }
1345
+ }
1346
+ }
1347
+ }
1348
+ },
1349
+ "responses": {
1350
+ "200": {
1351
+ "description": "Successful response",
1352
+ "content": {
1353
+ "application/json": {
1354
+ "schema": {
1355
+ "type": "object"
1356
+ }
1357
+ }
1358
+ }
1359
+ },
1360
+ "400": {
1361
+ "description": "Bad request",
1362
+ "content": {
1363
+ "application/json": {
1364
+ "schema": {
1365
+ "type": "object",
1366
+ "properties": {
1367
+ "object": {
1368
+ "type": "string",
1369
+ "example": "error"
1370
+ },
1371
+ "status": {
1372
+ "type": "integer",
1373
+ "example": 400
1374
+ },
1375
+ "code": {
1376
+ "type": "string"
1377
+ },
1378
+ "message": {
1379
+ "type": "string"
1380
+ }
1381
+ }
1382
+ }
1383
+ }
1384
+ }
1385
+ }
1386
+ },
1387
+ "deprecated": false,
1388
+ "security": []
1389
+ }
1390
+ },
1391
+ "/v1/pages/{page_id}/properties/{property_id}": {
1392
+ "get": {
1393
+ "summary": "Retrieve a page property item",
1394
+ "description": "",
1395
+ "operationId": "retrieve-a-page-property",
1396
+ "parameters": [
1397
+ {
1398
+ "name": "page_id",
1399
+ "in": "path",
1400
+ "description": "Identifier for a Notion page",
1401
+ "schema": {
1402
+ "type": "string"
1403
+ },
1404
+ "required": true
1405
+ },
1406
+ {
1407
+ "name": "property_id",
1408
+ "in": "path",
1409
+ "description": "Identifier for a page [property](https://developers.notion.com/reference/page#all-property-values)",
1410
+ "schema": {
1411
+ "type": "string"
1412
+ },
1413
+ "required": true
1414
+ },
1415
+ {
1416
+ "name": "page_size",
1417
+ "in": "query",
1418
+ "description": "For paginated properties. The max number of property item objects on a page. The default size is 100",
1419
+ "schema": {
1420
+ "type": "integer",
1421
+ "format": "int32"
1422
+ }
1423
+ },
1424
+ {
1425
+ "name": "start_cursor",
1426
+ "in": "query",
1427
+ "description": "For paginated properties.",
1428
+ "schema": {
1429
+ "type": "string"
1430
+ }
1431
+ },
1432
+ {
1433
+ "$ref": "#/components/parameters/notionVersion"
1434
+ }
1435
+ ],
1436
+ "responses": {
1437
+ "200": {
1438
+ "description": "200",
1439
+ "content": {
1440
+ "application/json": {
1441
+ "examples": {}
1442
+ }
1443
+ }
1444
+ },
1445
+ "400": {
1446
+ "description": "Bad request",
1447
+ "content": {
1448
+ "application/json": {
1449
+ "schema": {
1450
+ "type": "object",
1451
+ "properties": {
1452
+ "object": {
1453
+ "type": "string",
1454
+ "example": "error"
1455
+ },
1456
+ "status": {
1457
+ "type": "integer",
1458
+ "example": 400
1459
+ },
1460
+ "code": {
1461
+ "type": "string"
1462
+ },
1463
+ "message": {
1464
+ "type": "string"
1465
+ }
1466
+ }
1467
+ }
1468
+ }
1469
+ }
1470
+ }
1471
+ },
1472
+ "deprecated": false,
1473
+ "security": []
1474
+ }
1475
+ },
1476
+ "/v1/comments": {
1477
+ "get": {
1478
+ "summary": "Retrieve comments",
1479
+ "description": "Retrieves a list of un-resolved [Comment objects](ref:comment-object) from a page or block.",
1480
+ "operationId": "retrieve-a-comment",
1481
+ "parameters": [
1482
+ {
1483
+ "name": "block_id",
1484
+ "in": "query",
1485
+ "description": "Identifier for a Notion block or page",
1486
+ "required": true,
1487
+ "schema": {
1488
+ "type": "string"
1489
+ }
1490
+ },
1491
+ {
1492
+ "name": "start_cursor",
1493
+ "in": "query",
1494
+ "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.",
1495
+ "schema": {
1496
+ "type": "string"
1497
+ }
1498
+ },
1499
+ {
1500
+ "name": "page_size",
1501
+ "in": "query",
1502
+ "description": "The number of items from the full list desired in the response. Maximum: 100",
1503
+ "schema": {
1504
+ "type": "integer",
1505
+ "format": "int32"
1506
+ }
1507
+ },
1508
+ {
1509
+ "$ref": "#/components/parameters/notionVersion"
1510
+ }
1511
+ ],
1512
+ "responses": {
1513
+ "200": {
1514
+ "description": "200",
1515
+ "content": {
1516
+ "application/json": {
1517
+ "examples": {
1518
+ "OK": {
1519
+ "value": {
1520
+ "object": "list",
1521
+ "results": [
1522
+ {
1523
+ "object": "comment",
1524
+ "id": "94cc56ab-9f02-409d-9f99-1037e9fe502f",
1525
+ "parent": {
1526
+ "type": "page_id",
1527
+ "page_id": "5c6a2821-6bb1-4a7e-b6e1-c50111515c3d"
1528
+ },
1529
+ "discussion_id": "f1407351-36f5-4c49-a13c-49f8ba11776d",
1530
+ "created_time": "2022-07-15T16:52:00.000Z",
1531
+ "last_edited_time": "2022-07-15T19:16:00.000Z",
1532
+ "created_by": {
1533
+ "object": "user",
1534
+ "id": "9b15170a-9941-4297-8ee6-83fa7649a87a"
1535
+ },
1536
+ "rich_text": [
1537
+ {
1538
+ "type": "text",
1539
+ "text": {
1540
+ "content": "Single comment",
1541
+ "link": null
1542
+ },
1543
+ "annotations": {
1544
+ "bold": false,
1545
+ "italic": false,
1546
+ "strikethrough": false,
1547
+ "underline": false,
1548
+ "code": false,
1549
+ "color": "default"
1550
+ },
1551
+ "plain_text": "Single comment",
1552
+ "href": null
1553
+ }
1554
+ ]
1555
+ }
1556
+ ],
1557
+ "next_cursor": null,
1558
+ "has_more": false,
1559
+ "type": "comment",
1560
+ "comment": {}
1561
+ }
1562
+ }
1563
+ }
1564
+ }
1565
+ }
1566
+ },
1567
+ "400": {
1568
+ "description": "Bad request",
1569
+ "content": {
1570
+ "application/json": {
1571
+ "schema": {
1572
+ "type": "object",
1573
+ "properties": {
1574
+ "object": {
1575
+ "type": "string",
1576
+ "example": "error"
1577
+ },
1578
+ "status": {
1579
+ "type": "integer",
1580
+ "example": 400
1581
+ },
1582
+ "code": {
1583
+ "type": "string"
1584
+ },
1585
+ "message": {
1586
+ "type": "string"
1587
+ }
1588
+ }
1589
+ }
1590
+ }
1591
+ }
1592
+ }
1593
+ },
1594
+ "deprecated": false,
1595
+ "security": []
1596
+ },
1597
+ "post": {
1598
+ "summary": "Create comment",
1599
+ "description": "Creates a comment in a page or existing discussion thread.",
1600
+ "operationId": "create-a-comment",
1601
+ "requestBody": {
1602
+ "content": {
1603
+ "application/json": {
1604
+ "schema": {
1605
+ "type": "object",
1606
+ "required": [
1607
+ "parent",
1608
+ "rich_text"
1609
+ ],
1610
+ "properties": {
1611
+ "parent": {
1612
+ "type": "object",
1613
+ "description": "The page that contains the comment",
1614
+ "required": [
1615
+ "page_id"
1616
+ ],
1617
+ "properties": {
1618
+ "page_id": {
1619
+ "type": "string",
1620
+ "description": "the page ID"
1621
+ }
1622
+ }
1623
+ },
1624
+ "rich_text": {
1625
+ "type": "array",
1626
+ "items": {
1627
+ "type": "object",
1628
+ "required": [
1629
+ "text"
1630
+ ],
1631
+ "properties": {
1632
+ "text": {
1633
+ "type": "object",
1634
+ "required": [
1635
+ "content"
1636
+ ],
1637
+ "properties": {
1638
+ "content": {
1639
+ "type": "string",
1640
+ "description": "The content of the comment"
1641
+ }
1642
+ }
1643
+ }
1644
+ }
1645
+ }
1646
+ }
1647
+ }
1648
+ }
1649
+ }
1650
+ }
1651
+ },
1652
+ "responses": {
1653
+ "200": {
1654
+ "description": "200",
1655
+ "content": {
1656
+ "application/json": {
1657
+ "examples": {
1658
+ "Result": {
1659
+ "value": {
1660
+ "object": "comment",
1661
+ "id": "b52b8ed6-e029-4707-a671-832549c09de3",
1662
+ "parent": {
1663
+ "type": "page_id",
1664
+ "page_id": "5c6a2821-6bb1-4a7e-b6e1-c50111515c3d"
1665
+ },
1666
+ "discussion_id": "f1407351-36f5-4c49-a13c-49f8ba11776d",
1667
+ "created_time": "2022-07-15T20:53:00.000Z",
1668
+ "last_edited_time": "2022-07-15T20:53:00.000Z",
1669
+ "created_by": {
1670
+ "object": "user",
1671
+ "id": "067dee40-6ebd-496f-b446-093c715fb5ec"
1672
+ },
1673
+ "rich_text": [
1674
+ {
1675
+ "type": "text",
1676
+ "text": {
1677
+ "content": "Hello world",
1678
+ "link": null
1679
+ },
1680
+ "annotations": {
1681
+ "bold": false,
1682
+ "italic": false,
1683
+ "strikethrough": false,
1684
+ "underline": false,
1685
+ "code": false,
1686
+ "color": "default"
1687
+ },
1688
+ "plain_text": "Hello world",
1689
+ "href": null
1690
+ }
1691
+ ]
1692
+ }
1693
+ }
1694
+ }
1695
+ }
1696
+ }
1697
+ },
1698
+ "400": {
1699
+ "description": "Bad request",
1700
+ "content": {
1701
+ "application/json": {
1702
+ "schema": {
1703
+ "type": "object",
1704
+ "properties": {
1705
+ "object": {
1706
+ "type": "string",
1707
+ "example": "error"
1708
+ },
1709
+ "status": {
1710
+ "type": "integer",
1711
+ "example": 400
1712
+ },
1713
+ "code": {
1714
+ "type": "string"
1715
+ },
1716
+ "message": {
1717
+ "type": "string"
1718
+ }
1719
+ }
1720
+ }
1721
+ }
1722
+ }
1723
+ }
1724
+ },
1725
+ "deprecated": false,
1726
+ "security": []
1727
+ }
1728
+ },
1729
+ "/v1/data_sources/{data_source_id}/query": {
1730
+ "post": {
1731
+ "summary": "Query a data source",
1732
+ "description": "Query a data source (database) using filters and sorts",
1733
+ "operationId": "query-data-source",
1734
+ "tags": [
1735
+ "Data sources"
1736
+ ],
1737
+ "parameters": [
1738
+ {
1739
+ "name": "data_source_id",
1740
+ "in": "path",
1741
+ "description": "Identifier for a Notion data source (database)",
1742
+ "schema": {
1743
+ "type": "string"
1744
+ },
1745
+ "required": true
1746
+ },
1747
+ {
1748
+ "name": "filter_properties",
1749
+ "in": "query",
1750
+ "description": "A list of page property value IDs to limit the response",
1751
+ "schema": {
1752
+ "type": "array",
1753
+ "items": {
1754
+ "type": "string"
1755
+ }
1756
+ }
1757
+ },
1758
+ {
1759
+ "$ref": "#/components/parameters/notionVersion"
1760
+ }
1761
+ ],
1762
+ "requestBody": {
1763
+ "content": {
1764
+ "application/json": {
1765
+ "schema": {
1766
+ "type": "object",
1767
+ "properties": {
1768
+ "filter": {
1769
+ "type": "object",
1770
+ "description": "Filter conditions for querying the data source"
1771
+ },
1772
+ "sorts": {
1773
+ "type": "array",
1774
+ "items": {
1775
+ "$ref": "#/components/schemas/sortObject"
1776
+ }
1777
+ },
1778
+ "start_cursor": {
1779
+ "type": "string"
1780
+ },
1781
+ "page_size": {
1782
+ "type": "integer",
1783
+ "default": 100
1784
+ },
1785
+ "archived": {
1786
+ "type": "boolean"
1787
+ },
1788
+ "in_trash": {
1789
+ "type": "boolean"
1790
+ }
1791
+ }
1792
+ }
1793
+ }
1794
+ }
1795
+ },
1796
+ "responses": {
1797
+ "200": {
1798
+ "description": "Successful response",
1799
+ "content": {
1800
+ "application/json": {
1801
+ "schema": {
1802
+ "type": "object"
1803
+ }
1804
+ }
1805
+ }
1806
+ },
1807
+ "400": {
1808
+ "description": "Bad request",
1809
+ "content": {
1810
+ "application/json": {
1811
+ "schema": {
1812
+ "type": "object",
1813
+ "properties": {
1814
+ "object": {
1815
+ "type": "string",
1816
+ "example": "error"
1817
+ },
1818
+ "status": {
1819
+ "type": "integer",
1820
+ "example": 400
1821
+ },
1822
+ "code": {
1823
+ "type": "string"
1824
+ },
1825
+ "message": {
1826
+ "type": "string"
1827
+ }
1828
+ }
1829
+ }
1830
+ }
1831
+ }
1832
+ }
1833
+ },
1834
+ "deprecated": false,
1835
+ "security": []
1836
+ }
1837
+ },
1838
+ "/v1/data_sources/{data_source_id}": {
1839
+ "get": {
1840
+ "summary": "Retrieve a data source",
1841
+ "description": "Retrieve metadata and schema for a data source",
1842
+ "operationId": "retrieve-a-data-source",
1843
+ "tags": [
1844
+ "Data sources"
1845
+ ],
1846
+ "parameters": [
1847
+ {
1848
+ "name": "data_source_id",
1849
+ "in": "path",
1850
+ "description": "Identifier for a Notion data source",
1851
+ "schema": {
1852
+ "type": "string"
1853
+ },
1854
+ "required": true
1855
+ },
1856
+ {
1857
+ "$ref": "#/components/parameters/notionVersion"
1858
+ }
1859
+ ],
1860
+ "responses": {
1861
+ "200": {
1862
+ "description": "Successful response",
1863
+ "content": {
1864
+ "application/json": {
1865
+ "schema": {
1866
+ "type": "object"
1867
+ }
1868
+ }
1869
+ }
1870
+ },
1871
+ "400": {
1872
+ "description": "Bad request",
1873
+ "content": {
1874
+ "application/json": {
1875
+ "schema": {
1876
+ "type": "object",
1877
+ "properties": {
1878
+ "object": {
1879
+ "type": "string",
1880
+ "example": "error"
1881
+ },
1882
+ "status": {
1883
+ "type": "integer",
1884
+ "example": 400
1885
+ },
1886
+ "code": {
1887
+ "type": "string"
1888
+ },
1889
+ "message": {
1890
+ "type": "string"
1891
+ }
1892
+ }
1893
+ }
1894
+ }
1895
+ }
1896
+ }
1897
+ },
1898
+ "deprecated": false,
1899
+ "security": []
1900
+ },
1901
+ "patch": {
1902
+ "summary": "Update a data source",
1903
+ "description": "Update properties of a data source",
1904
+ "operationId": "update-a-data-source",
1905
+ "tags": [
1906
+ "Data sources"
1907
+ ],
1908
+ "parameters": [
1909
+ {
1910
+ "name": "data_source_id",
1911
+ "in": "path",
1912
+ "description": "Identifier for a Notion data source",
1913
+ "schema": {
1914
+ "type": "string"
1915
+ },
1916
+ "required": true
1917
+ },
1918
+ {
1919
+ "$ref": "#/components/parameters/notionVersion"
1920
+ }
1921
+ ],
1922
+ "requestBody": {
1923
+ "content": {
1924
+ "application/json": {
1925
+ "schema": {
1926
+ "type": "object",
1927
+ "properties": {
1928
+ "title": {
1929
+ "type": "array",
1930
+ "items": {
1931
+ "$ref": "#/components/schemas/richTextRequest"
1932
+ }
1933
+ },
1934
+ "description": {
1935
+ "type": "array",
1936
+ "items": {
1937
+ "$ref": "#/components/schemas/richTextRequest"
1938
+ },
1939
+ "maxItems": 100
1940
+ },
1941
+ "properties": {
1942
+ "type": "object",
1943
+ "description": "Property schema updates"
1944
+ }
1945
+ }
1946
+ }
1947
+ }
1948
+ }
1949
+ },
1950
+ "responses": {
1951
+ "200": {
1952
+ "description": "Successful response",
1953
+ "content": {
1954
+ "application/json": {
1955
+ "schema": {
1956
+ "type": "object"
1957
+ }
1958
+ }
1959
+ }
1960
+ },
1961
+ "400": {
1962
+ "description": "Bad request",
1963
+ "content": {
1964
+ "application/json": {
1965
+ "schema": {
1966
+ "type": "object",
1967
+ "properties": {
1968
+ "object": {
1969
+ "type": "string",
1970
+ "example": "error"
1971
+ },
1972
+ "status": {
1973
+ "type": "integer",
1974
+ "example": 400
1975
+ },
1976
+ "code": {
1977
+ "type": "string"
1978
+ },
1979
+ "message": {
1980
+ "type": "string"
1981
+ }
1982
+ }
1983
+ }
1984
+ }
1985
+ }
1986
+ }
1987
+ },
1988
+ "deprecated": false,
1989
+ "security": []
1990
+ }
1991
+ },
1992
+ "/v1/data_sources": {
1993
+ "post": {
1994
+ "summary": "Create a data source",
1995
+ "description": "Create a new data source (database)",
1996
+ "operationId": "create-a-data-source",
1997
+ "tags": [
1998
+ "Data sources"
1999
+ ],
2000
+ "parameters": [
2001
+ {
2002
+ "$ref": "#/components/parameters/notionVersion"
2003
+ }
2004
+ ],
2005
+ "requestBody": {
2006
+ "content": {
2007
+ "application/json": {
2008
+ "schema": {
2009
+ "type": "object",
2010
+ "required": [
2011
+ "parent",
2012
+ "properties"
2013
+ ],
2014
+ "properties": {
2015
+ "parent": {
2016
+ "$ref": "#/components/schemas/pageIdParentRequest"
2017
+ },
2018
+ "properties": {
2019
+ "type": "object",
2020
+ "description": "Property schema of data source"
2021
+ },
2022
+ "title": {
2023
+ "type": "array",
2024
+ "items": {
2025
+ "$ref": "#/components/schemas/richTextRequest"
2026
+ },
2027
+ "maxItems": 100
2028
+ }
2029
+ }
2030
+ }
2031
+ }
2032
+ }
2033
+ },
2034
+ "responses": {
2035
+ "200": {
2036
+ "description": "Successful response",
2037
+ "content": {
2038
+ "application/json": {
2039
+ "schema": {
2040
+ "type": "object"
2041
+ }
2042
+ }
2043
+ }
2044
+ },
2045
+ "400": {
2046
+ "description": "Bad request",
2047
+ "content": {
2048
+ "application/json": {
2049
+ "schema": {
2050
+ "type": "object",
2051
+ "properties": {
2052
+ "object": {
2053
+ "type": "string",
2054
+ "example": "error"
2055
+ },
2056
+ "status": {
2057
+ "type": "integer",
2058
+ "example": 400
2059
+ },
2060
+ "code": {
2061
+ "type": "string"
2062
+ },
2063
+ "message": {
2064
+ "type": "string"
2065
+ }
2066
+ }
2067
+ }
2068
+ }
2069
+ }
2070
+ }
2071
+ },
2072
+ "deprecated": false,
2073
+ "security": []
2074
+ }
2075
+ },
2076
+ "/v1/data_sources/{data_source_id}/templates": {
2077
+ "get": {
2078
+ "summary": "List templates in a data source",
2079
+ "description": "List available templates for a data source",
2080
+ "operationId": "list-data-source-templates",
2081
+ "tags": [
2082
+ "Data sources"
2083
+ ],
2084
+ "parameters": [
2085
+ {
2086
+ "name": "data_source_id",
2087
+ "in": "path",
2088
+ "description": "Identifier for a Notion data source",
2089
+ "schema": {
2090
+ "type": "string"
2091
+ },
2092
+ "required": true
2093
+ },
2094
+ {
2095
+ "name": "start_cursor",
2096
+ "in": "query",
2097
+ "schema": {
2098
+ "type": "string"
2099
+ }
2100
+ },
2101
+ {
2102
+ "name": "page_size",
2103
+ "in": "query",
2104
+ "schema": {
2105
+ "type": "integer",
2106
+ "default": 100
2107
+ }
2108
+ },
2109
+ {
2110
+ "$ref": "#/components/parameters/notionVersion"
2111
+ }
2112
+ ],
2113
+ "responses": {
2114
+ "200": {
2115
+ "description": "Successful response",
2116
+ "content": {
2117
+ "application/json": {
2118
+ "schema": {
2119
+ "type": "object"
2120
+ }
2121
+ }
2122
+ }
2123
+ },
2124
+ "400": {
2125
+ "description": "Bad request",
2126
+ "content": {
2127
+ "application/json": {
2128
+ "schema": {
2129
+ "type": "object",
2130
+ "properties": {
2131
+ "object": {
2132
+ "type": "string",
2133
+ "example": "error"
2134
+ },
2135
+ "status": {
2136
+ "type": "integer",
2137
+ "example": 400
2138
+ },
2139
+ "code": {
2140
+ "type": "string"
2141
+ },
2142
+ "message": {
2143
+ "type": "string"
2144
+ }
2145
+ }
2146
+ }
2147
+ }
2148
+ }
2149
+ }
2150
+ },
2151
+ "deprecated": false,
2152
+ "security": []
2153
+ }
2154
+ },
2155
+ "/v1/pages/{page_id}/move": {
2156
+ "post": {
2157
+ "summary": "Move a page",
2158
+ "description": "Move a page to a different parent location",
2159
+ "operationId": "move-page",
2160
+ "tags": [
2161
+ "Pages"
2162
+ ],
2163
+ "parameters": [
2164
+ {
2165
+ "name": "page_id",
2166
+ "in": "path",
2167
+ "description": "Identifier for a Notion page",
2168
+ "schema": {
2169
+ "type": "string",
2170
+ "format": "uuid"
2171
+ },
2172
+ "required": true
2173
+ },
2174
+ {
2175
+ "$ref": "#/components/parameters/notionVersion"
2176
+ }
2177
+ ],
2178
+ "requestBody": {
2179
+ "content": {
2180
+ "application/json": {
2181
+ "schema": {
2182
+ "type": "object",
2183
+ "required": [
2184
+ "parent"
2185
+ ],
2186
+ "properties": {
2187
+ "parent": {
2188
+ "$ref": "#/components/schemas/movePageParentRequest"
2189
+ }
2190
+ }
2191
+ }
2192
+ }
2193
+ }
2194
+ },
2195
+ "responses": {
2196
+ "200": {
2197
+ "description": "Successful response",
2198
+ "content": {
2199
+ "application/json": {
2200
+ "schema": {
2201
+ "type": "object"
2202
+ }
2203
+ }
2204
+ }
2205
+ },
2206
+ "400": {
2207
+ "description": "Bad request",
2208
+ "content": {
2209
+ "application/json": {
2210
+ "schema": {
2211
+ "type": "object",
2212
+ "properties": {
2213
+ "object": {
2214
+ "type": "string",
2215
+ "example": "error"
2216
+ },
2217
+ "status": {
2218
+ "type": "integer",
2219
+ "example": 400
2220
+ },
2221
+ "code": {
2222
+ "type": "string"
2223
+ },
2224
+ "message": {
2225
+ "type": "string"
2226
+ }
2227
+ }
2228
+ }
2229
+ }
2230
+ }
2231
+ }
2232
+ },
2233
+ "deprecated": false,
2234
+ "security": []
2235
+ }
2236
+ }
2237
+ }
2238
+ }