-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
2476 lines (2370 loc) · 75.2 KB
/
openapi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: "Automation API"
description: "API Backend for epilot Automation Workflows feature"
version: 1.0.0
tags:
- name: flows
description: Automation flows
- name: executions
description: Automation executions
- name: bulk
description: Bulk job for triggering automation executions
security:
- EpilotAuth: []
paths:
"/v1/automation/flows":
get:
operationId: searchFlows
summary: searchFlows
description: Search available automation flows
tags:
- flows
parameters:
- name: schema
in: query
description: Entity Schema
schema:
type: string
example: submission
- name: size
in: query
description: "Pagination: max number of results to return"
schema:
type: integer
default: 25
- name: from
in: query
description: "Pagination: starting for results"
schema:
type: integer
default: 0
- name: trigger_source_id
in: query
description: "Trigger source identifier"
schema:
type: string
example: 600945fe-212e-4b97-acf7-391d64648384
responses:
"200":
description: List of automation flows, including total count
content:
application/json:
schema:
$ref: "#/components/schemas/SearchAutomationsResp"
post:
operationId: createFlow
summary: createFlow
description: Create new automation flow
tags:
- flows
requestBody:
description: Automation flow to create
content:
application/json:
schema:
$ref: "#/components/schemas/AutomationFlow"
responses:
"201":
description: The created automation flow
content:
application/json:
schema:
$ref: "#/components/schemas/AutomationFlow"
"403":
$ref: "#/components/responses/ForbiddenError"
"/v1/automation/flows/{flow_id}":
get:
operationId: getFlow
summary: getFlow
description: List available automation flows
tags:
- flows
parameters:
- name: flow_id
in: path
required: true
description: Automation Workflow ID
schema:
$ref: "#/components/schemas/AutomationFlowId"
responses:
"200":
description: The returned automation flow
content:
application/json:
schema:
$ref: "#/components/schemas/AutomationFlow"
"403":
$ref: "#/components/responses/ForbiddenError"
"404":
$ref: "#/components/responses/NotFoundError"
put:
operationId: putFlow
summary: putFlow
description: Update automation flow by id
tags:
- flows
parameters:
- name: flow_id
in: path
required: true
description: Automation Workflow ID
schema:
$ref: "#/components/schemas/AutomationFlowId"
requestBody:
description: Automation flow to create
content:
application/json:
schema:
$ref: "#/components/schemas/AutomationFlow"
responses:
"200":
description: The updated automation flow
content:
application/json:
schema:
$ref: "#/components/schemas/AutomationFlow"
"403":
$ref: "#/components/responses/ForbiddenError"
delete:
operationId: deleteFlow
summary: deleteFlow
description: Update automation flow by id
tags:
- flows
parameters:
- name: flow_id
in: path
required: true
description: Automation Workflow ID
schema:
$ref: "#/components/schemas/AutomationFlowId"
responses:
"200":
description: Flow deleted successfully
"403":
$ref: "#/components/responses/ForbiddenError"
"404":
$ref: "#/components/responses/NotFoundError"
"/v1/automation/executions":
get:
operationId: getExecutions
summary: getExecutions
description: List automation executions
parameters:
- name: entity_id
in: query
schema:
$ref: "#/components/schemas/EntityId"
- name: size
in: query
description: "Pagination: max number of results to return"
schema:
type: integer
default: 25
- name: from
in: query
description: "Pagination: starting for results"
schema:
type: integer
default: 0
tags:
- executions
responses:
"200":
description: List of automation executions
content:
application/json:
schema:
$ref: "#/components/schemas/GetExecutionsResp"
"403":
$ref: "#/components/responses/ForbiddenError"
post:
operationId: startExecution
summary: startExecution
description: Start new automation execution
requestBody:
description: Execution parameters
content:
application/json:
schema:
$ref: "#/components/schemas/StartExecutionRequest"
tags:
- executions
responses:
"201":
description: The created execution
content:
application/json:
schema:
$ref: "#/components/schemas/AutomationExecution"
"403":
$ref: "#/components/responses/ForbiddenError"
"/v1/automation/executions/bulk-jobs":
post:
operationId: bulkTriggerExecutions
summary: bulkTriggerExecutions
description: Create a bulk job that triggers multiple automation executions
requestBody:
description: Execution parameters
content:
application/json:
schema:
$ref: "#/components/schemas/BulkTriggerRequest"
example:
flow_id: 8e2e067e-3c63-4b1a-8e02-6150a3d1fd89
entity_ids:
- 7791b04a-16d2-44a2-9af9-2d59c25c512f
- b35a6c51-2a15-4ef1-9623-20db37b0744f
tags:
- bulk
responses:
"202":
description: Trigger Executions Job Info
content:
application/json:
schema:
$ref: "#/components/schemas/BulkTriggerJob"
"403":
$ref: "#/components/responses/ForbiddenError"
"/v1/automation/executions/bulk-jobs/{job_id}":
get:
operationId: getBulkJob
summary: getBulkJob
description: Get the status of a bulk job that triggers multiple automation executions
parameters:
- name: job_id
in: path
schema:
$ref: "#/components/schemas/JobId"
required: true
tags:
- bulk
responses:
"200":
description: Bulk Job Info
content:
application/json:
schema:
$ref: "#/components/schemas/BulkTriggerJob"
"403":
$ref: "#/components/responses/ForbiddenError"
"404":
$ref: "#/components/responses/NotFoundError"
patch:
operationId: patchBulkJob
summary: patchBulkJob
description: Approve / Cancel bulk job that triggers multiple automation executions
parameters:
- name: job_id
in: path
schema:
$ref: "#/components/schemas/JobId"
required: true
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PatchBulkJobRequest"
example:
action: APPROVE
task_token: b35a6c51-2a15-4ef1-9623-20db37b0744f
tags:
- bulk
responses:
"200":
description: Bulk Job Info
content:
application/json:
schema:
$ref: "#/components/schemas/BulkTriggerJob"
"403":
$ref: "#/components/responses/ForbiddenError"
"404":
$ref: "#/components/responses/NotFoundError"
"/v1/automation/executions/{execution_id}":
get:
operationId: getExecution
summary: getExecution
description: Get automation execution
parameters:
- name: execution_id
in: path
schema:
$ref: "#/components/schemas/AutomationExecutionId"
required: true
tags:
- executions
responses:
"200":
description: The returned execution
content:
application/json:
schema:
$ref: "#/components/schemas/AutomationExecution"
"403":
$ref: "#/components/responses/ForbiddenError"
"404":
$ref: "#/components/responses/NotFoundError"
delete:
operationId: cancelExecution
summary: cancelExecution
description: Cancel automation execution
parameters:
- name: execution_id
in: path
schema:
$ref: "#/components/schemas/AutomationExecutionId"
required: true
tags:
- executions
responses:
"200":
description: The cancelled execution
content:
application/json:
schema:
$ref: "#/components/schemas/AutomationExecution"
"403":
$ref: "#/components/responses/ForbiddenError"
"404":
$ref: "#/components/responses/NotFoundError"
/v1/automation/executions/{execution_id}/{action_id}/retrigger:
post:
operationId: retriggerAction
summary: retriggerAction
description: Retry a specific automation execution action which failed / is stuck.
tags:
- executions
parameters:
- name: execution_id
in: path
description: Execution Id
schema:
$ref: "#/components/schemas/AutomationExecutionId"
required: true
- name: action_id
in: path
description: Id of Action to retry.
schema:
$ref: "#/components/schemas/AutomationActionId"
required: true
requestBody:
description: Retry request details.
required: false
content:
application/json:
schema:
$ref: "#/components/schemas/RetryReq"
responses:
"200":
description: action re-triggered with success
"403":
$ref: "#/components/responses/ForbiddenError"
"404":
$ref: "#/components/responses/NotFoundError"
/v1/automation/public/executions:resume:
post:
operationId: resumeExecutionWithToken
summary: resumeExecutionWithToken
description: |
Resume a paused automation execution using a unique resume token.
This public API is normally called when a user lands on a confirmation page via email link.
Example link: https://automation.epilot.io/confirm-email?token=eyJraWQiOiJrZXkifQ...
tags:
- executions
security: []
requestBody:
description: Retry request details.
content:
application/json:
schema:
$ref: "#/components/schemas/ResumeReq"
responses:
"200":
description: execution resumed with success
content:
application/json:
schema:
$ref: "#/components/schemas/ResumeResp"
"400":
description: execution could not be resumed
"403":
$ref: "#/components/responses/ForbiddenError"
"404":
$ref: "#/components/responses/NotFoundError"
components:
securitySchemes:
EpilotAuth:
type: http
scheme: bearer
description: Epilot Bearer Token
schemas:
AutomationFlowId:
type: string
example: 7791b04a-16d2-44a2-9af9-2d59c25c512f
readOnly: true
AutomationActionId:
type: string
example: 9ec3711b-db63-449c-b894-54d5bb622a8f
AutomationFlow:
type: object
properties:
id:
$ref: "#/components/schemas/AutomationFlowId"
flow_name:
type: string
description: A descriptive name for the Automation
example: Handle contact form
enabled:
type: boolean
description: Whether the automation is enabled or not
disable_details:
type: object
properties:
disabled_at:
type: string
format: date-time
description: When the flow was disabled
disabled_by:
type: string
enum: [system, user]
description: Who disabled the flow (system or user)
required:
- disabled_at
- disabled_by
triggers:
type: array
items:
$ref: "#/components/schemas/AnyTrigger"
trigger_conditions:
type: array
items:
$ref: "#/components/schemas/TriggerCondition"
entity_schema:
description: The triggering entity schema
type: string
example: submission
conditions:
type: array
items:
$ref: "#/components/schemas/ActionCondition"
schedules:
type: array
items:
$ref: "#/components/schemas/ActionSchedule"
actions:
type: array
description: The actions (nodes) of the automation flow
items:
$ref: "#/components/schemas/AnyActionConfig"
readOnly: true
runs:
type: number
example: 7
description: Number of automation executions that ran
created_at:
type: string
format: date-time
readOnly: true
updated_at:
type: string
format: date-time
readOnly: true
created_by:
type: string
example: user:123
description: User / service who created automation flow
readOnly: true
last_updated_by:
type: string
example: user:123
description: User / service who last updated automation flow
readOnly: true
org_id:
type: string
example: "123"
description: Organization the automation flow belongs to
readOnly: true
system_flow:
type: boolean
description: Determines if the flow is a system generated flow
version:
type: number
description: Version of the flow
example: 2
_manifest:
type: array
description: Source blueprint/manifest ID used when automation is created via blueprints.
items:
type: string
format: uuid
example: 123e4567-e89b-12d3-a456-426614174000
nullable: true
required:
- flow_name
- triggers
- actions
SearchAutomationsResp:
type: object
properties:
total:
type: number
results:
type: array
items:
$ref: "#/components/schemas/AutomationFlow"
required:
- total
- results
AnyTrigger:
anyOf:
- $ref: "#/components/schemas/FrontendSubmitTrigger"
- $ref: "#/components/schemas/JourneySubmitTrigger"
- $ref: "#/components/schemas/ApiSubmissionTrigger"
- $ref: "#/components/schemas/EntityOperationTrigger"
- $ref: "#/components/schemas/ActivityTrigger"
- $ref: "#/components/schemas/EntityManualTrigger"
- $ref: "#/components/schemas/ReceivedEmailTrigger"
AnyAction:
anyOf:
- $ref: "#/components/schemas/MapEntityAction"
- $ref: "#/components/schemas/TriggerWorkflowAction"
- $ref: "#/components/schemas/TriggerWebhookAction"
- $ref: "#/components/schemas/CreateDocumentAction"
- $ref: "#/components/schemas/SendEmailAction"
- $ref: "#/components/schemas/CartCheckoutAction"
- $ref: "#/components/schemas/AutomationAction"
AnyActionConfig:
anyOf:
- $ref: "#/components/schemas/MapEntityActionConfig"
- $ref: "#/components/schemas/TriggerWorkflowActionConfig"
- $ref: "#/components/schemas/TriggerWebhookActionConfig"
- $ref: "#/components/schemas/CreateDocumentActionConfig"
- $ref: "#/components/schemas/SendEmailActionConfig"
- $ref: "#/components/schemas/CartCheckoutActionConfig"
- $ref: "#/components/schemas/AutomationActionConfig"
AutomationActionConfig:
type: object
properties:
id:
$ref: "#/components/schemas/AutomationActionId"
flow_action_id:
$ref: "#/components/schemas/AutomationActionId"
name:
type: string
type:
type: string
config:
type: object
additionalProperties: true
allow_failure:
description: Whether to stop execution in a failed state if this action fails
type: boolean
created_automatically:
description: Flag indicating whether the action was created automatically or manually
type: boolean
is_bulk_action:
description: Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
type: boolean
reason:
type: object
properties:
message:
type: string
description: Why the action has to be skipped/failed
example: There are no registered portal users for the given emails, hence skipping the action
payload:
type: object
additionalProperties: true
description: Extra metadata about the skipping reason - such as a certain condition not met, etc.
condition_id:
type: string
description: Condition Id to be checked before executing the action
schedule_id:
type: string
description: Schedule Id which indicates the schedule of the action
AutomationActionExecutionState:
type: object
properties:
execution_status:
$ref: "#/components/schemas/ExecutionStatus"
started_at:
type: string
updated_at:
type: string
outputs:
type: object
additionalProperties: true
example: {}
error_output:
$ref: "#/components/schemas/ErrorOutput"
retry_strategy:
$ref: "#/components/schemas/RetryStrategy"
RetryStrategy:
type: string
description: different behaviors for retrying failed execution actions.
enum:
- RETRY_AND_RESUME
- RETRY_AND_STOP
- RETRY_ALL_PARENT_CONDITION_ACTIONS
AutomationAction:
allOf:
- $ref: "#/components/schemas/AutomationActionConfig"
- $ref: "#/components/schemas/AutomationActionExecutionState"
ErrorOutput:
type: object
properties:
error_code:
$ref: "#/components/schemas/ErrorCode"
error_reason:
type: string
error_info:
type: object
additionalProperties: true
properties:
details:
type: array
items:
$ref: "#/components/schemas/ErrorDetail"
required:
- error_code
- error_reason
ErrorCode:
type: string
enum:
- MAPPING_ERROR
- REFRESH_RELATIONS_ERROR
- DUPLICATE_ENTITY_ERROR
- TRIGGER_WORKFLOW_ERROR
- TIMEOUT_ERROR
- BAD_CONFIG
- INTERNAL_ERROR
- TRIGGER_WEBHOOK_ERROR
- TEMPLATE_ERROR
- INVALID_PAYLOAD
- INVALID_SCHEDULE_CONFIG
ErrorDetail:
type: object
properties:
explanation:
type: string
context:
type: string
id:
type: string
required:
- explanation
CartCheckoutActionConfig:
allOf:
- $ref: "#/components/schemas/AutomationActionConfig"
- type: object
description: Creates an order entity with prices from journey
properties:
type:
enum:
- cart-checkout
config:
$ref: "#/components/schemas/CartCheckoutConfig"
CartCheckoutAction:
allOf:
- $ref: "#/components/schemas/AutomationAction"
- type: object
description: Creates an order entity with prices from journey
properties:
type:
enum:
- cart-checkout
config:
$ref: "#/components/schemas/CartCheckoutConfig"
CartCheckoutConfig:
type: object
properties:
version:
description: Version of the config
type: string
default: "1"
mapping_config:
$ref: "#/components/schemas/MappingConfigRef"
relation_attributes:
type: array
items:
$ref: "#/components/schemas/RelationAttribute"
mapping_attributes:
type: array
items:
anyOf:
- $ref: "#/components/schemas/MappingAttributeV2"
- $ref: "#/components/schemas/MappingAttribute"
linkback_relation_attribute:
type: string
default: mapped_entities
description: |
Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback
linkback_relation_tags:
type: array
description: Relation tags (labels) to include in main entity linkback relation attribute
items:
type: string
target_unique:
type: array
description: Unique key for target entity (see upsertEntity of Entity API)
items:
type: string
MapEntityActionConfig:
allOf:
- $ref: "#/components/schemas/AutomationActionConfig"
- type: object
properties:
type:
enum:
- map-entity
config:
$ref: "#/components/schemas/MapEntityConfig"
example:
id: 2520gja-2sgmsaga-0asg-822jgal
name: Map Entity
type: map-entity
config:
target_schema: contact
target_unique:
- email.0.email
relation_attributes:
- target: company
mode: append
source_filter:
schema: account
limit: 1
mapping_attributes:
- target: _tags
operation: { _append: ["primary", "payer"], _uniq: true }
- target: email
operation:
{ _append: [{ email: { _copy: "billing_contact.email" } }] }
- target: first_name
operation: { _copy: "billing_contact.first_name" }
- target: last_name
operation: { _copy: "billing_contact.last_name" }
- target: contact_type
operation: { _set: "customer" }
- target: address
operation:
{
_append:
[
{
"_tags": ["billing", "primary"],
"street_name": { _copy: "billing_contact.street_name" },
"street_number":
{ _copy: "billing_contact.street_number" },
"city": { _copy: "billing_contact.city" },
"postal_code": { _copy: "billing_contact.postal_code" },
"country": { _copy: "billing_contact.country" },
},
{
"_tags": ["delivery"],
"street_name":
{ _copy: "delivery_contact.street_name" },
"street_number":
{ _copy: "delivery_contact.street_number" },
"city": { _copy: "delivery_contact.city" },
"postal_code":
{ _copy: "delivery_contact.postal_code" },
"country": { _copy: "delivery_contact.country" },
},
],
_uniq:
["street_name", "street_number", "postal_code", "country"],
}
MapEntityAction:
allOf:
- $ref: "#/components/schemas/AutomationAction"
- type: object
properties:
type:
enum:
- map-entity
config:
$ref: "#/components/schemas/MapEntityConfig"
MapEntityConfig:
type: object
properties:
mapping_config:
$ref: "#/components/schemas/MappingConfigRef"
target_schema:
type: string
description: Schema of target entity
target_unique:
type: array
description: Unique key for target entity (see upsertEntity of Entity API)
items:
type: string
mapping_attributes:
type: array
description: Attribute mappings
items:
anyOf:
- $ref: "#/components/schemas/MappingAttributeV2"
- $ref: "#/components/schemas/MappingAttribute"
relation_attributes:
type: array
description: Relation mappings
items:
$ref: "#/components/schemas/RelationAttribute"
linkback_relation_attribute:
type: string
default: mapped_entities
description: |
Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback
linkback_relation_tags:
type: array
description: Relation tags (labels) to include in main entity linkback relation attribute
items:
type: string
required:
- target_schema
MappingConfigRef:
type: object
properties:
config_id:
type: string
description: Id of Entity Mapping Configuration to run for mapping.
target_id:
type: string
description: Id of TargetConfig to run for mapping.
version:
type: number
description: Version of Entity Mapping Configuration to run for mapping.
required:
- config_id
- target_id
RelationAttribute:
type: object
properties:
target:
type: string
description: Target attribute to store the relation in
target_tags:
type: array
description: Relation tags (labels) to set for the stored relations
items:
type: string
target_tags_include_source:
type: boolean
description: Include all relation tags (labels) present on the main entity relation
default: false
source_filter:
type: object
description: A filter to identify which source entities to pick as relations from main entity
properties:
limit:
type: integer
description: Limit relations to maximum number (default, all matched relations)
minimum: 0
schema:
type: string
description: Filter by specific schema
attribute:
type: string
description: Filter by a specific relation attribute on the main entity
relation_tag:
type: string
description: Filter by relation tag (label) on the main entity
tag:
type: string
description: Filter by a specific tag on the related entity
self:
type: boolean
description: Picks main entity as relation (overrides other filters)
default: false
related_to:
type: object
additionalProperties: true
deprecated: true
mode:
type: string
enum:
- append
- prepend
- set
required:
- target
- mode
MappingAttributeV2:
type: object
properties:
target:
type: string
description: Target JSON path for the attribute to set
operation:
$ref: "#/components/schemas/OperationNode"
required:
- targetPath
- operation
example:
target: _tags
operation: { _append: ["new", "tags"], _uniq: true }
OperationNode:
description: Mapping operation nodes are either primitive values or operation node objects
oneOf:
- $ref: "#/components/schemas/OperationObjectNode"
- $ref: "#/components/schemas/PrimitiveJSONValue"
OperationObjectNode:
type: object
properties:
_set:
$ref: "#/components/schemas/PrimitiveJSONValue"
_append:
description: Append to array
items:
# $ref: "#/components/schemas/OperationNode"
$ref: "#/components/schemas/PrimitiveJSONValue"
_uniq:
description: Unique array
oneOf:
- type: boolean
example: true
- type: array
description: Unique key consisting of object keys
example: ["email"]
items:
type: string
_copy:
description: Copy JSONPath value from source entity context
type: string
example: "contact.first_name"
additionalProperties: true
PrimitiveJSONValue: {}
MappingAttribute:
anyOf:
- $ref: "#/components/schemas/SetValueMapper"
- $ref: "#/components/schemas/CopyValueMapper"
- $ref: "#/components/schemas/AppendValueMapper"
MappingAttributeMode:
type: string
enum:
- copy_if_exists
- append_if_exists
- set_value
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.
SetValueMapper:
type: object
deprecated: true
properties:
mode:
$ref: "#/components/schemas/MappingAttributeMode"
target:
type: string
description: JSON like target path for the attribute. Eg. last_name
value:
description: >
Any value to be set: string, number, string[], number[], JSON object, etc.