@celigo/api-specs 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -0
  3. package/dist/account.yml +592 -0
  4. package/dist/agent.yml +908 -0
  5. package/dist/ai-agent.yml +5471 -0
  6. package/dist/api.yml +4140 -0
  7. package/dist/apim.yml +1286 -0
  8. package/dist/asynchelper.yml +3391 -0
  9. package/dist/audit.yml +2006 -0
  10. package/dist/connection.yml +8665 -0
  11. package/dist/connector.yml +1406 -0
  12. package/dist/ediprofile.yml +911 -0
  13. package/dist/editransaction.yml +1210 -0
  14. package/dist/enduser.yml +1724 -0
  15. package/dist/environment.yml +568 -0
  16. package/dist/eventreport.yml +692 -0
  17. package/dist/export.yml +17610 -0
  18. package/dist/filedefinition.yml +1396 -0
  19. package/dist/filestorage.yml +3102 -0
  20. package/dist/flow.yml +7928 -0
  21. package/dist/guardrail.yml +2763 -0
  22. package/dist/httpconnector.yml +2277 -0
  23. package/dist/httpconnectorendpoint.yml +722 -0
  24. package/dist/httpconnectorresource.yml +396 -0
  25. package/dist/iclient.yml +4452 -0
  26. package/dist/import.yml +15381 -0
  27. package/dist/integration.yml +4406 -0
  28. package/dist/job.yml +2014 -0
  29. package/dist/lookupcache.yml +1325 -0
  30. package/dist/marketplace.yml +685 -0
  31. package/dist/mcp-oauth-provider.yml +590 -0
  32. package/dist/mcp-server.yml +2656 -0
  33. package/dist/notification.yml +488 -0
  34. package/dist/processor.yml +1253 -0
  35. package/dist/profile.yml +455 -0
  36. package/dist/recyclebin.yml +768 -0
  37. package/dist/script.yml +1128 -0
  38. package/dist/stack.yml +1291 -0
  39. package/dist/state.yml +894 -0
  40. package/dist/subscription.yml +1405 -0
  41. package/dist/sync.yml +4857 -0
  42. package/dist/tag.yml +553 -0
  43. package/dist/template.yml +897 -0
  44. package/dist/tool.yml +33656 -0
  45. package/dist/tradingpartnerconnector.yml +1490 -0
  46. package/dist/user.yml +831 -0
  47. package/package.json +41 -0
  48. package/schemas.json +8420 -0
@@ -0,0 +1,3391 @@
1
+ openapi: 3.2.0
2
+ info:
3
+ version: 1.0.0
4
+ title: Async Helpers
5
+ description: API for managing Celigo async helpers — submit/status/result polling definitions for external asynchronous job APIs.
6
+ x-celigo-ai-guidance:
7
+ - |-
8
+ API for managing async helpers in Celigo. An async helper teaches an
9
+ export or import step how to talk to an *asynchronous* external API — one
10
+ that does not return results immediately but instead acknowledges the
11
+ request and processes it in the background (the "fire-and-check-back"
12
+ pattern: HTTP 202 responses, job tickets, feed / document IDs, etc.).
13
+
14
+ An async helper is NOT an independent runtime resource. It only does
15
+ anything when referenced from an export or import via `http._asyncHelperId`.
16
+ It bundles the polling configuration (how long to wait, how often to poll,
17
+ where the status lives in the response, which values mean in-progress /
18
+ done / error) plus references to the two export resources that do the
19
+ actual work:
20
+
21
+ - a required **status export** (`http.status._exportId`) that the platform
22
+ calls on each poll to check whether the background job is finished, and
23
+ - a **result export** (`http.result._exportId`) that fetches the final
24
+ payload once the job reports done.
25
+
26
+ The status export and the result export must themselves be ordinary
27
+ (synchronous) exports — they cannot reference an async helper of their own.
28
+ servers:
29
+ - url: https://api.integrator.io
30
+ description: Production (US / default region)
31
+ - url: https://api.eu.integrator.io
32
+ description: Production (EU region)
33
+ - url: https://api.au.integrator.io
34
+ description: Production (AU region)
35
+ - url: https://api.ca.integrator.io
36
+ description: Production (CA region)
37
+ security:
38
+ - bearerAuth: []
39
+ tags:
40
+ - name: Async Helpers
41
+ description: |-
42
+ API for managing async helper resources in Celigo. Async helpers define how
43
+ integrator.io polls an external system's asynchronous job API: submitting a
44
+ request, checking its status until completion, and retrieving the result.
45
+
46
+ An async helper ties together three phases:
47
+
48
+ - **Submit** -- initiate the remote job (or reuse the status endpoint).
49
+ - **Status** -- poll until the job reaches a done or error state.
50
+ - **Result** -- fetch the final payload once the status indicates success.
51
+
52
+ Each phase references an export resource that contains the HTTP
53
+ configuration (connection, method, relative URI, etc.).
54
+
55
+ ## Async helper schema
56
+
57
+ {% openapi-schemas spec="asynchelper" schemas="AsyncHelper" grouped="true" %}
58
+ paths:
59
+ /v1/asynchelpers:
60
+ get:
61
+ x-internal: false
62
+ operationId: listAsyncHelpers
63
+ tags:
64
+ - Async Helpers
65
+ summary: List async helpers
66
+ description: Returns an array of all async helper resources in the account.
67
+ parameters:
68
+ - name: limit
69
+ in: query
70
+ description: Maximum number of records to return per page.
71
+ schema:
72
+ type: integer
73
+ minimum: 1
74
+ - $ref: '#/components/parameters/After'
75
+ - name: externalId
76
+ in: query
77
+ description: Filter to async helpers matching this exact external identifier.
78
+ schema:
79
+ type: string
80
+ responses:
81
+ '200':
82
+ description: Array of async helper objects.
83
+ headers:
84
+ Link:
85
+ description: |-
86
+ RFC-5988 pagination links. When more pages remain, includes a `<...>; rel="next"` entry;
87
+ absent on the final page.
88
+ schema:
89
+ type: string
90
+ content:
91
+ application/json:
92
+ schema:
93
+ type: array
94
+ items:
95
+ $ref: '#/components/schemas/AsyncHelper'
96
+ examples:
97
+ list:
98
+ summary: List with one async helper
99
+ value:
100
+ - _id: 64a1b2c3d4e5f60011223344
101
+ lastModified: '2026-04-15T14:30:15Z'
102
+ name: Salesforce Bulk Query Helper
103
+ _templateId: 5c6c135fc802b3146e12eecf
104
+ _sourceId: 6256b8c0cddb8a1ba55198d5
105
+ http:
106
+ submit:
107
+ sameAsStatus: true
108
+ status:
109
+ _exportId: 63b1c2d3e4f5a60011334455
110
+ statusPath: status
111
+ pollWaitTime: 4
112
+ initialWaitTime: 1
113
+ inProgressValues:
114
+ - InProgress
115
+ - UploadComplete
116
+ doneValues:
117
+ - JobComplete
118
+ errorValues:
119
+ - Failed
120
+ - Aborted
121
+ result:
122
+ _exportId: 63c1d2e3f4a5b60011445566
123
+ '204':
124
+ description: No async helpers exist in the account.
125
+ '401':
126
+ $ref: '#/components/responses/401-unauthorized'
127
+ x-celigo-ai-guidance:
128
+ - |-
129
+ Returns a list of all async helpers configured in the account.
130
+ If no async helpers exist, a 204 response with no body will be returned.
131
+ post:
132
+ x-internal: false
133
+ operationId: createAsyncHelper
134
+ tags:
135
+ - Async Helpers
136
+ summary: Create an async helper
137
+ description: |-
138
+ Creates a new async helper resource. The referenced
139
+ `http.status._exportId` must be an existing export resource. If
140
+ `http.submit.sameAsStatus` is `false`, also set
141
+ `http.submit.resourcePath` to extract the async job identifier.
142
+ requestBody:
143
+ required: true
144
+ content:
145
+ application/json:
146
+ schema:
147
+ $ref: '#/components/schemas/AsyncHelperRequest'
148
+ examples:
149
+ same_as_status:
150
+ summary: Submit reuses the status endpoint
151
+ value:
152
+ name: Salesforce Bulk Query Helper
153
+ http:
154
+ submit:
155
+ sameAsStatus: true
156
+ status:
157
+ _exportId: 63b1c2d3e4f5a60011334455
158
+ statusPath: status
159
+ pollWaitTime: 4
160
+ initialWaitTime: 1
161
+ inProgressValues:
162
+ - InProgress
163
+ - UploadComplete
164
+ doneValues:
165
+ - JobComplete
166
+ errorValues:
167
+ - Failed
168
+ - Aborted
169
+ result:
170
+ _exportId: 63c1d2e3f4a5b60011445566
171
+ separate_submit:
172
+ summary: Separate submit endpoint
173
+ value:
174
+ name: Report Generation Helper
175
+ http:
176
+ submit:
177
+ sameAsStatus: false
178
+ resourcePath: jobId
179
+ status:
180
+ _exportId: 63b1c2d3e4f5a60011334455
181
+ statusPath: job.state
182
+ pollWaitTime: 5
183
+ inProgressValues:
184
+ - Pending
185
+ - Processing
186
+ doneValues:
187
+ - Completed
188
+ doneWithoutDataValues:
189
+ - NoData
190
+ errorValues:
191
+ - Failed
192
+ result: {}
193
+ responses:
194
+ '201':
195
+ description: Async helper created successfully.
196
+ content:
197
+ application/json:
198
+ schema:
199
+ $ref: '#/components/schemas/AsyncHelper'
200
+ examples:
201
+ created:
202
+ summary: Newly created async helper
203
+ value:
204
+ _id: 64a1b2c3d4e5f60011223344
205
+ lastModified: '2026-04-29T14:30:00Z'
206
+ name: Salesforce Bulk Query Helper
207
+ http:
208
+ submit:
209
+ sameAsStatus: true
210
+ status:
211
+ _exportId: 63b1c2d3e4f5a60011334455
212
+ statusPath: status
213
+ pollWaitTime: 4
214
+ initialWaitTime: 1
215
+ inProgressValues:
216
+ - InProgress
217
+ - UploadComplete
218
+ doneValues:
219
+ - JobComplete
220
+ errorValues:
221
+ - Failed
222
+ - Aborted
223
+ result:
224
+ _exportId: 63c1d2e3f4a5b60011445566
225
+ '400':
226
+ $ref: '#/components/responses/400-bad-request'
227
+ '401':
228
+ $ref: '#/components/responses/401-unauthorized'
229
+ '422':
230
+ $ref: '#/components/responses/422-unprocessable-entity'
231
+ x-celigo-ai-guidance:
232
+ - |-
233
+ Creates a new async helper. The `http.status._exportId` (status export)
234
+ and `http.status.statusPath` are required. The status and result exports
235
+ referenced here must be ordinary exports that do not themselves reference
236
+ an async helper.
237
+ /v1/asynchelpers/{_id}:
238
+ get:
239
+ x-internal: false
240
+ operationId: getAsyncHelperById
241
+ tags:
242
+ - Async Helpers
243
+ summary: Get an async helper
244
+ description: Returns a single async helper resource by its ID.
245
+ parameters:
246
+ - name: _id
247
+ in: path
248
+ required: true
249
+ description: Async helper ID.
250
+ schema:
251
+ type: string
252
+ format: objectId
253
+ x-celigo-refModel: asynchelpers
254
+ responses:
255
+ '200':
256
+ description: The async helper record.
257
+ content:
258
+ application/json:
259
+ schema:
260
+ $ref: '#/components/schemas/AsyncHelper'
261
+ examples:
262
+ detail:
263
+ summary: Async helper with all phases configured
264
+ value:
265
+ _id: 64a1b2c3d4e5f60011223344
266
+ lastModified: '2026-04-15T14:30:15Z'
267
+ name: Salesforce Bulk Query Helper
268
+ _templateId: 5c6c135fc802b3146e12eecf
269
+ _sourceId: 6256b8c0cddb8a1ba55198d5
270
+ http:
271
+ submit:
272
+ sameAsStatus: true
273
+ status:
274
+ _exportId: 63b1c2d3e4f5a60011334455
275
+ statusPath: status
276
+ pollWaitTime: 4
277
+ initialWaitTime: 1
278
+ inProgressValues:
279
+ - InProgress
280
+ - UploadComplete
281
+ doneValues:
282
+ - JobComplete
283
+ errorValues:
284
+ - Failed
285
+ - Aborted
286
+ result:
287
+ _exportId: 63c1d2e3f4a5b60011445566
288
+ '400':
289
+ description: The `_id` is not a valid ObjectId.
290
+ content:
291
+ application/json:
292
+ schema:
293
+ $ref: '#/components/schemas/Error'
294
+ examples:
295
+ invalid_ref:
296
+ summary: Invalid ObjectId format
297
+ value:
298
+ errors:
299
+ - code: invalid_ref
300
+ message: Please provide a valid _id.
301
+ '401':
302
+ $ref: '#/components/responses/401-unauthorized'
303
+ '404':
304
+ description: No async helper exists with the given ID.
305
+ content:
306
+ application/json:
307
+ schema:
308
+ $ref: '#/components/schemas/Error'
309
+ examples:
310
+ not_found:
311
+ summary: Async helper does not exist
312
+ value:
313
+ errors:
314
+ - code: invalid_ref
315
+ message: AsyncHelper not found.
316
+ x-celigo-ai-guidance:
317
+ - |-
318
+ Returns the complete configuration of a specific async helper, including
319
+ its polling configuration and the status / result export references.
320
+ put:
321
+ x-internal: false
322
+ operationId: updateAsyncHelper
323
+ tags:
324
+ - Async Helpers
325
+ summary: Update an async helper
326
+ description: |-
327
+ Updates an existing async helper with the provided data. This is a full
328
+ replacement — all required fields must be included in the request body.
329
+ parameters:
330
+ - name: _id
331
+ in: path
332
+ required: true
333
+ description: Async helper ID.
334
+ schema:
335
+ type: string
336
+ format: objectId
337
+ x-celigo-refModel: asynchelpers
338
+ requestBody:
339
+ required: true
340
+ content:
341
+ application/json:
342
+ schema:
343
+ $ref: '#/components/schemas/AsyncHelperRequest'
344
+ examples:
345
+ update:
346
+ summary: Update async helper with new error values
347
+ value:
348
+ name: Salesforce Bulk Query Helper
349
+ http:
350
+ submit:
351
+ sameAsStatus: true
352
+ status:
353
+ _exportId: 63b1c2d3e4f5a60011334455
354
+ statusPath: status
355
+ pollWaitTime: 4
356
+ initialWaitTime: 1
357
+ inProgressValues:
358
+ - InProgress
359
+ - UploadComplete
360
+ doneValues:
361
+ - JobComplete
362
+ errorValues:
363
+ - Failed
364
+ - Aborted
365
+ - TimedOut
366
+ result:
367
+ _exportId: 63c1d2e3f4a5b60011445566
368
+ responses:
369
+ '200':
370
+ description: Async helper updated successfully.
371
+ content:
372
+ application/json:
373
+ schema:
374
+ $ref: '#/components/schemas/AsyncHelper'
375
+ examples:
376
+ updated:
377
+ summary: Async helper with new error value applied
378
+ value:
379
+ _id: 64a1b2c3d4e5f60011223344
380
+ lastModified: '2026-04-16T09:05:42Z'
381
+ name: Salesforce Bulk Query Helper
382
+ http:
383
+ submit:
384
+ sameAsStatus: true
385
+ status:
386
+ _exportId: 63b1c2d3e4f5a60011334455
387
+ statusPath: status
388
+ pollWaitTime: 4
389
+ initialWaitTime: 1
390
+ inProgressValues:
391
+ - InProgress
392
+ - UploadComplete
393
+ doneValues:
394
+ - JobComplete
395
+ errorValues:
396
+ - Failed
397
+ - Aborted
398
+ - TimedOut
399
+ result:
400
+ _exportId: 63c1d2e3f4a5b60011445566
401
+ '400':
402
+ $ref: '#/components/responses/400-bad-request'
403
+ '401':
404
+ $ref: '#/components/responses/401-unauthorized'
405
+ '404':
406
+ $ref: '#/components/responses/404-not-found'
407
+ '422':
408
+ $ref: '#/components/responses/422-unprocessable-entity'
409
+ delete:
410
+ x-internal: false
411
+ operationId: deleteAsyncHelper
412
+ tags:
413
+ - Async Helpers
414
+ summary: Delete an async helper
415
+ description: |-
416
+ Deletes an async helper. The resource is soft-deleted and retained in
417
+ the recycle bin for 30 days before permanent removal. If other resources
418
+ reference this async helper (e.g. exports, flows), the delete is blocked
419
+ — use `GET /v1/asynchelpers/{_id}/dependencies` to discover dependents
420
+ first.
421
+ parameters:
422
+ - name: _id
423
+ in: path
424
+ required: true
425
+ description: Async helper ID.
426
+ schema:
427
+ type: string
428
+ format: objectId
429
+ x-celigo-refModel: asynchelpers
430
+ responses:
431
+ '204':
432
+ description: Async helper deleted successfully.
433
+ '401':
434
+ $ref: '#/components/responses/401-unauthorized'
435
+ '404':
436
+ $ref: '#/components/responses/404-not-found'
437
+ '422':
438
+ $ref: '#/components/responses/422-dependency-conflict'
439
+ /v1/asynchelpers/{_id}/dependencies:
440
+ get:
441
+ x-internal: false
442
+ operationId: listAsyncHelperDependencies
443
+ tags:
444
+ - Async Helpers
445
+ summary: List dependencies of an async helper
446
+ description: |-
447
+ Returns the set of resources that depend on the specified resource.
448
+ The response is an object whose keys are dependent-resource types
449
+ (e.g. `flows`, `imports`) and whose values are arrays of dependency
450
+ entries.
451
+
452
+ Returns `{}` for both zero-dependency and nonexistent IDs.
453
+ parameters:
454
+ - name: _id
455
+ in: path
456
+ required: true
457
+ description: Resource ID.
458
+ schema:
459
+ type: string
460
+ format: objectId
461
+ x-celigo-refModel: asynchelpers
462
+ responses:
463
+ '200':
464
+ description: |
465
+ Dependency map. Keys are resource-type strings; values are arrays
466
+ of dependency entries. Returns `{}` when no dependents exist.
467
+ content:
468
+ application/json:
469
+ schema:
470
+ $ref: '#/components/schemas/DependencyResponse'
471
+ examples:
472
+ none:
473
+ summary: No dependents (also returned for a nonexistent ID)
474
+ value: {}
475
+ '401':
476
+ $ref: '#/components/responses/401-unauthorized'
477
+ components:
478
+ securitySchemes:
479
+ bearerAuth:
480
+ type: http
481
+ scheme: bearer
482
+ parameters:
483
+ After:
484
+ name: after
485
+ in: query
486
+ required: false
487
+ description: |-
488
+ Opaque cursor for forward pagination. Pass the value from the `Link`
489
+ response header (`rel="next"`) to fetch the next page.
490
+ schema:
491
+ type: string
492
+ schemas:
493
+ items:
494
+ type: object
495
+ properties:
496
+ generate:
497
+ type: string
498
+ description: |
499
+ **Purpose**
500
+ Defines the target field name in the output object/record.
501
+
502
+ **Guidance**
503
+ This is the PRIMARY FIELD that identifies the output property being created:
504
+
505
+ - For regular fields: Set to the exact property name (e.g., "firstName", "price", "isActive")
506
+ - For object fields: Set to the object property name, then add child mappings in the 'mappings' array
507
+ - For array fields: Set to the array property name, then configure 'buildArrayHelper'
508
+ - For arrays within arrays: Leave EMPTY for the inner array mappings, as they don't have field names
509
+
510
+ IMPORTANT: Do NOT use dot notation (e.g., "customer.firstName") in this field. Instead, create proper
511
+ hierarchical structure with nested mappings:
512
+ ```json
513
+ {
514
+ "generate": "customer",
515
+ "dataType": "object",
516
+ "status": "Active",
517
+ "mappings": [
518
+ {"generate": "firstName", "dataType": "string", "extract": "$.name.first", "status": "Active"}
519
+ ]
520
+ }
521
+ ```
522
+
523
+ When parsing existing mappings, empty 'generate' fields almost always indicate inner array structures
524
+ within a parent array.
525
+ examples:
526
+ - name
527
+ - address
528
+ - items
529
+ dataType:
530
+ type: string
531
+ description: |
532
+ **Purpose**
533
+ Explicitly declares the data type of the output field, controlling how data is processed and structured.
534
+
535
+ **Guidance**
536
+ This is a REQUIRED field that fundamentally determines mapping behavior:
537
+
538
+ **Simple Types (direct value mapping)**
539
+ - `string`: Text values, converts other types to string representation
540
+ - `number`: Numeric values, attempts conversion from strings
541
+ - `boolean`: True/false values, converts truthy/falsy values
542
+
543
+ Dates are represented as strings — use `string` for date fields and
544
+ drive the parsing/formatting through the `extractDateFormat` /
545
+ `generateDateFormat` / `extractDateTimezone` / `generateDateTimezone`
546
+ fields. There is no separate `date` enum value.
547
+
548
+ **Complex Types (require additional configuration)**
549
+ - `object`: Creates a nested object. REQUIRES child mappings in the 'mappings' array
550
+
551
+ **Array Types**
552
+ - `stringarray`: Array of strings
553
+ - `numberarray`: Array of numbers
554
+ - `booleanarray`: Array of booleans
555
+ - `objectarray`: Array of objects (most common array type)
556
+ - `arrayarray`: Array of arrays (for matrix/table structures)
557
+
558
+ Array dataTypes can be populated two ways: pass a source array through
559
+ unchanged via `extract` alone (when the source is already an array of
560
+ the right shape), or construct/iterate via `buildArrayHelper`.
561
+
562
+ IMPORTANT: The dataType controls which additional fields are relevant:
563
+ - For date-like string fields: extractDateFormat, generateDateFormat, etc. become relevant
564
+ - For object types: 'mappings' array becomes relevant
565
+ - For array types: `buildArrayHelper` is one option (see above)
566
+
567
+ When analyzing existing mappings or generating new ones, always check dataType first
568
+ to understand what additional fields should be present.
569
+ x-celigo-ai-guidance:
570
+ - |-
571
+ Missing `dataType` is rejected at save with validation error
572
+ `[mandatory_destination_datatype] Destination datatype is a
573
+ required field.` When in doubt, use `"string"` — it accepts
574
+ any source value and the runtime will coerce it.
575
+ enum:
576
+ - string
577
+ - number
578
+ - boolean
579
+ - object
580
+ - stringarray
581
+ - numberarray
582
+ - booleanarray
583
+ - objectarray
584
+ - arrayarray
585
+ x-enumDescriptions:
586
+ string: Text values; converts other types to their string representation.
587
+ number: Numeric values; attempts conversion from strings.
588
+ boolean: True/false values; converts truthy/falsy values.
589
+ object: Nested object that requires child mappings in the `mappings` array.
590
+ stringarray: Array of string values.
591
+ numberarray: Array of numeric values.
592
+ booleanarray: Array of boolean values.
593
+ objectarray: Array of objects, the most common array type.
594
+ arrayarray: Array of arrays, used for matrix or table structures.
595
+ examples:
596
+ - string
597
+ - number
598
+ - object
599
+ - objectarray
600
+ extract:
601
+ type: string
602
+ description: |
603
+ **Purpose**
604
+ Defines how to retrieve data from the input record to populate the output field.
605
+
606
+ **Guidance**
607
+ This field supports THREE DISTINCT PATTERNS that are easily distinguished:
608
+
609
+ **1. json Path Syntax**
610
+ - MUST start with '$.' prefix
611
+ - Used for precisely targeting data in structured JSON objects
612
+ - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street'
613
+ - Wildcards like [*] extract multiple values/objects
614
+
615
+ ```json
616
+ "extract": "$.customer.addresses[*]" // Extracts all addresses
617
+ ```
618
+
619
+ **2. Handlebars Template Syntax**
620
+ - Contains '{{' and '}}' pattern
621
+ - Evaluated by the AFE 2.0 handlebars template engine
622
+ - Can include logic, formatting, and computation
623
+ - Access input record fields with {{record.fieldName}} notation
624
+ - Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
625
+ - Valid on `object`, `objectarray`, and primitive-array dataTypes as
626
+ well as scalars — the rendered template output must parse into the
627
+ declared shape
628
+
629
+ ```json
630
+ "extract": "{{record.price}} {{record.currency}}" // Combines two fields
631
+ ```
632
+
633
+ **3. Hard-Coded Value (literal string)**
634
+ - Does NOT start with '$.'
635
+ - Does NOT contain handlebars '{{' syntax
636
+ - System treats it as a literal string value
637
+ - VERY COMMON for setting static/constant values
638
+ - Examples: "Active", "USD", "Completed", "true"
639
+
640
+ ```json
641
+ "extract": "primary" // Sets field value to the literal string "primary"
642
+ "extract": "true" // Sets field value to the literal string "true"
643
+ "extract": "N/A" // Sets field value to the literal string "N/A"
644
+ ```
645
+
646
+ This third pattern is the simplest and most efficient way to set hard-coded values in your mappings.
647
+ AI agents should use this pattern whenever a field needs a static value that doesn't come from
648
+ the input record or require computation.
649
+
650
+ **Important implementation details**
651
+
652
+ - JSON path patterns ALWAYS execute from the TOP-LEVEL root of the input record
653
+ - The system maintains this context even in deeply nested mappings
654
+ - For object mappings without child mappings, extract should return a complete object
655
+ - When both extract and mappings are defined for objects, extract is applied first
656
+
657
+ For most simple field-to-field mappings, prefer JSON path syntax for its clarity and performance.
658
+ For hard-coded values, simply use the literal string as the extract value.
659
+ x-celigo-ai-guidance:
660
+ - |-
661
+ ## SIZE LIMIT
662
+ The platform's import save validator caps this field at **1024
663
+ characters**. Saves with a longer `extract` are rejected
664
+ with `[size_limit_exceeded] The maximum size of the field:
665
+ mappings.<index>.extract in the Import document should be
666
+ 1024 characters`. This typically only matters for
667
+ Handlebars templates that build complex strings inline -- if
668
+ a template is approaching the cap, prefer one of:
669
+
670
+ - **Decompose into nested mappings** (set `dataType:
671
+ "object"` and use child `mappings` -- each child gets
672
+ its own 1024-char budget).
673
+ - **Move the logic to a `preMap` hook** so the heavy
674
+ transformation runs in script and the mapping just reads
675
+ `record.<computed>`.
676
+ - **Use a lookup** (`lookupName` + a small `lookups` entry)
677
+ for value translation that would otherwise need a long
678
+ `{{#if ...}}{{else if ...}}` chain.
679
+ examples:
680
+ - $.fullName
681
+ - '{{record.fullName}}'
682
+ - primary
683
+ - $.lineItems[*].unitPrice
684
+ extractDateFormat:
685
+ type: string
686
+ description: |
687
+ Specifies the format pattern of the input date string to ensure proper parsing.
688
+
689
+ Used on string-typed mappings whose `extract` yields a date. Uses
690
+ Moment.js-compatible formatting tokens to describe how the incoming date
691
+ string is structured.
692
+ examples:
693
+ - YYYY-MM-DD
694
+ - MM/DD/YYYY
695
+ - DD-MMM-YYYY HH:mm:ss
696
+ extractDateTimezone:
697
+ type: string
698
+ description: |
699
+ Specifies the timezone of the input date string using Olson/IANA timezone identifiers.
700
+
701
+ Used on string-typed mappings whose `extract` yields a date; tells the system
702
+ how to interpret timestamp values from the input system.
703
+ examples:
704
+ - UTC
705
+ - America/New_York
706
+ - Europe/London
707
+ generateDateFormat:
708
+ type: string
709
+ description: |
710
+ Specifies the output format pattern when generating a date string or converting
711
+ from a Date type to String type.
712
+
713
+ Uses Moment.js-compatible formatting tokens to define the structure of the resulting
714
+ date string.
715
+ examples:
716
+ - YYYY-MM-DD
717
+ - MM/DD/YYYY
718
+ - DD-MMM-YYYY HH:mm:ss
719
+ generateDateTimezone:
720
+ type: string
721
+ description: |
722
+ Specifies the timezone to apply when generating or converting timestamp values
723
+ using Olson/IANA timezone identifiers.
724
+
725
+ Controls timezone conversion when producing date output.
726
+ examples:
727
+ - UTC
728
+ - America/New_York
729
+ - Europe/London
730
+ default:
731
+ type:
732
+ - string
733
+ - 'null'
734
+ description: |
735
+ Specifies a fallback value to use when extract returns empty/null or when conditional
736
+ logic fails and no other mapping supplies a value.
737
+
738
+ Explicit JSON `null` is itself a valid fallback: the destination field is written as
739
+ JSON null when the extract yields nothing (the Mapper UI's "Use null as default value"
740
+ action). Omitting the key entirely means no fallback — the field is left out of the
741
+ output when the extract is empty (the UI's "Do nothing" action).
742
+ x-celigo-ai-guidance:
743
+ - |-
744
+ `"default": null` and `"default": ""` are distinct saved values, not
745
+ absent keys: null renders the destination field as JSON null and the
746
+ empty string renders it as `""` when the extract yields nothing.
747
+ Preserve them verbatim when editing or migrating a mapping — dropping
748
+ the key changes runtime behavior from "use null/empty string as
749
+ default value" to "do nothing" (field omitted from the output).
750
+ examples:
751
+ - N/A
752
+ - '0'
753
+ - 'false'
754
+ lookupName:
755
+ type: string
756
+ description: |
757
+ **Purpose**
758
+ References a lookup table for transforming values during the mapping process.
759
+
760
+ **Usage**
761
+
762
+ The lookupName refers to a named lookup defined in the lookups array of the same resource.
763
+
764
+ ```json
765
+ {
766
+ "generate": "countryName",
767
+ "dataType": "string",
768
+ "extract": "$.countryCode",
769
+ "lookupName": "countryCodeToName"
770
+ }
771
+ ```
772
+
773
+ During processing, the system:
774
+ 1. Extracts the value from the input record (e.g., "US")
775
+ 2. Finds the lookup table with the specified name
776
+ 3. Uses the extracted value as a key in the lookup
777
+ 4. Returns the corresponding value (e.g., "United States")
778
+
779
+ **Benefits**
780
+
781
+ - **Standardization**: Ensures consistent value translation across mappings
782
+ - **Centralization**: Define translations once and reference them in multiple places
783
+ - **Maintainability**: Update all mappings by changing the lookup definition
784
+ - **Readability**: Makes mappings more descriptive and self-documenting
785
+
786
+ The specific lookup capabilities depend on the context where mappings are used.
787
+ examples:
788
+ - countryCodeToName
789
+ - statusMapping
790
+ - departmentCodes
791
+ description:
792
+ type: string
793
+ description: |
794
+ Optional free-text annotation that appears in the Mapper sidebar to provide context about
795
+ the mapping's purpose for collaboration and documentation.
796
+
797
+ Has no functional impact on the mapping behavior.
798
+ examples:
799
+ - Maps customer name
800
+ - Converts price to target currency
801
+ - Formats date for target system
802
+ sourceDataType:
803
+ type: string
804
+ description: |
805
+ Declares the JSON type of the value produced by `extract`, before any
806
+ conversion to `dataType`. Same enum as `dataType`. Set on leaf mappings
807
+ only — parent mappings (with child `mappings` or `buildArrayHelper`)
808
+ have no extracted value of their own; the children carry their own
809
+ `sourceDataType`.
810
+
811
+ For date fields use `string` (JSON represents dates as strings); the
812
+ parsing/formatting lives in `extractDateFormat` / `generateDateFormat` /
813
+ `extractDateTimezone` / `generateDateTimezone`.
814
+ enum:
815
+ - string
816
+ - number
817
+ - boolean
818
+ - object
819
+ - stringarray
820
+ - numberarray
821
+ - booleanarray
822
+ - objectarray
823
+ - arrayarray
824
+ x-enumDescriptions:
825
+ string: Source value is a text string.
826
+ number: Source value is numeric.
827
+ boolean: Source value is true or false.
828
+ object: Source value is a JSON object.
829
+ stringarray: Source value is an array of strings.
830
+ numberarray: Source value is an array of numbers.
831
+ booleanarray: Source value is an array of booleans.
832
+ objectarray: Source value is an array of objects.
833
+ arrayarray: Source value is an array of arrays.
834
+ examples:
835
+ - string
836
+ - number
837
+ - boolean
838
+ - object
839
+ mappings:
840
+ type: array
841
+ description: |
842
+ **Purpose**
843
+ Enables recursive definition of nested object structures through child mapping objects.
844
+
845
+ **Guidance**
846
+ This is the KEY FIELD that implements the recursive pattern at the core of this schema:
847
+
848
+ **When to Use**
849
+ - REQUIRED when dataType = "object" (unless you are copying an entire object from the input record)
850
+ - REQUIRED in buildArrayHelper.mappings when defining complex object array elements
851
+ - NEVER used with simple types (string, number, boolean, date)
852
+
853
+ **Behavior**
854
+ - Each mapping in this array becomes a property of the parent object
855
+ - The full Mappings schema is repeated recursively at each level
856
+ - Can be nested to any depth for complex hierarchical structures
857
+
858
+ **Context Handling**
859
+ - Each level of nesting changes the mapping CONTEXT for 'generate'
860
+ - The extraction CONTEXT always remains the original input record
861
+ - This means child mappings can pull data from anywhere in the input record
862
+
863
+ **Common Patterns**
864
+
865
+ **Nested Objects**
866
+ ```json
867
+ {
868
+ "generate": "customer",
869
+ "dataType": "object",
870
+ "mappings": [
871
+ {
872
+ "generate": "contact",
873
+ "dataType": "object",
874
+ "mappings": [
875
+ {"generate": "email", "dataType": "string", "extract": "$.customerEmail"}
876
+ ]
877
+ }
878
+ ]
879
+ }
880
+ ```
881
+
882
+ **Multiple Fields in Object**
883
+ ```json
884
+ {
885
+ "generate": "address",
886
+ "dataType": "object",
887
+ "mappings": [
888
+ {"generate": "street", "dataType": "string", "extract": "$.address.line1"},
889
+ {"generate": "city", "dataType": "string", "extract": "$.address.city"},
890
+ {"generate": "country", "dataType": "string", "extract": "$.address.country"}
891
+ ]
892
+ }
893
+ ```
894
+
895
+ IMPORTANT: When analyzing or generating mappings, ALWAYS check if parent.dataType = "object"
896
+ or if you're inside buildArrayHelper.mappings for objectarray elements. These are the only
897
+ valid contexts for the mappings array.
898
+ items:
899
+ $ref: '#/components/schemas/items'
900
+ examples:
901
+ - - generate: firstName
902
+ extract: $.name.first
903
+ dataType: string
904
+ status: Active
905
+ - generate: lastName
906
+ extract: $.name.last
907
+ dataType: string
908
+ status: Active
909
+ buildArrayHelper:
910
+ type: array
911
+ x-celigo-ai-guidance:
912
+ - |-
913
+ Entry-level `extract` accepts an iterating array path
914
+ (`$.items[*]`), `"$"` (the record root), or omission — a
915
+ constructed entry (child `mappings` with the extract omitted or
916
+ `"$"`; the two spellings are equivalent) contributes exactly one
917
+ element, and entries append in order. Indexed or comma-joined
918
+ entry extracts (`"$[0]"`, `"$[0],$[0]"`) are not valid: the
919
+ processor renders the entire destination array as null with no
920
+ validation error. To emit a fixed number of static elements, add
921
+ that many sibling constructed entries — never index the extract.
922
+ description: |
923
+ **Purpose**
924
+ Configures how to construct arrays in the output record, handling various array types and inputs.
925
+
926
+ **Guidance**
927
+ This is the REQUIRED mechanism for ALL array data types:
928
+
929
+ **When to Use**
930
+ - REQUIRED when dataType ends with "array" (stringarray, objectarray, etc.)
931
+ - Each entry in this array contributes elements to the output array
932
+ - Multiple entries allow combining data from different input arrays
933
+
934
+ **Array Type Handling**
935
+
936
+ **For Simple Arrays (stringarray, numberarray, booleanarray)**
937
+ - Only the 'extract' field is used to pull values
938
+ - JSON path with wildcards (e.g., $.items[*].name) returns multiple values
939
+ - Each result is converted to the appropriate primitive type
940
+ ```json
941
+ {
942
+ "generate": "productNames",
943
+ "dataType": "stringarray",
944
+ "buildArrayHelper": [
945
+ {"extract": "$.products[*].name"}
946
+ ]
947
+ }
948
+ ```
949
+
950
+ **For Object Arrays (objectarray) - three patterns**
951
+
952
+ 1. Extract Only (existing objects):
953
+ ```json
954
+ {
955
+ "generate": "contacts",
956
+ "dataType": "objectarray",
957
+ "buildArrayHelper": [
958
+ {"extract": "$.account.primaryContacts[*]"}, // Pull primary contact objects
959
+ {"extract": "$.account.secondaryContacts[*]"}, // Pull secondary contact objects
960
+ {"extract": "$.vendor.contactPersons[*]"}, // Pull vendor contact objects
961
+ {"extract": "$.subsidiaries[*].mainContact"} // Pull main contact from each subsidiary
962
+ ]
963
+ }
964
+ ```
965
+
966
+ 2. Mappings Only (constructed object):
967
+ ```json
968
+ {
969
+ "generate": "contactInfo",
970
+ "dataType": "objectarray",
971
+ "buildArrayHelper": [
972
+ {
973
+ "mappings": [ // Creates one object in the array
974
+ {"generate": "type", "dataType": "string", "extract": "primary"},
975
+ {"generate": "email", "dataType": "string", "extract": "$.primaryEmail"}
976
+ ]
977
+ },
978
+ {
979
+ "mappings": [ // Creates another object in the array
980
+ {"generate": "type", "dataType": "string", "extract": "secondary"},
981
+ {"generate": "email", "dataType": "string", "extract": "$.secondaryEmail"}
982
+ ]
983
+ }
984
+ ]
985
+ }
986
+ ```
987
+ Each constructed entry contributes exactly one element, in entry
988
+ order; writing the entry with `"extract": "$"` is equivalent to
989
+ omitting the extract (both anchor the element at the record root).
990
+ A fixed number of static elements is built from that many sibling
991
+ constructed entries.
992
+
993
+ 3. Extract AND Mappings (transform input arrays):
994
+ ```json
995
+ {
996
+ "generate": "lineItems",
997
+ "dataType": "objectarray",
998
+ "buildArrayHelper": [
999
+ {
1000
+ "extract": "$.order.items[*]", // For each item in the array
1001
+ "mappings": [ // Transform to this structure using the composite object
1002
+ {"generate": "sku", "dataType": "string", "extract": "$.order.items.productId"}, // Notice: items is singular
1003
+ {"generate": "quantity", "dataType": "number", "extract": "$.order.items.qty"}, // Notice: items is singular
1004
+ {"generate": "orderNumber", "dataType": "string", "extract": "$.order.id"}, // Access parent data
1005
+ {"generate": "customerName", "dataType": "string", "extract": "$.customerName"} // Access root data
1006
+ ]
1007
+ }
1008
+ ]
1009
+ }
1010
+ ```
1011
+
1012
+ **For Arrays of Arrays (arrayarray)**
1013
+ - Similar to objectarray, but inner arrays have empty 'generate' fields
1014
+ - Used for matrix/table structures
1015
+ ```json
1016
+ {
1017
+ "generate": "matrix",
1018
+ "dataType": "arrayarray",
1019
+ "buildArrayHelper": [
1020
+ {
1021
+ "extract": "$.rows[*]", // For each row in the rows array
1022
+ "mappings": [
1023
+ {
1024
+ "dataType": "numberarray", // Note: No generate field for inner arrays
1025
+ "buildArrayHelper": [
1026
+ {"extract": "$.rows.columns[*]"} // Notice: "rows" is singular in the composite object
1027
+ ]
1028
+ }
1029
+ ]
1030
+ }
1031
+ ]
1032
+ }
1033
+ ```
1034
+
1035
+ **Important details**
1036
+
1037
+ - When both extract and mappings are provided, the system creates special composite objects
1038
+ that maintain hierarchical context during processing
1039
+ - This enables accessing both the current array element AND its parent context
1040
+ - An ITERATING entry's extract MUST use JSON path syntax starting with '$.'
1041
+ (e.g. '$.items[*]'). A CONSTRUCTED entry (child mappings building one element)
1042
+ instead omits extract or sets it to exactly "$" — never rewrite "$" into a
1043
+ '$.'-prefixed, indexed, or comma-joined form ('$[0]', '$[0],$[0]'): those render
1044
+ the entire destination array as null without raising a validation error
1045
+ - Each array helper entry acts independently, potentially adding multiple elements
1046
+
1047
+ The buildArrayHelper is the most complex part of the mappings system - always analyze the
1048
+ dataType first to understand which pattern is appropriate.
1049
+ items:
1050
+ type: object
1051
+ properties:
1052
+ extract:
1053
+ type: string
1054
+ description: |
1055
+ JSON path expression that identifies the input array or values to extract.
1056
+
1057
+ For objectarray with mappings, this defines which input objects to iterate through.
1058
+ The JSON path must return either a single object or an array of objects.
1059
+
1060
+ For a CONSTRUCTED entry (child mappings building exactly one element from
1061
+ record-root fields and constants), omit this field or set it to exactly "$" —
1062
+ the two spellings are equivalent. Indexed or comma-joined forms ('$[0]',
1063
+ '$[0],$[0]') are not valid at the entry level: the processor renders the
1064
+ entire destination array as null without raising a validation error.
1065
+
1066
+ The system creates special composite objects during processing to maintain
1067
+ hierarchical relationships, allowing easy access to both the current array item
1068
+ and its parent contexts.
1069
+ examples:
1070
+ - $.items[*]
1071
+ - $.order.lineItems[*]
1072
+ - $.parents[*].children[*]
1073
+ - $
1074
+ sourceDataType:
1075
+ type: string
1076
+ description: |
1077
+ Declares the JSON type of the input array being iterated, to ensure
1078
+ proper type handling during array construction. Same enum as `dataType`.
1079
+ enum:
1080
+ - string
1081
+ - number
1082
+ - boolean
1083
+ - object
1084
+ - stringarray
1085
+ - numberarray
1086
+ - booleanarray
1087
+ - objectarray
1088
+ - arrayarray
1089
+ x-enumDescriptions:
1090
+ string: Input array contains string elements.
1091
+ number: Input array contains numeric elements.
1092
+ boolean: Input array contains boolean elements.
1093
+ object: Input array contains object elements.
1094
+ stringarray: Input array contains arrays of strings.
1095
+ numberarray: Input array contains arrays of numbers.
1096
+ booleanarray: Input array contains arrays of booleans.
1097
+ objectarray: Input array contains arrays of objects.
1098
+ arrayarray: Input array contains arrays of arrays.
1099
+ examples:
1100
+ - string
1101
+ - number
1102
+ - boolean
1103
+ - object
1104
+ default:
1105
+ type:
1106
+ - string
1107
+ - 'null'
1108
+ description: |
1109
+ Specifies a fallback value when the extracted array element is empty or
1110
+ not found in the input data.
1111
+
1112
+ Explicit JSON `null` is itself a valid fallback (the element is written as
1113
+ JSON null); omitting the key means no fallback is applied.
1114
+ examples:
1115
+ - N/A
1116
+ - '0'
1117
+ - 'false'
1118
+ conditional:
1119
+ type: object
1120
+ description: |
1121
+ Defines conditional rules for including each array element in the result.
1122
+ properties:
1123
+ when:
1124
+ type: string
1125
+ description: |
1126
+ Specifies the condition that must be met for an array element to be included.
1127
+
1128
+ 'extract_not_empty' only includes elements where the extract field returns a value.
1129
+ enum:
1130
+ - extract_not_empty
1131
+ x-enumDescriptions:
1132
+ extract_not_empty: Include the array element only when the extract field returns a non-empty value.
1133
+ examples:
1134
+ - extract_not_empty
1135
+ mappings:
1136
+ type: array
1137
+ description: |
1138
+ Contains recursive mapping definitions for complex array element transformations.
1139
+
1140
+ **Composite object mechanism**
1141
+
1142
+ When both 'extract' and 'mappings' are used together, the system implements a sophisticated
1143
+ "composite object" approach that is crucial for AI agents to understand:
1144
+
1145
+ 1. The system starts with the complete input record
1146
+
1147
+ 2. For each array element matched by the extract path, it creates a modified version of
1148
+ the input record where:
1149
+ - Array paths in the extract JSON path are REPLACED with single objects
1150
+ - Each array ([]) in the path is converted to a single object ({})
1151
+ - This preserves the hierarchical relationship between nested arrays
1152
+
1153
+ **Example**
1154
+
1155
+ Given an input record:
1156
+ ```json
1157
+ {
1158
+ "customer": {
1159
+ "name": "John Doe",
1160
+ "orders": [
1161
+ {
1162
+ "id": "O-001",
1163
+ "items": [
1164
+ {"sku": "ABC", "qty": 2},
1165
+ {"sku": "XYZ", "qty": 1}
1166
+ ]
1167
+ },
1168
+ {
1169
+ "id": "O-002",
1170
+ "items": [
1171
+ {"sku": "DEF", "qty": 3}
1172
+ ]
1173
+ }
1174
+ ]
1175
+ }
1176
+ }
1177
+ ```
1178
+
1179
+ With extract path: `$.customer.orders[*].items[*]`
1180
+
1181
+ For each item, the system creates a composite object like:
1182
+ ```json
1183
+ {
1184
+ "customer": {
1185
+ "name": "John Doe",
1186
+ "orders": { // Note: Array replaced with single object
1187
+ "id": "O-001",
1188
+ "items": { // Note: Array replaced with single object
1189
+ "sku": "ABC",
1190
+ "qty": 2
1191
+ }
1192
+ }
1193
+ }
1194
+ }
1195
+ ```
1196
+
1197
+ Then in your mappings, you can access:
1198
+ - The current item: `$.customer.orders.items.sku`
1199
+ - The parent order: `$.customer.orders.id`
1200
+ - Top-level data: `$.customer.name`
1201
+
1202
+ This approach allows for precise mapping from deeply nested structures while maintaining
1203
+ access to all contextual parent data, without requiring complex array index management.
1204
+
1205
+ **Implementation guidance**
1206
+
1207
+ When implementing the composite object mechanism:
1208
+
1209
+ 1. Analyze the extract path to identify all array patterns (`[*]` or `[number]`)
1210
+ 2. For each array in the path, understand that it will be replaced with a single object
1211
+ 3. In the mappings, use paths that reference these arrays as if they were objects
1212
+ 4. Remember that every mapping still has access to the full input record context
1213
+ 5. This mechanism is especially powerful when mapping hierarchical data like:
1214
+ - Order → Line Items → Taxes/Discounts
1215
+ - Customer → Addresses → Address Lines
1216
+ - Invoice → Line Items → Serial Numbers
1217
+
1218
+ The extract path effectively tells the system "iterate through these arrays",
1219
+ while the composite object mechanism ensures you can still access both the
1220
+ current array item AND its parent context during mapping.
1221
+ items:
1222
+ $ref: '#/components/schemas/items'
1223
+ examples:
1224
+ - - generate: itemName
1225
+ extract: $.name
1226
+ dataType: string
1227
+ status: Active
1228
+ - generate: itemPrice
1229
+ extract: $.price
1230
+ dataType: number
1231
+ status: Active
1232
+ status:
1233
+ type: string
1234
+ description: |
1235
+ **Purpose**
1236
+ Required on every mapping entry. Controls whether the mapping is applied.
1237
+
1238
+ **Guidance**
1239
+ Emit `"Active"` for mappings that should run; `"Draft"` saves an
1240
+ in-progress mapping without the Active-only field validations. The
1241
+ API rejects a mapping missing this field
1242
+ (validation error: "Mapping object must have status field present.").
1243
+ x-celigo-ai-guidance:
1244
+ - |-
1245
+ Emit `"Active"` for mappings that should run; `"Draft"` is also
1246
+ accepted and saves the mapping while bypassing the Active-only
1247
+ field validations. The value is case-sensitive. The API rejects:
1248
+ - Missing field: `[status_field_absent] Mapping object must have status field present.`
1249
+ - Wrong case (e.g. `"active"`): `[invalid_status_enums] active is not a valid enum for status field.`
1250
+ enum:
1251
+ - Active
1252
+ - Draft
1253
+ x-enumDescriptions:
1254
+ Active: The mapping is enabled and applied during processing.
1255
+ Draft: In-progress mapping; saved without the Active-only field validations.
1256
+ examples:
1257
+ - Active
1258
+ conditional:
1259
+ type: object
1260
+ description: |
1261
+ **Purpose**
1262
+ Defines conditional processing rules for the entire mapping.
1263
+
1264
+ **Guidance**
1265
+ These conditions determine whether the mapping is applied based on record
1266
+ state or field content:
1267
+
1268
+ **When to Use**
1269
+ - When a mapping should only be applied in specific circumstances
1270
+ - To implement conditional logic without using complex handlebars expressions
1271
+ - For creating mappings that only run during create or update operations
1272
+
1273
+ **Available Conditions**
1274
+
1275
+ - `record_created`: Apply only when creating a new record
1276
+ Useful for setting initial values that should not be overwritten during updates
1277
+
1278
+ - `record_updated`: Apply only when updating an existing record
1279
+ Useful for transformation logic that should only run during updates
1280
+
1281
+ - `extract_not_empty`: Apply only when the extract field returns a value
1282
+ Useful for conditional mapping based on input data availability
1283
+
1284
+ **Example**
1285
+ ```json
1286
+ {
1287
+ "generate": "statusMessage",
1288
+ "dataType": "string",
1289
+ "status": "Active",
1290
+ "extract": "$.status.message",
1291
+ "conditional": {
1292
+ "when": "extract_not_empty" // Only map when status.message exists
1293
+ }
1294
+ }
1295
+ ```
1296
+ properties:
1297
+ when:
1298
+ type: string
1299
+ description: |
1300
+ Specifies the condition that triggers application of this mapping:
1301
+ - record_created: Apply only when creating a new record
1302
+ - record_updated: Apply only when updating an existing record
1303
+ - extract_not_empty: Apply only when the extract field returns a value
1304
+ enum:
1305
+ - record_created
1306
+ - record_updated
1307
+ - extract_not_empty
1308
+ x-enumDescriptions:
1309
+ record_created: Apply this mapping only when creating a new record.
1310
+ record_updated: Apply this mapping only when updating an existing record.
1311
+ extract_not_empty: Apply this mapping only when the extract field returns a non-empty value.
1312
+ examples:
1313
+ - record_created
1314
+ - record_updated
1315
+ - extract_not_empty
1316
+ required:
1317
+ - dataType
1318
+ Mappings:
1319
+ type: array
1320
+ description: |
1321
+ Array of field mapping configurations for transforming data from one format into another.
1322
+
1323
+ **Guidance**
1324
+
1325
+ This schema is designed around RECURSION as its core architectural principle. Understanding this recursive
1326
+ nature is essential for building effective mappings:
1327
+
1328
+ 1. The schema is self-referential by design - a mapping can contain nested mappings of the same structure
1329
+ 2. Complex data structures (nested objects, arrays of objects, arrays of arrays of objects) are ALL
1330
+ handled through this recursive pattern
1331
+ 3. Each mapping handles one level of the data structure; deeper levels are handled by nested mappings
1332
+
1333
+ When generating mappings programmatically:
1334
+ - For simple fields (string, number, boolean): Create single mapping objects
1335
+ - For objects: Create a parent mapping with nested 'mappings' array containing child field mappings
1336
+ - For arrays: Use 'buildArrayHelper' with extract paths defining array inputs and
1337
+ recursive 'mappings' to define object structures
1338
+
1339
+ The system will process these nested structures recursively during runtime, ensuring proper construction
1340
+ of complex hierarchical data while maintaining excellent performance.
1341
+ items:
1342
+ type: object
1343
+ properties:
1344
+ generate:
1345
+ type: string
1346
+ description: |
1347
+ **Purpose**
1348
+ Defines the target field name in the output object/record.
1349
+
1350
+ **Guidance**
1351
+ This is the PRIMARY FIELD that identifies the output property being created:
1352
+
1353
+ - For regular fields: Set to the exact property name (e.g., "firstName", "price", "isActive")
1354
+ - For object fields: Set to the object property name, then add child mappings in the 'mappings' array
1355
+ - For array fields: Set to the array property name, then configure 'buildArrayHelper'
1356
+ - For arrays within arrays: Leave EMPTY for the inner array mappings, as they don't have field names
1357
+
1358
+ IMPORTANT: Do NOT use dot notation (e.g., "customer.firstName") in this field. Instead, create proper
1359
+ hierarchical structure with nested mappings:
1360
+ ```json
1361
+ {
1362
+ "generate": "customer",
1363
+ "dataType": "object",
1364
+ "status": "Active",
1365
+ "mappings": [
1366
+ {"generate": "firstName", "dataType": "string", "extract": "$.name.first", "status": "Active"}
1367
+ ]
1368
+ }
1369
+ ```
1370
+
1371
+ When parsing existing mappings, empty 'generate' fields almost always indicate inner array structures
1372
+ within a parent array.
1373
+ examples:
1374
+ - name
1375
+ - address
1376
+ - items
1377
+ dataType:
1378
+ type: string
1379
+ description: |
1380
+ **Purpose**
1381
+ Explicitly declares the data type of the output field, controlling how data is processed and structured.
1382
+
1383
+ **Guidance**
1384
+ This is a REQUIRED field that fundamentally determines mapping behavior:
1385
+
1386
+ **Simple Types (direct value mapping)**
1387
+ - `string`: Text values, converts other types to string representation
1388
+ - `number`: Numeric values, attempts conversion from strings
1389
+ - `boolean`: True/false values, converts truthy/falsy values
1390
+
1391
+ Dates are represented as strings — use `string` for date fields and
1392
+ drive the parsing/formatting through the `extractDateFormat` /
1393
+ `generateDateFormat` / `extractDateTimezone` / `generateDateTimezone`
1394
+ fields. There is no separate `date` enum value.
1395
+
1396
+ **Complex Types (require additional configuration)**
1397
+ - `object`: Creates a nested object. REQUIRES child mappings in the 'mappings' array
1398
+
1399
+ **Array Types**
1400
+ - `stringarray`: Array of strings
1401
+ - `numberarray`: Array of numbers
1402
+ - `booleanarray`: Array of booleans
1403
+ - `objectarray`: Array of objects (most common array type)
1404
+ - `arrayarray`: Array of arrays (for matrix/table structures)
1405
+
1406
+ Array dataTypes can be populated two ways: pass a source array through
1407
+ unchanged via `extract` alone (when the source is already an array of
1408
+ the right shape), or construct/iterate via `buildArrayHelper`.
1409
+
1410
+ IMPORTANT: The dataType controls which additional fields are relevant:
1411
+ - For date-like string fields: extractDateFormat, generateDateFormat, etc. become relevant
1412
+ - For object types: 'mappings' array becomes relevant
1413
+ - For array types: `buildArrayHelper` is one option (see above)
1414
+
1415
+ When analyzing existing mappings or generating new ones, always check dataType first
1416
+ to understand what additional fields should be present.
1417
+ x-celigo-ai-guidance:
1418
+ - |-
1419
+ Missing `dataType` is rejected at save with validation error
1420
+ `[mandatory_destination_datatype] Destination datatype is a
1421
+ required field.` When in doubt, use `"string"` — it accepts
1422
+ any source value and the runtime will coerce it.
1423
+ enum:
1424
+ - string
1425
+ - number
1426
+ - boolean
1427
+ - object
1428
+ - stringarray
1429
+ - numberarray
1430
+ - booleanarray
1431
+ - objectarray
1432
+ - arrayarray
1433
+ x-enumDescriptions:
1434
+ string: Text values; converts other types to their string representation.
1435
+ number: Numeric values; attempts conversion from strings.
1436
+ boolean: True/false values; converts truthy/falsy values.
1437
+ object: Nested object that requires child mappings in the `mappings` array.
1438
+ stringarray: Array of string values.
1439
+ numberarray: Array of numeric values.
1440
+ booleanarray: Array of boolean values.
1441
+ objectarray: Array of objects, the most common array type.
1442
+ arrayarray: Array of arrays, used for matrix or table structures.
1443
+ examples:
1444
+ - string
1445
+ - number
1446
+ - object
1447
+ - objectarray
1448
+ extract:
1449
+ type: string
1450
+ description: |
1451
+ **Purpose**
1452
+ Defines how to retrieve data from the input record to populate the output field.
1453
+
1454
+ **Guidance**
1455
+ This field supports THREE DISTINCT PATTERNS that are easily distinguished:
1456
+
1457
+ **1. json Path Syntax**
1458
+ - MUST start with '$.' prefix
1459
+ - Used for precisely targeting data in structured JSON objects
1460
+ - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street'
1461
+ - Wildcards like [*] extract multiple values/objects
1462
+
1463
+ ```json
1464
+ "extract": "$.customer.addresses[*]" // Extracts all addresses
1465
+ ```
1466
+
1467
+ **2. Handlebars Template Syntax**
1468
+ - Contains '{{' and '}}' pattern
1469
+ - Evaluated by the AFE 2.0 handlebars template engine
1470
+ - Can include logic, formatting, and computation
1471
+ - Access input record fields with {{record.fieldName}} notation
1472
+ - Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
1473
+ - Valid on `object`, `objectarray`, and primitive-array dataTypes as
1474
+ well as scalars — the rendered template output must parse into the
1475
+ declared shape
1476
+
1477
+ ```json
1478
+ "extract": "{{record.price}} {{record.currency}}" // Combines two fields
1479
+ ```
1480
+
1481
+ **3. Hard-Coded Value (literal string)**
1482
+ - Does NOT start with '$.'
1483
+ - Does NOT contain handlebars '{{' syntax
1484
+ - System treats it as a literal string value
1485
+ - VERY COMMON for setting static/constant values
1486
+ - Examples: "Active", "USD", "Completed", "true"
1487
+
1488
+ ```json
1489
+ "extract": "primary" // Sets field value to the literal string "primary"
1490
+ "extract": "true" // Sets field value to the literal string "true"
1491
+ "extract": "N/A" // Sets field value to the literal string "N/A"
1492
+ ```
1493
+
1494
+ This third pattern is the simplest and most efficient way to set hard-coded values in your mappings.
1495
+ AI agents should use this pattern whenever a field needs a static value that doesn't come from
1496
+ the input record or require computation.
1497
+
1498
+ **Important implementation details**
1499
+
1500
+ - JSON path patterns ALWAYS execute from the TOP-LEVEL root of the input record
1501
+ - The system maintains this context even in deeply nested mappings
1502
+ - For object mappings without child mappings, extract should return a complete object
1503
+ - When both extract and mappings are defined for objects, extract is applied first
1504
+
1505
+ For most simple field-to-field mappings, prefer JSON path syntax for its clarity and performance.
1506
+ For hard-coded values, simply use the literal string as the extract value.
1507
+ x-celigo-ai-guidance:
1508
+ - |-
1509
+ ## SIZE LIMIT
1510
+ The platform's import save validator caps this field at **1024
1511
+ characters**. Saves with a longer `extract` are rejected
1512
+ with `[size_limit_exceeded] The maximum size of the field:
1513
+ mappings.<index>.extract in the Import document should be
1514
+ 1024 characters`. This typically only matters for
1515
+ Handlebars templates that build complex strings inline -- if
1516
+ a template is approaching the cap, prefer one of:
1517
+
1518
+ - **Decompose into nested mappings** (set `dataType:
1519
+ "object"` and use child `mappings` -- each child gets
1520
+ its own 1024-char budget).
1521
+ - **Move the logic to a `preMap` hook** so the heavy
1522
+ transformation runs in script and the mapping just reads
1523
+ `record.<computed>`.
1524
+ - **Use a lookup** (`lookupName` + a small `lookups` entry)
1525
+ for value translation that would otherwise need a long
1526
+ `{{#if ...}}{{else if ...}}` chain.
1527
+ examples:
1528
+ - $.fullName
1529
+ - '{{record.fullName}}'
1530
+ - primary
1531
+ - $.lineItems[*].unitPrice
1532
+ extractDateFormat:
1533
+ type: string
1534
+ description: |
1535
+ Specifies the format pattern of the input date string to ensure proper parsing.
1536
+
1537
+ Used on string-typed mappings whose `extract` yields a date. Uses
1538
+ Moment.js-compatible formatting tokens to describe how the incoming date
1539
+ string is structured.
1540
+ examples:
1541
+ - YYYY-MM-DD
1542
+ - MM/DD/YYYY
1543
+ - DD-MMM-YYYY HH:mm:ss
1544
+ extractDateTimezone:
1545
+ type: string
1546
+ description: |
1547
+ Specifies the timezone of the input date string using Olson/IANA timezone identifiers.
1548
+
1549
+ Used on string-typed mappings whose `extract` yields a date; tells the system
1550
+ how to interpret timestamp values from the input system.
1551
+ examples:
1552
+ - UTC
1553
+ - America/New_York
1554
+ - Europe/London
1555
+ generateDateFormat:
1556
+ type: string
1557
+ description: |
1558
+ Specifies the output format pattern when generating a date string or converting
1559
+ from a Date type to String type.
1560
+
1561
+ Uses Moment.js-compatible formatting tokens to define the structure of the resulting
1562
+ date string.
1563
+ examples:
1564
+ - YYYY-MM-DD
1565
+ - MM/DD/YYYY
1566
+ - DD-MMM-YYYY HH:mm:ss
1567
+ generateDateTimezone:
1568
+ type: string
1569
+ description: |
1570
+ Specifies the timezone to apply when generating or converting timestamp values
1571
+ using Olson/IANA timezone identifiers.
1572
+
1573
+ Controls timezone conversion when producing date output.
1574
+ examples:
1575
+ - UTC
1576
+ - America/New_York
1577
+ - Europe/London
1578
+ default:
1579
+ type:
1580
+ - string
1581
+ - 'null'
1582
+ description: |
1583
+ Specifies a fallback value to use when extract returns empty/null or when conditional
1584
+ logic fails and no other mapping supplies a value.
1585
+
1586
+ Explicit JSON `null` is itself a valid fallback: the destination field is written as
1587
+ JSON null when the extract yields nothing (the Mapper UI's "Use null as default value"
1588
+ action). Omitting the key entirely means no fallback — the field is left out of the
1589
+ output when the extract is empty (the UI's "Do nothing" action).
1590
+ x-celigo-ai-guidance:
1591
+ - |-
1592
+ `"default": null` and `"default": ""` are distinct saved values, not
1593
+ absent keys: null renders the destination field as JSON null and the
1594
+ empty string renders it as `""` when the extract yields nothing.
1595
+ Preserve them verbatim when editing or migrating a mapping — dropping
1596
+ the key changes runtime behavior from "use null/empty string as
1597
+ default value" to "do nothing" (field omitted from the output).
1598
+ examples:
1599
+ - N/A
1600
+ - '0'
1601
+ - 'false'
1602
+ lookupName:
1603
+ type: string
1604
+ description: |
1605
+ **Purpose**
1606
+ References a lookup table for transforming values during the mapping process.
1607
+
1608
+ **Usage**
1609
+
1610
+ The lookupName refers to a named lookup defined in the lookups array of the same resource.
1611
+
1612
+ ```json
1613
+ {
1614
+ "generate": "countryName",
1615
+ "dataType": "string",
1616
+ "extract": "$.countryCode",
1617
+ "lookupName": "countryCodeToName"
1618
+ }
1619
+ ```
1620
+
1621
+ During processing, the system:
1622
+ 1. Extracts the value from the input record (e.g., "US")
1623
+ 2. Finds the lookup table with the specified name
1624
+ 3. Uses the extracted value as a key in the lookup
1625
+ 4. Returns the corresponding value (e.g., "United States")
1626
+
1627
+ **Benefits**
1628
+
1629
+ - **Standardization**: Ensures consistent value translation across mappings
1630
+ - **Centralization**: Define translations once and reference them in multiple places
1631
+ - **Maintainability**: Update all mappings by changing the lookup definition
1632
+ - **Readability**: Makes mappings more descriptive and self-documenting
1633
+
1634
+ The specific lookup capabilities depend on the context where mappings are used.
1635
+ examples:
1636
+ - countryCodeToName
1637
+ - statusMapping
1638
+ - departmentCodes
1639
+ description:
1640
+ type: string
1641
+ description: |
1642
+ Optional free-text annotation that appears in the Mapper sidebar to provide context about
1643
+ the mapping's purpose for collaboration and documentation.
1644
+
1645
+ Has no functional impact on the mapping behavior.
1646
+ examples:
1647
+ - Maps customer name
1648
+ - Converts price to target currency
1649
+ - Formats date for target system
1650
+ sourceDataType:
1651
+ type: string
1652
+ description: |
1653
+ Declares the JSON type of the value produced by `extract`, before any
1654
+ conversion to `dataType`. Same enum as `dataType`. Set on leaf mappings
1655
+ only — parent mappings (with child `mappings` or `buildArrayHelper`)
1656
+ have no extracted value of their own; the children carry their own
1657
+ `sourceDataType`.
1658
+
1659
+ For date fields use `string` (JSON represents dates as strings); the
1660
+ parsing/formatting lives in `extractDateFormat` / `generateDateFormat` /
1661
+ `extractDateTimezone` / `generateDateTimezone`.
1662
+ enum:
1663
+ - string
1664
+ - number
1665
+ - boolean
1666
+ - object
1667
+ - stringarray
1668
+ - numberarray
1669
+ - booleanarray
1670
+ - objectarray
1671
+ - arrayarray
1672
+ x-enumDescriptions:
1673
+ string: Source value is a text string.
1674
+ number: Source value is numeric.
1675
+ boolean: Source value is true or false.
1676
+ object: Source value is a JSON object.
1677
+ stringarray: Source value is an array of strings.
1678
+ numberarray: Source value is an array of numbers.
1679
+ booleanarray: Source value is an array of booleans.
1680
+ objectarray: Source value is an array of objects.
1681
+ arrayarray: Source value is an array of arrays.
1682
+ examples:
1683
+ - string
1684
+ - number
1685
+ - boolean
1686
+ - object
1687
+ mappings:
1688
+ type: array
1689
+ description: |
1690
+ **Purpose**
1691
+ Enables recursive definition of nested object structures through child mapping objects.
1692
+
1693
+ **Guidance**
1694
+ This is the KEY FIELD that implements the recursive pattern at the core of this schema:
1695
+
1696
+ **When to Use**
1697
+ - REQUIRED when dataType = "object" (unless you are copying an entire object from the input record)
1698
+ - REQUIRED in buildArrayHelper.mappings when defining complex object array elements
1699
+ - NEVER used with simple types (string, number, boolean, date)
1700
+
1701
+ **Behavior**
1702
+ - Each mapping in this array becomes a property of the parent object
1703
+ - The full Mappings schema is repeated recursively at each level
1704
+ - Can be nested to any depth for complex hierarchical structures
1705
+
1706
+ **Context Handling**
1707
+ - Each level of nesting changes the mapping CONTEXT for 'generate'
1708
+ - The extraction CONTEXT always remains the original input record
1709
+ - This means child mappings can pull data from anywhere in the input record
1710
+
1711
+ **Common Patterns**
1712
+
1713
+ **Nested Objects**
1714
+ ```json
1715
+ {
1716
+ "generate": "customer",
1717
+ "dataType": "object",
1718
+ "mappings": [
1719
+ {
1720
+ "generate": "contact",
1721
+ "dataType": "object",
1722
+ "mappings": [
1723
+ {"generate": "email", "dataType": "string", "extract": "$.customerEmail"}
1724
+ ]
1725
+ }
1726
+ ]
1727
+ }
1728
+ ```
1729
+
1730
+ **Multiple Fields in Object**
1731
+ ```json
1732
+ {
1733
+ "generate": "address",
1734
+ "dataType": "object",
1735
+ "mappings": [
1736
+ {"generate": "street", "dataType": "string", "extract": "$.address.line1"},
1737
+ {"generate": "city", "dataType": "string", "extract": "$.address.city"},
1738
+ {"generate": "country", "dataType": "string", "extract": "$.address.country"}
1739
+ ]
1740
+ }
1741
+ ```
1742
+
1743
+ IMPORTANT: When analyzing or generating mappings, ALWAYS check if parent.dataType = "object"
1744
+ or if you're inside buildArrayHelper.mappings for objectarray elements. These are the only
1745
+ valid contexts for the mappings array.
1746
+ items:
1747
+ $ref: '#/components/schemas/items'
1748
+ examples:
1749
+ - - generate: firstName
1750
+ extract: $.name.first
1751
+ dataType: string
1752
+ status: Active
1753
+ - generate: lastName
1754
+ extract: $.name.last
1755
+ dataType: string
1756
+ status: Active
1757
+ buildArrayHelper:
1758
+ type: array
1759
+ x-celigo-ai-guidance:
1760
+ - |-
1761
+ Entry-level `extract` accepts an iterating array path
1762
+ (`$.items[*]`), `"$"` (the record root), or omission — a
1763
+ constructed entry (child `mappings` with the extract omitted or
1764
+ `"$"`; the two spellings are equivalent) contributes exactly one
1765
+ element, and entries append in order. Indexed or comma-joined
1766
+ entry extracts (`"$[0]"`, `"$[0],$[0]"`) are not valid: the
1767
+ processor renders the entire destination array as null with no
1768
+ validation error. To emit a fixed number of static elements, add
1769
+ that many sibling constructed entries — never index the extract.
1770
+ description: |
1771
+ **Purpose**
1772
+ Configures how to construct arrays in the output record, handling various array types and inputs.
1773
+
1774
+ **Guidance**
1775
+ This is the REQUIRED mechanism for ALL array data types:
1776
+
1777
+ **When to Use**
1778
+ - REQUIRED when dataType ends with "array" (stringarray, objectarray, etc.)
1779
+ - Each entry in this array contributes elements to the output array
1780
+ - Multiple entries allow combining data from different input arrays
1781
+
1782
+ **Array Type Handling**
1783
+
1784
+ **For Simple Arrays (stringarray, numberarray, booleanarray)**
1785
+ - Only the 'extract' field is used to pull values
1786
+ - JSON path with wildcards (e.g., $.items[*].name) returns multiple values
1787
+ - Each result is converted to the appropriate primitive type
1788
+ ```json
1789
+ {
1790
+ "generate": "productNames",
1791
+ "dataType": "stringarray",
1792
+ "buildArrayHelper": [
1793
+ {"extract": "$.products[*].name"}
1794
+ ]
1795
+ }
1796
+ ```
1797
+
1798
+ **For Object Arrays (objectarray) - three patterns**
1799
+
1800
+ 1. Extract Only (existing objects):
1801
+ ```json
1802
+ {
1803
+ "generate": "contacts",
1804
+ "dataType": "objectarray",
1805
+ "buildArrayHelper": [
1806
+ {"extract": "$.account.primaryContacts[*]"}, // Pull primary contact objects
1807
+ {"extract": "$.account.secondaryContacts[*]"}, // Pull secondary contact objects
1808
+ {"extract": "$.vendor.contactPersons[*]"}, // Pull vendor contact objects
1809
+ {"extract": "$.subsidiaries[*].mainContact"} // Pull main contact from each subsidiary
1810
+ ]
1811
+ }
1812
+ ```
1813
+
1814
+ 2. Mappings Only (constructed object):
1815
+ ```json
1816
+ {
1817
+ "generate": "contactInfo",
1818
+ "dataType": "objectarray",
1819
+ "buildArrayHelper": [
1820
+ {
1821
+ "mappings": [ // Creates one object in the array
1822
+ {"generate": "type", "dataType": "string", "extract": "primary"},
1823
+ {"generate": "email", "dataType": "string", "extract": "$.primaryEmail"}
1824
+ ]
1825
+ },
1826
+ {
1827
+ "mappings": [ // Creates another object in the array
1828
+ {"generate": "type", "dataType": "string", "extract": "secondary"},
1829
+ {"generate": "email", "dataType": "string", "extract": "$.secondaryEmail"}
1830
+ ]
1831
+ }
1832
+ ]
1833
+ }
1834
+ ```
1835
+ Each constructed entry contributes exactly one element, in entry
1836
+ order; writing the entry with `"extract": "$"` is equivalent to
1837
+ omitting the extract (both anchor the element at the record root).
1838
+ A fixed number of static elements is built from that many sibling
1839
+ constructed entries.
1840
+
1841
+ 3. Extract AND Mappings (transform input arrays):
1842
+ ```json
1843
+ {
1844
+ "generate": "lineItems",
1845
+ "dataType": "objectarray",
1846
+ "buildArrayHelper": [
1847
+ {
1848
+ "extract": "$.order.items[*]", // For each item in the array
1849
+ "mappings": [ // Transform to this structure using the composite object
1850
+ {"generate": "sku", "dataType": "string", "extract": "$.order.items.productId"}, // Notice: items is singular
1851
+ {"generate": "quantity", "dataType": "number", "extract": "$.order.items.qty"}, // Notice: items is singular
1852
+ {"generate": "orderNumber", "dataType": "string", "extract": "$.order.id"}, // Access parent data
1853
+ {"generate": "customerName", "dataType": "string", "extract": "$.customerName"} // Access root data
1854
+ ]
1855
+ }
1856
+ ]
1857
+ }
1858
+ ```
1859
+
1860
+ **For Arrays of Arrays (arrayarray)**
1861
+ - Similar to objectarray, but inner arrays have empty 'generate' fields
1862
+ - Used for matrix/table structures
1863
+ ```json
1864
+ {
1865
+ "generate": "matrix",
1866
+ "dataType": "arrayarray",
1867
+ "buildArrayHelper": [
1868
+ {
1869
+ "extract": "$.rows[*]", // For each row in the rows array
1870
+ "mappings": [
1871
+ {
1872
+ "dataType": "numberarray", // Note: No generate field for inner arrays
1873
+ "buildArrayHelper": [
1874
+ {"extract": "$.rows.columns[*]"} // Notice: "rows" is singular in the composite object
1875
+ ]
1876
+ }
1877
+ ]
1878
+ }
1879
+ ]
1880
+ }
1881
+ ```
1882
+
1883
+ **Important details**
1884
+
1885
+ - When both extract and mappings are provided, the system creates special composite objects
1886
+ that maintain hierarchical context during processing
1887
+ - This enables accessing both the current array element AND its parent context
1888
+ - An ITERATING entry's extract MUST use JSON path syntax starting with '$.'
1889
+ (e.g. '$.items[*]'). A CONSTRUCTED entry (child mappings building one element)
1890
+ instead omits extract or sets it to exactly "$" — never rewrite "$" into a
1891
+ '$.'-prefixed, indexed, or comma-joined form ('$[0]', '$[0],$[0]'): those render
1892
+ the entire destination array as null without raising a validation error
1893
+ - Each array helper entry acts independently, potentially adding multiple elements
1894
+
1895
+ The buildArrayHelper is the most complex part of the mappings system - always analyze the
1896
+ dataType first to understand which pattern is appropriate.
1897
+ items:
1898
+ type: object
1899
+ properties:
1900
+ extract:
1901
+ type: string
1902
+ description: |
1903
+ JSON path expression that identifies the input array or values to extract.
1904
+
1905
+ For objectarray with mappings, this defines which input objects to iterate through.
1906
+ The JSON path must return either a single object or an array of objects.
1907
+
1908
+ For a CONSTRUCTED entry (child mappings building exactly one element from
1909
+ record-root fields and constants), omit this field or set it to exactly "$" —
1910
+ the two spellings are equivalent. Indexed or comma-joined forms ('$[0]',
1911
+ '$[0],$[0]') are not valid at the entry level: the processor renders the
1912
+ entire destination array as null without raising a validation error.
1913
+
1914
+ The system creates special composite objects during processing to maintain
1915
+ hierarchical relationships, allowing easy access to both the current array item
1916
+ and its parent contexts.
1917
+ examples:
1918
+ - $.items[*]
1919
+ - $.order.lineItems[*]
1920
+ - $.parents[*].children[*]
1921
+ - $
1922
+ sourceDataType:
1923
+ type: string
1924
+ description: |
1925
+ Declares the JSON type of the input array being iterated, to ensure
1926
+ proper type handling during array construction. Same enum as `dataType`.
1927
+ enum:
1928
+ - string
1929
+ - number
1930
+ - boolean
1931
+ - object
1932
+ - stringarray
1933
+ - numberarray
1934
+ - booleanarray
1935
+ - objectarray
1936
+ - arrayarray
1937
+ x-enumDescriptions:
1938
+ string: Input array contains string elements.
1939
+ number: Input array contains numeric elements.
1940
+ boolean: Input array contains boolean elements.
1941
+ object: Input array contains object elements.
1942
+ stringarray: Input array contains arrays of strings.
1943
+ numberarray: Input array contains arrays of numbers.
1944
+ booleanarray: Input array contains arrays of booleans.
1945
+ objectarray: Input array contains arrays of objects.
1946
+ arrayarray: Input array contains arrays of arrays.
1947
+ examples:
1948
+ - string
1949
+ - number
1950
+ - boolean
1951
+ - object
1952
+ default:
1953
+ type:
1954
+ - string
1955
+ - 'null'
1956
+ description: |
1957
+ Specifies a fallback value when the extracted array element is empty or
1958
+ not found in the input data.
1959
+
1960
+ Explicit JSON `null` is itself a valid fallback (the element is written as
1961
+ JSON null); omitting the key means no fallback is applied.
1962
+ examples:
1963
+ - N/A
1964
+ - '0'
1965
+ - 'false'
1966
+ conditional:
1967
+ type: object
1968
+ description: |
1969
+ Defines conditional rules for including each array element in the result.
1970
+ properties:
1971
+ when:
1972
+ type: string
1973
+ description: |
1974
+ Specifies the condition that must be met for an array element to be included.
1975
+
1976
+ 'extract_not_empty' only includes elements where the extract field returns a value.
1977
+ enum:
1978
+ - extract_not_empty
1979
+ x-enumDescriptions:
1980
+ extract_not_empty: Include the array element only when the extract field returns a non-empty value.
1981
+ examples:
1982
+ - extract_not_empty
1983
+ mappings:
1984
+ type: array
1985
+ description: |
1986
+ Contains recursive mapping definitions for complex array element transformations.
1987
+
1988
+ **Composite object mechanism**
1989
+
1990
+ When both 'extract' and 'mappings' are used together, the system implements a sophisticated
1991
+ "composite object" approach that is crucial for AI agents to understand:
1992
+
1993
+ 1. The system starts with the complete input record
1994
+
1995
+ 2. For each array element matched by the extract path, it creates a modified version of
1996
+ the input record where:
1997
+ - Array paths in the extract JSON path are REPLACED with single objects
1998
+ - Each array ([]) in the path is converted to a single object ({})
1999
+ - This preserves the hierarchical relationship between nested arrays
2000
+
2001
+ **Example**
2002
+
2003
+ Given an input record:
2004
+ ```json
2005
+ {
2006
+ "customer": {
2007
+ "name": "John Doe",
2008
+ "orders": [
2009
+ {
2010
+ "id": "O-001",
2011
+ "items": [
2012
+ {"sku": "ABC", "qty": 2},
2013
+ {"sku": "XYZ", "qty": 1}
2014
+ ]
2015
+ },
2016
+ {
2017
+ "id": "O-002",
2018
+ "items": [
2019
+ {"sku": "DEF", "qty": 3}
2020
+ ]
2021
+ }
2022
+ ]
2023
+ }
2024
+ }
2025
+ ```
2026
+
2027
+ With extract path: `$.customer.orders[*].items[*]`
2028
+
2029
+ For each item, the system creates a composite object like:
2030
+ ```json
2031
+ {
2032
+ "customer": {
2033
+ "name": "John Doe",
2034
+ "orders": { // Note: Array replaced with single object
2035
+ "id": "O-001",
2036
+ "items": { // Note: Array replaced with single object
2037
+ "sku": "ABC",
2038
+ "qty": 2
2039
+ }
2040
+ }
2041
+ }
2042
+ }
2043
+ ```
2044
+
2045
+ Then in your mappings, you can access:
2046
+ - The current item: `$.customer.orders.items.sku`
2047
+ - The parent order: `$.customer.orders.id`
2048
+ - Top-level data: `$.customer.name`
2049
+
2050
+ This approach allows for precise mapping from deeply nested structures while maintaining
2051
+ access to all contextual parent data, without requiring complex array index management.
2052
+
2053
+ **Implementation guidance**
2054
+
2055
+ When implementing the composite object mechanism:
2056
+
2057
+ 1. Analyze the extract path to identify all array patterns (`[*]` or `[number]`)
2058
+ 2. For each array in the path, understand that it will be replaced with a single object
2059
+ 3. In the mappings, use paths that reference these arrays as if they were objects
2060
+ 4. Remember that every mapping still has access to the full input record context
2061
+ 5. This mechanism is especially powerful when mapping hierarchical data like:
2062
+ - Order → Line Items → Taxes/Discounts
2063
+ - Customer → Addresses → Address Lines
2064
+ - Invoice → Line Items → Serial Numbers
2065
+
2066
+ The extract path effectively tells the system "iterate through these arrays",
2067
+ while the composite object mechanism ensures you can still access both the
2068
+ current array item AND its parent context during mapping.
2069
+ items:
2070
+ $ref: '#/components/schemas/items'
2071
+ examples:
2072
+ - - generate: itemName
2073
+ extract: $.name
2074
+ dataType: string
2075
+ status: Active
2076
+ - generate: itemPrice
2077
+ extract: $.price
2078
+ dataType: number
2079
+ status: Active
2080
+ status:
2081
+ type: string
2082
+ description: |
2083
+ **Purpose**
2084
+ Required on every mapping entry. Controls whether the mapping is applied.
2085
+
2086
+ **Guidance**
2087
+ Emit `"Active"` for mappings that should run; `"Draft"` saves an
2088
+ in-progress mapping without the Active-only field validations. The
2089
+ API rejects a mapping missing this field
2090
+ (validation error: "Mapping object must have status field present.").
2091
+ x-celigo-ai-guidance:
2092
+ - |-
2093
+ Emit `"Active"` for mappings that should run; `"Draft"` is also
2094
+ accepted and saves the mapping while bypassing the Active-only
2095
+ field validations. The value is case-sensitive. The API rejects:
2096
+ - Missing field: `[status_field_absent] Mapping object must have status field present.`
2097
+ - Wrong case (e.g. `"active"`): `[invalid_status_enums] active is not a valid enum for status field.`
2098
+ enum:
2099
+ - Active
2100
+ - Draft
2101
+ x-enumDescriptions:
2102
+ Active: The mapping is enabled and applied during processing.
2103
+ Draft: In-progress mapping; saved without the Active-only field validations.
2104
+ examples:
2105
+ - Active
2106
+ conditional:
2107
+ type: object
2108
+ description: |
2109
+ **Purpose**
2110
+ Defines conditional processing rules for the entire mapping.
2111
+
2112
+ **Guidance**
2113
+ These conditions determine whether the mapping is applied based on record
2114
+ state or field content:
2115
+
2116
+ **When to Use**
2117
+ - When a mapping should only be applied in specific circumstances
2118
+ - To implement conditional logic without using complex handlebars expressions
2119
+ - For creating mappings that only run during create or update operations
2120
+
2121
+ **Available Conditions**
2122
+
2123
+ - `record_created`: Apply only when creating a new record
2124
+ Useful for setting initial values that should not be overwritten during updates
2125
+
2126
+ - `record_updated`: Apply only when updating an existing record
2127
+ Useful for transformation logic that should only run during updates
2128
+
2129
+ - `extract_not_empty`: Apply only when the extract field returns a value
2130
+ Useful for conditional mapping based on input data availability
2131
+
2132
+ **Example**
2133
+ ```json
2134
+ {
2135
+ "generate": "statusMessage",
2136
+ "dataType": "string",
2137
+ "status": "Active",
2138
+ "extract": "$.status.message",
2139
+ "conditional": {
2140
+ "when": "extract_not_empty" // Only map when status.message exists
2141
+ }
2142
+ }
2143
+ ```
2144
+ properties:
2145
+ when:
2146
+ type: string
2147
+ description: |
2148
+ Specifies the condition that triggers application of this mapping:
2149
+ - record_created: Apply only when creating a new record
2150
+ - record_updated: Apply only when updating an existing record
2151
+ - extract_not_empty: Apply only when the extract field returns a value
2152
+ enum:
2153
+ - record_created
2154
+ - record_updated
2155
+ - extract_not_empty
2156
+ x-enumDescriptions:
2157
+ record_created: Apply this mapping only when creating a new record.
2158
+ record_updated: Apply this mapping only when updating an existing record.
2159
+ extract_not_empty: Apply this mapping only when the extract field returns a non-empty value.
2160
+ examples:
2161
+ - record_created
2162
+ - record_updated
2163
+ - extract_not_empty
2164
+ required:
2165
+ - dataType
2166
+ Lookups:
2167
+ type: array
2168
+ description: |
2169
+ Configuration for value-to-value transformations using lookup tables.
2170
+
2171
+ **Purpose**
2172
+
2173
+ Lookups provide a way to translate values from one system to another. They transform
2174
+ input values into output values using either static mapping tables or
2175
+ dynamic lookup caches.
2176
+
2177
+ **Lookup mechanisms**
2178
+
2179
+ There are two distinct lookup mechanisms available:
2180
+
2181
+ 1. **Static Lookups**: Define a simple key-value map object and store it as part of your resource
2182
+ - Best for: Small, fixed sets of values that rarely change
2183
+ - Implementation: Configure the `map` object with input-to-output value mappings
2184
+ - Example: Country codes, status values, simple translations
2185
+
2186
+ 2. **Dynamic Lookups**: Reference an existing 'Lookup Cache' resource in your Celigo account
2187
+ - Best for: Large datasets, frequently changing values, or complex reference data
2188
+ - Implementation: Configure `_lookupCacheId` to reference cached data maintained independently
2189
+ - Example: Product catalogs, customer databases, pricing information
2190
+
2191
+ **Property usage**
2192
+
2193
+ There are two mutually exclusive ways to configure lookups, depending on which mechanism you choose:
2194
+
2195
+ 1. **For Static Mappings**: Configure the `map` property with a direct key-value object
2196
+ ```json
2197
+ "map": {"US": "United States", "CA": "Canada"}
2198
+ ```
2199
+
2200
+ 2. **For Dynamic Lookups**: Configure the following properties:
2201
+ - `_lookupCacheId`: Reference to the lookup cache resource
2202
+ - `extract`: JSON path to extract specific value from the returned lookup object
2203
+
2204
+ **When to use**
2205
+
2206
+ Lookups are ideal for:
2207
+
2208
+ 1. **Value Translation**: Mapping codes or IDs to human-readable values
2209
+
2210
+ 2. **Data Enrichment**: Adding related information to records during processing
2211
+
2212
+ 3. **Normalization**: Ensuring consistent formatting of values across systems
2213
+
2214
+ **Implementation details**
2215
+
2216
+ Lookups can be referenced in:
2217
+
2218
+ 1. **Field Mappings**: Direct use in field transformation configurations
2219
+
2220
+ 2. **Handlebars Templates**: Use within templates with the syntax:
2221
+ ```
2222
+ {{lookup 'lookupName' record.fieldName}}
2223
+ ```
2224
+
2225
+ **Example usage**
2226
+
2227
+ ```json
2228
+ "lookups": [
2229
+ {
2230
+ "name": "countryCodeToName",
2231
+ "map": {
2232
+ "US": "United States",
2233
+ "CA": "Canada",
2234
+ "UK": "United Kingdom"
2235
+ },
2236
+ "default": "Unknown Country",
2237
+ "allowFailures": true
2238
+ },
2239
+ {
2240
+ "name": "productDetails",
2241
+ "_lookupCacheId": "60a2c4e6f321d800129a1a3c",
2242
+ "extract": "$.details.price",
2243
+ "allowFailures": false
2244
+ }
2245
+ ]
2246
+ ```
2247
+ items:
2248
+ type: object
2249
+ properties:
2250
+ name:
2251
+ type: string
2252
+ description: |
2253
+ Unique identifier for the lookup table within this configuration.
2254
+
2255
+ This name must be unique within the scope where the lookup is defined and is used to reference
2256
+ the lookup in handlebars templates with the syntax {{lookup 'name' value}}.
2257
+
2258
+ Choose descriptive names that indicate the transformation purpose, such as:
2259
+ - "countryCodeToName" for country code to full name conversion
2260
+ - "statusMapping" for status code translations
2261
+ - "departmentCodes" for department code to name mapping
2262
+ examples:
2263
+ - countryCodeToName
2264
+ - statusMapping
2265
+ - departmentCodes
2266
+ map:
2267
+ type:
2268
+ - object
2269
+ - 'null'
2270
+ description: |
2271
+ The lookup mapping table as key-value pairs. The platform stores `null`
2272
+ here on dynamic lookups, which resolve values at runtime instead of
2273
+ from a static table.
2274
+
2275
+ This object contains the input values as keys and their corresponding
2276
+ output values. When a input value matches a key in this object,
2277
+ it will be replaced with the corresponding value.
2278
+
2279
+ The map should be kept to a reasonable size (typically under 100 entries)
2280
+ for optimal performance. For larger mapping requirements, consider using
2281
+ dynamic lookups instead.
2282
+
2283
+ Maps can include:
2284
+ - Simple code to name conversions: {"US": "United States"}
2285
+ - Status transformations: {"A": "Active", "I": "Inactive"}
2286
+ - ID to name mappings: {"100": "Marketing", "200": "Sales"}
2287
+
2288
+ Values can be strings, numbers, or booleans, but all are stored as strings
2289
+ in the configuration.
2290
+ examples:
2291
+ - US: United States
2292
+ UK: United Kingdom
2293
+ CA: Canada
2294
+ - A: Active
2295
+ I: Inactive
2296
+ P: Pending
2297
+ - 'true': 'Yes'
2298
+ 'false': 'No'
2299
+ _lookupCacheId:
2300
+ type: string
2301
+ description: |
2302
+ Reference to a LookupCache resource that contains the reference data for the lookup.
2303
+
2304
+ **Purpose**
2305
+
2306
+ This field connects the lookup to an external data source that has been cached in the system.
2307
+ Unlike static lookups that use the `map` property, dynamic lookups can reference large datasets
2308
+ or frequently changing information without requiring constant updates to the integration.
2309
+
2310
+ **Implementation details**
2311
+
2312
+ The LookupCache resource referenced by this ID contains:
2313
+ - The data records to be used as a reference source
2314
+ - Configuration for how the data should be indexed and accessed
2315
+ - Caching parameters to balance performance with data freshness
2316
+
2317
+ **Usage patterns**
2318
+
2319
+ Commonly used to reference:
2320
+ - Product catalogs or SKU databases
2321
+ - Customer or account information
2322
+ - Pricing tables or discount rules
2323
+ - Complex business logic lookup tables
2324
+
2325
+ Format: 24-character hexadecimal string (MongoDB ObjectId)
2326
+ format: objectid
2327
+ x-celigo-refModel: lookupcaches
2328
+ examples:
2329
+ - 60a2c4e6f321d800129a1a3c
2330
+ - 5f8d43a1b9e5a80011a35f2c
2331
+ extract:
2332
+ type: string
2333
+ description: |
2334
+ JSON path expression that extracts a specific value from the cached lookup object.
2335
+
2336
+ **Purpose**
2337
+
2338
+ When using dynamic lookups with a LookupCache, this JSON path identifies which field to extract
2339
+ from the cached object after it has been retrieved using the lookup key.
2340
+
2341
+ **Implementation details**
2342
+
2343
+ - Must use JSON path syntax (similar to mapping extract fields)
2344
+ - Operates on the cached object returned by the lookup operation
2345
+ - Examples:
2346
+ - "$.name" - Extract the name field from the top level
2347
+ - "$.details.price" - Extract a nested price field
2348
+ - "$.attributes[0].value" - Extract a value from the first element of an array
2349
+
2350
+ **Usage scenario**
2351
+
2352
+ When a lookup cache contains complex objects:
2353
+ ```json
2354
+ // Cache entry for key "PROD-123":
2355
+ {
2356
+ "id": "PROD-123",
2357
+ "name": "Premium Widget",
2358
+ "details": {
2359
+ "price": 99.99,
2360
+ "currency": "USD",
2361
+ "inStock": true
2362
+ }
2363
+ }
2364
+ ```
2365
+
2366
+ Setting extract to "$.details.price" would return 99.99 as the lookup result.
2367
+
2368
+ If no extract is provided, the entire cached object is returned as the lookup result.
2369
+ examples:
2370
+ - $.name
2371
+ - $.details.price
2372
+ - $.attributes.color
2373
+ - $.category.name
2374
+ default:
2375
+ type:
2376
+ - string
2377
+ - 'null'
2378
+ description: |
2379
+ Default value to use when the source value is not found in the lookup map.
2380
+ The platform stores `null` here when no default is configured.
2381
+
2382
+ This value is used as a fallback when:
2383
+ 1. The source value doesn't match any key in the map
2384
+ 2. allowFailures is set to true
2385
+
2386
+ Setting an appropriate default helps prevent flow failures due to unexpected
2387
+ values and provides predictable behavior for edge cases.
2388
+
2389
+ Common default patterns include:
2390
+ - Descriptive unknowns: "Unknown Country", "Unspecified Status"
2391
+ - Original value indicators: "{Original Value}", "No mapping found"
2392
+ - Neutral values: "Other", "N/A", "Miscellaneous"
2393
+
2394
+ If allowFailures is false and no default is specified, the flow will fail
2395
+ when encountering unmapped values.
2396
+ examples:
2397
+ - Unknown
2398
+ - Other
2399
+ - N/A
2400
+ - Unmapped Value
2401
+ - '{Original Value}'
2402
+ x-celigo-ai-guidance:
2403
+ - 'Omit this field entirely when no fallback value is intended. The API rejects an empty string with [invalid_field] Invalid value '''' for field ''default'' — emitting default: "" to mean "no default" fails validation; leaving the key out is the valid spelling of that intent.'
2404
+ allowFailures:
2405
+ type:
2406
+ - boolean
2407
+ - 'null'
2408
+ description: |
2409
+ When true, missing lookup values will use the default value rather than causing an error.
2410
+
2411
+ **Behavior control**
2412
+
2413
+ This field determines how the system handles source values that don't exist in the map:
2414
+
2415
+ - true: Use the default value for missing mappings and continue processing
2416
+ - false: Treat missing mappings as errors, failing the record
2417
+
2418
+ **Recommendation**
2419
+
2420
+ Set this to true when:
2421
+ - New source values might appear over time
2422
+ - Data quality issues could introduce unexpected values
2423
+ - Processing should continue even with imperfect mapping
2424
+
2425
+ Set this to false when:
2426
+ - Complete data accuracy is critical
2427
+ - All possible source values are known and controlled
2428
+ - Missing mappings indicate serious data problems that should be addressed
2429
+
2430
+ The best practice is typically to set allowFailures to true with a meaningful
2431
+ default value, so flows remain operational while alerting you to missing mappings.
2432
+ examples:
2433
+ - true
2434
+ - false
2435
+ Transform:
2436
+ type: object
2437
+ description: |
2438
+ Configuration for transforming data during processing operations. This object enables
2439
+ reshaping of records.
2440
+
2441
+ **Transformation capabilities**
2442
+
2443
+ Celigo's transformation engine offers powerful features for data manipulation:
2444
+ - Precise field mapping with JSONPath expressions
2445
+ - Support for any level of nested arrays
2446
+ - Formula-based field value generation
2447
+ - Dynamic references to flow and integration settings
2448
+
2449
+ **Implementation approaches**
2450
+
2451
+ There are two distinct transformation mechanisms available:
2452
+
2453
+ **Rule-Based Transformation (`type: "expression"`)**
2454
+ - **Best For**: Most transformation scenarios from simple to complex
2455
+ - **Capabilities**: Field mapping, formula calculations, lookups, nested data handling
2456
+ - **Advantages**: Visual configuration, no coding required, intuitive interface
2457
+ - **Configuration**: Define rules in the `expression` object
2458
+ - **Use When**: You have clear mapping requirements or need to reshape data structure
2459
+
2460
+ **Script-Based Transformation (`type: "script"`)**
2461
+ - **Best For**: Extremely complex logic or proprietary algorithms
2462
+ - **Capabilities**: Full programmatic control, custom processing, complex business rules
2463
+ - **Advantages**: Maximum flexibility, can implement any transformation logic
2464
+ - **Configuration**: Reference a script in the `script` object
2465
+ - **Use When**: Visual transformation tools aren't sufficient for your use case
2466
+ properties:
2467
+ type:
2468
+ type: string
2469
+ description: |
2470
+ Determines which transformation mechanism to use. This choice affects which properties
2471
+ must be configured and how transformation logic is implemented.
2472
+
2473
+ **Available types**
2474
+
2475
+ **Rule-Based Transformation (`"expression"`)**
2476
+ - **Required Config**: The `expression` object with mapping definitions
2477
+ - **Behavior**: Applies declarative rules to reshape data
2478
+ - **Best For**: Most transformation scenarios from simple to complex
2479
+ - **Advantages**: Visual configuration, no coding required
2480
+
2481
+ **Script-Based Transformation (`"script"`)**
2482
+ - **Required Config**: The `script` object with _scriptId and function
2483
+ - **Behavior**: Executes custom JavaScript to transform data
2484
+ - **Best For**: Extremely complex logic or proprietary algorithms
2485
+ - **Advantages**: Maximum flexibility, can implement any logic
2486
+
2487
+ **Implementation guidance**
2488
+
2489
+ 1. For standard data transformations, use `"expression"`
2490
+ 2. For complex logic or specialized processing, use `"script"`
2491
+ 3. When selecting a type, you must configure the corresponding object:
2492
+ - `type: "expression"` requires the `expression` object
2493
+ - `type: "script"` requires the `script` object
2494
+ enum:
2495
+ - expression
2496
+ - script
2497
+ x-enumDescriptions:
2498
+ expression: Rule-based transformation using declarative mapping definitions.
2499
+ script: Script-based transformation using custom JavaScript logic.
2500
+ examples:
2501
+ - expression
2502
+ - script
2503
+ expression:
2504
+ type: object
2505
+ description: |
2506
+ Configuration for declarative rule-based transformations. This object enables reshaping data
2507
+ without requiring custom code.
2508
+
2509
+ **Usage context**
2510
+
2511
+ This object is REQUIRED when `transform.type` is set to "expression" and should not be
2512
+ configured otherwise. It provides a standardized way to define transformation rules that
2513
+ can map, modify, and generate data elements.
2514
+
2515
+ **Implementation guidance**
2516
+
2517
+ The expression system uses a rule-based approach where:
2518
+ - Field mappings define how input data is transformed to target fields
2519
+ - Formulas can be used to calculate or generate new values
2520
+ - Lookups can enrich data by fetching related information
2521
+ - Mode determines how records are processed (create new or modify existing)
2522
+ properties:
2523
+ version:
2524
+ type: string
2525
+ description: |
2526
+ Version of the expression format. Determines which rules
2527
+ property contains the transformation logic.
2528
+ enum:
2529
+ - '1'
2530
+ - '2'
2531
+ x-enumDescriptions:
2532
+ '1': Legacy format. Rules are in the `rules` array (array of arrays of extract/generate objects).
2533
+ '2': Current format. Rules are in the `rulesTwoDotZero` object with mode, mappings, and lookups.
2534
+ examples:
2535
+ - '1'
2536
+ - '2'
2537
+ rules:
2538
+ type: array
2539
+ description: |
2540
+ Transformation rules for version 1 expressions. An array of
2541
+ rule groups; each group is an array of field-mapping objects.
2542
+ Most transforms have a single group. Present when `version`
2543
+ is `"1"`. The output record contains ONLY the generated
2544
+ fields — every unmapped field is dropped (v1 has no
2545
+ equivalent of Transform 2.0's `modify` mode), and the
2546
+ record's trace key does not survive the rebuild.
2547
+ x-celigo-ai-guidance:
2548
+ - |-
2549
+ v1 rules REPLACE the record: a one-field rule group drops
2550
+ every other field, silently breaking downstream filters,
2551
+ router branch rules, and templates that referenced the
2552
+ dropped fields. Either map every field downstream logic
2553
+ needs forward, or author Transform 2.0 with
2554
+ ``mode: "modify"`` instead.
2555
+ items:
2556
+ type: array
2557
+ items:
2558
+ type: object
2559
+ properties:
2560
+ extract:
2561
+ type: string
2562
+ description: |
2563
+ Source field path to read from. Supports multiple
2564
+ syntaxes: bare field names (`id`), dot notation
2565
+ (`fulfillment.shipment_id`), slash-prefixed paths
2566
+ for XML (`/FeedProcessingStatus`), wildcards (`*.id`,
2567
+ `*.[Internal ID]`), and array indexing (`SDF[0]`).
2568
+ generate:
2569
+ type: string
2570
+ description: |
2571
+ Target field name to write to. Typically a bare name
2572
+ (`id`) or dot path (`SDF.Filter.ID`).
2573
+ key:
2574
+ type: string
2575
+ description: |
2576
+ Auto-generated identifier for this rule, used by the
2577
+ UI to track individual rules for editing and reordering.
2578
+ required:
2579
+ - extract
2580
+ - generate
2581
+ rulesTwoDotZero:
2582
+ type: object
2583
+ description: |
2584
+ Configuration for version 2 transformation rules. This object contains the core logic
2585
+ for how data is mapped, enriched, and transformed.
2586
+
2587
+ **Capabilities**
2588
+
2589
+ Transformation 2.0 provides:
2590
+ - Precise field mapping with JSONPath expressions
2591
+ - Support for deeply nested data structures
2592
+ - Formula-based field generation
2593
+ - Dynamic lookups for data enrichment
2594
+ - Multiple operating modes to fit different scenarios
2595
+ properties:
2596
+ mode:
2597
+ type: string
2598
+ description: |
2599
+ Transformation mode that determines how records are handled during processing.
2600
+
2601
+ **Available modes**
2602
+
2603
+ **Create Mode (`"create"`)**
2604
+ - **Behavior**: Builds entirely new output records from inputs
2605
+ - **Use When**: Output structure differs significantly from input
2606
+ - **Advantage**: Clean slate approach, no field inheritance
2607
+
2608
+ **Modify Mode (`"modify"`)**
2609
+ - **Behavior**: Makes targeted edits to existing records
2610
+ - **Use When**: Output structure should remain similar to input
2611
+ - **Advantage**: Preserves unmapped fields from the original record
2612
+ enum:
2613
+ - create
2614
+ - modify
2615
+ x-enumDescriptions:
2616
+ create: Builds entirely new output records from inputs, ignoring unmapped fields.
2617
+ modify: Makes targeted edits to existing records, preserving unmapped fields.
2618
+ examples:
2619
+ - create
2620
+ - modify
2621
+ mappings:
2622
+ $ref: '#/components/schemas/Mappings'
2623
+ lookups:
2624
+ allOf:
2625
+ - description: |
2626
+ Shared lookup tables used across all mappings defined in the transformation rules.
2627
+
2628
+ **Purpose**
2629
+
2630
+ Lookups provide centralized value translation that can be referenced from any mapping
2631
+ in your transformation configuration. They enable consistent translation of codes, IDs,
2632
+ and values between systems without duplicating translation logic.
2633
+
2634
+ **Usage in transformations**
2635
+
2636
+ Lookups are particularly valuable in transformations for:
2637
+
2638
+ - **Data Normalization**: Standardizing values from diverse source systems
2639
+ - **Code Translation**: Converting between different coding systems (e.g., status codes)
2640
+ - **Field Enrichment**: Adding descriptive values based on ID or code lookups
2641
+ - **Cross-Reference Resolution**: Mapping identifiers between integrated systems
2642
+
2643
+ **Implementation**
2644
+
2645
+ Lookups are defined once in this array and referenced by name in mappings:
2646
+
2647
+ ```json
2648
+ "lookups": [
2649
+ {
2650
+ "name": "statusMapping",
2651
+ "map": {
2652
+ "A": "Active",
2653
+ "I": "Inactive",
2654
+ "P": "Pending"
2655
+ },
2656
+ "default": "Unknown Status"
2657
+ }
2658
+ ]
2659
+ ```
2660
+
2661
+ Then referenced in mappings using the lookupName property:
2662
+
2663
+ ```json
2664
+ {
2665
+ "generate": "status",
2666
+ "dataType": "string",
2667
+ "extract": "$.statusCode",
2668
+ "lookupName": "statusMapping"
2669
+ }
2670
+ ```
2671
+
2672
+ The system automatically applies the lookup during transformation processing.
2673
+
2674
+ For complete details on lookup properties and behavior, see the Lookups schema.
2675
+ - $ref: '#/components/schemas/Lookups'
2676
+ inputContext:
2677
+ type: string
2678
+ enum:
2679
+ - record
2680
+ - envelope
2681
+ x-enumDescriptions:
2682
+ record: The transform processor evaluates `mappings[].extract` JSONPath against the flat record itself (`$.field`, no `record.` segment) — the default when absent.
2683
+ envelope: The transform processor evaluates JSONPath against the wrapped runtime envelope `{record, settings, job, …}` (file-provider steps also carry `fileMeta`) — extracts must include the `record.` segment (`$.record.field`).
2684
+ description: |
2685
+ Controls the JSON shape the transformTwoDotZero processor
2686
+ evaluates `mappings[].extract` JSONPath values against at
2687
+ flow runtime. Applies only to Transform 2.0 (v2,
2688
+ `rulesTwoDotZero`); v1 transforms (the `rules` array on
2689
+ `transform.expression.rules`) and script-mode transforms
2690
+ ignore this field.
2691
+ x-celigo-ai-guidance:
2692
+ - |-
2693
+ ## Extract anchoring by mode
2694
+
2695
+ - `record` (default — absent / empty / undefined): the
2696
+ processor sees the FLAT record as its evaluation root.
2697
+ `mappings[].extract` JSONPath MUST anchor directly at
2698
+ `$` with NO `record.` segment — e.g. `"$.orderId"`,
2699
+ `"$.customer.email"`; PLACEHOLDER extracts use
2700
+ `"$.PLACEHOLDER_<field>"`.
2701
+ This is the dominant Celigo idiom and the right choice for new transforms.
2702
+ - `envelope`: the processor sees a wrapped object
2703
+ `{record: {...}, settings: ..., job: ...}` (plus
2704
+ `fileMeta` on file-provider steps).
2705
+ `mappings[].extract` JSONPath MUST include the
2706
+ `record.` segment — e.g. `"$.record.orderId"`;
2707
+ PLACEHOLDER extracts use `"$.record.PLACEHOLDER_<field>"`.
2708
+ Pick this only when the transform was authored against
2709
+ the envelope shape on purpose.
2710
+ - |-
2711
+ Handlebars expressions inside `extract`
2712
+ (`{{record.field}}`, `{{dateFormat ... record.field}}`)
2713
+ ALWAYS reference the `record` root regardless of
2714
+ `inputContext` — only JSONPath anchoring flips.
2715
+ - |-
2716
+ Emit `inputContext` explicitly on new v2 transforms:
2717
+ unset is read as `record`, but stating it makes the
2718
+ extract-anchoring contract self-documenting and immune
2719
+ to a platform default change.
2720
+ - |-
2721
+ ## Allowed values
2722
+
2723
+ - ``record`` (default — emitted when the field is absent
2724
+ / empty / undefined): the transform processor sees
2725
+ the FLAT record itself as its evaluation root.
2726
+ ``mappings[].extract`` JSONPath values MUST anchor
2727
+ directly at ``$`` with NO ``record.`` segment — for
2728
+ example ``"$.orderId"`` or
2729
+ ``"$.customer.email"``. PLACEHOLDER extracts use
2730
+ ``"$.PLACEHOLDER_<field>"``. This is the dominant
2731
+ Celigo idiom and the right choice for new transforms.
2732
+
2733
+ - ``envelope``: the transform processor sees a wrapped
2734
+ object of the shape
2735
+ ``{record: {...}, settings: ..., job: ...}`` (plus
2736
+ ``fileMeta`` on file-provider steps) — the
2737
+ same runtime-context envelope Handlebars / SQL /
2738
+ GraphQL specialists consume. ``mappings[].extract``
2739
+ JSONPath values MUST include the ``record.`` segment
2740
+ — for example ``"$.record.orderId"`` or
2741
+ ``"$.record.customer.email"``. PLACEHOLDER extracts
2742
+ use ``"$.record.PLACEHOLDER_<field>"``. Pick this
2743
+ mode only when the export was authored against the
2744
+ envelope shape on purpose (typically because an
2745
+ upstream step intentionally feeds the wrapped
2746
+ runtime context through to the transform).
2747
+
2748
+ ## Handlebars expressions are NOT affected
2749
+
2750
+ Handlebars expressions inside ``extract``
2751
+ (``{{record.field}}``,
2752
+ ``{{dateFormat ... record.field}}``, etc.) ALWAYS
2753
+ reference the runtime context's ``record`` root
2754
+ regardless of ``inputContext`` — the Handlebars runtime
2755
+ always sees the wrapped envelope. Only JSONPath
2756
+ behavior flips with this field.
2757
+
2758
+ ## Agent guidance
2759
+
2760
+ Set this field explicitly on every new v2 transform
2761
+ the agent authors. Leaving it unset is interpreted as
2762
+ ``record`` by the platform, but emitting
2763
+ ``inputContext: record`` makes the contract
2764
+ self-documenting and prevents the transform from
2765
+ drifting into envelope mode if an upstream change ever
2766
+ changes the platform default. The TransformsAgent
2767
+ reads this value off the transform config and threads
2768
+ it into the generator's prompt so the JSONPath form
2769
+ matches the runtime root.
2770
+ - |-
2771
+ ## fileMeta on file-provider steps
2772
+
2773
+ File-provider exports and lookups populate a
2774
+ ``fileMeta`` envelope key describing each record's
2775
+ source file: ``fileName``, ``fileSize``, and
2776
+ ``lastModifiedTime`` (epoch milliseconds). Reach it
2777
+ as ``$.fileMeta.<field>`` in envelope mode, or as
2778
+ ``{{fileMeta.<field>}}`` from a Handlebars extract in
2779
+ either mode. The keys are exactly these three —
2780
+ lowercase variants such as ``filesize`` or
2781
+ ``filename`` resolve empty. The standalone transform
2782
+ processor substitutes sample fileMeta values when the
2783
+ posted data lacks them, so a resolving editor render
2784
+ is not proof the step provides fileMeta — only
2785
+ file-provider steps populate it at flow runtime.
2786
+ examples:
2787
+ - record
2788
+ - envelope
2789
+ script:
2790
+ type: object
2791
+ description: |
2792
+ Configuration for programmable script-based transformations. This object enables complex, custom
2793
+ transformation logic beyond what expression-based transformations can provide.
2794
+
2795
+ **Usage context**
2796
+
2797
+ This object is REQUIRED when `transform.type` is set to "script" and should not be configured
2798
+ otherwise. It provides a way to execute custom JavaScript code to transform data according to
2799
+ specialized business rules or complex algorithms.
2800
+
2801
+ **Implementation approach**
2802
+
2803
+ Script-based transformation works by:
2804
+ 1. Executing the specified function from the referenced script
2805
+ 2. Passing input data to the function
2806
+ 3. Using the function's return value as the transformed output
2807
+
2808
+ **Common use cases**
2809
+
2810
+ Script transformation is ideal for:
2811
+ - Complex business logic that can't be expressed through mappings
2812
+ - Algorithmic transformations requiring computation
2813
+ - Dynamic transformations based on external factors
2814
+ - Legacy system data format compatibility
2815
+ - Multi-stage processing with intermediate steps
2816
+
2817
+ Only use script-based transformation when expression-based transformation is insufficient.
2818
+ Script transformation requires maintaining custom code, which adds complexity to the integration.
2819
+ properties:
2820
+ _scriptId:
2821
+ type: string
2822
+ description: |
2823
+ Reference to a predefined script resource containing the transformation logic.
2824
+
2825
+ The referenced script should contain the function specified in the
2826
+ 'function' property.
2827
+ format: objectid
2828
+ x-celigo-refModel: scripts
2829
+ examples:
2830
+ - 60a2c4e6f321d800129a1a3c
2831
+ - 5f8d43a1b9e5a80011a35f2c
2832
+ function:
2833
+ type: string
2834
+ description: |
2835
+ Name of the function within the script to execute for transformation. This function
2836
+ must exist in the script referenced by _scriptId.
2837
+ examples:
2838
+ - transformData
2839
+ - convertRecord
2840
+ - applyMapping
2841
+ AsyncHelperBase:
2842
+ type: object
2843
+ description: Writable fields shared by the request and response schemas.
2844
+ properties:
2845
+ name:
2846
+ type: string
2847
+ minLength: 1
2848
+ description: Human-readable name for the async helper.
2849
+ examples:
2850
+ - Salesforce Bulk Query Helper
2851
+ externalId:
2852
+ type: string
2853
+ description: |
2854
+ External identifier for the async helper. Used by integration apps
2855
+ to reference resources by a stable, human-readable key.
2856
+ examples:
2857
+ - amazon_csv_feed_asynchelper
2858
+ http:
2859
+ type: object
2860
+ description: |
2861
+ HTTP configuration for the three async phases: submit, status, and
2862
+ result.
2863
+ properties:
2864
+ submit:
2865
+ type: object
2866
+ description: Configuration for submitting the initial async request.
2867
+ properties:
2868
+ sameAsStatus:
2869
+ type: boolean
2870
+ description: |
2871
+ When `true`, the submit step reuses the status export's
2872
+ configuration. When `false`, configure `resourcePath`
2873
+ and optionally `transform`.
2874
+ examples:
2875
+ - true
2876
+ x-celigo-ai-guidance:
2877
+ - |-
2878
+ When true, reuse the status export's parsing rules for the
2879
+ initial submission response and ignore `resourcePath` /
2880
+ `transform`.
2881
+ resourcePath:
2882
+ type: string
2883
+ description: |
2884
+ Path to extract the async job identifier from the submit
2885
+ response. Only used when `sameAsStatus` is `false`.
2886
+ examples:
2887
+ - id
2888
+ x-celigo-ai-guidance:
2889
+ - |-
2890
+ JSON/XML path to the data in the initial submission response
2891
+ (used only when `sameAsStatus` is false). Handlebars
2892
+ expressions may reference values from the status and result
2893
+ messages.
2894
+ transform:
2895
+ $ref: '#/components/schemas/Transform'
2896
+ x-celigo-ai-guidance:
2897
+ - |-
2898
+ Optional transform rules applied to the initial submission
2899
+ response. Use when the asynchronous API returns non-JSON
2900
+ (e.g. XML from Amazon) that must be converted to JSON before
2901
+ `resourcePath` can extract from it. This is the rules-based
2902
+ (v1) transform shape.
2903
+ required:
2904
+ - sameAsStatus
2905
+ x-celigo-ai-guidance:
2906
+ - |-
2907
+ How to process the initial asynchronous request's response.
2908
+ Optional — omit (or set `sameAsStatus: true`) when the initial
2909
+ response is parsed the same way as a status check.
2910
+ - |-
2911
+ Optional. When the initial response looks identical to a status
2912
+ check response, set `sameAsStatus: true` and the platform reuses
2913
+ the status export's parsing rules. Otherwise supply `resourcePath`
2914
+ (and `transform` for non-JSON responses) so the platform can pull
2915
+ the job ticket / feed id out of the acknowledgement.
2916
+ status:
2917
+ type: object
2918
+ description: Configuration for polling the remote job's status.
2919
+ properties:
2920
+ _exportId:
2921
+ type: string
2922
+ format: objectId
2923
+ x-celigo-refModel: exports
2924
+ description: Export resource ID for the status polling call.
2925
+ examples:
2926
+ - 63b1c2d3e4f5a60011334455
2927
+ x-celigo-ai-guidance:
2928
+ - |-
2929
+ Required. The export resource the platform runs on each poll
2930
+ to check whether the requested task is done. Must be an
2931
+ ordinary export that does not itself reference an async helper.
2932
+ statusPath:
2933
+ type: string
2934
+ minLength: 1
2935
+ description: Path to extract the status value from the poll response.
2936
+ examples:
2937
+ - status
2938
+ x-celigo-ai-guidance:
2939
+ - |-
2940
+ Required. The XML/JSON path in the status response where the
2941
+ in-progress / done / error value appears (applied to records
2942
+ from the status export). For example `FeedProcessingStatus`.
2943
+ initialWaitTime:
2944
+ type:
2945
+ - number
2946
+ - 'null'
2947
+ minimum: 0
2948
+ description: |
2949
+ Seconds to wait before the first status poll. May be fractional
2950
+ for sub-second waits; stored as null when unset.
2951
+ examples:
2952
+ - 1
2953
+ pollWaitTime:
2954
+ type:
2955
+ - number
2956
+ - 'null'
2957
+ minimum: 0
2958
+ description: |
2959
+ Seconds to wait between subsequent status poll requests. May be
2960
+ fractional for sub-second polling; stored as null when unset.
2961
+ examples:
2962
+ - 4
2963
+ inProgressValues:
2964
+ type: array
2965
+ description: |
2966
+ Values indicating the remote job is still running, so polling
2967
+ continues until the status matches one of the terminal lists.
2968
+ items:
2969
+ type: string
2970
+ examples:
2971
+ - - InProgress
2972
+ - Pending
2973
+ doneValues:
2974
+ type: array
2975
+ minItems: 1
2976
+ description: Values indicating the remote job completed successfully.
2977
+ items:
2978
+ type: string
2979
+ examples:
2980
+ - - Completed
2981
+ - Done
2982
+ doneWithoutDataValues:
2983
+ type: array
2984
+ description: Values indicating completion with no data. Optional.
2985
+ items:
2986
+ type: string
2987
+ errorValues:
2988
+ type: array
2989
+ description: Values indicating the remote job failed. Optional.
2990
+ items:
2991
+ type: string
2992
+ required:
2993
+ - _exportId
2994
+ - statusPath
2995
+ - inProgressValues
2996
+ - doneValues
2997
+ x-celigo-ai-guidance:
2998
+ - |-
2999
+ How the platform checks whether the background job is finished.
3000
+ On each poll it runs the status export and inspects the response
3001
+ at `statusPath` against the configured value lists.
3002
+ result:
3003
+ type: object
3004
+ description: |
3005
+ Configuration for retrieving the result. Omit `_exportId` to use
3006
+ the last status poll response as the result.
3007
+ properties:
3008
+ _exportId:
3009
+ type:
3010
+ - string
3011
+ - 'null'
3012
+ format: objectId
3013
+ x-celigo-refModel: exports
3014
+ description: |
3015
+ Export resource ID for retrieving the result. Optional; null (or
3016
+ omitted) means the last status poll response is used as the result.
3017
+ examples:
3018
+ - 63c1d2e3f4a5b60011445566
3019
+ x-celigo-ai-guidance:
3020
+ - |-
3021
+ The export resource that retrieves the final results of the
3022
+ originally requested task. Must be an ordinary export that
3023
+ does not itself reference an async helper. Note: an export
3024
+ configured with an async helper cannot carry its own
3025
+ transforms, output filters, or preSavePage hooks — build
3026
+ those into a dedicated result export instead.
3027
+ required:
3028
+ - submit
3029
+ - status
3030
+ x-celigo-ai-guidance:
3031
+ - |-
3032
+ The async-API contract: how to interpret the initial submission
3033
+ response, how to poll for status, and where to fetch results.
3034
+ ResourceResponse:
3035
+ type: object
3036
+ description: Response
3037
+ x-celigo-ai-guidance:
3038
+ - Core response fields shared by all Celigo resources
3039
+ properties:
3040
+ _id:
3041
+ type: string
3042
+ format: objectId
3043
+ readOnly: true
3044
+ description: Unique identifier for the resource. Format is a 24-character hexadecimal string.
3045
+ x-celigo-ai-guidance:
3046
+ - |-
3047
+ The _id is used in:
3048
+ - API endpoints that operate on a specific resource (e.g., GET, PUT, DELETE)
3049
+ - References from other resources (e.g., flows that use this resource)
3050
+ - Job history and error tracking
3051
+ examples:
3052
+ - 5f8d43a1b9e5a80011a35f2c
3053
+ createdAt:
3054
+ type: string
3055
+ format: date-time
3056
+ readOnly: true
3057
+ description: Timestamp when the resource was created. Set automatically and cannot be modified.
3058
+ x-celigo-ai-guidance:
3059
+ - Recorded in ISO 8601 with a UTC timezone (Z suffix).
3060
+ examples:
3061
+ - '2023-04-01T09:15:32Z'
3062
+ lastModified:
3063
+ type: string
3064
+ format: date-time
3065
+ readOnly: true
3066
+ description: Timestamp when the resource was last updated. Changes whenever any property is modified.
3067
+ x-celigo-ai-guidance:
3068
+ - Recorded in ISO 8601 with a UTC timezone (Z suffix); always equal to or later than `createdAt`.
3069
+ examples:
3070
+ - '2023-04-15T14:30:15Z'
3071
+ deletedAt:
3072
+ type:
3073
+ - string
3074
+ - 'null'
3075
+ format: date-time
3076
+ readOnly: true
3077
+ description: Timestamp when the resource was soft-deleted. When null or absent, the resource is active.
3078
+ x-celigo-ai-guidance:
3079
+ - Non-null means the resource is soft-deleted (in the recycle bin) — recoverable within the retention period before permanent removal.
3080
+ examples:
3081
+ - '2023-05-20T11:45:32Z'
3082
+ required:
3083
+ - _id
3084
+ IAResourceResponse:
3085
+ type: object
3086
+ description: Integration app response fields for resources that are part of integration apps
3087
+ properties:
3088
+ _integrationId:
3089
+ type: string
3090
+ format: objectId
3091
+ x-celigo-refModel: integrations
3092
+ readOnly: true
3093
+ description: |
3094
+ Reference to the specific integration instance that contains this resource.
3095
+
3096
+ This field is only populated for resources that are part of an integration app
3097
+ installation. It contains the unique identifier (_id) of the integration
3098
+ resource that was installed in the account.
3099
+
3100
+ The integration instance represents a specific installed instance of an
3101
+ integration app, with its own configuration, settings, and runtime environment.
3102
+
3103
+ This reference enables:
3104
+ - Tracing the resource back to its parent integration instance
3105
+ - Permission and access control based on integration ownership
3106
+ - Lifecycle management (enabling/disabling, updating, or uninstalling)
3107
+ examples:
3108
+ - 5f9a7b2c3d4e5f6a7b8c9d0e
3109
+ _connectorId:
3110
+ type: string
3111
+ format: objectId
3112
+ x-celigo-refModel: connectors
3113
+ readOnly: true
3114
+ description: |
3115
+ Reference to the integration app that defines this resource.
3116
+
3117
+ This field is only populated for resources that are part of an integration app.
3118
+ It contains the unique identifier (_id) of the integration app (connector)
3119
+ that defines the structure, behavior, and templates for this resource.
3120
+
3121
+ The integration app is the published template that can be installed
3122
+ multiple times across different accounts, with each installation creating
3123
+ a separate integration instance (referenced by _integrationId).
3124
+
3125
+ This reference enables:
3126
+ - Identifying the source integration app for this resource
3127
+ - Determining which template version is being used
3128
+ - Linking to documentation, support, and marketplace information
3129
+ examples:
3130
+ - 5e8d43a1b9e5a80011a35f1b
3131
+ x-celigo-ai-guidance:
3132
+ - |-
3133
+ Read-only connector (Integration App template) reference; present only on
3134
+ connector-owned resources. Never set or modify it when authoring resources.
3135
+ AsyncHelper:
3136
+ type: object
3137
+ required:
3138
+ - _id
3139
+ - name
3140
+ - http
3141
+ description: Async helper object as returned by the API.
3142
+ allOf:
3143
+ - $ref: '#/components/schemas/AsyncHelperBase'
3144
+ - $ref: '#/components/schemas/ResourceResponse'
3145
+ - $ref: '#/components/schemas/IAResourceResponse'
3146
+ - type: object
3147
+ properties:
3148
+ _templateId:
3149
+ type: string
3150
+ format: objectId
3151
+ readOnly: true
3152
+ x-celigo-refModel: templates
3153
+ description: Template this async helper was created from.
3154
+ examples:
3155
+ - 5c6c135fc802b3146e12eecf
3156
+ _sourceId:
3157
+ type: string
3158
+ format: objectId
3159
+ readOnly: true
3160
+ description: Source resource this async helper was cloned from.
3161
+ examples:
3162
+ - 6256b8c0cddb8a1ba55198d5
3163
+ x-celigo-ai-guidance:
3164
+ - |-
3165
+ An async helper bundles the polling configuration for an asynchronous
3166
+ external API plus references to the status export (polled to check
3167
+ progress) and the result export (fetches the final payload). It is
3168
+ referenced from an export or import via `http._asyncHelperId`.
3169
+ AsyncHelperRequest:
3170
+ type: object
3171
+ description: |
3172
+ Request body for creating or replacing an async helper resource. All
3173
+ required fields must be present for both POST (create) and PUT (replace)
3174
+ operations.
3175
+ required:
3176
+ - name
3177
+ - http
3178
+ allOf:
3179
+ - $ref: '#/components/schemas/AsyncHelperBase'
3180
+ x-celigo-ai-guidance:
3181
+ - |-
3182
+ `name` and the status configuration (`http.status._exportId` and
3183
+ `http.status.statusPath`) are the required fields. The status and result
3184
+ exports referenced here must be ordinary exports that do not themselves
3185
+ reference an async helper.
3186
+ Error:
3187
+ type: object
3188
+ description: Standard error response envelope returned by integrator.io APIs.
3189
+ properties:
3190
+ errors:
3191
+ type: array
3192
+ description: List of errors that occurred while processing the request.
3193
+ items:
3194
+ type: object
3195
+ properties:
3196
+ code:
3197
+ oneOf:
3198
+ - type: string
3199
+ - type: integer
3200
+ description: |-
3201
+ Machine-readable error code. Usually a string like
3202
+ `invalid_ref`, `missing_required_field`, or `unauthorized`;
3203
+ may be an **integer** when the error mirrors an upstream HTTP
3204
+ status (e.g. `500`) — most commonly returned by connection-ping
3205
+ and adaptor-proxy responses.
3206
+ message:
3207
+ type: string
3208
+ description: Human-readable description of the error.
3209
+ field:
3210
+ type: string
3211
+ description: |-
3212
+ Optional pointer to the document field that caused the error.
3213
+ Used by structural validation errors (`missing_required_field`,
3214
+ `invalid_ref`) to indicate which field is at fault
3215
+ (e.g. `_id`, `type`, `http.baseURI`).
3216
+ source:
3217
+ type: string
3218
+ description: |-
3219
+ Optional origin layer for the error — e.g. `application` when
3220
+ the error came from the remote system the adaptor called,
3221
+ `connector` when the adaptor itself rejected the request.
3222
+ required:
3223
+ - message
3224
+ required:
3225
+ - errors
3226
+ DependencyEntry:
3227
+ type: object
3228
+ description: A single resource that depends on the queried resource.
3229
+ properties:
3230
+ id:
3231
+ type: string
3232
+ description: Unique identifier of the dependent resource.
3233
+ examples:
3234
+ - 61f92026dd053843b5d72350
3235
+ name:
3236
+ type: string
3237
+ description: Display name of the dependent resource.
3238
+ examples:
3239
+ - Import Orders to NetSuite
3240
+ paths:
3241
+ type: array
3242
+ description: |-
3243
+ Dot-notation paths within the dependent resource that reference
3244
+ the target resource. `[*]` denotes array elements.
3245
+ items:
3246
+ type: string
3247
+ examples:
3248
+ - - hooks.preSavePage._scriptId
3249
+ accessLevel:
3250
+ type: string
3251
+ description: The caller's access level on the dependent resource.
3252
+ examples:
3253
+ - manage
3254
+ dependencyIds:
3255
+ type: object
3256
+ description: |-
3257
+ Map of resource types to arrays of IDs that this dependent
3258
+ resource references on the target. Keys are singular or plural
3259
+ resource type strings; values are arrays of ID strings.
3260
+ additionalProperties:
3261
+ type: array
3262
+ items:
3263
+ type: string
3264
+ example:
3265
+ script:
3266
+ - 64ff4b21612a134bd2f45531
3267
+ required:
3268
+ - id
3269
+ - name
3270
+ - paths
3271
+ - accessLevel
3272
+ - dependencyIds
3273
+ DependencyResponse:
3274
+ type: object
3275
+ description: |
3276
+ Map of dependent-resource types to arrays of dependency entries.
3277
+ Keys are plural resource type strings (e.g. `flows`, `imports`,
3278
+ `connections`). An empty object `{}` means no dependents.
3279
+ additionalProperties:
3280
+ type: array
3281
+ items:
3282
+ $ref: '#/components/schemas/DependencyEntry'
3283
+ example:
3284
+ exports:
3285
+ - id: 64ff4b21612a134bd2f45534
3286
+ name: Bank FTP Export
3287
+ paths:
3288
+ - hooks.preSavePage._scriptId
3289
+ accessLevel: manage
3290
+ dependencyIds:
3291
+ script:
3292
+ - 64ff4b21612a134bd2f45531
3293
+ flows:
3294
+ - id: 64ff4b22612a134bd2f45538
3295
+ name: CAMT-053 to Celigo CAM Format
3296
+ paths:
3297
+ - pageGenerators[*]._exportId
3298
+ accessLevel: manage
3299
+ dependencyIds:
3300
+ export:
3301
+ - 64ff4b21612a134bd2f45534
3302
+ responses:
3303
+ 401-unauthorized:
3304
+ description: |-
3305
+ Unauthorized. The request lacks a valid bearer token, or the provided token
3306
+ failed to authenticate.
3307
+
3308
+ Note: the 401 response is produced by the auth middleware **before** the
3309
+ request reaches the endpoint handler, so it does **not** follow the
3310
+ standard `{errors: [...]}` envelope. Instead the body is a bare
3311
+ `{message: string}` object with no `code`, no `errors` array. Callers
3312
+ handling 401s should key off the HTTP status and the `message` string,
3313
+ not try to destructure an `errors[]`.
3314
+ content:
3315
+ application/json:
3316
+ schema:
3317
+ type: object
3318
+ properties:
3319
+ message:
3320
+ type: string
3321
+ description: |-
3322
+ Human-readable description of the auth failure. Known values:
3323
+ - `"Unauthorized"` — no `Authorization` header on the request.
3324
+ - `"Bearer Authentication Failed"` — header present but token
3325
+ is invalid, revoked, or expired.
3326
+ required:
3327
+ - message
3328
+ examples:
3329
+ missing_token:
3330
+ summary: No Authorization header sent
3331
+ value:
3332
+ message: Unauthorized
3333
+ invalid_token:
3334
+ summary: Bearer token invalid or revoked
3335
+ value:
3336
+ message: Bearer Authentication Failed
3337
+ 400-bad-request:
3338
+ description: |
3339
+ Bad request. The server could not understand the request because of malformed syntax or invalid parameters.
3340
+ content:
3341
+ application/json:
3342
+ schema:
3343
+ $ref: '#/components/schemas/Error'
3344
+ examples:
3345
+ default:
3346
+ value:
3347
+ errors:
3348
+ - code: invalid_request
3349
+ message: The request body failed validation.
3350
+ 422-unprocessable-entity:
3351
+ description: |
3352
+ Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.
3353
+ content:
3354
+ application/json:
3355
+ schema:
3356
+ $ref: '#/components/schemas/Error'
3357
+ examples:
3358
+ default:
3359
+ value:
3360
+ errors:
3361
+ - code: unprocessable_entity
3362
+ message: The request could not be processed due to a semantic error.
3363
+ 404-not-found:
3364
+ description: |
3365
+ Not found. The requested resource does not exist or is not visible to the caller.
3366
+ content:
3367
+ application/json:
3368
+ schema:
3369
+ $ref: '#/components/schemas/Error'
3370
+ examples:
3371
+ default:
3372
+ value:
3373
+ errors:
3374
+ - code: not_found
3375
+ message: The requested resource was not found.
3376
+ 422-dependency-conflict:
3377
+ description: |-
3378
+ The resource has dependents that must be deleted first. Each entry
3379
+ in the `errors` array names one blocking resource.
3380
+ content:
3381
+ application/json:
3382
+ schema:
3383
+ $ref: '#/components/schemas/Error'
3384
+ examples:
3385
+ default:
3386
+ value:
3387
+ errors:
3388
+ - code: dependencies_not_deleted
3389
+ message: export 6902d88c10b42b2eaac9b2a1 must be deleted before you can delete connection 6398ddf316be761fb16a6523
3390
+ x-enable-proxy: true
3391
+ x-internal: false