-
Notifications
You must be signed in to change notification settings - Fork 16
/
api.notionlink.io.yaml
259 lines (259 loc) · 7.63 KB
/
api.notionlink.io.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
openapi: 3.0.0
info:
title: Chat with Workspace
description: Chat with your Notion workspace.
version: 'v1'
servers:
- url: https://api.notionlink.io
paths:
/search:
post:
summary: Search endpoint
description: |
Returns all pages or databases that have titles that include the query param.
If no query param is provided, then the response contains all pages or databases.
To limit the request to search only pages or to search only databases, use the filter param.
operationId: searchEndpoint
security:
- BearerAuth: ['app:write']
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
query:
type: string
sort:
$ref: '#/components/schemas/Sort'
filter:
$ref: '#/components/schemas/Filter'
start_cursor:
type: string
page_size:
type: integer
responses:
200:
description: Success
content:
application/json:
schema:
type: object
properties:
results:
type: array
items:
type: object
next_cursor:
type: string
has_more:
type: boolean
type:
type: string
page_or_database:
type: string
401:
description: Missing access token
403:
description: Invalid access token or insufficient permissions
500:
description: Internal server error
/page/{id}:
get:
summary: Get page endpoint
description: |
Retrieves a Page object using the ID specified.
Responses contains page properties, not page content.
To fetch page content, use the retrieve block children endpoint.
operationId: getPageEndpoint
security:
- BearerAuth: ['app:read']
parameters:
- name: id
in: path
description: Page ID
required: true
schema:
type: string
responses:
200:
description: Success
content:
application/json:
schema:
type: object
401:
description: Missing access token
403:
description: Invalid access token or insufficient permissions
500:
description: Internal server error or failed to fetch data from Notion API
/block/{id}:
get:
summary: Get block endpoint
description: |
Retrieves a specific block by its ID.
Pages are considered blocks, so you can provide a page ID to this endpoint.
operationId: getBlockEndpoint
security:
- BearerAuth: ['app:read']
parameters:
- name: id
in: path
description: Block ID
required: true
schema:
type: string
responses:
200:
description: Success
content:
application/json:
schema:
type: object
401:
description: Missing access token
403:
description: Invalid access token or insufficient permissions
500:
description: Internal server error or failed to fetch data from Notion API
/block/{id}/children:
get:
summary: Get block children endpoint
description: |
Returns a paginated array of child block objects contained in the block using the ID specified.
In order to receive a complete representation of a block, you may need to recursively retrieve the block children of child blocks.
Pages are considered blocks, so you can provide a page ID.
operationId: getBlockChildrenEndpoint
security:
- BearerAuth: ['app:read']
parameters:
- name: id
in: path
description: Block ID
required: true
schema:
type: string
- name: start_cursor
in: query
description: Pagination cursor
schema:
type: string
- name: page_size
in: query
description: Size of the page
schema:
type: integer
responses:
200:
description: Success
content:
application/json:
schema:
type: object
401:
description: Missing access token
403:
description: Invalid access token or insufficient permissions
500:
description: Internal server error or failed to fetch data from Notion API
/database/{id}:
get:
summary: Get database endpoint
description: |
Retrieves a database object — information that describes the structure and columns of a database — for a provided database ID.
To fetch database rows rather than columns, use the Query a database endpoint.
operationId: getDatabaseEndpoint
security:
- BearerAuth: ['app:read']
parameters:
- name: id
in: path
description: Database ID
required: true
schema:
type: string
responses:
200:
description: Success
content:
application/json:
schema:
type: object
401:
description: Missing access token
403:
description: Invalid access token or insufficient permissions
500:
description: Internal server error or failed to fetch data from Notion API
/database/{id}/query:
post:
summary: Query database endpoint
description: |
Gets a list of Pages contained in the database, filtered and ordered according to the filter conditions and sort criteria provided in the request.
The response may contain fewer than page_size of results.
operationId: queryDatabaseEndpoint
security:
- BearerAuth: ['app:read']
parameters:
- name: id
in: path
description: Database ID
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
filter:
type: object
sorts:
type: array
items:
type: object
start_cursor:
type: string
page_size:
type: integer
responses:
200:
description: Success
content:
application/json:
schema:
type: object
401:
description: Missing access token
403:
description: Invalid access token or insufficient permissions
500:
description: Internal server error or failed to fetch data from Notion API
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
schemas:
Sort:
type: object
properties:
direction:
type: string
enum: ['ascending', 'descending']
timestamp:
type: string
enum: ['last_edited_time']
Filter:
type: object
properties:
value:
type: string
enum: ['page', 'database']
property:
type: string
enum: ['object']