@epilot/automation-client 2.2.2 → 2.3.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/dist/openapi.json CHANGED
@@ -1,2108 +1,2269 @@
1
1
  {
2
- "openapi": "3.0.3",
3
- "info": {
4
- "title": "Automation API",
5
- "description": "API Backend for epilot Automation Workflows feature",
6
- "version": "1.0.0"
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "Automation API",
5
+ "description": "API Backend for epilot Automation Workflows feature",
6
+ "version": "1.0.0"
7
+ },
8
+ "tags": [
9
+ {
10
+ "name": "flows",
11
+ "description": "Automation flows"
7
12
  },
8
- "tags": [
9
- {
10
- "name": "flows",
11
- "description": "Automation flows"
12
- },
13
- {
14
- "name": "executions",
15
- "description": "Automation executions"
16
- }
17
- ],
18
- "security": [
19
- {
20
- "EpilotAuth": []
21
- }
22
- ],
23
- "paths": {
24
- "/v1/automation/flows": {
25
- "get": {
26
- "operationId": "searchFlows",
27
- "summary": "searchFlows",
28
- "description": "Search available automation flows",
29
- "tags": [
30
- "flows"
31
- ],
32
- "parameters": [
33
- {
34
- "name": "schema",
35
- "in": "query",
36
- "description": "Entity Schema",
37
- "schema": {
38
- "type": "string",
39
- "example": "submission"
40
- }
41
- },
42
- {
43
- "name": "size",
44
- "in": "query",
45
- "description": "Pagination: max number of results to return",
46
- "schema": {
47
- "type": "integer",
48
- "default": 25
49
- }
50
- },
51
- {
52
- "name": "from",
53
- "in": "query",
54
- "description": "Pagination: starting for results",
55
- "schema": {
56
- "type": "integer",
57
- "default": 0
58
- }
59
- },
60
- {
61
- "name": "trigger_source_id",
62
- "in": "query",
63
- "description": "Trigger source identifier",
64
- "schema": {
65
- "type": "string",
66
- "example": "600945fe-212e-4b97-acf7-391d64648384"
67
- }
68
- }
69
- ],
70
- "responses": {
71
- "200": {
72
- "description": "List of automation flows, including total count",
73
- "content": {
74
- "application/json": {
75
- "schema": {
76
- "$ref": "#/components/schemas/SearchAutomationsResp"
77
- }
78
- }
79
- }
80
- }
81
- }
82
- },
83
- "post": {
84
- "operationId": "createFlow",
85
- "summary": "createFlow",
86
- "description": "Create new automation flow",
87
- "tags": [
88
- "flows"
89
- ],
90
- "requestBody": {
91
- "description": "Automation flow to create",
92
- "content": {
93
- "application/json": {
94
- "schema": {
95
- "$ref": "#/components/schemas/AutomationFlow"
96
- }
97
- }
98
- }
99
- },
100
- "responses": {
101
- "201": {
102
- "description": "The created automation flow",
103
- "content": {
104
- "application/json": {
105
- "schema": {
106
- "$ref": "#/components/schemas/AutomationFlow"
107
- }
108
- }
109
- }
110
- }
13
+ {
14
+ "name": "executions",
15
+ "description": "Automation executions"
16
+ }
17
+ ],
18
+ "security": [
19
+ {
20
+ "EpilotAuth": []
21
+ }
22
+ ],
23
+ "paths": {
24
+ "/v1/automation/flows": {
25
+ "get": {
26
+ "operationId": "searchFlows",
27
+ "summary": "searchFlows",
28
+ "description": "Search available automation flows",
29
+ "tags": [
30
+ "flows"
31
+ ],
32
+ "parameters": [
33
+ {
34
+ "name": "schema",
35
+ "in": "query",
36
+ "description": "Entity Schema",
37
+ "schema": {
38
+ "type": "string",
39
+ "example": "submission"
40
+ }
41
+ },
42
+ {
43
+ "name": "size",
44
+ "in": "query",
45
+ "description": "Pagination: max number of results to return",
46
+ "schema": {
47
+ "type": "integer",
48
+ "default": 25
49
+ }
50
+ },
51
+ {
52
+ "name": "from",
53
+ "in": "query",
54
+ "description": "Pagination: starting for results",
55
+ "schema": {
56
+ "type": "integer",
57
+ "default": 0
58
+ }
59
+ },
60
+ {
61
+ "name": "trigger_source_id",
62
+ "in": "query",
63
+ "description": "Trigger source identifier",
64
+ "schema": {
65
+ "type": "string",
66
+ "example": "600945fe-212e-4b97-acf7-391d64648384"
67
+ }
68
+ }
69
+ ],
70
+ "responses": {
71
+ "200": {
72
+ "description": "List of automation flows, including total count",
73
+ "content": {
74
+ "application/json": {
75
+ "schema": {
76
+ "$ref": "#/components/schemas/SearchAutomationsResp"
111
77
  }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ },
83
+ "post": {
84
+ "operationId": "createFlow",
85
+ "summary": "createFlow",
86
+ "description": "Create new automation flow",
87
+ "tags": [
88
+ "flows"
89
+ ],
90
+ "requestBody": {
91
+ "description": "Automation flow to create",
92
+ "content": {
93
+ "application/json": {
94
+ "schema": {
95
+ "$ref": "#/components/schemas/AutomationFlow"
96
+ }
112
97
  }
98
+ }
113
99
  },
114
- "/v1/automation/flows/{flow_id}": {
115
- "get": {
116
- "operationId": "getFlow",
117
- "summary": "getFlow",
118
- "description": "List available automation flows",
119
- "tags": [
120
- "flows"
121
- ],
122
- "parameters": [
123
- {
124
- "name": "flow_id",
125
- "in": "path",
126
- "required": true,
127
- "description": "Automation Workflow ID",
128
- "schema": {
129
- "$ref": "#/components/schemas/AutomationFlowId"
130
- }
131
- }
132
- ],
133
- "responses": {
134
- "200": {
135
- "description": "The returned automation flow",
136
- "content": {
137
- "application/json": {
138
- "schema": {
139
- "$ref": "#/components/schemas/AutomationFlow"
140
- }
141
- }
142
- }
143
- }
144
- }
145
- },
146
- "put": {
147
- "operationId": "putFlow",
148
- "summary": "putFlow",
149
- "description": "Update automation flow by id",
150
- "tags": [
151
- "flows"
152
- ],
153
- "parameters": [
154
- {
155
- "name": "flow_id",
156
- "in": "path",
157
- "required": true,
158
- "description": "Automation Workflow ID",
159
- "schema": {
160
- "$ref": "#/components/schemas/AutomationFlowId"
161
- }
162
- }
163
- ],
164
- "requestBody": {
165
- "description": "Automation flow to create",
166
- "content": {
167
- "application/json": {
168
- "schema": {
169
- "$ref": "#/components/schemas/AutomationFlow"
170
- }
171
- }
172
- }
173
- },
174
- "responses": {
175
- "200": {
176
- "description": "The updated automation flow",
177
- "content": {
178
- "application/json": {
179
- "schema": {
180
- "$ref": "#/components/schemas/AutomationFlow"
181
- }
182
- }
183
- }
184
- }
100
+ "responses": {
101
+ "201": {
102
+ "description": "The created automation flow",
103
+ "content": {
104
+ "application/json": {
105
+ "schema": {
106
+ "$ref": "#/components/schemas/AutomationFlow"
185
107
  }
186
- },
187
- "delete": {
188
- "operationId": "deleteFlow",
189
- "summary": "deleteFlow",
190
- "description": "Update automation flow by id",
191
- "tags": [
192
- "flows"
193
- ],
194
- "parameters": [
195
- {
196
- "name": "flow_id",
197
- "in": "path",
198
- "required": true,
199
- "description": "Automation Workflow ID",
200
- "schema": {
201
- "$ref": "#/components/schemas/AutomationFlowId"
202
- }
203
- }
204
- ],
205
- "responses": {
206
- "200": {
207
- "description": "The deleted automation flow",
208
- "content": {
209
- "application/json": {
210
- "schema": {
211
- "$ref": "#/components/schemas/AutomationFlow"
212
- }
213
- }
214
- }
215
- }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ },
114
+ "/v1/automation/flows/{flow_id}": {
115
+ "get": {
116
+ "operationId": "getFlow",
117
+ "summary": "getFlow",
118
+ "description": "List available automation flows",
119
+ "tags": [
120
+ "flows"
121
+ ],
122
+ "parameters": [
123
+ {
124
+ "name": "flow_id",
125
+ "in": "path",
126
+ "required": true,
127
+ "description": "Automation Workflow ID",
128
+ "schema": {
129
+ "$ref": "#/components/schemas/AutomationFlowId"
130
+ }
131
+ }
132
+ ],
133
+ "responses": {
134
+ "200": {
135
+ "description": "The returned automation flow",
136
+ "content": {
137
+ "application/json": {
138
+ "schema": {
139
+ "$ref": "#/components/schemas/AutomationFlow"
216
140
  }
141
+ }
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "put": {
147
+ "operationId": "putFlow",
148
+ "summary": "putFlow",
149
+ "description": "Update automation flow by id",
150
+ "tags": [
151
+ "flows"
152
+ ],
153
+ "parameters": [
154
+ {
155
+ "name": "flow_id",
156
+ "in": "path",
157
+ "required": true,
158
+ "description": "Automation Workflow ID",
159
+ "schema": {
160
+ "$ref": "#/components/schemas/AutomationFlowId"
217
161
  }
162
+ }
163
+ ],
164
+ "requestBody": {
165
+ "description": "Automation flow to create",
166
+ "content": {
167
+ "application/json": {
168
+ "schema": {
169
+ "$ref": "#/components/schemas/AutomationFlow"
170
+ }
171
+ }
172
+ }
218
173
  },
219
- "/v1/automation/executions": {
220
- "get": {
221
- "operationId": "getExecutions",
222
- "summary": "getExecutions",
223
- "description": "List automation executions",
224
- "parameters": [
225
- {
226
- "name": "entity_id",
227
- "in": "query",
228
- "schema": {
229
- "$ref": "#/components/schemas/EntityId"
230
- }
231
- },
232
- {
233
- "name": "size",
234
- "in": "query",
235
- "description": "Pagination: max number of results to return",
236
- "schema": {
237
- "type": "integer",
238
- "default": 25
239
- }
240
- },
241
- {
242
- "name": "from",
243
- "in": "query",
244
- "description": "Pagination: starting for results",
245
- "schema": {
246
- "type": "integer",
247
- "default": 0
248
- }
249
- }
250
- ],
251
- "tags": [
252
- "executions"
253
- ],
254
- "responses": {
255
- "200": {
256
- "description": "List of automation executions",
257
- "content": {
258
- "application/json": {
259
- "schema": {
260
- "$ref": "#/components/schemas/GetExecutionsResp"
261
- }
262
- }
263
- }
264
- }
174
+ "responses": {
175
+ "200": {
176
+ "description": "The updated automation flow",
177
+ "content": {
178
+ "application/json": {
179
+ "schema": {
180
+ "$ref": "#/components/schemas/AutomationFlow"
265
181
  }
266
- },
267
- "post": {
268
- "operationId": "startExecution",
269
- "summary": "startExecution",
270
- "description": "Start new automation execution",
271
- "requestBody": {
272
- "description": "Execution parameters",
273
- "content": {
274
- "application/json": {
275
- "schema": {
276
- "$ref": "#/components/schemas/StartExecutionRequest"
277
- }
278
- }
279
- }
280
- },
281
- "tags": [
282
- "executions"
283
- ],
284
- "responses": {
285
- "201": {
286
- "description": "The created execution",
287
- "content": {
288
- "application/json": {
289
- "schema": {
290
- "$ref": "#/components/schemas/AutomationExecution"
291
- }
292
- }
293
- }
294
- }
182
+ }
183
+ }
184
+ }
185
+ }
186
+ },
187
+ "delete": {
188
+ "operationId": "deleteFlow",
189
+ "summary": "deleteFlow",
190
+ "description": "Update automation flow by id",
191
+ "tags": [
192
+ "flows"
193
+ ],
194
+ "parameters": [
195
+ {
196
+ "name": "flow_id",
197
+ "in": "path",
198
+ "required": true,
199
+ "description": "Automation Workflow ID",
200
+ "schema": {
201
+ "$ref": "#/components/schemas/AutomationFlowId"
202
+ }
203
+ }
204
+ ],
205
+ "responses": {
206
+ "200": {
207
+ "description": "The deleted automation flow",
208
+ "content": {
209
+ "application/json": {
210
+ "schema": {
211
+ "$ref": "#/components/schemas/AutomationFlow"
295
212
  }
213
+ }
296
214
  }
215
+ }
216
+ }
217
+ }
218
+ },
219
+ "/v1/automation/executions": {
220
+ "get": {
221
+ "operationId": "getExecutions",
222
+ "summary": "getExecutions",
223
+ "description": "List automation executions",
224
+ "parameters": [
225
+ {
226
+ "name": "entity_id",
227
+ "in": "query",
228
+ "schema": {
229
+ "$ref": "#/components/schemas/EntityId"
230
+ }
231
+ },
232
+ {
233
+ "name": "size",
234
+ "in": "query",
235
+ "description": "Pagination: max number of results to return",
236
+ "schema": {
237
+ "type": "integer",
238
+ "default": 25
239
+ }
240
+ },
241
+ {
242
+ "name": "from",
243
+ "in": "query",
244
+ "description": "Pagination: starting for results",
245
+ "schema": {
246
+ "type": "integer",
247
+ "default": 0
248
+ }
249
+ }
250
+ ],
251
+ "tags": [
252
+ "executions"
253
+ ],
254
+ "responses": {
255
+ "200": {
256
+ "description": "List of automation executions",
257
+ "content": {
258
+ "application/json": {
259
+ "schema": {
260
+ "$ref": "#/components/schemas/GetExecutionsResp"
261
+ }
262
+ }
263
+ }
264
+ }
265
+ }
266
+ },
267
+ "post": {
268
+ "operationId": "startExecution",
269
+ "summary": "startExecution",
270
+ "description": "Start new automation execution",
271
+ "requestBody": {
272
+ "description": "Execution parameters",
273
+ "content": {
274
+ "application/json": {
275
+ "schema": {
276
+ "$ref": "#/components/schemas/StartExecutionRequest"
277
+ }
278
+ }
279
+ }
297
280
  },
298
- "/v1/automation/executions/{execution_id}": {
299
- "get": {
300
- "operationId": "getExecution",
301
- "summary": "getExecution",
302
- "description": "Get automation execution",
303
- "parameters": [
304
- {
305
- "name": "execution_id",
306
- "in": "path",
307
- "schema": {
308
- "$ref": "#/components/schemas/AutomationExecutionId"
309
- },
310
- "required": true
311
- }
312
- ],
313
- "tags": [
314
- "executions"
315
- ],
316
- "responses": {
317
- "200": {
318
- "description": "The returned execution",
319
- "content": {
320
- "application/json": {
321
- "schema": {
322
- "$ref": "#/components/schemas/AutomationExecution"
323
- }
324
- }
325
- }
326
- }
281
+ "tags": [
282
+ "executions"
283
+ ],
284
+ "responses": {
285
+ "201": {
286
+ "description": "The created execution",
287
+ "content": {
288
+ "application/json": {
289
+ "schema": {
290
+ "$ref": "#/components/schemas/AutomationExecution"
327
291
  }
328
- },
329
- "delete": {
330
- "operationId": "cancelExecution",
331
- "summary": "cancelExecution",
332
- "description": "Cancel automation execution",
333
- "parameters": [
334
- {
335
- "name": "execution_id",
336
- "in": "path",
337
- "schema": {
338
- "$ref": "#/components/schemas/AutomationExecutionId"
339
- },
340
- "required": true
341
- }
342
- ],
343
- "tags": [
344
- "executions"
345
- ],
346
- "responses": {
347
- "200": {
348
- "description": "The cancelled execution",
349
- "content": {
350
- "application/json": {
351
- "schema": {
352
- "$ref": "#/components/schemas/AutomationExecution"
353
- }
354
- }
355
- }
356
- }
292
+ }
293
+ }
294
+ }
295
+ }
296
+ }
297
+ },
298
+ "/v1/automation/executions/{execution_id}": {
299
+ "get": {
300
+ "operationId": "getExecution",
301
+ "summary": "getExecution",
302
+ "description": "Get automation execution",
303
+ "parameters": [
304
+ {
305
+ "name": "execution_id",
306
+ "in": "path",
307
+ "schema": {
308
+ "$ref": "#/components/schemas/AutomationExecutionId"
309
+ },
310
+ "required": true
311
+ }
312
+ ],
313
+ "tags": [
314
+ "executions"
315
+ ],
316
+ "responses": {
317
+ "200": {
318
+ "description": "The returned execution",
319
+ "content": {
320
+ "application/json": {
321
+ "schema": {
322
+ "$ref": "#/components/schemas/AutomationExecution"
357
323
  }
324
+ }
358
325
  }
359
- },
360
- "/v1/automation/executions/{execution_id}/{action_id}/retrigger": {
361
- "post": {
362
- "operationId": "retriggerAction",
363
- "summary": "retriggerAction",
364
- "description": "Retry a specific automation execution action which failed / is stuck.",
365
- "tags": [
366
- "executions"
367
- ],
368
- "parameters": [
369
- {
370
- "name": "execution_id",
371
- "in": "path",
372
- "description": "Execution Id",
373
- "schema": {
374
- "$ref": "#/components/schemas/AutomationExecutionId"
375
- },
376
- "required": true
377
- },
378
- {
379
- "name": "action_id",
380
- "in": "path",
381
- "description": "Id of Action to retry.",
382
- "schema": {
383
- "$ref": "#/components/schemas/AutomationActionId"
384
- },
385
- "required": true
386
- }
387
- ],
388
- "requestBody": {
389
- "description": "Retry request details.",
390
- "required": false,
391
- "content": {
392
- "application/json": {
393
- "schema": {
394
- "$ref": "#/components/schemas/RetryReq"
395
- }
396
- }
397
- }
398
- },
399
- "responses": {
400
- "200": {
401
- "description": "action re-triggered with success"
402
- }
326
+ }
327
+ }
328
+ },
329
+ "delete": {
330
+ "operationId": "cancelExecution",
331
+ "summary": "cancelExecution",
332
+ "description": "Cancel automation execution",
333
+ "parameters": [
334
+ {
335
+ "name": "execution_id",
336
+ "in": "path",
337
+ "schema": {
338
+ "$ref": "#/components/schemas/AutomationExecutionId"
339
+ },
340
+ "required": true
341
+ }
342
+ ],
343
+ "tags": [
344
+ "executions"
345
+ ],
346
+ "responses": {
347
+ "200": {
348
+ "description": "The cancelled execution",
349
+ "content": {
350
+ "application/json": {
351
+ "schema": {
352
+ "$ref": "#/components/schemas/AutomationExecution"
403
353
  }
354
+ }
404
355
  }
356
+ }
405
357
  }
358
+ }
406
359
  },
407
- "components": {
408
- "securitySchemes": {
409
- "EpilotAuth": {
410
- "type": "http",
411
- "scheme": "bearer",
412
- "description": "Epilot Bearer Token"
360
+ "/v1/automation/executions/{execution_id}/{action_id}/retrigger": {
361
+ "post": {
362
+ "operationId": "retriggerAction",
363
+ "summary": "retriggerAction",
364
+ "description": "Retry a specific automation execution action which failed / is stuck.",
365
+ "tags": [
366
+ "executions"
367
+ ],
368
+ "parameters": [
369
+ {
370
+ "name": "execution_id",
371
+ "in": "path",
372
+ "description": "Execution Id",
373
+ "schema": {
374
+ "$ref": "#/components/schemas/AutomationExecutionId"
375
+ },
376
+ "required": true
377
+ },
378
+ {
379
+ "name": "action_id",
380
+ "in": "path",
381
+ "description": "Id of Action to retry.",
382
+ "schema": {
383
+ "$ref": "#/components/schemas/AutomationActionId"
384
+ },
385
+ "required": true
386
+ }
387
+ ],
388
+ "requestBody": {
389
+ "description": "Retry request details.",
390
+ "required": false,
391
+ "content": {
392
+ "application/json": {
393
+ "schema": {
394
+ "$ref": "#/components/schemas/RetryReq"
395
+ }
413
396
  }
397
+ }
414
398
  },
415
- "schemas": {
416
- "AutomationFlowId": {
417
- "type": "string",
418
- "example": "7791b04a-16d2-44a2-9af9-2d59c25c512f"
419
- },
420
- "AutomationActionId": {
421
- "type": "string",
422
- "example": "9ec3711b-db63-449c-b894-54d5bb622a8f"
423
- },
424
- "AutomationFlow": {
425
- "type": "object",
426
- "properties": {
427
- "id": {
428
- "$ref": "#/components/schemas/AutomationFlowId"
429
- },
430
- "flow_name": {
431
- "type": "string",
432
- "description": "A descriptive name for the Automation",
433
- "example": "Handle contact form"
434
- },
435
- "enabled": {
436
- "type": "boolean",
437
- "description": "Whether the automation is enabled or not",
438
- "default": true
439
- },
440
- "triggers": {
441
- "type": "array",
442
- "items": {
443
- "$ref": "#/components/schemas/AnyTrigger"
444
- }
445
- },
446
- "trigger_conditions": {
447
- "type": "array",
448
- "items": {
449
- "$ref": "#/components/schemas/TriggerCondition"
450
- }
451
- },
452
- "entity_schema": {
453
- "description": "The triggering entity schema",
454
- "type": "string",
455
- "example": "submission"
456
- },
457
- "actions": {
458
- "type": "array",
459
- "items": {
460
- "$ref": "#/components/schemas/AnyActionConfig"
461
- }
462
- },
463
- "runs": {
464
- "type": "number",
465
- "example": 7,
466
- "description": "Number of automation executions that ran"
467
- },
468
- "created_at": {
469
- "type": "string",
470
- "format": "date-time"
471
- },
472
- "updated_at": {
473
- "type": "string",
474
- "format": "date-time"
475
- },
476
- "created_by": {
477
- "type": "string",
478
- "example": "user:123",
479
- "description": "User / service who created automation flow"
480
- },
481
- "last_updated_by": {
482
- "type": "string",
483
- "example": "user:123",
484
- "description": "User / service who last updated automation flow"
485
- }
486
- },
487
- "required": [
488
- "flow_name",
489
- "triggers",
490
- "actions"
491
- ]
492
- },
493
- "SearchAutomationsResp": {
494
- "type": "object",
495
- "properties": {
496
- "total": {
497
- "type": "number"
498
- },
499
- "results": {
500
- "type": "array",
501
- "items": {
502
- "$ref": "#/components/schemas/AutomationFlow"
503
- }
504
- }
505
- },
506
- "required": [
507
- "total",
508
- "results"
509
- ]
510
- },
511
- "AnyTrigger": {
512
- "anyOf": [
513
- {
514
- "$ref": "#/components/schemas/FrontendSubmitTrigger"
515
- },
516
- {
517
- "$ref": "#/components/schemas/JourneySubmitTrigger"
518
- },
519
- {
520
- "$ref": "#/components/schemas/ApiSubmissionTrigger"
521
- },
522
- {
523
- "$ref": "#/components/schemas/EntityOperationTrigger"
524
- },
525
- {
526
- "$ref": "#/components/schemas/ActivityTrigger"
527
- },
528
- {
529
- "$ref": "#/components/schemas/EntityManualTrigger"
530
- },
531
- {
532
- "$ref": "#/components/schemas/ReceivedEmailTrigger"
533
- }
534
- ]
535
- },
536
- "AnyAction": {
537
- "anyOf": [
538
- {
539
- "$ref": "#/components/schemas/MapEntityAction"
540
- },
541
- {
542
- "$ref": "#/components/schemas/TriggerWorkflowAction"
543
- },
544
- {
545
- "$ref": "#/components/schemas/TriggerWebhookAction"
546
- },
547
- {
548
- "$ref": "#/components/schemas/CreateDocumentAction"
549
- },
550
- {
551
- "$ref": "#/components/schemas/SendEmailAction"
552
- },
553
- {
554
- "$ref": "#/components/schemas/CartCheckoutAction"
555
- },
556
- {
557
- "$ref": "#/components/schemas/AutomationAction"
558
- }
559
- ]
560
- },
561
- "AnyActionConfig": {
562
- "anyOf": [
563
- {
564
- "$ref": "#/components/schemas/MapEntityActionConfig"
565
- },
566
- {
567
- "$ref": "#/components/schemas/TriggerWorkflowActionConfig"
568
- },
569
- {
570
- "$ref": "#/components/schemas/TriggerWebhookActionConfig"
571
- },
572
- {
573
- "$ref": "#/components/schemas/CreateDocumentActionConfig"
574
- },
575
- {
576
- "$ref": "#/components/schemas/SendEmailActionConfig"
577
- },
578
- {
579
- "$ref": "#/components/schemas/CartCheckoutActionConfig"
580
- },
581
- {
582
- "$ref": "#/components/schemas/AutomationActionConfig"
583
- }
584
- ]
585
- },
586
- "AutomationActionConfig": {
587
- "type": "object",
588
- "properties": {
589
- "id": {
590
- "$ref": "#/components/schemas/AutomationActionId"
591
- },
592
- "flow_action_id": {
593
- "$ref": "#/components/schemas/AutomationActionId"
594
- },
595
- "name": {
596
- "type": "string"
597
- },
598
- "type": {
599
- "type": "string"
600
- },
601
- "config": {
602
- "type": "object",
603
- "additionalProperties": true
604
- },
605
- "allow_failure": {
606
- "description": "Whether to stop execution in a failed state if this action fails",
607
- "type": "boolean"
608
- },
609
- "created_automatically": {
610
- "description": "Flag indicating whether the action was created automatically or manually",
611
- "type": "boolean"
612
- }
613
- }
614
- },
615
- "AutomationActionExecutionState": {
616
- "type": "object",
617
- "properties": {
618
- "execution_status": {
619
- "$ref": "#/components/schemas/ExecutionStatus"
620
- },
621
- "started_at": {
622
- "type": "string"
623
- },
624
- "updated_at": {
625
- "type": "string"
626
- },
627
- "outputs": {
628
- "type": "object",
629
- "additionalProperties": true,
630
- "example": {}
631
- },
632
- "error_output": {
633
- "$ref": "#/components/schemas/ErrorOutput"
634
- },
635
- "retry_strategy": {
636
- "$ref": "#/components/schemas/RetryStrategy"
637
- }
638
- }
639
- },
640
- "RetryStrategy": {
641
- "type": "string",
642
- "description": "different behaviors for retrying failed execution actions.",
643
- "enum": [
644
- "RETRY_AND_RESUME",
645
- "RETRY_AND_STOP"
646
- ]
647
- },
648
- "AutomationAction": {
649
- "allOf": [
650
- {
651
- "$ref": "#/components/schemas/AutomationActionConfig"
652
- },
653
- {
654
- "$ref": "#/components/schemas/AutomationActionExecutionState"
655
- }
656
- ]
657
- },
658
- "ErrorOutput": {
659
- "type": "object",
660
- "properties": {
661
- "error_code": {
662
- "$ref": "#/components/schemas/ErrorCode"
663
- },
664
- "error_reason": {
665
- "type": "string"
666
- }
667
- },
668
- "required": [
669
- "error_code",
670
- "error_reason"
671
- ]
672
- },
673
- "ErrorCode": {
674
- "type": "string",
675
- "enum": [
676
- "MAPPING_ERROR",
677
- "REFRESH_RELATIONS_ERROR",
678
- "DUPLICATE_ENTITY_ERROR",
679
- "TRIGGER_WORKFLOW_ERROR",
680
- "TIMEOUT_ERROR",
681
- "BAD_CONFIG",
682
- "INTERNAL_ERROR"
683
- ]
684
- },
685
- "CartCheckoutActionConfig": {
686
- "allOf": [
687
- {
688
- "$ref": "#/components/schemas/AutomationActionConfig"
689
- },
690
- {
691
- "type": "object",
692
- "description": "Creates an order entity with prices from journey",
693
- "properties": {
694
- "type": {
695
- "enum": [
696
- "cart-checkout"
697
- ]
698
- },
699
- "config": {
700
- "$ref": "#/components/schemas/CartCheckoutConfig"
701
- }
702
- }
703
- }
704
- ]
705
- },
706
- "CartCheckoutAction": {
707
- "allOf": [
708
- {
709
- "$ref": "#/components/schemas/AutomationAction"
710
- },
711
- {
712
- "type": "object",
713
- "description": "Creates an order entity with prices from journey",
714
- "properties": {
715
- "type": {
716
- "enum": [
717
- "cart-checkout"
718
- ]
719
- },
720
- "config": {
721
- "$ref": "#/components/schemas/CartCheckoutConfig"
722
- }
723
- }
724
- }
725
- ]
726
- },
727
- "CartCheckoutConfig": {
728
- "type": "object",
729
- "properties": {
730
- "version": {
731
- "description": "Version of the config",
732
- "type": "string",
733
- "default": "1"
734
- },
735
- "mapping_config": {
736
- "$ref": "#/components/schemas/MappingConfigRef"
737
- },
738
- "relation_attributes": {
739
- "type": "array",
740
- "items": {
741
- "$ref": "#/components/schemas/RelationAttribute"
742
- }
743
- },
744
- "mapping_attributes": {
745
- "type": "array",
746
- "items": {
747
- "anyOf": [
748
- {
749
- "$ref": "#/components/schemas/MappingAttributeV2"
750
- },
751
- {
752
- "$ref": "#/components/schemas/MappingAttribute"
753
- }
754
- ]
755
- }
756
- },
757
- "linkback_relation_attribute": {
758
- "type": "string",
759
- "default": "mapped_entities",
760
- "description": "Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\n"
761
- },
762
- "linkback_relation_tags": {
763
- "type": "array",
764
- "description": "Relation tags (labels) to include in main entity linkback relation attribute",
765
- "items": {
766
- "type": "string"
767
- }
768
- },
769
- "target_unique": {
770
- "type": "array",
771
- "description": "Unique key for target entity (see upsertEntity of Entity API)",
772
- "items": {
773
- "type": "string"
774
- }
775
- }
776
- }
777
- },
778
- "MapEntityActionConfig": {
779
- "allOf": [
780
- {
781
- "$ref": "#/components/schemas/AutomationActionConfig"
782
- },
783
- {
784
- "type": "object",
785
- "properties": {
786
- "type": {
787
- "enum": [
788
- "map-entity"
789
- ]
790
- },
791
- "config": {
792
- "$ref": "#/components/schemas/MapEntityConfig"
793
- }
794
- }
795
- }
796
- ],
797
- "example": {
798
- "id": "2520gja-2sgmsaga-0asg-822jgal",
799
- "name": "Map Entity",
800
- "type": "map-entity",
801
- "config": {
802
- "target_schema": "contact",
803
- "target_unique": [
804
- "email.0.email"
805
- ],
806
- "relation_attributes": [
807
- {
808
- "target": "company",
809
- "mode": "append",
810
- "source_filter": {
811
- "schema": "account",
812
- "limit": 1
813
- }
814
- }
815
- ],
816
- "mapping_attributes": [
817
- {
818
- "target": "_tags",
819
- "operation": {
820
- "_append": [
821
- "primary",
822
- "payer"
823
- ],
824
- "_uniq": true
825
- }
826
- },
827
- {
828
- "target": "email",
829
- "operation": {
830
- "_append": [
831
- {
832
- "email": {
833
- "_copy": "billing_contact.email"
834
- }
835
- }
836
- ]
837
- }
838
- },
839
- {
840
- "target": "first_name",
841
- "operation": {
842
- "_copy": "billing_contact.first_name"
843
- }
844
- },
845
- {
846
- "target": "last_name",
847
- "operation": {
848
- "_copy": "billing_contact.last_name"
849
- }
850
- },
851
- {
852
- "target": "contact_type",
853
- "operation": {
854
- "_set": "customer"
855
- }
856
- },
857
- {
858
- "target": "address",
859
- "operation": {
860
- "_append": [
861
- {
862
- "_tags": [
863
- "billing",
864
- "primary"
865
- ],
866
- "street_name": {
867
- "_copy": "billing_contact.street_name"
868
- },
869
- "street_number": {
870
- "_copy": "billing_contact.street_number"
871
- },
872
- "city": {
873
- "_copy": "billing_contact.city"
874
- },
875
- "postal_code": {
876
- "_copy": "billing_contact.postal_code"
877
- },
878
- "country": {
879
- "_copy": "billing_contact.country"
880
- }
881
- },
882
- {
883
- "_tags": [
884
- "delivery"
885
- ],
886
- "street_name": {
887
- "_copy": "delivery_contact.street_name"
888
- },
889
- "street_number": {
890
- "_copy": "delivery_contact.street_number"
891
- },
892
- "city": {
893
- "_copy": "delivery_contact.city"
894
- },
895
- "postal_code": {
896
- "_copy": "delivery_contact.postal_code"
897
- },
898
- "country": {
899
- "_copy": "delivery_contact.country"
900
- }
901
- }
902
- ],
903
- "_uniq": [
904
- "street_name",
905
- "street_number",
906
- "postal_code",
907
- "country"
908
- ]
909
- }
910
- }
911
- ]
912
- }
913
- }
914
- },
915
- "MapEntityAction": {
916
- "allOf": [
917
- {
918
- "$ref": "#/components/schemas/AutomationAction"
919
- },
920
- {
921
- "type": "object",
922
- "properties": {
923
- "type": {
924
- "enum": [
925
- "map-entity"
926
- ]
927
- },
928
- "config": {
929
- "$ref": "#/components/schemas/MapEntityConfig"
930
- }
931
- }
932
- }
933
- ]
934
- },
935
- "MapEntityConfig": {
936
- "type": "object",
937
- "properties": {
938
- "mapping_config": {
939
- "$ref": "#/components/schemas/MappingConfigRef"
940
- },
941
- "target_schema": {
942
- "type": "string",
943
- "description": "Schema of target entity"
944
- },
945
- "target_unique": {
946
- "type": "array",
947
- "description": "Unique key for target entity (see upsertEntity of Entity API)",
948
- "items": {
949
- "type": "string"
950
- }
951
- },
952
- "mapping_attributes": {
953
- "type": "array",
954
- "description": "Attribute mappings",
955
- "items": {
956
- "anyOf": [
957
- {
958
- "$ref": "#/components/schemas/MappingAttributeV2"
959
- },
960
- {
961
- "$ref": "#/components/schemas/MappingAttribute"
962
- }
963
- ]
964
- }
965
- },
966
- "relation_attributes": {
967
- "type": "array",
968
- "description": "Relation mappings",
969
- "items": {
970
- "$ref": "#/components/schemas/RelationAttribute"
971
- }
972
- },
973
- "linkback_relation_attribute": {
974
- "type": "string",
975
- "default": "mapped_entities",
976
- "description": "Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\n"
977
- },
978
- "linkback_relation_tags": {
979
- "type": "array",
980
- "description": "Relation tags (labels) to include in main entity linkback relation attribute",
981
- "items": {
982
- "type": "string"
983
- }
984
- }
985
- },
986
- "required": [
987
- "target_schema"
988
- ]
989
- },
990
- "MappingConfigRef": {
991
- "type": "object",
992
- "properties": {
993
- "config_id": {
994
- "type": "string",
995
- "description": "Id of Entity Mapping Configuration to run for mapping."
996
- },
997
- "target_id": {
998
- "type": "string",
999
- "description": "Id of TargetConfig to run for mapping."
1000
- },
1001
- "version": {
1002
- "type": "number",
1003
- "description": "Version of Entity Mapping Configuration to run for mapping."
1004
- }
1005
- },
1006
- "required": [
1007
- "config_id",
1008
- "target_id"
1009
- ]
1010
- },
1011
- "RelationAttribute": {
1012
- "type": "object",
1013
- "properties": {
1014
- "target": {
1015
- "type": "string",
1016
- "description": "Target attribute to store the relation in"
1017
- },
1018
- "target_tags": {
1019
- "type": "array",
1020
- "description": "Relation tags (labels) to set for the stored relations",
1021
- "items": {
1022
- "type": "string"
1023
- }
1024
- },
1025
- "target_tags_include_source": {
1026
- "type": "boolean",
1027
- "description": "Include all relation tags (labels) present on the main entity relation",
1028
- "default": false
1029
- },
1030
- "source_filter": {
1031
- "type": "object",
1032
- "description": "A filter to identify which source entities to pick as relations from main entity",
1033
- "properties": {
1034
- "limit": {
1035
- "type": "integer",
1036
- "description": "Limit relations to maximum number (default, all matched relations)",
1037
- "minimum": 0
1038
- },
1039
- "schema": {
1040
- "type": "string",
1041
- "description": "Filter by specific schema"
1042
- },
1043
- "attribute": {
1044
- "type": "string",
1045
- "description": "Filter by a specific relation attribute on the main entity"
1046
- },
1047
- "relation_tag": {
1048
- "type": "string",
1049
- "description": "Filter by relation tag (label) on the main entity"
1050
- },
1051
- "tag": {
1052
- "type": "string",
1053
- "description": "Filter by a specific tag on the related entity"
1054
- },
1055
- "self": {
1056
- "type": "boolean",
1057
- "description": "Picks main entity as relation (overrides other filters)",
1058
- "default": false
1059
- }
1060
- }
1061
- },
1062
- "related_to": {
1063
- "type": "object",
1064
- "additionalProperties": true,
1065
- "deprecated": true
1066
- },
1067
- "mode": {
1068
- "type": "string",
1069
- "enum": [
1070
- "append",
1071
- "prepend",
1072
- "set"
1073
- ]
1074
- }
1075
- },
1076
- "required": [
1077
- "target",
1078
- "mode"
1079
- ]
1080
- },
1081
- "MappingAttributeV2": {
1082
- "type": "object",
1083
- "properties": {
1084
- "target": {
1085
- "type": "string",
1086
- "description": "Target JSON path for the attribute to set"
1087
- },
1088
- "operation": {
1089
- "$ref": "#/components/schemas/OperationNode"
1090
- }
1091
- },
1092
- "required": [
1093
- "targetPath",
1094
- "operation"
1095
- ],
1096
- "example": {
1097
- "target": "_tags",
1098
- "operation": {
1099
- "_append": [
1100
- "new",
1101
- "tags"
1102
- ],
1103
- "_uniq": true
1104
- }
1105
- }
1106
- },
1107
- "OperationNode": {
1108
- "description": "Mapping operation nodes are either primitive values or operation node objects",
1109
- "oneOf": [
1110
- {
1111
- "$ref": "#/components/schemas/OperationObjectNode"
1112
- },
1113
- {
1114
- "$ref": "#/components/schemas/PrimitiveJSONValue"
1115
- }
1116
- ]
1117
- },
1118
- "OperationObjectNode": {
1119
- "type": "object",
1120
- "properties": {
1121
- "_set": {
1122
- "$ref": "#/components/schemas/PrimitiveJSONValue"
1123
- },
1124
- "_append": {
1125
- "description": "Append to array",
1126
- "items": {
1127
- "$ref": "#/components/schemas/PrimitiveJSONValue"
1128
- }
1129
- },
1130
- "_uniq": {
1131
- "description": "Unique array",
1132
- "oneOf": [
1133
- {
1134
- "type": "boolean",
1135
- "example": true
1136
- },
1137
- {
1138
- "type": "array",
1139
- "description": "Unique key consisting of object keys",
1140
- "example": [
1141
- "email"
1142
- ],
1143
- "items": {
1144
- "type": "string"
1145
- }
1146
- }
1147
- ]
1148
- },
1149
- "_copy": {
1150
- "description": "Copy JSONPath value from source entity context",
1151
- "type": "string",
1152
- "example": "contact.first_name"
1153
- }
1154
- },
1155
- "additionalProperties": true
1156
- },
1157
- "PrimitiveJSONValue": {},
1158
- "MappingAttribute": {
1159
- "anyOf": [
1160
- {
1161
- "$ref": "#/components/schemas/SetValueMapper"
1162
- },
1163
- {
1164
- "$ref": "#/components/schemas/CopyValueMapper"
1165
- },
1166
- {
1167
- "$ref": "#/components/schemas/AppendValueMapper"
1168
- }
1169
- ]
1170
- },
1171
- "MappingAttributeMode": {
1172
- "type": "string",
399
+ "responses": {
400
+ "200": {
401
+ "description": "action re-triggered with success"
402
+ }
403
+ }
404
+ }
405
+ }
406
+ },
407
+ "components": {
408
+ "securitySchemes": {
409
+ "EpilotAuth": {
410
+ "type": "http",
411
+ "scheme": "bearer",
412
+ "description": "Epilot Bearer Token"
413
+ }
414
+ },
415
+ "schemas": {
416
+ "AutomationFlowId": {
417
+ "type": "string",
418
+ "example": "7791b04a-16d2-44a2-9af9-2d59c25c512f",
419
+ "readOnly": true
420
+ },
421
+ "AutomationActionId": {
422
+ "type": "string",
423
+ "example": "9ec3711b-db63-449c-b894-54d5bb622a8f"
424
+ },
425
+ "AutomationFlow": {
426
+ "type": "object",
427
+ "properties": {
428
+ "id": {
429
+ "$ref": "#/components/schemas/AutomationFlowId"
430
+ },
431
+ "flow_name": {
432
+ "type": "string",
433
+ "description": "A descriptive name for the Automation",
434
+ "example": "Handle contact form"
435
+ },
436
+ "enabled": {
437
+ "type": "boolean",
438
+ "description": "Whether the automation is enabled or not",
439
+ "default": true
440
+ },
441
+ "triggers": {
442
+ "type": "array",
443
+ "items": {
444
+ "$ref": "#/components/schemas/AnyTrigger"
445
+ }
446
+ },
447
+ "trigger_conditions": {
448
+ "type": "array",
449
+ "items": {
450
+ "$ref": "#/components/schemas/TriggerCondition"
451
+ }
452
+ },
453
+ "entity_schema": {
454
+ "description": "The triggering entity schema",
455
+ "type": "string",
456
+ "example": "submission"
457
+ },
458
+ "actions": {
459
+ "type": "array",
460
+ "items": {
461
+ "$ref": "#/components/schemas/AnyActionConfig"
462
+ },
463
+ "readOnly": true
464
+ },
465
+ "runs": {
466
+ "type": "number",
467
+ "example": 7,
468
+ "description": "Number of automation executions that ran"
469
+ },
470
+ "created_at": {
471
+ "type": "string",
472
+ "format": "date-time",
473
+ "readOnly": true
474
+ },
475
+ "updated_at": {
476
+ "type": "string",
477
+ "format": "date-time",
478
+ "readOnly": true
479
+ },
480
+ "created_by": {
481
+ "type": "string",
482
+ "example": "user:123",
483
+ "description": "User / service who created automation flow",
484
+ "readOnly": true
485
+ },
486
+ "last_updated_by": {
487
+ "type": "string",
488
+ "example": "user:123",
489
+ "description": "User / service who last updated automation flow",
490
+ "readOnly": true
491
+ },
492
+ "org_id": {
493
+ "type": "string",
494
+ "example": "123",
495
+ "description": "Organization the automation flow belongs to",
496
+ "readOnly": true
497
+ }
498
+ },
499
+ "required": [
500
+ "flow_name",
501
+ "triggers",
502
+ "actions"
503
+ ]
504
+ },
505
+ "SearchAutomationsResp": {
506
+ "type": "object",
507
+ "properties": {
508
+ "total": {
509
+ "type": "number"
510
+ },
511
+ "results": {
512
+ "type": "array",
513
+ "items": {
514
+ "$ref": "#/components/schemas/AutomationFlow"
515
+ }
516
+ }
517
+ },
518
+ "required": [
519
+ "total",
520
+ "results"
521
+ ]
522
+ },
523
+ "AnyTrigger": {
524
+ "anyOf": [
525
+ {
526
+ "$ref": "#/components/schemas/FrontendSubmitTrigger"
527
+ },
528
+ {
529
+ "$ref": "#/components/schemas/JourneySubmitTrigger"
530
+ },
531
+ {
532
+ "$ref": "#/components/schemas/ApiSubmissionTrigger"
533
+ },
534
+ {
535
+ "$ref": "#/components/schemas/EntityOperationTrigger"
536
+ },
537
+ {
538
+ "$ref": "#/components/schemas/ActivityTrigger"
539
+ },
540
+ {
541
+ "$ref": "#/components/schemas/EntityManualTrigger"
542
+ },
543
+ {
544
+ "$ref": "#/components/schemas/ReceivedEmailTrigger"
545
+ }
546
+ ]
547
+ },
548
+ "AnyAction": {
549
+ "anyOf": [
550
+ {
551
+ "$ref": "#/components/schemas/MapEntityAction"
552
+ },
553
+ {
554
+ "$ref": "#/components/schemas/TriggerWorkflowAction"
555
+ },
556
+ {
557
+ "$ref": "#/components/schemas/TriggerWebhookAction"
558
+ },
559
+ {
560
+ "$ref": "#/components/schemas/CreateDocumentAction"
561
+ },
562
+ {
563
+ "$ref": "#/components/schemas/SendEmailAction"
564
+ },
565
+ {
566
+ "$ref": "#/components/schemas/CartCheckoutAction"
567
+ },
568
+ {
569
+ "$ref": "#/components/schemas/AutomationAction"
570
+ }
571
+ ]
572
+ },
573
+ "AnyActionConfig": {
574
+ "anyOf": [
575
+ {
576
+ "$ref": "#/components/schemas/MapEntityActionConfig"
577
+ },
578
+ {
579
+ "$ref": "#/components/schemas/TriggerWorkflowActionConfig"
580
+ },
581
+ {
582
+ "$ref": "#/components/schemas/TriggerWebhookActionConfig"
583
+ },
584
+ {
585
+ "$ref": "#/components/schemas/CreateDocumentActionConfig"
586
+ },
587
+ {
588
+ "$ref": "#/components/schemas/SendEmailActionConfig"
589
+ },
590
+ {
591
+ "$ref": "#/components/schemas/CartCheckoutActionConfig"
592
+ },
593
+ {
594
+ "$ref": "#/components/schemas/AutomationActionConfig"
595
+ }
596
+ ]
597
+ },
598
+ "AutomationActionConfig": {
599
+ "type": "object",
600
+ "properties": {
601
+ "id": {
602
+ "$ref": "#/components/schemas/AutomationActionId"
603
+ },
604
+ "flow_action_id": {
605
+ "$ref": "#/components/schemas/AutomationActionId"
606
+ },
607
+ "name": {
608
+ "type": "string"
609
+ },
610
+ "type": {
611
+ "type": "string"
612
+ },
613
+ "config": {
614
+ "type": "object",
615
+ "additionalProperties": true
616
+ },
617
+ "allow_failure": {
618
+ "description": "Whether to stop execution in a failed state if this action fails",
619
+ "type": "boolean"
620
+ },
621
+ "created_automatically": {
622
+ "description": "Flag indicating whether the action was created automatically or manually",
623
+ "type": "boolean"
624
+ }
625
+ }
626
+ },
627
+ "AutomationActionExecutionState": {
628
+ "type": "object",
629
+ "properties": {
630
+ "execution_status": {
631
+ "$ref": "#/components/schemas/ExecutionStatus"
632
+ },
633
+ "started_at": {
634
+ "type": "string"
635
+ },
636
+ "updated_at": {
637
+ "type": "string"
638
+ },
639
+ "outputs": {
640
+ "type": "object",
641
+ "additionalProperties": true,
642
+ "example": {}
643
+ },
644
+ "error_output": {
645
+ "$ref": "#/components/schemas/ErrorOutput"
646
+ },
647
+ "retry_strategy": {
648
+ "$ref": "#/components/schemas/RetryStrategy"
649
+ }
650
+ }
651
+ },
652
+ "RetryStrategy": {
653
+ "type": "string",
654
+ "description": "different behaviors for retrying failed execution actions.",
655
+ "enum": [
656
+ "RETRY_AND_RESUME",
657
+ "RETRY_AND_STOP"
658
+ ]
659
+ },
660
+ "AutomationAction": {
661
+ "allOf": [
662
+ {
663
+ "$ref": "#/components/schemas/AutomationActionConfig"
664
+ },
665
+ {
666
+ "$ref": "#/components/schemas/AutomationActionExecutionState"
667
+ }
668
+ ]
669
+ },
670
+ "ErrorOutput": {
671
+ "type": "object",
672
+ "properties": {
673
+ "error_code": {
674
+ "$ref": "#/components/schemas/ErrorCode"
675
+ },
676
+ "error_reason": {
677
+ "type": "string"
678
+ }
679
+ },
680
+ "required": [
681
+ "error_code",
682
+ "error_reason"
683
+ ]
684
+ },
685
+ "ErrorCode": {
686
+ "type": "string",
687
+ "enum": [
688
+ "MAPPING_ERROR",
689
+ "REFRESH_RELATIONS_ERROR",
690
+ "DUPLICATE_ENTITY_ERROR",
691
+ "TRIGGER_WORKFLOW_ERROR",
692
+ "TIMEOUT_ERROR",
693
+ "BAD_CONFIG",
694
+ "INTERNAL_ERROR"
695
+ ]
696
+ },
697
+ "CartCheckoutActionConfig": {
698
+ "allOf": [
699
+ {
700
+ "$ref": "#/components/schemas/AutomationActionConfig"
701
+ },
702
+ {
703
+ "type": "object",
704
+ "description": "Creates an order entity with prices from journey",
705
+ "properties": {
706
+ "type": {
1173
707
  "enum": [
1174
- "copy_if_exists",
1175
- "append_if_exists",
1176
- "set_value"
1177
- ],
1178
- "description": "- copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property.\n"
1179
- },
1180
- "SetValueMapper": {
1181
- "type": "object",
1182
- "deprecated": true,
1183
- "properties": {
1184
- "mode": {
1185
- "$ref": "#/components/schemas/MappingAttributeMode"
1186
- },
1187
- "target": {
1188
- "type": "string",
1189
- "description": "JSON like target path for the attribute. Eg. last_name"
1190
- },
1191
- "value": {
1192
- "description": "Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any.\n"
1193
- }
1194
- },
1195
- "required": [
1196
- "mode",
1197
- "target",
1198
- "value"
1199
- ]
1200
- },
1201
- "CopyValueMapper": {
1202
- "type": "object",
1203
- "deprecated": true,
1204
- "properties": {
1205
- "mode": {
1206
- "$ref": "#/components/schemas/MappingAttributeMode"
1207
- },
1208
- "target": {
1209
- "type": "string",
1210
- "description": "JSON like target path for the attribute. Eg. last_name"
1211
- },
1212
- "source": {
1213
- "type": "string",
1214
- "description": "JSON source path for the value to be extracted from the main entity. Eg: steps[1].['Product Info'].price\n"
1215
- }
1216
- },
1217
- "required": [
1218
- "mode",
1219
- "target",
1220
- "source"
1221
- ]
1222
- },
1223
- "AppendValueMapper": {
1224
- "type": "object",
1225
- "deprecated": true,
1226
- "properties": {
1227
- "mode": {
1228
- "$ref": "#/components/schemas/MappingAttributeMode"
1229
- },
1230
- "target": {
1231
- "type": "string",
1232
- "description": "JSON like target path for the attribute. Eg. last_name"
1233
- },
1234
- "source": {
1235
- "type": "string",
1236
- "description": "JSON source path for the value to be extracted from the main entity. Eg: steps[1].['Product Info'].price\n"
1237
- },
1238
- "value_json": {
1239
- "type": "string",
1240
- "description": "To be provided only when mapping json objects into a target attribute. Eg array of addresses.\n"
1241
- },
1242
- "target_unique": {
1243
- "type": "array",
1244
- "items": {
1245
- "type": "string"
1246
- },
1247
- "description": "Array of keys which should be used when checking for uniqueness. Eg: [country, city, postal_code]\n"
1248
- }
1249
- },
1250
- "required": [
1251
- "mode",
1252
- "target",
1253
- "value_json"
708
+ "cart-checkout"
1254
709
  ]
1255
- },
1256
- "SendEmailActionConfig": {
1257
- "allOf": [
1258
- {
1259
- "$ref": "#/components/schemas/AutomationActionConfig"
1260
- },
1261
- {
1262
- "type": "object",
1263
- "properties": {
1264
- "type": {
1265
- "enum": [
1266
- "send-email"
1267
- ]
1268
- },
1269
- "config": {
1270
- "$ref": "#/components/schemas/SendEmailConfig"
1271
- }
1272
- }
1273
- }
1274
- ],
1275
- "example": {
1276
- "id": "25jga0-gkasl26-0asg-908sgaj2",
1277
- "name": "Send Email",
1278
- "type": "send-email",
1279
- "config": {
1280
- "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2",
1281
- "language_code": "de"
1282
- }
1283
- }
1284
- },
1285
- "SendEmailAction": {
1286
- "allOf": [
1287
- {
1288
- "$ref": "#/components/schemas/AutomationAction"
1289
- },
1290
- {
1291
- "type": "object",
1292
- "properties": {
1293
- "type": {
1294
- "enum": [
1295
- "send-email"
1296
- ]
1297
- },
1298
- "config": {
1299
- "$ref": "#/components/schemas/SendEmailConfig"
1300
- }
1301
- }
1302
- }
1303
- ]
1304
- },
1305
- "SendEmailConfig": {
1306
- "type": "object",
1307
- "properties": {
1308
- "email_template_id": {
1309
- "type": "string"
1310
- },
1311
- "language_code": {
1312
- "type": "string",
1313
- "enum": [
1314
- "de",
1315
- "en"
1316
- ]
1317
- },
1318
- "attachments": {
1319
- "type": "array",
1320
- "description": "Include extra file attachments in sent email.\n\nAttachments in email template will be sent regardless of this configuration.\n",
1321
- "items": {
1322
- "type": "object",
1323
- "properties": {
1324
- "source_filter": {
1325
- "type": "object",
1326
- "description": "Specify filters to match file entities related to main entity",
1327
- "properties": {
1328
- "limit": {
1329
- "type": "integer",
1330
- "description": "Limit files to maximum number (default, all matched file relations)",
1331
- "minimum": 0,
1332
- "example": 1
1333
- },
1334
- "filename_regex": {
1335
- "type": "string",
1336
- "description": "Match by filename. Regex syntax supported",
1337
- "example": ".*"
1338
- },
1339
- "attribute": {
1340
- "type": "string",
1341
- "description": "Filter by a specific relation attribute on the main entity",
1342
- "example": "_files"
1343
- },
1344
- "relation_tag": {
1345
- "type": "string",
1346
- "description": "Filter by relation tag (label) on the main entity",
1347
- "example": "contract"
1348
- },
1349
- "tag": {
1350
- "type": "string",
1351
- "description": "Filter by a specific tag on the related file entity"
1352
- },
1353
- "document_type": {
1354
- "type": "string",
1355
- "description": "Filter by a specific document type (e.g. document)",
1356
- "enum": [
1357
- "document",
1358
- "text",
1359
- "image",
1360
- "video",
1361
- "audio",
1362
- "spreadsheet",
1363
- "presentation",
1364
- "font",
1365
- "archive",
1366
- "application",
1367
- "unknown"
1368
- ]
1369
- },
1370
- "self": {
1371
- "type": "boolean",
1372
- "description": "Picks main entity as file (only works if source entity is a file)",
1373
- "default": false
1374
- }
1375
- }
1376
- }
1377
- }
1378
- },
1379
- "required": [
1380
- "email_template_id"
1381
- ]
1382
- }
1383
- }
1384
- },
1385
- "CreateDocumentActionConfig": {
1386
- "allOf": [
1387
- {
1388
- "$ref": "#/components/schemas/AutomationActionConfig"
1389
- },
1390
- {
1391
- "type": "object",
1392
- "properties": {
1393
- "type": {
1394
- "enum": [
1395
- "create-document"
1396
- ]
1397
- },
1398
- "config": {
1399
- "$ref": "#/components/schemas/CreateDocumentConfig"
1400
- }
1401
- }
1402
- }
1403
- ],
1404
- "example": {
1405
- "id": "08g988-ojt2jtaga-292h-8978gsaga",
1406
- "name": "Create Document",
1407
- "type": "create-document",
1408
- "config": {
1409
- "template_id": {
1410
- "type": "string",
1411
- "example": "112b08ba-789c-42f2-9940-43b302f641e8\""
1412
- },
1413
- "filename": {
1414
- "type": "string",
1415
- "example": "newsletter.pdf\""
1416
- }
1417
- }
1418
- }
1419
- },
1420
- "CreateDocumentAction": {
1421
- "allOf": [
1422
- {
1423
- "$ref": "#/components/schemas/AutomationAction"
1424
- },
1425
- {
1426
- "type": "object",
1427
- "properties": {
1428
- "type": {
1429
- "enum": [
1430
- "create-document"
1431
- ]
1432
- },
1433
- "config": {
1434
- "$ref": "#/components/schemas/CreateDocumentConfig"
1435
- }
1436
- }
1437
- }
1438
- ]
1439
- },
1440
- "CreateDocumentConfig": {
1441
- "type": "object",
1442
- "properties": {
1443
- "template_id": {
1444
- "type": "string"
1445
- },
1446
- "filename": {
1447
- "type": "string"
1448
- }
1449
- }
1450
- },
1451
- "TriggerWorkflowActionConfig": {
1452
- "allOf": [
1453
- {
1454
- "$ref": "#/components/schemas/AutomationActionConfig"
1455
- },
1456
- {
1457
- "type": "object",
1458
- "properties": {
1459
- "type": {
1460
- "enum": [
1461
- "trigger-workflow"
1462
- ]
1463
- },
1464
- "config": {
1465
- "$ref": "#/components/schemas/TriggerWorkflowConfig"
1466
- }
1467
- }
1468
- }
1469
- ],
1470
- "example": {
1471
- "id": "08g988-ojt2jtaga-292h-8978gsaga",
1472
- "name": "Trigger Workflow",
1473
- "type": "trigger-workflow",
1474
- "config": {
1475
- "target_workflow": "mfptvUMH",
1476
- "conditions": [
1477
- {
1478
- "schema": "ivy-opportunity",
1479
- "source": "customer.type",
1480
- "comparison": "equals",
1481
- "value": "PRIVATE"
1482
- }
1483
- ],
1484
- "assign_steps": [
1485
- {
1486
- "step_name": "Lead Sales",
1487
- "user_ids": [
1488
- 10010729
1489
- ]
1490
- },
1491
- {
1492
- "step_name": "Operations",
1493
- "user_ids": [
1494
- 10010728,
1495
- 10010729
1496
- ]
1497
- }
1498
- ]
1499
- }
710
+ },
711
+ "config": {
712
+ "$ref": "#/components/schemas/CartCheckoutConfig"
713
+ }
714
+ }
715
+ }
716
+ ]
717
+ },
718
+ "CartCheckoutAction": {
719
+ "allOf": [
720
+ {
721
+ "$ref": "#/components/schemas/AutomationAction"
722
+ },
723
+ {
724
+ "type": "object",
725
+ "description": "Creates an order entity with prices from journey",
726
+ "properties": {
727
+ "type": {
728
+ "enum": [
729
+ "cart-checkout"
730
+ ]
731
+ },
732
+ "config": {
733
+ "$ref": "#/components/schemas/CartCheckoutConfig"
734
+ }
735
+ }
736
+ }
737
+ ]
738
+ },
739
+ "CartCheckoutConfig": {
740
+ "type": "object",
741
+ "properties": {
742
+ "version": {
743
+ "description": "Version of the config",
744
+ "type": "string",
745
+ "default": "1"
746
+ },
747
+ "mapping_config": {
748
+ "$ref": "#/components/schemas/MappingConfigRef"
749
+ },
750
+ "relation_attributes": {
751
+ "type": "array",
752
+ "items": {
753
+ "$ref": "#/components/schemas/RelationAttribute"
754
+ }
755
+ },
756
+ "mapping_attributes": {
757
+ "type": "array",
758
+ "items": {
759
+ "anyOf": [
760
+ {
761
+ "$ref": "#/components/schemas/MappingAttributeV2"
762
+ },
763
+ {
764
+ "$ref": "#/components/schemas/MappingAttribute"
1500
765
  }
1501
- },
1502
- "TriggerWorkflowAction": {
1503
- "allOf": [
1504
- {
1505
- "$ref": "#/components/schemas/AutomationAction"
1506
- },
1507
- {
1508
- "type": "object",
1509
- "properties": {
1510
- "type": {
1511
- "enum": [
1512
- "trigger-workflow"
1513
- ]
1514
- },
1515
- "config": {
1516
- "$ref": "#/components/schemas/TriggerWorkflowConfig"
1517
- }
1518
- }
1519
- }
766
+ ]
767
+ }
768
+ },
769
+ "linkback_relation_attribute": {
770
+ "type": "string",
771
+ "default": "mapped_entities",
772
+ "description": "Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\n"
773
+ },
774
+ "linkback_relation_tags": {
775
+ "type": "array",
776
+ "description": "Relation tags (labels) to include in main entity linkback relation attribute",
777
+ "items": {
778
+ "type": "string"
779
+ }
780
+ },
781
+ "target_unique": {
782
+ "type": "array",
783
+ "description": "Unique key for target entity (see upsertEntity of Entity API)",
784
+ "items": {
785
+ "type": "string"
786
+ }
787
+ }
788
+ }
789
+ },
790
+ "MapEntityActionConfig": {
791
+ "allOf": [
792
+ {
793
+ "$ref": "#/components/schemas/AutomationActionConfig"
794
+ },
795
+ {
796
+ "type": "object",
797
+ "properties": {
798
+ "type": {
799
+ "enum": [
800
+ "map-entity"
1520
801
  ]
1521
- },
1522
- "TriggerWorkflowConfig": {
1523
- "type": "object",
1524
- "properties": {
1525
- "target_workflow": {
1526
- "type": "string"
1527
- },
1528
- "conditions": {
1529
- "type": "array",
1530
- "items": {
1531
- "$ref": "#/components/schemas/TriggerWorkflowCondition"
1532
- }
1533
- },
1534
- "assignees": {
1535
- "type": "array",
1536
- "items": {
1537
- "type": "string"
1538
- }
1539
- },
1540
- "assign_steps": {
1541
- "type": "array",
1542
- "items": {
1543
- "$ref": "#/components/schemas/AssignUsersToStep"
1544
- }
1545
- }
802
+ },
803
+ "config": {
804
+ "$ref": "#/components/schemas/MapEntityConfig"
805
+ }
806
+ }
807
+ }
808
+ ],
809
+ "example": {
810
+ "id": "2520gja-2sgmsaga-0asg-822jgal",
811
+ "name": "Map Entity",
812
+ "type": "map-entity",
813
+ "config": {
814
+ "target_schema": "contact",
815
+ "target_unique": [
816
+ "email.0.email"
817
+ ],
818
+ "relation_attributes": [
819
+ {
820
+ "target": "company",
821
+ "mode": "append",
822
+ "source_filter": {
823
+ "schema": "account",
824
+ "limit": 1
1546
825
  }
1547
- },
1548
- "TriggerWorkflowCondition": {
1549
- "allOf": [
1550
- {
1551
- "$ref": "#/components/schemas/TriggerCondition"
1552
- },
1553
- {
1554
- "type": "object",
1555
- "properties": {
1556
- "schema": {
1557
- "type": "string"
1558
- }
1559
- }
1560
- }
1561
- ],
1562
- "required": [
1563
- "schema",
1564
- "source",
1565
- "comparison"
1566
- ],
1567
- "example": {
1568
- "schema": "contact",
1569
- "source": "email",
1570
- "comparison": "equals",
1571
- "value": "test@epilot.cloud"
826
+ }
827
+ ],
828
+ "mapping_attributes": [
829
+ {
830
+ "target": "_tags",
831
+ "operation": {
832
+ "_append": [
833
+ "primary",
834
+ "payer"
835
+ ],
836
+ "_uniq": true
1572
837
  }
1573
- },
1574
- "AssignUsersToStep": {
1575
- "type": "object",
1576
- "properties": {
1577
- "step_id": {
1578
- "type": "string"
1579
- },
1580
- "step_name": {
1581
- "type": "string"
1582
- },
1583
- "user_ids": {
1584
- "type": "array",
1585
- "items": {
1586
- "type": "number"
1587
- }
1588
- }
1589
- },
1590
- "example": [
1591
- {
1592
- "step_id": "xyh9t2ha",
1593
- "step_name": "Lead Sales",
1594
- "user_ids": [
1595
- 10010729
1596
- ]
1597
- },
1598
- {
1599
- "step_id": "29jgasl",
1600
- "step_name": "Operations",
1601
- "user_ids": [
1602
- 10010728,
1603
- 10010729
1604
- ]
1605
- }
1606
- ]
1607
- },
1608
- "TriggerWebhookActionConfig": {
1609
- "allOf": [
1610
- {
1611
- "$ref": "#/components/schemas/AutomationActionConfig"
1612
- },
838
+ },
839
+ {
840
+ "target": "email",
841
+ "operation": {
842
+ "_append": [
1613
843
  {
1614
- "type": "object",
1615
- "properties": {
1616
- "type": {
1617
- "enum": [
1618
- "trigger-webhook"
1619
- ]
1620
- },
1621
- "config": {
1622
- "$ref": "#/components/schemas/TriggerWebhookConfig"
1623
- }
1624
- }
1625
- }
1626
- ],
1627
- "example": {
1628
- "id": "2520gja-2sgmsaga-0asg-822jgal",
1629
- "name": "Trigger Webhook",
1630
- "type": "trigger-webhook",
1631
- "config": {
1632
- "entity_sources": [
1633
- "contact",
1634
- "account"
1635
- ],
1636
- "target_webhook_id": "25jg9ag2ga"
844
+ "email": {
845
+ "_copy": "billing_contact.email"
846
+ }
1637
847
  }
848
+ ]
1638
849
  }
1639
- },
1640
- "TriggerWebhookAction": {
1641
- "allOf": [
1642
- {
1643
- "$ref": "#/components/schemas/AutomationAction"
1644
- },
1645
- {
1646
- "type": "object",
1647
- "properties": {
1648
- "type": {
1649
- "enum": [
1650
- "trigger-webhook"
1651
- ]
1652
- },
1653
- "config": {
1654
- "$ref": "#/components/schemas/TriggerWebhookConfig"
1655
- }
1656
- }
1657
- }
1658
- ]
1659
- },
1660
- "TriggerWebhookConfig": {
1661
- "type": "object",
1662
- "properties": {
1663
- "entity_sources": {
1664
- "type": "array",
1665
- "items": {
1666
- "type": "string"
1667
- }
1668
- },
1669
- "target_webhook_id": {
1670
- "type": "string"
1671
- }
850
+ },
851
+ {
852
+ "target": "first_name",
853
+ "operation": {
854
+ "_copy": "billing_contact.first_name"
1672
855
  }
1673
- },
1674
- "AutomationExecutionId": {
1675
- "type": "string",
1676
- "example": "9baf184f-bc81-4128-bca3-d974c90a12c4"
1677
- },
1678
- "AutomationExecution": {
1679
- "type": "object",
1680
- "properties": {
1681
- "id": {
1682
- "$ref": "#/components/schemas/AutomationExecutionId"
1683
- },
1684
- "execution_status": {
1685
- "$ref": "#/components/schemas/ExecutionStatus"
1686
- },
1687
- "entity_id": {
1688
- "$ref": "#/components/schemas/EntityId"
1689
- },
1690
- "activity_id": {
1691
- "$ref": "#/components/schemas/ActivityId"
1692
- },
1693
- "entity_snapshot": {
1694
- "$ref": "#/components/schemas/EntityItemSnapshot"
1695
- },
1696
- "org_id": {
1697
- "$ref": "#/components/schemas/OrganizationId"
1698
- },
1699
- "flow_id": {
1700
- "$ref": "#/components/schemas/AutomationFlowId"
1701
- },
1702
- "flow_name": {
1703
- "type": "string",
1704
- "example": "Handle contact form"
1705
- },
1706
- "created_at": {
1707
- "type": "string",
1708
- "format": "date-time"
1709
- },
1710
- "updated_at": {
1711
- "type": "string",
1712
- "format": "date-time"
1713
- },
1714
- "current_action_id": {
1715
- "$ref": "#/components/schemas/AutomationActionId"
1716
- },
1717
- "actions": {
1718
- "type": "array",
1719
- "items": {
1720
- "$ref": "#/components/schemas/AnyAction"
1721
- }
1722
- }
1723
- },
1724
- "required": [
1725
- "id",
1726
- "status",
1727
- "entity_id",
1728
- "org_id",
1729
- "flow_id",
1730
- "actions"
1731
- ]
1732
- },
1733
- "ExecutionStatus": {
1734
- "type": "string",
856
+ },
857
+ {
858
+ "target": "last_name",
859
+ "operation": {
860
+ "_copy": "billing_contact.last_name"
861
+ }
862
+ },
863
+ {
864
+ "target": "contact_type",
865
+ "operation": {
866
+ "_set": "customer"
867
+ }
868
+ },
869
+ {
870
+ "target": "address",
871
+ "operation": {
872
+ "_append": [
873
+ {
874
+ "_tags": [
875
+ "billing",
876
+ "primary"
877
+ ],
878
+ "street_name": {
879
+ "_copy": "billing_contact.street_name"
880
+ },
881
+ "street_number": {
882
+ "_copy": "billing_contact.street_number"
883
+ },
884
+ "city": {
885
+ "_copy": "billing_contact.city"
886
+ },
887
+ "postal_code": {
888
+ "_copy": "billing_contact.postal_code"
889
+ },
890
+ "country": {
891
+ "_copy": "billing_contact.country"
892
+ }
893
+ },
894
+ {
895
+ "_tags": [
896
+ "delivery"
897
+ ],
898
+ "street_name": {
899
+ "_copy": "delivery_contact.street_name"
900
+ },
901
+ "street_number": {
902
+ "_copy": "delivery_contact.street_number"
903
+ },
904
+ "city": {
905
+ "_copy": "delivery_contact.city"
906
+ },
907
+ "postal_code": {
908
+ "_copy": "delivery_contact.postal_code"
909
+ },
910
+ "country": {
911
+ "_copy": "delivery_contact.country"
912
+ }
913
+ }
914
+ ],
915
+ "_uniq": [
916
+ "street_name",
917
+ "street_number",
918
+ "postal_code",
919
+ "country"
920
+ ]
921
+ }
922
+ }
923
+ ]
924
+ }
925
+ }
926
+ },
927
+ "MapEntityAction": {
928
+ "allOf": [
929
+ {
930
+ "$ref": "#/components/schemas/AutomationAction"
931
+ },
932
+ {
933
+ "type": "object",
934
+ "properties": {
935
+ "type": {
1735
936
  "enum": [
1736
- "pending",
1737
- "in_progress",
1738
- "success",
1739
- "failed",
1740
- "cancelled"
937
+ "map-entity"
1741
938
  ]
1742
- },
1743
- "GetExecutionsResp": {
1744
- "type": "object",
1745
- "properties": {
1746
- "total": {
1747
- "type": "number"
1748
- },
1749
- "results": {
1750
- "type": "array",
1751
- "items": {
1752
- "$ref": "#/components/schemas/AutomationExecution"
1753
- }
1754
- }
939
+ },
940
+ "config": {
941
+ "$ref": "#/components/schemas/MapEntityConfig"
942
+ }
943
+ }
944
+ }
945
+ ]
946
+ },
947
+ "MapEntityConfig": {
948
+ "type": "object",
949
+ "properties": {
950
+ "mapping_config": {
951
+ "$ref": "#/components/schemas/MappingConfigRef"
952
+ },
953
+ "target_schema": {
954
+ "type": "string",
955
+ "description": "Schema of target entity"
956
+ },
957
+ "target_unique": {
958
+ "type": "array",
959
+ "description": "Unique key for target entity (see upsertEntity of Entity API)",
960
+ "items": {
961
+ "type": "string"
962
+ }
963
+ },
964
+ "mapping_attributes": {
965
+ "type": "array",
966
+ "description": "Attribute mappings",
967
+ "items": {
968
+ "anyOf": [
969
+ {
970
+ "$ref": "#/components/schemas/MappingAttributeV2"
1755
971
  },
1756
- "required": [
1757
- "total",
1758
- "results"
1759
- ]
1760
- },
1761
- "StartExecutionRequest": {
1762
- "type": "object",
1763
- "properties": {
1764
- "entity_id": {
1765
- "$ref": "#/components/schemas/EntityId"
1766
- },
1767
- "flow_id": {
1768
- "$ref": "#/components/schemas/AutomationFlowId"
1769
- }
972
+ {
973
+ "$ref": "#/components/schemas/MappingAttribute"
1770
974
  }
1771
- },
1772
- "EntityId": {
975
+ ]
976
+ }
977
+ },
978
+ "relation_attributes": {
979
+ "type": "array",
980
+ "description": "Relation mappings",
981
+ "items": {
982
+ "$ref": "#/components/schemas/RelationAttribute"
983
+ }
984
+ },
985
+ "linkback_relation_attribute": {
986
+ "type": "string",
987
+ "default": "mapped_entities",
988
+ "description": "Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\n"
989
+ },
990
+ "linkback_relation_tags": {
991
+ "type": "array",
992
+ "description": "Relation tags (labels) to include in main entity linkback relation attribute",
993
+ "items": {
994
+ "type": "string"
995
+ }
996
+ }
997
+ },
998
+ "required": [
999
+ "target_schema"
1000
+ ]
1001
+ },
1002
+ "MappingConfigRef": {
1003
+ "type": "object",
1004
+ "properties": {
1005
+ "config_id": {
1006
+ "type": "string",
1007
+ "description": "Id of Entity Mapping Configuration to run for mapping."
1008
+ },
1009
+ "target_id": {
1010
+ "type": "string",
1011
+ "description": "Id of TargetConfig to run for mapping."
1012
+ },
1013
+ "version": {
1014
+ "type": "number",
1015
+ "description": "Version of Entity Mapping Configuration to run for mapping."
1016
+ }
1017
+ },
1018
+ "required": [
1019
+ "config_id",
1020
+ "target_id"
1021
+ ]
1022
+ },
1023
+ "RelationAttribute": {
1024
+ "type": "object",
1025
+ "properties": {
1026
+ "target": {
1027
+ "type": "string",
1028
+ "description": "Target attribute to store the relation in"
1029
+ },
1030
+ "target_tags": {
1031
+ "type": "array",
1032
+ "description": "Relation tags (labels) to set for the stored relations",
1033
+ "items": {
1034
+ "type": "string"
1035
+ }
1036
+ },
1037
+ "target_tags_include_source": {
1038
+ "type": "boolean",
1039
+ "description": "Include all relation tags (labels) present on the main entity relation",
1040
+ "default": false
1041
+ },
1042
+ "source_filter": {
1043
+ "type": "object",
1044
+ "description": "A filter to identify which source entities to pick as relations from main entity",
1045
+ "properties": {
1046
+ "limit": {
1047
+ "type": "integer",
1048
+ "description": "Limit relations to maximum number (default, all matched relations)",
1049
+ "minimum": 0
1050
+ },
1051
+ "schema": {
1773
1052
  "type": "string",
1774
- "example": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74"
1775
- },
1776
- "ActivityId": {
1053
+ "description": "Filter by specific schema"
1054
+ },
1055
+ "attribute": {
1777
1056
  "type": "string",
1778
- "example": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74"
1779
- },
1780
- "OrganizationId": {
1057
+ "description": "Filter by a specific relation attribute on the main entity"
1058
+ },
1059
+ "relation_tag": {
1781
1060
  "type": "string",
1782
- "example": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74"
1783
- },
1784
- "JourneySubmitTrigger": {
1785
- "type": "object",
1786
- "properties": {
1787
- "type": {
1788
- "type": "string",
1789
- "enum": [
1790
- "journey_submission"
1791
- ]
1792
- },
1793
- "configuration": {
1794
- "type": "object",
1795
- "properties": {
1796
- "source_id": {
1797
- "type": "string",
1798
- "format": "uuid"
1799
- }
1800
- },
1801
- "required": [
1802
- "source_id"
1803
- ]
1804
- }
1805
- },
1806
- "required": [
1807
- "type",
1808
- "configuration"
1061
+ "description": "Filter by relation tag (label) on the main entity"
1062
+ },
1063
+ "tag": {
1064
+ "type": "string",
1065
+ "description": "Filter by a specific tag on the related entity"
1066
+ },
1067
+ "self": {
1068
+ "type": "boolean",
1069
+ "description": "Picks main entity as relation (overrides other filters)",
1070
+ "default": false
1071
+ }
1072
+ }
1073
+ },
1074
+ "related_to": {
1075
+ "type": "object",
1076
+ "additionalProperties": true,
1077
+ "deprecated": true
1078
+ },
1079
+ "mode": {
1080
+ "type": "string",
1081
+ "enum": [
1082
+ "append",
1083
+ "prepend",
1084
+ "set"
1085
+ ]
1086
+ }
1087
+ },
1088
+ "required": [
1089
+ "target",
1090
+ "mode"
1091
+ ]
1092
+ },
1093
+ "MappingAttributeV2": {
1094
+ "type": "object",
1095
+ "properties": {
1096
+ "target": {
1097
+ "type": "string",
1098
+ "description": "Target JSON path for the attribute to set"
1099
+ },
1100
+ "operation": {
1101
+ "$ref": "#/components/schemas/OperationNode"
1102
+ }
1103
+ },
1104
+ "required": [
1105
+ "targetPath",
1106
+ "operation"
1107
+ ],
1108
+ "example": {
1109
+ "target": "_tags",
1110
+ "operation": {
1111
+ "_append": [
1112
+ "new",
1113
+ "tags"
1114
+ ],
1115
+ "_uniq": true
1116
+ }
1117
+ }
1118
+ },
1119
+ "OperationNode": {
1120
+ "description": "Mapping operation nodes are either primitive values or operation node objects",
1121
+ "oneOf": [
1122
+ {
1123
+ "$ref": "#/components/schemas/OperationObjectNode"
1124
+ },
1125
+ {
1126
+ "$ref": "#/components/schemas/PrimitiveJSONValue"
1127
+ }
1128
+ ]
1129
+ },
1130
+ "OperationObjectNode": {
1131
+ "type": "object",
1132
+ "properties": {
1133
+ "_set": {
1134
+ "$ref": "#/components/schemas/PrimitiveJSONValue"
1135
+ },
1136
+ "_append": {
1137
+ "description": "Append to array",
1138
+ "items": {
1139
+ "$ref": "#/components/schemas/PrimitiveJSONValue"
1140
+ }
1141
+ },
1142
+ "_uniq": {
1143
+ "description": "Unique array",
1144
+ "oneOf": [
1145
+ {
1146
+ "type": "boolean",
1147
+ "example": true
1148
+ },
1149
+ {
1150
+ "type": "array",
1151
+ "description": "Unique key consisting of object keys",
1152
+ "example": [
1153
+ "email"
1154
+ ],
1155
+ "items": {
1156
+ "type": "string"
1157
+ }
1158
+ }
1159
+ ]
1160
+ },
1161
+ "_copy": {
1162
+ "description": "Copy JSONPath value from source entity context",
1163
+ "type": "string",
1164
+ "example": "contact.first_name"
1165
+ }
1166
+ },
1167
+ "additionalProperties": true
1168
+ },
1169
+ "PrimitiveJSONValue": {},
1170
+ "MappingAttribute": {
1171
+ "anyOf": [
1172
+ {
1173
+ "$ref": "#/components/schemas/SetValueMapper"
1174
+ },
1175
+ {
1176
+ "$ref": "#/components/schemas/CopyValueMapper"
1177
+ },
1178
+ {
1179
+ "$ref": "#/components/schemas/AppendValueMapper"
1180
+ }
1181
+ ]
1182
+ },
1183
+ "MappingAttributeMode": {
1184
+ "type": "string",
1185
+ "enum": [
1186
+ "copy_if_exists",
1187
+ "append_if_exists",
1188
+ "set_value"
1189
+ ],
1190
+ "description": "- copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property.\n"
1191
+ },
1192
+ "SetValueMapper": {
1193
+ "type": "object",
1194
+ "deprecated": true,
1195
+ "properties": {
1196
+ "mode": {
1197
+ "$ref": "#/components/schemas/MappingAttributeMode"
1198
+ },
1199
+ "target": {
1200
+ "type": "string",
1201
+ "description": "JSON like target path for the attribute. Eg. last_name"
1202
+ },
1203
+ "value": {
1204
+ "description": "Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any.\n"
1205
+ }
1206
+ },
1207
+ "required": [
1208
+ "mode",
1209
+ "target",
1210
+ "value"
1211
+ ]
1212
+ },
1213
+ "CopyValueMapper": {
1214
+ "type": "object",
1215
+ "deprecated": true,
1216
+ "properties": {
1217
+ "mode": {
1218
+ "$ref": "#/components/schemas/MappingAttributeMode"
1219
+ },
1220
+ "target": {
1221
+ "type": "string",
1222
+ "description": "JSON like target path for the attribute. Eg. last_name"
1223
+ },
1224
+ "source": {
1225
+ "type": "string",
1226
+ "description": "JSON source path for the value to be extracted from the main entity. Eg: steps[1].['Product Info'].price\n"
1227
+ }
1228
+ },
1229
+ "required": [
1230
+ "mode",
1231
+ "target",
1232
+ "source"
1233
+ ]
1234
+ },
1235
+ "AppendValueMapper": {
1236
+ "type": "object",
1237
+ "deprecated": true,
1238
+ "properties": {
1239
+ "mode": {
1240
+ "$ref": "#/components/schemas/MappingAttributeMode"
1241
+ },
1242
+ "target": {
1243
+ "type": "string",
1244
+ "description": "JSON like target path for the attribute. Eg. last_name"
1245
+ },
1246
+ "source": {
1247
+ "type": "string",
1248
+ "description": "JSON source path for the value to be extracted from the main entity. Eg: steps[1].['Product Info'].price\n"
1249
+ },
1250
+ "value_json": {
1251
+ "type": "string",
1252
+ "description": "To be provided only when mapping json objects into a target attribute. Eg array of addresses.\n"
1253
+ },
1254
+ "target_unique": {
1255
+ "type": "array",
1256
+ "items": {
1257
+ "type": "string"
1258
+ },
1259
+ "description": "Array of keys which should be used when checking for uniqueness. Eg: [country, city, postal_code]\n"
1260
+ }
1261
+ },
1262
+ "required": [
1263
+ "mode",
1264
+ "target",
1265
+ "value_json"
1266
+ ]
1267
+ },
1268
+ "SendEmailActionConfig": {
1269
+ "allOf": [
1270
+ {
1271
+ "$ref": "#/components/schemas/AutomationActionConfig"
1272
+ },
1273
+ {
1274
+ "type": "object",
1275
+ "properties": {
1276
+ "type": {
1277
+ "enum": [
1278
+ "send-email"
1809
1279
  ]
1810
- },
1811
- "FrontendSubmitTrigger": {
1812
- "type": "object",
1813
- "properties": {
1814
- "type": {
1815
- "type": "string",
1816
- "enum": [
1817
- "frontend_submission"
1818
- ]
1819
- },
1820
- "configuration": {
1821
- "type": "object",
1822
- "properties": {
1823
- "source_id": {
1824
- "type": "string",
1825
- "example": "99"
1826
- }
1827
- }
1828
- }
1829
- },
1830
- "required": [
1831
- "type",
1832
- "configuration"
1280
+ },
1281
+ "config": {
1282
+ "$ref": "#/components/schemas/SendEmailConfig"
1283
+ }
1284
+ }
1285
+ }
1286
+ ],
1287
+ "example": {
1288
+ "id": "25jga0-gkasl26-0asg-908sgaj2",
1289
+ "name": "Send Email",
1290
+ "type": "send-email",
1291
+ "config": {
1292
+ "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2",
1293
+ "language_code": "de"
1294
+ }
1295
+ }
1296
+ },
1297
+ "SendEmailAction": {
1298
+ "allOf": [
1299
+ {
1300
+ "$ref": "#/components/schemas/AutomationAction"
1301
+ },
1302
+ {
1303
+ "type": "object",
1304
+ "properties": {
1305
+ "type": {
1306
+ "enum": [
1307
+ "send-email"
1833
1308
  ]
1309
+ },
1310
+ "config": {
1311
+ "$ref": "#/components/schemas/SendEmailConfig"
1312
+ }
1313
+ }
1314
+ }
1315
+ ]
1316
+ },
1317
+ "SendEmailConfig": {
1318
+ "type": "object",
1319
+ "properties": {
1320
+ "email_template_id": {
1321
+ "type": "string"
1322
+ },
1323
+ "language_code": {
1324
+ "type": "string",
1325
+ "enum": [
1326
+ "de",
1327
+ "en"
1328
+ ]
1329
+ },
1330
+ "attachments": {
1331
+ "type": "array",
1332
+ "description": "Include extra file attachments in sent email.\n\nAttachments in email template will be sent regardless of this configuration.\n",
1333
+ "items": {
1334
+ "type": "object",
1335
+ "properties": {
1336
+ "source_filter": {
1337
+ "type": "object",
1338
+ "description": "Specify filters to match file entities related to main entity",
1339
+ "properties": {
1340
+ "limit": {
1341
+ "type": "integer",
1342
+ "description": "Limit files to maximum number (default, all matched file relations)",
1343
+ "minimum": 0,
1344
+ "example": 1
1345
+ },
1346
+ "filename_regex": {
1347
+ "type": "string",
1348
+ "description": "Match by filename. Regex syntax supported",
1349
+ "example": ".*"
1350
+ },
1351
+ "attribute": {
1352
+ "type": "string",
1353
+ "description": "Filter by a specific relation attribute on the main entity",
1354
+ "example": "_files"
1355
+ },
1356
+ "relation_tag": {
1357
+ "type": "string",
1358
+ "description": "Filter by relation tag (label) on the main entity",
1359
+ "example": "contract"
1360
+ },
1361
+ "tag": {
1362
+ "type": "string",
1363
+ "description": "Filter by a specific tag on the related file entity"
1364
+ },
1365
+ "document_type": {
1366
+ "type": "string",
1367
+ "description": "Filter by a specific document type (e.g. document)",
1368
+ "enum": [
1369
+ "document",
1370
+ "text",
1371
+ "image",
1372
+ "video",
1373
+ "audio",
1374
+ "spreadsheet",
1375
+ "presentation",
1376
+ "font",
1377
+ "archive",
1378
+ "application",
1379
+ "unknown"
1380
+ ]
1381
+ },
1382
+ "self": {
1383
+ "type": "boolean",
1384
+ "description": "Picks main entity as file (only works if source entity is a file)",
1385
+ "default": false
1386
+ }
1387
+ }
1388
+ }
1389
+ }
1834
1390
  },
1835
- "ApiSubmissionTrigger": {
1836
- "type": "object",
1837
- "properties": {
1838
- "type": {
1839
- "type": "string",
1840
- "enum": [
1841
- "api_submission"
1842
- ]
1843
- },
1844
- "configuration": {
1845
- "type": "object",
1846
- "properties": {
1847
- "source_id": {
1848
- "type": "string"
1849
- }
1850
- }
1851
- }
1852
- },
1853
- "required": [
1854
- "type",
1855
- "configuration"
1391
+ "required": [
1392
+ "email_template_id"
1393
+ ]
1394
+ }
1395
+ }
1396
+ },
1397
+ "CreateDocumentActionConfig": {
1398
+ "allOf": [
1399
+ {
1400
+ "$ref": "#/components/schemas/AutomationActionConfig"
1401
+ },
1402
+ {
1403
+ "type": "object",
1404
+ "properties": {
1405
+ "type": {
1406
+ "enum": [
1407
+ "create-document"
1856
1408
  ]
1857
- },
1858
- "ReceivedEmailTrigger": {
1859
- "type": "object",
1860
- "properties": {
1861
- "type": {
1862
- "type": "string",
1863
- "enum": [
1864
- "received_email"
1865
- ]
1866
- },
1867
- "configuration": {
1868
- "type": "object",
1869
- "properties": {
1870
- "message_type": {
1871
- "type": "string",
1872
- "enum": [
1873
- "RECEIVED"
1874
- ]
1875
- }
1876
- }
1877
- }
1878
- },
1879
- "required": [
1880
- "type",
1881
- "configuration"
1409
+ },
1410
+ "config": {
1411
+ "$ref": "#/components/schemas/CreateDocumentConfig"
1412
+ }
1413
+ }
1414
+ }
1415
+ ],
1416
+ "example": {
1417
+ "id": "08g988-ojt2jtaga-292h-8978gsaga",
1418
+ "name": "Create Document",
1419
+ "type": "create-document",
1420
+ "config": {
1421
+ "template_id": {
1422
+ "type": "string",
1423
+ "example": "112b08ba-789c-42f2-9940-43b302f641e8\""
1424
+ },
1425
+ "filename": {
1426
+ "type": "string",
1427
+ "example": "newsletter.pdf\""
1428
+ }
1429
+ }
1430
+ }
1431
+ },
1432
+ "CreateDocumentAction": {
1433
+ "allOf": [
1434
+ {
1435
+ "$ref": "#/components/schemas/AutomationAction"
1436
+ },
1437
+ {
1438
+ "type": "object",
1439
+ "properties": {
1440
+ "type": {
1441
+ "enum": [
1442
+ "create-document"
1882
1443
  ]
1883
- },
1884
- "EntityOperationTrigger": {
1885
- "type": "object",
1886
- "properties": {
1887
- "type": {
1888
- "type": "string",
1889
- "enum": [
1890
- "entity_operation"
1891
- ]
1892
- },
1893
- "configuration": {
1894
- "type": "object",
1895
- "properties": {
1896
- "schema": {
1897
- "type": "string",
1898
- "example": "submission"
1899
- },
1900
- "operations": {
1901
- "type": "array",
1902
- "minItems": 1,
1903
- "items": {
1904
- "type": "string",
1905
- "enum": [
1906
- "createEntity",
1907
- "updateEntity",
1908
- "deleteEntity"
1909
- ]
1910
- }
1911
- },
1912
- "include_activities": {
1913
- "type": "array",
1914
- "items": {
1915
- "type": "string",
1916
- "example": [
1917
- "CreateEntity"
1918
- ]
1919
- }
1920
- },
1921
- "exclude_activities": {
1922
- "type": "array",
1923
- "items": {
1924
- "type": "string",
1925
- "example": [
1926
- "SyncEntity"
1927
- ]
1928
- }
1929
- }
1930
- },
1931
- "required": [
1932
- "schema",
1933
- "operations"
1934
- ]
1935
- }
1936
- },
1937
- "required": [
1938
- "type",
1939
- "configuration"
1444
+ },
1445
+ "config": {
1446
+ "$ref": "#/components/schemas/CreateDocumentConfig"
1447
+ }
1448
+ }
1449
+ }
1450
+ ]
1451
+ },
1452
+ "CreateDocumentConfig": {
1453
+ "type": "object",
1454
+ "properties": {
1455
+ "template_id": {
1456
+ "type": "string"
1457
+ },
1458
+ "filename": {
1459
+ "type": "string"
1460
+ }
1461
+ }
1462
+ },
1463
+ "TriggerWorkflowActionConfig": {
1464
+ "allOf": [
1465
+ {
1466
+ "$ref": "#/components/schemas/AutomationActionConfig"
1467
+ },
1468
+ {
1469
+ "type": "object",
1470
+ "properties": {
1471
+ "type": {
1472
+ "enum": [
1473
+ "trigger-workflow"
1940
1474
  ]
1941
- },
1942
- "ActivityTrigger": {
1943
- "type": "object",
1944
- "properties": {
1945
- "type": {
1946
- "type": "string",
1947
- "enum": [
1948
- "activity"
1949
- ]
1950
- },
1951
- "configuration": {
1952
- "type": "object",
1953
- "properties": {
1954
- "schema": {
1955
- "type": "string",
1956
- "example": "submission"
1957
- },
1958
- "types": {
1959
- "type": "array",
1960
- "items": {
1961
- "type": "string",
1962
- "enum": [
1963
- "CreateMeterReading",
1964
- "UpdateMeterReading",
1965
- "MessageActivity",
1966
- "SyncActivity"
1967
- ]
1968
- }
1969
- }
1970
- }
1971
- }
1972
- },
1973
- "required": [
1974
- "type",
1975
- "configuration"
1475
+ },
1476
+ "config": {
1477
+ "$ref": "#/components/schemas/TriggerWorkflowConfig"
1478
+ }
1479
+ }
1480
+ }
1481
+ ],
1482
+ "example": {
1483
+ "id": "08g988-ojt2jtaga-292h-8978gsaga",
1484
+ "name": "Trigger Workflow",
1485
+ "type": "trigger-workflow",
1486
+ "config": {
1487
+ "target_workflow": "mfptvUMH",
1488
+ "conditions": [
1489
+ {
1490
+ "schema": "ivy-opportunity",
1491
+ "source": "customer.type",
1492
+ "comparison": "equals",
1493
+ "value": "PRIVATE"
1494
+ }
1495
+ ],
1496
+ "assign_steps": [
1497
+ {
1498
+ "step_name": "Lead Sales",
1499
+ "user_ids": [
1500
+ 10010729
1976
1501
  ]
1977
- },
1978
- "EntityManualTrigger": {
1979
- "type": "object",
1980
- "properties": {
1981
- "type": {
1982
- "type": "string",
1983
- "enum": [
1984
- "entity_manual"
1985
- ]
1986
- },
1987
- "configuration": {
1988
- "type": "object",
1989
- "properties": {
1990
- "schema": {
1991
- "description": "Which entity type can this automation be triggered from",
1992
- "type": "string",
1993
- "example": "submission"
1994
- }
1995
- }
1996
- }
1997
- },
1998
- "required": [
1999
- "type",
2000
- "configuration"
1502
+ },
1503
+ {
1504
+ "step_name": "Operations",
1505
+ "user_ids": [
1506
+ 10010728,
1507
+ 10010729
2001
1508
  ]
2002
- },
2003
- "TriggerCondition": {
1509
+ }
1510
+ ]
1511
+ }
1512
+ }
1513
+ },
1514
+ "TriggerWorkflowAction": {
1515
+ "allOf": [
1516
+ {
1517
+ "$ref": "#/components/schemas/AutomationAction"
1518
+ },
1519
+ {
1520
+ "type": "object",
1521
+ "properties": {
1522
+ "type": {
1523
+ "enum": [
1524
+ "trigger-workflow"
1525
+ ]
1526
+ },
1527
+ "config": {
1528
+ "$ref": "#/components/schemas/TriggerWorkflowConfig"
1529
+ }
1530
+ }
1531
+ }
1532
+ ]
1533
+ },
1534
+ "TriggerWorkflowConfig": {
1535
+ "type": "object",
1536
+ "properties": {
1537
+ "target_workflow": {
1538
+ "type": "string"
1539
+ },
1540
+ "conditions": {
1541
+ "type": "array",
1542
+ "items": {
1543
+ "$ref": "#/components/schemas/TriggerWorkflowCondition"
1544
+ }
1545
+ },
1546
+ "assignees": {
1547
+ "type": "array",
1548
+ "items": {
1549
+ "type": "string"
1550
+ }
1551
+ },
1552
+ "assign_steps": {
1553
+ "type": "array",
1554
+ "items": {
1555
+ "$ref": "#/components/schemas/AssignUsersToStep"
1556
+ }
1557
+ }
1558
+ }
1559
+ },
1560
+ "TriggerWorkflowCondition": {
1561
+ "allOf": [
1562
+ {
1563
+ "$ref": "#/components/schemas/TriggerCondition"
1564
+ },
1565
+ {
1566
+ "type": "object",
1567
+ "properties": {
1568
+ "schema": {
1569
+ "type": "string"
1570
+ }
1571
+ }
1572
+ }
1573
+ ],
1574
+ "required": [
1575
+ "schema",
1576
+ "source",
1577
+ "comparison"
1578
+ ],
1579
+ "example": {
1580
+ "schema": "contact",
1581
+ "source": "email",
1582
+ "comparison": "equals",
1583
+ "value": "test@epilot.cloud"
1584
+ }
1585
+ },
1586
+ "AssignUsersToStep": {
1587
+ "type": "object",
1588
+ "properties": {
1589
+ "step_id": {
1590
+ "type": "string"
1591
+ },
1592
+ "step_name": {
1593
+ "type": "string"
1594
+ },
1595
+ "user_ids": {
1596
+ "type": "array",
1597
+ "items": {
1598
+ "type": "number"
1599
+ }
1600
+ }
1601
+ },
1602
+ "example": [
1603
+ {
1604
+ "step_id": "xyh9t2ha",
1605
+ "step_name": "Lead Sales",
1606
+ "user_ids": [
1607
+ 10010729
1608
+ ]
1609
+ },
1610
+ {
1611
+ "step_id": "29jgasl",
1612
+ "step_name": "Operations",
1613
+ "user_ids": [
1614
+ 10010728,
1615
+ 10010729
1616
+ ]
1617
+ }
1618
+ ]
1619
+ },
1620
+ "TriggerWebhookActionConfig": {
1621
+ "allOf": [
1622
+ {
1623
+ "$ref": "#/components/schemas/AutomationActionConfig"
1624
+ },
1625
+ {
1626
+ "type": "object",
1627
+ "properties": {
1628
+ "type": {
1629
+ "enum": [
1630
+ "trigger-webhook"
1631
+ ]
1632
+ },
1633
+ "config": {
1634
+ "$ref": "#/components/schemas/TriggerWebhookConfig"
1635
+ }
1636
+ }
1637
+ }
1638
+ ],
1639
+ "example": {
1640
+ "id": "2520gja-2sgmsaga-0asg-822jgal",
1641
+ "name": "Trigger Webhook",
1642
+ "type": "trigger-webhook",
1643
+ "config": {
1644
+ "entity_sources": [
1645
+ "contact",
1646
+ "account"
1647
+ ],
1648
+ "target_webhook_id": "25jg9ag2ga"
1649
+ }
1650
+ }
1651
+ },
1652
+ "TriggerWebhookAction": {
1653
+ "allOf": [
1654
+ {
1655
+ "$ref": "#/components/schemas/AutomationAction"
1656
+ },
1657
+ {
1658
+ "type": "object",
1659
+ "properties": {
1660
+ "type": {
1661
+ "enum": [
1662
+ "trigger-webhook"
1663
+ ]
1664
+ },
1665
+ "config": {
1666
+ "$ref": "#/components/schemas/TriggerWebhookConfig"
1667
+ }
1668
+ }
1669
+ }
1670
+ ]
1671
+ },
1672
+ "TriggerWebhookConfig": {
1673
+ "type": "object",
1674
+ "properties": {
1675
+ "entity_sources": {
1676
+ "type": "array",
1677
+ "items": {
1678
+ "type": "string"
1679
+ }
1680
+ },
1681
+ "target_webhook_id": {
1682
+ "type": "string"
1683
+ }
1684
+ }
1685
+ },
1686
+ "AutomationExecutionId": {
1687
+ "type": "string",
1688
+ "example": "9baf184f-bc81-4128-bca3-d974c90a12c4"
1689
+ },
1690
+ "AutomationExecution": {
1691
+ "type": "object",
1692
+ "properties": {
1693
+ "id": {
1694
+ "$ref": "#/components/schemas/AutomationExecutionId"
1695
+ },
1696
+ "execution_status": {
1697
+ "$ref": "#/components/schemas/ExecutionStatus"
1698
+ },
1699
+ "entity_id": {
1700
+ "$ref": "#/components/schemas/EntityId"
1701
+ },
1702
+ "activity_id": {
1703
+ "$ref": "#/components/schemas/ActivityId"
1704
+ },
1705
+ "entity_snapshot": {
1706
+ "$ref": "#/components/schemas/EntityItemSnapshot"
1707
+ },
1708
+ "org_id": {
1709
+ "$ref": "#/components/schemas/OrganizationId"
1710
+ },
1711
+ "flow_id": {
1712
+ "$ref": "#/components/schemas/AutomationFlowId"
1713
+ },
1714
+ "flow_name": {
1715
+ "type": "string",
1716
+ "example": "Handle contact form"
1717
+ },
1718
+ "created_at": {
1719
+ "type": "string",
1720
+ "format": "date-time"
1721
+ },
1722
+ "updated_at": {
1723
+ "type": "string",
1724
+ "format": "date-time"
1725
+ },
1726
+ "current_action_id": {
1727
+ "$ref": "#/components/schemas/AutomationActionId"
1728
+ },
1729
+ "actions": {
1730
+ "type": "array",
1731
+ "items": {
1732
+ "$ref": "#/components/schemas/AnyAction"
1733
+ }
1734
+ },
1735
+ "trigger_event": {
1736
+ "oneOf": [
1737
+ {
1738
+ "$ref": "#/components/schemas/TriggerEventManual"
1739
+ },
1740
+ {
1741
+ "$ref": "#/components/schemas/TriggerEventEntityActivity"
1742
+ },
1743
+ {
1744
+ "$ref": "#/components/schemas/TriggerEventEntityOperation"
1745
+ }
1746
+ ]
1747
+ }
1748
+ },
1749
+ "required": [
1750
+ "id",
1751
+ "status",
1752
+ "entity_id",
1753
+ "org_id",
1754
+ "flow_id",
1755
+ "actions"
1756
+ ]
1757
+ },
1758
+ "TriggerEventManual": {
1759
+ "type": "object",
1760
+ "properties": {
1761
+ "type": {
1762
+ "type": "string",
1763
+ "enum": [
1764
+ "manual"
1765
+ ]
1766
+ },
1767
+ "org_id": {
1768
+ "type": "string",
1769
+ "example": "123"
1770
+ },
1771
+ "entity_id": {
1772
+ "$ref": "#/components/schemas/EntityId"
1773
+ },
1774
+ "caller": {
1775
+ "$ref": "#/components/schemas/ApiCallerContext"
1776
+ }
1777
+ },
1778
+ "required": [
1779
+ "org_id",
1780
+ "entity_id"
1781
+ ]
1782
+ },
1783
+ "TriggerEventEntityActivity": {
1784
+ "type": "object",
1785
+ "properties": {
1786
+ "type": {
1787
+ "type": "string",
1788
+ "enum": [
1789
+ "entity_activity"
1790
+ ]
1791
+ },
1792
+ "org_id": {
1793
+ "type": "string",
1794
+ "example": "123"
1795
+ },
1796
+ "activity_id": {
1797
+ "$ref": "#/components/schemas/ActivityId"
1798
+ },
1799
+ "activity_type": {
1800
+ "type": "string"
1801
+ },
1802
+ "entity_id": {
1803
+ "$ref": "#/components/schemas/EntityId"
1804
+ }
1805
+ },
1806
+ "required": [
1807
+ "org_id",
1808
+ "activity_id",
1809
+ "activity_type"
1810
+ ]
1811
+ },
1812
+ "TriggerEventEntityOperation": {
1813
+ "type": "object",
1814
+ "properties": {
1815
+ "type": {
1816
+ "type": "string",
1817
+ "enum": [
1818
+ "entity_operation"
1819
+ ]
1820
+ },
1821
+ "entity_id": {
1822
+ "$ref": "#/components/schemas/EntityId"
1823
+ },
1824
+ "org_id": {
1825
+ "type": "string",
1826
+ "example": "123"
1827
+ },
1828
+ "activity_id": {
1829
+ "$ref": "#/components/schemas/ActivityId"
1830
+ },
1831
+ "operation_type": {
1832
+ "$ref": "#/components/schemas/EntityOperation"
1833
+ }
1834
+ },
1835
+ "required": [
1836
+ "entity_id",
1837
+ "org_id",
1838
+ "activity_id",
1839
+ "operation_type"
1840
+ ]
1841
+ },
1842
+ "ApiCallerContext": {
1843
+ "type": "object",
1844
+ "additionalProperties": true,
1845
+ "properties": {
1846
+ "EpilotAuth": {
1847
+ "type": "object",
1848
+ "properties": {
1849
+ "token": {
2004
1850
  "type": "object",
2005
1851
  "properties": {
2006
- "source": {
2007
- "type": "string"
2008
- },
2009
- "comparison": {
2010
- "$ref": "#/components/schemas/Comparison"
2011
- },
2012
- "value": {
2013
- "oneOf": [
2014
- {
2015
- "type": "string"
2016
- },
2017
- {
2018
- "type": "number"
2019
- },
2020
- {
2021
- "type": "array",
2022
- "items": {
2023
- "type": "string"
2024
- }
2025
- },
2026
- {
2027
- "type": "array",
2028
- "items": {
2029
- "type": "number"
2030
- }
2031
- }
2032
- ]
2033
- }
1852
+ "sub": {
1853
+ "type": "string",
1854
+ "example": "476e9b48-42f4-4234-a2b0-4668b34626ce"
1855
+ },
1856
+ "email": {
1857
+ "type": "string",
1858
+ "example": "example@epilot.cloud"
1859
+ },
1860
+ "cognito:username": {
1861
+ "type": "string",
1862
+ "example": "example@epilot.cloud"
1863
+ },
1864
+ "custom:ivy_user_id": {
1865
+ "type": "string",
1866
+ "example": "10006129"
1867
+ }
2034
1868
  },
2035
- "required": [
2036
- "source",
2037
- "comparison"
2038
- ],
2039
1869
  "example": {
2040
- "source": "billing_contact.email",
2041
- "comparison": "exists"
1870
+ "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",
1871
+ "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",
1872
+ "custom:ivy_org_id": "739224",
1873
+ "cognito:username": "n.ahmad@epilot.cloud",
1874
+ "custom:ivy_user_id": "10006129",
1875
+ "aud": "6e0jbdnger7nmoktaaflarue1l",
1876
+ "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",
1877
+ "token_use": "id",
1878
+ "auth_time": 1614333023,
1879
+ "exp": 1614336623,
1880
+ "iat": 1614333023,
1881
+ "email": "n.ahmad@epilot.cloud"
2042
1882
  }
1883
+ }
1884
+ }
1885
+ }
1886
+ }
1887
+ },
1888
+ "ExecutionStatus": {
1889
+ "type": "string",
1890
+ "enum": [
1891
+ "pending",
1892
+ "in_progress",
1893
+ "success",
1894
+ "failed",
1895
+ "cancelled"
1896
+ ]
1897
+ },
1898
+ "GetExecutionsResp": {
1899
+ "type": "object",
1900
+ "properties": {
1901
+ "total": {
1902
+ "type": "number"
1903
+ },
1904
+ "results": {
1905
+ "type": "array",
1906
+ "items": {
1907
+ "$ref": "#/components/schemas/AutomationExecution"
1908
+ }
1909
+ }
1910
+ },
1911
+ "required": [
1912
+ "total",
1913
+ "results"
1914
+ ]
1915
+ },
1916
+ "StartExecutionRequest": {
1917
+ "type": "object",
1918
+ "properties": {
1919
+ "entity_id": {
1920
+ "$ref": "#/components/schemas/EntityId"
1921
+ },
1922
+ "flow_id": {
1923
+ "$ref": "#/components/schemas/AutomationFlowId"
1924
+ }
1925
+ }
1926
+ },
1927
+ "EntityId": {
1928
+ "type": "string",
1929
+ "example": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74"
1930
+ },
1931
+ "ActivityId": {
1932
+ "type": "string",
1933
+ "example": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74"
1934
+ },
1935
+ "OrganizationId": {
1936
+ "type": "string",
1937
+ "example": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74"
1938
+ },
1939
+ "JourneySubmitTrigger": {
1940
+ "type": "object",
1941
+ "properties": {
1942
+ "type": {
1943
+ "type": "string",
1944
+ "enum": [
1945
+ "journey_submission"
1946
+ ]
1947
+ },
1948
+ "configuration": {
1949
+ "type": "object",
1950
+ "properties": {
1951
+ "source_id": {
1952
+ "type": "string",
1953
+ "format": "uuid"
1954
+ }
2043
1955
  },
2044
- "Comparison": {
1956
+ "required": [
1957
+ "source_id"
1958
+ ]
1959
+ }
1960
+ },
1961
+ "required": [
1962
+ "type",
1963
+ "configuration"
1964
+ ]
1965
+ },
1966
+ "FrontendSubmitTrigger": {
1967
+ "type": "object",
1968
+ "properties": {
1969
+ "type": {
1970
+ "type": "string",
1971
+ "enum": [
1972
+ "frontend_submission"
1973
+ ]
1974
+ },
1975
+ "configuration": {
1976
+ "type": "object",
1977
+ "properties": {
1978
+ "source_id": {
1979
+ "type": "string",
1980
+ "example": "99"
1981
+ }
1982
+ }
1983
+ }
1984
+ },
1985
+ "required": [
1986
+ "type",
1987
+ "configuration"
1988
+ ]
1989
+ },
1990
+ "ApiSubmissionTrigger": {
1991
+ "type": "object",
1992
+ "properties": {
1993
+ "type": {
1994
+ "type": "string",
1995
+ "enum": [
1996
+ "api_submission"
1997
+ ]
1998
+ },
1999
+ "configuration": {
2000
+ "type": "object",
2001
+ "properties": {
2002
+ "source_id": {
2003
+ "type": "string"
2004
+ }
2005
+ }
2006
+ }
2007
+ },
2008
+ "required": [
2009
+ "type",
2010
+ "configuration"
2011
+ ]
2012
+ },
2013
+ "ReceivedEmailTrigger": {
2014
+ "type": "object",
2015
+ "properties": {
2016
+ "type": {
2017
+ "type": "string",
2018
+ "enum": [
2019
+ "received_email"
2020
+ ]
2021
+ },
2022
+ "configuration": {
2023
+ "type": "object",
2024
+ "properties": {
2025
+ "message_type": {
2045
2026
  "type": "string",
2046
2027
  "enum": [
2047
- "equals",
2048
- "any_of",
2049
- "not_empty",
2050
- "is_empty"
2051
- ]
2052
- },
2053
- "EntityItemSnapshot": {
2054
- "type": "object",
2055
- "properties": {
2056
- "_id": {
2057
- "$ref": "#/components/schemas/EntityId"
2058
- },
2059
- "_title": {
2060
- "type": "string"
2061
- },
2062
- "_org": {
2063
- "type": "string"
2064
- },
2065
- "_schema": {
2066
- "type": "string"
2067
- },
2068
- "_tags": {
2069
- "type": "array",
2070
- "items": {
2071
- "type": "string"
2072
- }
2073
- },
2074
- "_created_at": {
2075
- "type": "string",
2076
- "format": "date-time"
2077
- },
2078
- "_updated_at": {
2079
- "type": "string",
2080
- "format": "date-time"
2081
- }
2082
- },
2083
- "additionalProperties": true,
2084
- "required": [
2085
- "_id",
2086
- "_title",
2087
- "_org",
2088
- "_schema",
2089
- "_created_at",
2090
- "_updated_at"
2028
+ "RECEIVED"
2091
2029
  ]
2030
+ }
2031
+ }
2032
+ }
2033
+ },
2034
+ "required": [
2035
+ "type",
2036
+ "configuration"
2037
+ ]
2038
+ },
2039
+ "EntityOperationTrigger": {
2040
+ "type": "object",
2041
+ "properties": {
2042
+ "type": {
2043
+ "type": "string",
2044
+ "enum": [
2045
+ "entity_operation"
2046
+ ]
2047
+ },
2048
+ "configuration": {
2049
+ "type": "object",
2050
+ "properties": {
2051
+ "schema": {
2052
+ "type": "string",
2053
+ "example": "submission"
2054
+ },
2055
+ "operations": {
2056
+ "type": "array",
2057
+ "minItems": 1,
2058
+ "items": {
2059
+ "$ref": "#/components/schemas/EntityOperation"
2060
+ }
2061
+ },
2062
+ "include_activities": {
2063
+ "type": "array",
2064
+ "items": {
2065
+ "type": "string",
2066
+ "example": [
2067
+ "CreateEntity"
2068
+ ]
2069
+ }
2070
+ },
2071
+ "exclude_activities": {
2072
+ "type": "array",
2073
+ "items": {
2074
+ "type": "string",
2075
+ "example": [
2076
+ "SyncEntity"
2077
+ ]
2078
+ }
2079
+ }
2092
2080
  },
2093
- "RetryReq": {
2094
- "type": "object",
2095
- "properties": {
2096
- "retry_strategy": {
2097
- "$ref": "#/components/schemas/RetryStrategy"
2098
- }
2081
+ "required": [
2082
+ "schema",
2083
+ "operations"
2084
+ ]
2085
+ }
2086
+ },
2087
+ "required": [
2088
+ "type",
2089
+ "configuration"
2090
+ ]
2091
+ },
2092
+ "ActivityTrigger": {
2093
+ "type": "object",
2094
+ "properties": {
2095
+ "type": {
2096
+ "type": "string",
2097
+ "enum": [
2098
+ "activity"
2099
+ ]
2100
+ },
2101
+ "configuration": {
2102
+ "type": "object",
2103
+ "properties": {
2104
+ "schema": {
2105
+ "type": "string",
2106
+ "example": "submission"
2107
+ },
2108
+ "types": {
2109
+ "type": "array",
2110
+ "items": {
2111
+ "type": "string",
2112
+ "enum": [
2113
+ "CreateMeterReading",
2114
+ "UpdateMeterReading",
2115
+ "MessageActivity",
2116
+ "SyncActivity"
2117
+ ]
2118
+ }
2119
+ }
2120
+ }
2121
+ }
2122
+ },
2123
+ "required": [
2124
+ "type",
2125
+ "configuration"
2126
+ ]
2127
+ },
2128
+ "EntityOperation": {
2129
+ "type": "string",
2130
+ "enum": [
2131
+ "createEntity",
2132
+ "updateEntity",
2133
+ "deleteEntity"
2134
+ ]
2135
+ },
2136
+ "EntityManualTrigger": {
2137
+ "type": "object",
2138
+ "properties": {
2139
+ "type": {
2140
+ "type": "string",
2141
+ "enum": [
2142
+ "entity_manual"
2143
+ ]
2144
+ },
2145
+ "configuration": {
2146
+ "type": "object",
2147
+ "properties": {
2148
+ "schema": {
2149
+ "description": "Which entity type can this automation be triggered from",
2150
+ "type": "string",
2151
+ "example": "submission"
2152
+ }
2153
+ }
2154
+ }
2155
+ },
2156
+ "required": [
2157
+ "type",
2158
+ "configuration"
2159
+ ]
2160
+ },
2161
+ "TriggerCondition": {
2162
+ "type": "object",
2163
+ "properties": {
2164
+ "source": {
2165
+ "type": "string"
2166
+ },
2167
+ "comparison": {
2168
+ "$ref": "#/components/schemas/Comparison"
2169
+ },
2170
+ "value": {
2171
+ "oneOf": [
2172
+ {
2173
+ "type": "string"
2174
+ },
2175
+ {
2176
+ "type": "number"
2177
+ },
2178
+ {
2179
+ "type": "array",
2180
+ "items": {
2181
+ "type": "string"
2182
+ }
2183
+ },
2184
+ {
2185
+ "type": "array",
2186
+ "items": {
2187
+ "type": "number"
2099
2188
  }
2189
+ }
2190
+ ]
2191
+ }
2192
+ },
2193
+ "required": [
2194
+ "source",
2195
+ "comparison"
2196
+ ],
2197
+ "example": {
2198
+ "source": "billing_contact.email",
2199
+ "comparison": "exists"
2200
+ }
2201
+ },
2202
+ "Comparison": {
2203
+ "type": "string",
2204
+ "enum": [
2205
+ "equals",
2206
+ "any_of",
2207
+ "not_empty",
2208
+ "is_empty"
2209
+ ]
2210
+ },
2211
+ "EntityItemSnapshot": {
2212
+ "type": "object",
2213
+ "properties": {
2214
+ "_id": {
2215
+ "$ref": "#/components/schemas/EntityId"
2216
+ },
2217
+ "_title": {
2218
+ "type": "string"
2219
+ },
2220
+ "_org": {
2221
+ "type": "string"
2222
+ },
2223
+ "_schema": {
2224
+ "type": "string"
2225
+ },
2226
+ "_tags": {
2227
+ "type": "array",
2228
+ "items": {
2229
+ "type": "string"
2100
2230
  }
2231
+ },
2232
+ "_created_at": {
2233
+ "type": "string",
2234
+ "format": "date-time"
2235
+ },
2236
+ "_updated_at": {
2237
+ "type": "string",
2238
+ "format": "date-time"
2239
+ }
2240
+ },
2241
+ "additionalProperties": true,
2242
+ "required": [
2243
+ "_id",
2244
+ "_title",
2245
+ "_org",
2246
+ "_schema",
2247
+ "_created_at",
2248
+ "_updated_at"
2249
+ ]
2250
+ },
2251
+ "RetryReq": {
2252
+ "type": "object",
2253
+ "properties": {
2254
+ "retry_strategy": {
2255
+ "$ref": "#/components/schemas/RetryStrategy"
2256
+ }
2101
2257
  }
2258
+ }
2259
+ }
2260
+ },
2261
+ "servers": [
2262
+ {
2263
+ "url": "https://automation.sls.epilot.io"
2102
2264
  },
2103
- "servers": [
2104
- {
2105
- "url": "https://automation.sls.epilot.io"
2106
- }
2107
- ]
2265
+ {
2266
+ "url": "https://automation.sls.epilot.io"
2267
+ }
2268
+ ]
2108
2269
  }