-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
308 lines (306 loc) · 8.74 KB
/
openapi.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
openapi: 3.0.2
info:
title: Zapier AI Actions API
description: ''
version: 1.0.0
servers:
- url: https://actions.zapier.com
tags:
- name: Action
- name: Check
- name: Configuration
- name: Log
paths:
/api/v1/check:
get:
tags:
- Check
summary: Check
operationId: Check_authTestGet
security:
- SessionAuth: []
- AccessPointApiKeyHeader: []
- AccessPointApiKeyQuery: []
- AccessPointOAuth: []
description: Test that the API and auth are working.
parameters: []
responses:
'200':
description: OK
/api/v1/configuration-link:
get:
tags:
- Configuration
summary: Get Configuration Link
operationId: Configuration_getConfigurationLink
security:
- SessionAuth: []
- AccessPointApiKeyHeader: []
- AccessPointApiKeyQuery: []
- AccessPointOAuth: []
description: >-
Provides a link to configure more actions. Alternatively, searching
through apps and actions will provide more specific configuration links.
parameters: []
responses:
'200':
description: OK
/api/v1/exposed:
get:
tags:
- Action
summary: List Exposed Actions
operationId: Action_listExposedActions
security:
- SessionAuth: []
- AccessPointApiKeyHeader: []
- AccessPointApiKeyQuery: []
- AccessPointOAuth: []
description: List all the currently exposed actions for the given account.
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExposedActionResponseSchema'
/api/v1/exposed/{exposed_app_action_id}/execute:
post:
tags:
- Action
summary: Execute App Action Endpoint
operationId: Action_executeAppAction
security:
- SessionAuth: []
- AccessPointApiKeyHeader: []
- AccessPointApiKeyQuery: []
- AccessPointOAuth: []
description: >-
Give us a plain english description of exact action you want to do.
There should be dynamically generated documentation for this endpoint
for each action that is exposed.
parameters:
- in: path
name: exposed_app_action_id
schema:
title: Exposed App Action Id
type: string
pattern: ^[A-Z0-9]{26}$
example: 01ARZ3NDEKTSV4RRFFQ69G5FAV
required: true
example: 01ARZ3NDEKTSV4RRFFQ69G5FAV
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ExecuteRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExecuteResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/execution-log/{execution_log_id}:
get:
tags:
- Log
summary: Get Execution Log Endpoint
operationId: Log_getExecutionLog
security:
- SessionAuth: []
- AccessPointApiKeyHeader: []
- AccessPointApiKeyQuery: []
- AccessPointOAuth: []
description: Get the execution log for a given execution log id.
parameters:
- in: path
name: execution_log_id
schema:
title: Execution Log Id
type: string
pattern: ^[A-Z0-9]{26}$
example: 01ARZ3NDEKTSV4RRFFQ69G5FAV
required: true
example: 01ARZ3NDEKTSV4RRFFQ69G5FAV
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExecuteResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
ExposedActionSchema:
title: ExposedActionSchema
type: object
properties:
description:
title: Description
description: Description of the action.
type: string
id:
title: Id
description: The unique ID of the exposed action.
type: string
operation_id:
title: Operation Id
description: The operation ID of the exposed action.
type: string
params:
title: Params
description: Available hint fields for the action.
type: object
required:
- id
- operation_id
- description
- params
ExposedActionResponseSchema:
title: ExposedActionResponseSchema
type: object
properties:
results:
title: Results
type: array
items:
$ref: '#/components/schemas/ExposedActionSchema'
configuration_link:
title: Configuration Link
description: URL to configure and expose more actions.
type: string
required:
- results
- configuration_link
ExecuteResponse:
title: ExecuteResponse
description: This is a summary of the results given the action that was executed.
type: object
properties:
id:
title: Id
description: The id of the execution log.
type: string
action_used:
title: Action Used
description: The name of the action that was executed.
type: string
input_params:
title: Input Params
description: The params we used / will use to execute the action.
type: object
review_url:
title: Review Url
description: >-
The URL to run the action or review the AI choices the AI made for
input_params given instructions.
type: string
result:
title: Result
description: >-
A trimmed down result of the first item of the full results. Ideal
for humans and language models!
type: object
additional_results:
title: Additional Results
description: The rest of the full results. Always returns an array of objects
type: array
items:
type: object
result_field_labels:
title: Result Field Labels
description: Human readable labels for some of the keys in the result.
type: object
status:
title: Status
description: The status of the execution.
default: success
enum:
- success
- error
- empty
- preview
type: string
error:
title: Error
description: The error message if the execution failed.
type: string
assistant_hint:
title: Assistant Hint
description: A hint for the assistant on what to do next.
type: string
required:
- id
- action_used
- input_params
- review_url
- additional_results
ErrorResponse:
title: ErrorResponse
type: object
properties:
error:
title: Error
description: Error message.
type: string
required:
- error
ExecuteRequest:
title: ExecuteRequest
description: >-
This extends from ExecuteRequestBase to add the preview_only option.
(1) Providers who allow side effects or (2) actions that do not have a
side effect should use this class.
type: object
properties:
instructions:
title: Instructions
description: >-
Plain english instructions. Provide as much detail as possible, even
if other fields are present.
type: string
preview_only:
title: Preview Only
description: >-
If true, we will not execute the action, but will return the params
of the preview.
default: false
type: boolean
required:
- instructions
securitySchemes:
SessionAuth:
type: apiKey
in: cookie
name: nlasession
AccessPointApiKeyHeader:
type: apiKey
in: header
name: X-API-Key
AccessPointApiKeyQuery:
type: apiKey
in: query
name: api_key
AccessPointOAuth:
type: oauth2
flows:
authorizationCode:
authorizationUrl: /oauth/authorize/
tokenUrl: /oauth/token/
scopes:
nla:exposed_actions:execute: Run AI Actions