@celigo/api-specs 0.2.38 → 0.2.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/topic.yml ADDED
@@ -0,0 +1,1783 @@
1
+ openapi: 3.2.0
2
+ info:
3
+ version: 1.0.0
4
+ title: Topics
5
+ description: Manage Event Streams topics — durable event streams that buffer published messages for topic exports.
6
+ x-celigo-ai-guidance:
7
+ - |-
8
+ API for managing Event Streams topics: account-level, durable message channels. A topic import
9
+ step (or POST /v1/topics/{_id}/publish) appends messages; each subscribed topic export step reads
10
+ them independently; messages expire after retentionMs. Topics are registered on integrations like
11
+ lookup caches (Integration._registeredTopicIds) through the /v1/integrations/{_id}/topics routes.
12
+ servers:
13
+ - url: https://api.integrator.io
14
+ description: Production (US / default region)
15
+ - url: https://api.eu.integrator.io
16
+ description: Production (EU region)
17
+ - url: https://api.au.integrator.io
18
+ description: Production (AU region)
19
+ - url: https://api.ca.integrator.io
20
+ description: Production (CA region)
21
+ security:
22
+ - bearerAuth: []
23
+ tags:
24
+ - name: Topics
25
+ description: |-
26
+ Topics are durable event streams that decouple the flows that publish messages from the flows
27
+ that consume them: a topic import step (or `POST /v1/topics/{_id}/publish`) appends messages, each
28
+ subscribed topic export step reads them at its own pace, and messages expire after the topic's
29
+ `retentionMs`. Event Streams is a licensed feature: listing topics works on every account, but
30
+ creating or updating a topic and every message operation require the `topics` entitlement —
31
+ without it they fail with `topics_subscription_required` (a 422 validation error on topic writes,
32
+ 403 on the message endpoints) — and the license also caps how many topics the account may hold
33
+ (`topicsAllowed`) and the longest retention allowed (`retentionCeilingDays`).
34
+
35
+ ## Topic schema
36
+
37
+ {% openapi-schemas spec="topic" schemas="Topic" grouped="true" %}
38
+ paths:
39
+ /v1/topics:
40
+ get:
41
+ x-internal: false
42
+ summary: List topics
43
+ description: |-
44
+ Returns the account's topics sorted by `name` ascending (ties by most recently modified first).
45
+ Topics in the recycle bin are not included. `include` and `exclude` projections are not
46
+ supported on this resource.
47
+ operationId: listTopics
48
+ tags:
49
+ - Topics
50
+ parameters:
51
+ - name: limit
52
+ in: query
53
+ required: false
54
+ description: Maximum number of topics to return per page. Omit to return all topics.
55
+ schema:
56
+ type: integer
57
+ minimum: 1
58
+ examples:
59
+ - 100
60
+ - name: sort_by
61
+ in: query
62
+ required: false
63
+ description: Field to sort by. Any other field name is rejected.
64
+ schema:
65
+ type: string
66
+ enum:
67
+ - name
68
+ - lastModified
69
+ x-enumDescriptions:
70
+ name: Alphabetical by display name (the default)
71
+ lastModified: Most recently modified first
72
+ examples:
73
+ - lastModified
74
+ - $ref: '#/components/parameters/After'
75
+ - name: externalId
76
+ in: query
77
+ required: false
78
+ description: |-
79
+ Return only topics whose `externalId` equals this value. Repeat the parameter to match any of
80
+ several values.
81
+ schema:
82
+ type: string
83
+ examples:
84
+ - erp-orders-created
85
+ responses:
86
+ '200':
87
+ description: Array of topics.
88
+ headers:
89
+ Link:
90
+ description: |-
91
+ RFC 5988 pagination link. Includes `<...>; rel="next"` with an `after` cursor when more
92
+ topics remain; absent on the final page.
93
+ schema:
94
+ type: string
95
+ content:
96
+ application/json:
97
+ schema:
98
+ type: array
99
+ items:
100
+ $ref: '#/components/schemas/Topic'
101
+ examples:
102
+ default:
103
+ value:
104
+ - _id: 6aab2870265e1cf39fcbee4d
105
+ _userId: 624cb0346309dc3a543733a2
106
+ name: orders.created
107
+ description: One event per order placed. Consumed by the fulfillment and finance flows.
108
+ retentionMs: 604800000
109
+ createdAt: '2026-09-16T23:38:24.578Z'
110
+ lastModified: '2026-09-16T23:38:24.578Z'
111
+ - _id: 6aab2870bb44c84f7b77e9f7
112
+ _userId: 624cb0346309dc3a543733a2
113
+ name: orders.fulfillment
114
+ description: Pick, pack and ship instructions emitted by the fulfillment flow, one per order.
115
+ retentionMs: 3600000
116
+ externalId: wms-fulfillment
117
+ createdAt: '2026-09-16T23:38:24.885Z'
118
+ lastModified: '2026-09-16T23:38:24.885Z'
119
+ '204':
120
+ description: No topics match — the account has none, or none carry the requested `externalId`.
121
+ '400':
122
+ description: |-
123
+ `after` is not a cursor issued by this endpoint, or `sort_by` names an unsupported field.
124
+ Error code: `invalid_query_param`.
125
+ content:
126
+ application/json:
127
+ schema:
128
+ $ref: '#/components/schemas/Error'
129
+ examples:
130
+ bad_sort:
131
+ value:
132
+ errors:
133
+ - code: invalid_query_param
134
+ message: The query parameter "sort_by" has invalid value.
135
+ '401':
136
+ $ref: '#/components/responses/401-unauthorized'
137
+ '422':
138
+ description: '`limit` is not a positive integer. Error code: `invalid_query_param`.'
139
+ content:
140
+ application/json:
141
+ schema:
142
+ $ref: '#/components/schemas/Error'
143
+ examples:
144
+ bad_limit:
145
+ value:
146
+ errors:
147
+ - code: invalid_query_param
148
+ message: Invalid limit sent in request.
149
+ post:
150
+ x-internal: false
151
+ summary: Create a topic
152
+ description: |-
153
+ Creates a topic and counts it against the license's `topics.topicsAllowed` quota. The stream
154
+ itself is provisioned lazily on the first publish, so a new topic reports no messages until
155
+ something is published to it. Pass `__integrationIds` to register the topic on integrations in the
156
+ same call; otherwise register it later with the `/v1/integrations/{_id}/topics/…/register`
157
+ operations so flows in those integrations can bind to it.
158
+ operationId: createTopic
159
+ tags:
160
+ - Topics
161
+ x-celigo-ai-guidance:
162
+ - |-
163
+ The account quota is enforced only on create and on restore from the recycle bin: when the
164
+ account already holds `topics.topicsAllowed` active topics the call fails with 422
165
+ `topics_limit_exceeded`. Topics sitting in the recycle bin do not count — delete or purge an
166
+ unused topic first.
167
+ requestBody:
168
+ required: true
169
+ content:
170
+ application/json:
171
+ schema:
172
+ $ref: '#/components/schemas/Request'
173
+ examples:
174
+ minimal:
175
+ summary: Name only — seven-day retention
176
+ value:
177
+ name: orders.created
178
+ full:
179
+ summary: Custom retention, external key, registered on one integration
180
+ value:
181
+ name: orders.fulfillment
182
+ description: Pick, pack and ship instructions emitted by the fulfillment flow, one per order.
183
+ retentionMs: 3600000
184
+ externalId: wms-fulfillment
185
+ __integrationIds:
186
+ - 6ab1f4a138d7733b45998d99
187
+ responses:
188
+ '201':
189
+ description: |-
190
+ Created topic. When `__integrationIds` was sent and some registrations failed, the body also
191
+ carries `__failedIntegrationRegistrations`, an array of `{_integrationId, error}` entries — the
192
+ topic itself was still created.
193
+ content:
194
+ application/json:
195
+ schema:
196
+ $ref: '#/components/schemas/Topic'
197
+ examples:
198
+ created:
199
+ value:
200
+ _id: 6aab2870bb44c84f7b77e9f7
201
+ _userId: 624cb0346309dc3a543733a2
202
+ name: orders.fulfillment
203
+ description: Pick, pack and ship instructions emitted by the fulfillment flow, one per order.
204
+ retentionMs: 3600000
205
+ externalId: wms-fulfillment
206
+ createdAt: '2026-09-16T23:38:24.885Z'
207
+ lastModified: '2026-09-16T23:38:24.885Z'
208
+ '401':
209
+ $ref: '#/components/responses/401-unauthorized'
210
+ '404':
211
+ description: An id in `__integrationIds` does not belong to an integration in this account. Nothing is created.
212
+ content:
213
+ application/json:
214
+ schema:
215
+ $ref: '#/components/schemas/Error'
216
+ examples:
217
+ unknown_integration:
218
+ value:
219
+ errors:
220
+ - field: _id
221
+ code: invalid_ref
222
+ message: unable to find integration for the given id.
223
+ '422':
224
+ description: |-
225
+ Validation failed. `retentionMs` outside its bounds (`min`, `max`), above the license ceiling
226
+ (`topics_retention_exceeds_entitlement`), or not numeric (`invalid_field`); `name` longer than
227
+ 200 characters (`maxlength`); `description` or `externalId` over their size limits
228
+ (`size_limit_exceeded`); the account at its topic quota (`topics_limit_exceeded`); or a
229
+ malformed `__integrationIds` (`invalid_request`, `invalid_ref`).
230
+ content:
231
+ application/json:
232
+ schema:
233
+ $ref: '#/components/schemas/Error'
234
+ examples:
235
+ retention_above_ceiling:
236
+ value:
237
+ errors:
238
+ - field: _id
239
+ code: topics_retention_exceeds_entitlement
240
+ message: The requested retention exceeds your account's topic retention ceiling of 90 days. Contact your account manager to raise it.
241
+ - field: retentionMs
242
+ code: max
243
+ message: Path `retentionMs` (7776000001) is more than maximum allowed value (7776000000).
244
+ quota_reached:
245
+ value:
246
+ errors:
247
+ - field: _id
248
+ code: topics_limit_exceeded
249
+ message: You have reached your topic limit of 20. Delete an unused topic or contact your account manager to raise the limit.
250
+ duplicate_integration_ids:
251
+ value:
252
+ errors:
253
+ - code: invalid_request
254
+ message: __integrationIds must not contain duplicate integration IDs.
255
+ /v1/topics/{_id}:
256
+ get:
257
+ x-internal: false
258
+ summary: Get a topic
259
+ description: |-
260
+ Returns a topic's configuration. Read its messages with `GET /v1/topics/{_id}/messages`. A topic
261
+ in the recycle bin is reported as not found; restore it first.
262
+ operationId: getTopicById
263
+ tags:
264
+ - Topics
265
+ parameters:
266
+ - name: _id
267
+ in: path
268
+ required: true
269
+ description: Topic id.
270
+ schema:
271
+ type: string
272
+ format: objectId
273
+ x-celigo-refModel: topics
274
+ examples:
275
+ - 6aab2870265e1cf39fcbee4d
276
+ responses:
277
+ '200':
278
+ description: Topic object.
279
+ content:
280
+ application/json:
281
+ schema:
282
+ $ref: '#/components/schemas/Topic'
283
+ examples:
284
+ default:
285
+ value:
286
+ _id: 6aab2870265e1cf39fcbee4d
287
+ _userId: 624cb0346309dc3a543733a2
288
+ name: orders.created
289
+ description: One event per order placed. Consumed by the fulfillment and finance flows.
290
+ retentionMs: 604800000
291
+ createdAt: '2026-09-16T23:38:24.578Z'
292
+ lastModified: '2026-09-16T23:38:24.578Z'
293
+ '400':
294
+ description: '`_id` is not a 24-character hexadecimal ObjectId. Error code: `invalid_ref`.'
295
+ content:
296
+ application/json:
297
+ schema:
298
+ $ref: '#/components/schemas/Error'
299
+ examples:
300
+ malformed_id:
301
+ value:
302
+ errors:
303
+ - code: invalid_ref
304
+ message: Please provide a valid _id.
305
+ '401':
306
+ $ref: '#/components/responses/401-unauthorized'
307
+ '404':
308
+ description: |-
309
+ No active topic has this id. A topic in the recycle bin answers with the message "You are
310
+ trying to access a Topic that is already in the Recycle Bin…"; restore it with
311
+ `POST /v1/recycleBinTTL/topics/{_id}`.
312
+ content:
313
+ application/json:
314
+ schema:
315
+ $ref: '#/components/schemas/Error'
316
+ examples:
317
+ not_found:
318
+ value:
319
+ errors:
320
+ - code: invalid_ref
321
+ message: Topic not found.
322
+ in_recycle_bin:
323
+ value:
324
+ errors:
325
+ - code: invalid_ref
326
+ message: You are trying to access a Topic that is already in the Recycle Bin. Please restore it from the Recycle Bin and try your request again.
327
+ put:
328
+ x-internal: false
329
+ summary: Update a topic
330
+ description: |-
331
+ Replaces the topic's writable fields with the request body. Fields left out are cleared, not
332
+ kept: `description` and `externalId` are removed and `retentionMs` reverts to seven days — send
333
+ the full document, or use PATCH to change `name` or `description` alone. Read-only fields in the
334
+ body are ignored. Changing `retentionMs` re-configures the stream's retention window;
335
+ the topic id and its subscriptions are unaffected.
336
+ operationId: updateTopic
337
+ tags:
338
+ - Topics
339
+ parameters:
340
+ - name: _id
341
+ in: path
342
+ required: true
343
+ description: Topic id.
344
+ schema:
345
+ type: string
346
+ format: objectId
347
+ x-celigo-refModel: topics
348
+ examples:
349
+ - 6aab2870265e1cf39fcbee4d
350
+ requestBody:
351
+ required: true
352
+ content:
353
+ application/json:
354
+ schema:
355
+ $ref: '#/components/schemas/Request'
356
+ examples:
357
+ shorten_retention:
358
+ summary: Shorten retention to one day
359
+ value:
360
+ name: orders.created
361
+ description: One event per order placed. Consumed by the fulfillment and finance flows.
362
+ retentionMs: 86400000
363
+ responses:
364
+ '200':
365
+ description: Updated topic.
366
+ content:
367
+ application/json:
368
+ schema:
369
+ $ref: '#/components/schemas/Topic'
370
+ examples:
371
+ updated:
372
+ value:
373
+ _id: 6aab2870265e1cf39fcbee4d
374
+ _userId: 624cb0346309dc3a543733a2
375
+ name: orders.created
376
+ description: One event per order placed. Consumed by the fulfillment and finance flows.
377
+ retentionMs: 86400000
378
+ createdAt: '2026-09-16T23:38:24.578Z'
379
+ lastModified: '2026-09-22T02:51:12.733Z'
380
+ '401':
381
+ $ref: '#/components/responses/401-unauthorized'
382
+ '404':
383
+ $ref: '#/components/responses/404-not-found'
384
+ '422':
385
+ description: |-
386
+ Validation failed — the same codes as on create: `min`, `max`,
387
+ `topics_retention_exceeds_entitlement`, `invalid_field` for `retentionMs`; `maxlength` for
388
+ `name`; `size_limit_exceeded` for `description` or `externalId`.
389
+ content:
390
+ application/json:
391
+ schema:
392
+ $ref: '#/components/schemas/Error'
393
+ examples:
394
+ retention_too_short:
395
+ value:
396
+ errors:
397
+ - field: retentionMs
398
+ code: min
399
+ message: Path `retentionMs` (3599999) is less than minimum allowed value (3600000).
400
+ patch:
401
+ x-internal: false
402
+ summary: Patch a topic
403
+ description: |-
404
+ Applies a JSON Patch document (RFC 6902) to the topic. Only `/name` and `/description` are
405
+ patchable; every other path — including `/retentionMs` and `/externalId` — is rejected, so use
406
+ PUT to change those. Unlike PUT, fields not named in the patch are left untouched.
407
+ operationId: patchTopic
408
+ tags:
409
+ - Topics
410
+ parameters:
411
+ - name: _id
412
+ in: path
413
+ required: true
414
+ description: Topic id.
415
+ schema:
416
+ type: string
417
+ format: objectId
418
+ x-celigo-refModel: topics
419
+ examples:
420
+ - 6aab2870265e1cf39fcbee4d
421
+ requestBody:
422
+ required: true
423
+ content:
424
+ application/json:
425
+ schema:
426
+ $ref: '#/components/schemas/JsonPatchRequest'
427
+ examples:
428
+ rename:
429
+ summary: Rename and clear the description
430
+ value:
431
+ - op: replace
432
+ path: /name
433
+ value: orders.created.v2
434
+ - op: remove
435
+ path: /description
436
+ responses:
437
+ '204':
438
+ description: Topic patched. No body returned.
439
+ '401':
440
+ $ref: '#/components/responses/401-unauthorized'
441
+ '404':
442
+ $ref: '#/components/responses/404-not-found'
443
+ '422':
444
+ description: |-
445
+ A path other than `/name` or `/description` was patched ("… is not a whitelisted property"),
446
+ or the new value failed validation (for example `maxlength` on `/name`).
447
+ content:
448
+ application/json:
449
+ schema:
450
+ $ref: '#/components/schemas/Error'
451
+ examples:
452
+ not_whitelisted:
453
+ value:
454
+ errors:
455
+ - message: /retentionMs is not a whitelisted property
456
+ delete:
457
+ x-internal: false
458
+ summary: Delete a topic
459
+ description: |-
460
+ Moves the topic to the recycle bin, where it is kept for 30 days before being purged, and removes
461
+ it from `_registeredTopicIds` on every integration that had it registered; restoring it does not
462
+ re-register it. Its retained messages are kept and become readable again if the topic is
463
+ restored, and are gone for good once the topic is purged. Deletion is refused while any export or
464
+ import still binds to the topic through `topic._topicId`, or a flow still contains such a step —
465
+ delete or repoint those first, and purge them from the recycle bin before purging the topic.
466
+ operationId: deleteTopic
467
+ tags:
468
+ - Topics
469
+ parameters:
470
+ - name: _id
471
+ in: path
472
+ required: true
473
+ description: Topic id.
474
+ schema:
475
+ type: string
476
+ format: objectId
477
+ x-celigo-refModel: topics
478
+ examples:
479
+ - 6aab2870265e1cf39fcbee4d
480
+ responses:
481
+ '204':
482
+ description: Topic moved to the recycle bin.
483
+ '401':
484
+ $ref: '#/components/responses/401-unauthorized'
485
+ '404':
486
+ $ref: '#/components/responses/404-not-found'
487
+ '422':
488
+ description: An export, import, or flow still references the topic. Error code `dependencies_not_deleted`, one entry per blocking resource.
489
+ content:
490
+ application/json:
491
+ schema:
492
+ $ref: '#/components/schemas/Error'
493
+ examples:
494
+ listener_still_bound:
495
+ value:
496
+ errors:
497
+ - code: dependencies_not_deleted
498
+ message: export 6ab1f5b671fc8127d374d4ed must be deleted before you can delete topic 6aab2870265e1cf39fcbee4d
499
+ /v1/topics/{_id}/messages:
500
+ get:
501
+ x-internal: false
502
+ summary: List retained messages
503
+ description: |-
504
+ Reads the messages currently retained on a topic, oldest first, without affecting any
505
+ listener's read position — use it to inspect what producers are publishing or to confirm a
506
+ purge. Pages are cursor-based: follow `nextPageURL` until it is absent. Query parameters other
507
+ than the four below are ignored.
508
+ operationId: listTopicMessages
509
+ tags:
510
+ - Topics
511
+ parameters:
512
+ - name: _id
513
+ in: path
514
+ required: true
515
+ description: Topic id.
516
+ schema:
517
+ type: string
518
+ format: objectId
519
+ x-celigo-refModel: topics
520
+ examples:
521
+ - 6aab2870265e1cf39fcbee4d
522
+ - name: limit
523
+ in: query
524
+ required: false
525
+ description: Maximum number of messages per page.
526
+ schema:
527
+ type: integer
528
+ minimum: 1
529
+ maximum: 100
530
+ default: 50
531
+ examples:
532
+ - 20
533
+ - name: afterOffset
534
+ in: query
535
+ required: false
536
+ description: |-
537
+ Continuation cursor from the previous page's `nextPageURL`; returns messages after that
538
+ position. Take it from `nextPageURL` rather than computing it.
539
+ schema:
540
+ type: string
541
+ examples:
542
+ - '49'
543
+ - name: time_gt
544
+ in: query
545
+ required: false
546
+ description: Only messages published strictly after this time, as Unix epoch milliseconds.
547
+ schema:
548
+ type: integer
549
+ format: int64
550
+ examples:
551
+ - 1790047477000
552
+ - name: time_lte
553
+ in: query
554
+ required: false
555
+ description: Only messages published at or before this time, as Unix epoch milliseconds.
556
+ schema:
557
+ type: integer
558
+ format: int64
559
+ examples:
560
+ - 1790047500000
561
+ responses:
562
+ '200':
563
+ description: One page of messages. `messages` is empty when nothing is retained in the requested window.
564
+ content:
565
+ application/json:
566
+ schema:
567
+ $ref: '#/components/schemas/TopicMessagesResponse'
568
+ examples:
569
+ page:
570
+ summary: First of several pages
571
+ value:
572
+ messages:
573
+ - timestamp: '2026-09-22T03:24:35.992Z'
574
+ payload:
575
+ orderId: SO-1001
576
+ total: 42.5
577
+ - timestamp: '2026-09-22T03:24:35.992Z'
578
+ payload:
579
+ orderId: SO-1002
580
+ total: 18
581
+ nextPageURL: /v1/topics/6aab2870265e1cf39fcbee4d/messages?limit=2&afterOffset=1
582
+ empty:
583
+ summary: Nothing retained
584
+ value:
585
+ messages: []
586
+ '400':
587
+ description: |-
588
+ A query parameter is malformed: `limit` outside 1–100 (`invalid_limit`), `time_gt` or
589
+ `time_lte` not epoch milliseconds (`invalid_time_gt`, `invalid_time_lte`), or `afterOffset`
590
+ not a cursor issued by this endpoint (`invalid_after_offset`).
591
+ content:
592
+ application/json:
593
+ schema:
594
+ $ref: '#/components/schemas/Error'
595
+ examples:
596
+ bad_limit:
597
+ value:
598
+ errors:
599
+ - code: invalid_limit
600
+ message: limit must be an integer between 1 and 100
601
+ source: internal
602
+ bad_time:
603
+ value:
604
+ errors:
605
+ - code: invalid_time_gt
606
+ message: time_gt must be a Unix timestamp in milliseconds
607
+ source: internal
608
+ '401':
609
+ $ref: '#/components/responses/401-unauthorized'
610
+ '404':
611
+ $ref: '#/components/responses/404-not-found'
612
+ delete:
613
+ x-internal: false
614
+ summary: Purge retained messages
615
+ description: |-
616
+ Removes every retained message from the topic while keeping the topic, its retention setting,
617
+ and its subscriptions; the purge cannot be undone. Records an audit entry with `event: purge`
618
+ and `fieldChanges[0].fieldPath: messages`. To remove the topic itself, use
619
+ `DELETE /v1/topics/{_id}`.
620
+ operationId: purgeTopicMessages
621
+ tags:
622
+ - Topics
623
+ parameters:
624
+ - name: _id
625
+ in: path
626
+ required: true
627
+ description: Topic id.
628
+ schema:
629
+ type: string
630
+ format: objectId
631
+ x-celigo-refModel: topics
632
+ examples:
633
+ - 6aab2870265e1cf39fcbee4d
634
+ responses:
635
+ '200':
636
+ description: Purge result.
637
+ content:
638
+ application/json:
639
+ schema:
640
+ $ref: '#/components/schemas/PurgeMessagesResponse'
641
+ examples:
642
+ purged:
643
+ value:
644
+ deleted: true
645
+ nothing_to_purge:
646
+ value:
647
+ deleted: false
648
+ '401':
649
+ $ref: '#/components/responses/401-unauthorized'
650
+ '404':
651
+ $ref: '#/components/responses/404-not-found'
652
+ /v1/topics/{_id}/publish:
653
+ post:
654
+ x-internal: false
655
+ summary: Publish messages to a topic
656
+ description: |-
657
+ Appends messages to the topic in the order given, so every subscribed topic export receives them
658
+ on its next read. The first publish to a new topic provisions its stream, which can take a few
659
+ seconds longer than later calls. Oversized messages are rejected individually while the rest of
660
+ the batch is still published — always check `responses[].statusCode`.
661
+ operationId: publishTopicMessages
662
+ tags:
663
+ - Topics
664
+ parameters:
665
+ - name: _id
666
+ in: path
667
+ required: true
668
+ description: Topic id.
669
+ schema:
670
+ type: string
671
+ format: objectId
672
+ x-celigo-refModel: topics
673
+ examples:
674
+ - 6aab2870265e1cf39fcbee4d
675
+ requestBody:
676
+ required: true
677
+ content:
678
+ application/json:
679
+ schema:
680
+ $ref: '#/components/schemas/PublishRequest'
681
+ examples:
682
+ two_orders:
683
+ value:
684
+ messages:
685
+ - orderId: SO-1001
686
+ total: 42.5
687
+ - orderId: SO-1002
688
+ total: 18
689
+ responses:
690
+ '200':
691
+ description: |-
692
+ Per-message results in request order. A 200 means the request was accepted, not that every
693
+ message was published.
694
+ content:
695
+ application/json:
696
+ schema:
697
+ $ref: '#/components/schemas/PublishResponse'
698
+ examples:
699
+ all_published:
700
+ value:
701
+ responses:
702
+ - statusCode: 200
703
+ _json: {}
704
+ - statusCode: 200
705
+ _json: {}
706
+ one_too_large:
707
+ summary: Second message rejected for size, first one published
708
+ value:
709
+ responses:
710
+ - statusCode: 200
711
+ _json: {}
712
+ - statusCode: 422
713
+ errors:
714
+ - code: topic_publish_event_too_large
715
+ message: Message at index 1 exceeds the maximum allowed size of 1048576 bytes.
716
+ source: resource
717
+ resolved: false
718
+ occurredAt: 1790047646930
719
+ '400':
720
+ description: '`messages` is missing or not an array. Error code: `invalid_messages`.'
721
+ content:
722
+ application/json:
723
+ schema:
724
+ $ref: '#/components/schemas/Error'
725
+ examples:
726
+ not_an_array:
727
+ value:
728
+ errors:
729
+ - code: invalid_messages
730
+ message: The "messages" field is required and must be a JSON array of objects to publish.
731
+ source: internal
732
+ '401':
733
+ $ref: '#/components/responses/401-unauthorized'
734
+ '404':
735
+ $ref: '#/components/responses/404-not-found'
736
+ /v1/topics/{_id}/exports/{_exportId}/offsets:
737
+ get:
738
+ x-internal: false
739
+ summary: Get a listener's read position
740
+ description: |-
741
+ Reports how far a topic export (listener) has read on this topic — where its next run resumes.
742
+ Use it to check whether a listener is keeping up or has never run. The export must belong to the
743
+ account but need not subscribe to this topic; an export that does not simply has no cursor.
744
+ operationId: getTopicExportOffsets
745
+ tags:
746
+ - Topics
747
+ parameters:
748
+ - name: _id
749
+ in: path
750
+ required: true
751
+ description: Topic id.
752
+ schema:
753
+ type: string
754
+ format: objectId
755
+ x-celigo-refModel: topics
756
+ examples:
757
+ - 6aab2870265e1cf39fcbee4d
758
+ - name: _exportId
759
+ in: path
760
+ required: true
761
+ description: 'Id of the topic export (`adaptorType: TopicExport`) whose position to read.'
762
+ schema:
763
+ type: string
764
+ format: objectId
765
+ x-celigo-refModel: exports
766
+ examples:
767
+ - 6ab1f5b671fc8127d374d4ed
768
+ responses:
769
+ '200':
770
+ description: Read position of the export on this topic.
771
+ content:
772
+ application/json:
773
+ schema:
774
+ $ref: '#/components/schemas/TopicExportOffsets'
775
+ examples:
776
+ consuming:
777
+ summary: Listener that has committed a position
778
+ value:
779
+ hasCursor: true
780
+ offset: 1287
781
+ never_consumed:
782
+ summary: Listener that has not read this topic yet
783
+ value:
784
+ hasCursor: false
785
+ offset: -1
786
+ '401':
787
+ $ref: '#/components/responses/401-unauthorized'
788
+ '404':
789
+ description: The topic or the export does not exist in this account.
790
+ content:
791
+ application/json:
792
+ schema:
793
+ $ref: '#/components/schemas/Error'
794
+ examples:
795
+ export_not_found:
796
+ value:
797
+ errors:
798
+ - code: invalid_ref
799
+ message: Export not found.
800
+ /v1/topics/{_id}/audit:
801
+ get:
802
+ x-internal: false
803
+ summary: Get audit log for a topic
804
+ description: |-
805
+ Returns the change history for a topic, newest first: who changed what and when, including
806
+ message purges, recycle-bin deletes and restores. Works for a topic in the recycle bin; once the
807
+ topic is purged, query `GET /v1/audit?resourceType=topic&_resourceId={_id}` instead.
808
+ operationId: getTopicAudit
809
+ tags:
810
+ - Topics
811
+ parameters:
812
+ - name: _id
813
+ in: path
814
+ description: Topic id.
815
+ required: true
816
+ schema:
817
+ type: string
818
+ format: objectId
819
+ x-celigo-refModel: topics
820
+ examples:
821
+ - 6aab2870265e1cf39fcbee4d
822
+ - name: limit
823
+ in: query
824
+ description: Maximum number of audit entries to return per page.
825
+ required: false
826
+ schema:
827
+ type: integer
828
+ minimum: 1
829
+ maximum: 1000
830
+ default: 1000
831
+ examples:
832
+ - 100
833
+ - name: after
834
+ in: query
835
+ required: false
836
+ description: |-
837
+ Opaque pagination cursor for the next page. Take it from the `after` value in the `Link`
838
+ response header's `rel="next"` URL rather than constructing it.
839
+ schema:
840
+ type: string
841
+ examples:
842
+ - W3siJGRhdGUiOiIyMDI2LTA5LTIyVDAzOjIyOjQzLjkyNVoifSwiNmFiMWY0ODM3YzRiNGU2OTlmZTg1NWI2Il0
843
+ - name: from
844
+ in: query
845
+ required: false
846
+ description: Only return entries at or after this timestamp.
847
+ schema:
848
+ type: string
849
+ format: date-time
850
+ examples:
851
+ - '2026-09-01T00:00:00.000Z'
852
+ - name: to
853
+ in: query
854
+ required: false
855
+ description: Only return entries at or before this timestamp.
856
+ schema:
857
+ type: string
858
+ format: date-time
859
+ examples:
860
+ - '2026-09-30T23:59:59.999Z'
861
+ - name: action
862
+ in: query
863
+ required: false
864
+ description: |-
865
+ Filter by the change type. Maps to the `event` field on each entry; a value outside the
866
+ platform's audit vocabulary is rejected with 422 `invalid_audit_field`.
867
+ schema:
868
+ type: string
869
+ enum:
870
+ - create
871
+ - update
872
+ - delete
873
+ - view
874
+ - restore
875
+ - purge
876
+ - signin
877
+ - signout
878
+ - purgelogs
879
+ examples:
880
+ - purge
881
+ x-enumDescriptions:
882
+ create: A resource was created.
883
+ update: A resource was modified.
884
+ delete: A resource was deleted (moved to recycle bin).
885
+ view: A resource was viewed or accessed.
886
+ restore: A resource was restored from the recycle bin.
887
+ purge: Retained messages were purged, or the resource was permanently removed from the recycle bin.
888
+ signin: A user signed in to the account.
889
+ signout: A user signed out of the account.
890
+ purgelogs: Execution logs were purged for a resource.
891
+ - name: source
892
+ in: query
893
+ required: false
894
+ description: Filter by how the change was initiated.
895
+ schema:
896
+ type: string
897
+ enum:
898
+ - ui
899
+ - api
900
+ - system
901
+ - connector
902
+ - script
903
+ - sso
904
+ examples:
905
+ - api
906
+ x-enumDescriptions:
907
+ ui: Change made through the Celigo web UI.
908
+ api: Change made via the REST API.
909
+ system: Change made automatically by the platform.
910
+ connector: Change made by an Integration App (connector) process.
911
+ script: Change made by a custom script execution.
912
+ sso: Change triggered by an SSO authentication event.
913
+ - name: _byUserId
914
+ in: query
915
+ required: false
916
+ description: Filter to changes performed by a single user.
917
+ schema:
918
+ type: string
919
+ format: objectId
920
+ x-celigo-refModel: users
921
+ examples:
922
+ - 624cb0346309dc3a543733a2
923
+ responses:
924
+ '200':
925
+ description: Array of audit entries, newest first.
926
+ headers:
927
+ Link:
928
+ description: |-
929
+ RFC 5988 pagination link. Includes `<...>; rel="next"` with an `after` cursor when more
930
+ entries exist; absent on the final page.
931
+ schema:
932
+ type: string
933
+ content:
934
+ application/json:
935
+ schema:
936
+ type: array
937
+ items:
938
+ type: object
939
+ properties:
940
+ _id:
941
+ type: string
942
+ format: objectId
943
+ description: Unique identifier for this audit entry.
944
+ examples:
945
+ - 6ab1f5ab8dc372a2b50ae31a
946
+ resourceType:
947
+ type: string
948
+ description: Always `topic` for this endpoint.
949
+ examples:
950
+ - topic
951
+ _resourceId:
952
+ type: string
953
+ format: objectId
954
+ x-celigo-refModel: topics
955
+ description: Id of the topic this entry belongs to.
956
+ examples:
957
+ - 6aab2870265e1cf39fcbee4d
958
+ event:
959
+ type: string
960
+ description: |-
961
+ Type of change. A topic's history runs create → update… → delete → restore or
962
+ purge; `purge` also records each `DELETE /v1/topics/{_id}/messages`, which is
963
+ told apart by `fieldChanges[0].fieldPath` being `messages`.
964
+ enum:
965
+ - create
966
+ - update
967
+ - delete
968
+ - restore
969
+ - purge
970
+ x-enumDescriptions:
971
+ create: Topic was created.
972
+ update: Topic was modified by PUT or PATCH.
973
+ delete: Topic was moved to the recycle bin.
974
+ restore: Topic was restored from the recycle bin.
975
+ purge: Retained messages were purged, or the topic was permanently removed from the recycle bin.
976
+ source:
977
+ type: string
978
+ description: How the change was initiated. Restores from the recycle bin are recorded as `system`.
979
+ enum:
980
+ - api
981
+ - ui
982
+ - system
983
+ x-enumDescriptions:
984
+ api: Change made via the REST API.
985
+ ui: Change made through the Celigo UI.
986
+ system: Change made by an automated platform process.
987
+ time:
988
+ type: string
989
+ format: date-time
990
+ description: Timestamp when the change occurred.
991
+ examples:
992
+ - '2026-09-22T03:27:39.894Z'
993
+ byUser:
994
+ type: object
995
+ description: User who made the change.
996
+ properties:
997
+ _id:
998
+ type: string
999
+ format: objectId
1000
+ x-celigo-refModel: users
1001
+ description: User id.
1002
+ examples:
1003
+ - 624cb0346309dc3a543733a2
1004
+ email:
1005
+ type: string
1006
+ format: email
1007
+ description: User email address.
1008
+ examples:
1009
+ - user@example.com
1010
+ name:
1011
+ type: string
1012
+ description: User display name.
1013
+ examples:
1014
+ - Jane Doe
1015
+ fieldChanges:
1016
+ type: array
1017
+ description: |-
1018
+ Fields that were modified. Empty on `create`, `delete`, and `restore`; a single
1019
+ `messages` entry without values on a message purge.
1020
+ items:
1021
+ type: object
1022
+ properties:
1023
+ fieldPath:
1024
+ type: string
1025
+ description: Dot-notation path of the changed field, or `messages` for a message purge.
1026
+ examples:
1027
+ - retentionMs
1028
+ oldValue:
1029
+ description: Previous value (absent when the field was unset).
1030
+ newValue:
1031
+ description: New value (absent when the field was cleared).
1032
+ deletedInfo:
1033
+ type: object
1034
+ description: |-
1035
+ Present on every entry once the topic has been deleted; carries the topic's name at
1036
+ the time it was deleted so purged topics stay identifiable.
1037
+ properties:
1038
+ name:
1039
+ type: string
1040
+ description: Name of the topic when it was deleted.
1041
+ examples:
1042
+ - orders.created
1043
+ examples:
1044
+ default:
1045
+ value:
1046
+ - _id: 6ab1f5ab8dc372a2b50ae31a
1047
+ resourceType: topic
1048
+ _resourceId: 6aab2870265e1cf39fcbee4d
1049
+ source: api
1050
+ event: purge
1051
+ time: '2026-09-22T03:27:39.894Z'
1052
+ byUser:
1053
+ _id: 624cb0346309dc3a543733a2
1054
+ email: user@example.com
1055
+ name: Jane Doe
1056
+ fieldChanges:
1057
+ - fieldPath: messages
1058
+ - _id: 6ab1f4837c4b4e699fe855b6
1059
+ resourceType: topic
1060
+ _resourceId: 6aab2870265e1cf39fcbee4d
1061
+ source: api
1062
+ event: update
1063
+ time: '2026-09-22T03:22:43.925Z'
1064
+ byUser:
1065
+ _id: 624cb0346309dc3a543733a2
1066
+ email: user@example.com
1067
+ name: Jane Doe
1068
+ fieldChanges:
1069
+ - fieldPath: retentionMs
1070
+ oldValue: 604800000
1071
+ newValue: 3600000
1072
+ '204':
1073
+ description: No audit entries exist for this topic.
1074
+ '400':
1075
+ description: '`limit` is not a positive integer. Error code: `invalid_query_param`.'
1076
+ content:
1077
+ application/json:
1078
+ schema:
1079
+ $ref: '#/components/schemas/Error'
1080
+ examples:
1081
+ bad_limit:
1082
+ value:
1083
+ errors:
1084
+ - code: invalid_query_param
1085
+ message: Invalid limit sent in request.
1086
+ '401':
1087
+ $ref: '#/components/responses/401-unauthorized'
1088
+ '404':
1089
+ $ref: '#/components/responses/404-not-found'
1090
+ '422':
1091
+ description: |-
1092
+ `action` or `source` is outside the audit vocabulary (`invalid_audit_field`), or `from` / `to`
1093
+ is not an ISO 8601 timestamp (`invalid_timestamp_format`).
1094
+ content:
1095
+ application/json:
1096
+ schema:
1097
+ $ref: '#/components/schemas/Error'
1098
+ examples:
1099
+ bad_action:
1100
+ value:
1101
+ errors:
1102
+ - code: invalid_audit_field
1103
+ message: bogus is not a valid audit action.
1104
+ bad_timestamp:
1105
+ value:
1106
+ errors:
1107
+ - code: invalid_timestamp_format
1108
+ message: 'Please make sure that the time provided for field: "from" is in ISO8601 time format.'
1109
+ /v1/topics/{_id}/dependencies:
1110
+ get:
1111
+ x-internal: false
1112
+ operationId: listTopicDependencies
1113
+ tags:
1114
+ - Topics
1115
+ summary: List dependencies of a topic
1116
+ description: |-
1117
+ Returns the resources that reference the topic: `exports` and `imports` bound to it through
1118
+ `topic._topicId`, `flows` that contain those steps, and `integrations` that list it in
1119
+ `_registeredTopicIds`. Exports and imports listed here block `DELETE /v1/topics/{_id}` until they
1120
+ are removed or repointed. An unknown topic id returns an empty map rather than 404.
1121
+ parameters:
1122
+ - name: _id
1123
+ in: path
1124
+ required: true
1125
+ description: Topic id.
1126
+ schema:
1127
+ type: string
1128
+ format: objectId
1129
+ x-celigo-refModel: topics
1130
+ examples:
1131
+ - 6aab2870265e1cf39fcbee4d
1132
+ responses:
1133
+ '200':
1134
+ description: |-
1135
+ Dependency map. Keys are resource-type strings; values are arrays of dependency entries.
1136
+ Returns `{}` when nothing references the topic.
1137
+ content:
1138
+ application/json:
1139
+ schema:
1140
+ $ref: '#/components/schemas/DependencyResponse'
1141
+ examples:
1142
+ listener_and_integration:
1143
+ summary: Topic with a listener export and one registration
1144
+ value:
1145
+ exports:
1146
+ - id: 6ab1f5b671fc8127d374d4ed
1147
+ name: Orders created listener
1148
+ paths:
1149
+ - topic._topicId
1150
+ accessLevel: manage
1151
+ dependencyIds:
1152
+ topic:
1153
+ - 6aab2870265e1cf39fcbee4d
1154
+ integrations:
1155
+ - id: 6ab1f4a138d7733b45998d99
1156
+ name: Order fulfillment
1157
+ paths:
1158
+ - _registeredTopicIds[*]
1159
+ accessLevel: manage
1160
+ dependencyIds:
1161
+ topic:
1162
+ - 6aab2870265e1cf39fcbee4d
1163
+ empty:
1164
+ summary: Nothing references the topic
1165
+ value: {}
1166
+ '401':
1167
+ $ref: '#/components/responses/401-unauthorized'
1168
+ components:
1169
+ securitySchemes:
1170
+ bearerAuth:
1171
+ type: http
1172
+ scheme: bearer
1173
+ parameters:
1174
+ After:
1175
+ name: after
1176
+ in: query
1177
+ required: false
1178
+ description: |-
1179
+ Opaque cursor for forward pagination. Pass the value from the `Link`
1180
+ response header (`rel="next"`) to fetch the next page.
1181
+ schema:
1182
+ type: string
1183
+ schemas:
1184
+ Topic:
1185
+ type: object
1186
+ description: Topic as returned by the API.
1187
+ required:
1188
+ - _id
1189
+ - _userId
1190
+ - name
1191
+ - retentionMs
1192
+ - createdAt
1193
+ - lastModified
1194
+ properties:
1195
+ _id:
1196
+ type: string
1197
+ format: objectId
1198
+ readOnly: true
1199
+ x-celigo-refModel: topics
1200
+ description: |-
1201
+ Unique identifier for the topic. Topic exports and imports bind to it through
1202
+ `topic._topicId`, and it is the `_topicId` used by every `/v1/topics/{_id}/…` endpoint.
1203
+ examples:
1204
+ - 6ab1f44d7c4b4e699fe84b0a
1205
+ _userId:
1206
+ type: string
1207
+ format: objectId
1208
+ readOnly: true
1209
+ x-celigo-refModel: users
1210
+ description: Account owner whose license and topic quota the topic counts against.
1211
+ examples:
1212
+ - 624cb0346309dc3a543733a2
1213
+ name:
1214
+ type: string
1215
+ maxLength: 200
1216
+ description: |-
1217
+ Display name shown in the UI. Empty when the topic was created without one; not unique, so
1218
+ use `_id` to identify a topic.
1219
+ examples:
1220
+ - orders.created
1221
+ description:
1222
+ type:
1223
+ - string
1224
+ - 'null'
1225
+ maxLength: 5120
1226
+ description: What the topic carries and which flows consume it. Absent or null when never set.
1227
+ examples:
1228
+ - One event per order placed. Consumed by the fulfillment and finance flows.
1229
+ retentionMs:
1230
+ type: integer
1231
+ minimum: 3600000
1232
+ maximum: 7776000000
1233
+ default: 604800000
1234
+ description: |-
1235
+ How long a published message stays readable, in milliseconds, before it is dropped from the
1236
+ stream whether or not a listener consumed it. The week-long default applies when the topic was
1237
+ created without one.
1238
+ examples:
1239
+ - 604800000
1240
+ - 3600000
1241
+ externalId:
1242
+ type: string
1243
+ maxLength: 1024
1244
+ description: |-
1245
+ Caller-chosen key set at creation or update. Present only when it was supplied; filter the
1246
+ list with `GET /v1/topics?externalId=…`.
1247
+ examples:
1248
+ - erp-orders-created
1249
+ _integrationId:
1250
+ type: string
1251
+ format: objectId
1252
+ readOnly: true
1253
+ x-celigo-refModel: integrations
1254
+ description: |-
1255
+ Integration App installation that owns the topic. Present only on topics created by an
1256
+ Integration App; absent on topics you create directly, which are shared across integrations
1257
+ through `_registeredTopicIds` instead.
1258
+ examples:
1259
+ - 6ab1f4a138d7733b45998d99
1260
+ _connectorId:
1261
+ type: string
1262
+ format: objectId
1263
+ readOnly: true
1264
+ x-celigo-refModel: connectors
1265
+ description: |-
1266
+ Integration App (connector) that installed the topic. Present only on connector-managed
1267
+ topics, which the connector — not the user — registers and deregisters.
1268
+ examples:
1269
+ - 5b3c8f9a2e1d4c0011223344
1270
+ _templateId:
1271
+ type: string
1272
+ format: objectId
1273
+ readOnly: true
1274
+ x-celigo-refModel: templates
1275
+ description: Template the topic was installed from. Present only when it originated from a template.
1276
+ examples:
1277
+ - 6a27a36f9cea1a85192e72cd
1278
+ _sourceId:
1279
+ type: string
1280
+ format: objectId
1281
+ readOnly: true
1282
+ description: Topic this one was cloned or installed from. Present only on copies.
1283
+ examples:
1284
+ - 6aab2870265e1cf39fcbee4d
1285
+ draft:
1286
+ type: boolean
1287
+ readOnly: true
1288
+ description: |-
1289
+ When true, the topic was created as a draft by the AI-assisted builder and has not been
1290
+ confirmed yet. Absent on ordinary topics.
1291
+ examples:
1292
+ - true
1293
+ draftExpiresAt:
1294
+ type: string
1295
+ format: date-time
1296
+ readOnly: true
1297
+ description: Timestamp when an unconfirmed draft is deleted automatically. Present only when `draft` is true.
1298
+ examples:
1299
+ - '2026-09-24T03:30:27.432Z'
1300
+ createdAt:
1301
+ type: string
1302
+ format: date-time
1303
+ readOnly: true
1304
+ description: Timestamp when the topic was created.
1305
+ examples:
1306
+ - '2026-09-16T23:38:24.578Z'
1307
+ lastModified:
1308
+ type: string
1309
+ format: date-time
1310
+ readOnly: true
1311
+ description: Timestamp when the topic was last updated by PUT or PATCH.
1312
+ examples:
1313
+ - '2026-09-22T02:51:12.733Z'
1314
+ deletedAt:
1315
+ type: string
1316
+ format: date-time
1317
+ readOnly: true
1318
+ description: |-
1319
+ Timestamp when the topic was moved to the recycle bin. Present only on the copy returned by
1320
+ `GET /v1/recycleBinTTL/topics/{_id}`; deleted topics are hidden from every other endpoint.
1321
+ examples:
1322
+ - '2026-09-22T03:29:50.803Z'
1323
+ Error:
1324
+ type: object
1325
+ description: Standard error response envelope returned by integrator.io APIs.
1326
+ properties:
1327
+ errors:
1328
+ type: array
1329
+ description: List of errors that occurred while processing the request.
1330
+ items:
1331
+ type: object
1332
+ properties:
1333
+ code:
1334
+ oneOf:
1335
+ - type: string
1336
+ - type: integer
1337
+ description: |-
1338
+ Machine-readable error code. Usually a string like
1339
+ `invalid_ref`, `missing_required_field`, or `unauthorized`;
1340
+ may be an **integer** when the error mirrors an upstream HTTP
1341
+ status (e.g. `500`) — most commonly returned by connection-ping
1342
+ and adaptor-proxy responses.
1343
+ message:
1344
+ type: string
1345
+ description: Human-readable description of the error.
1346
+ field:
1347
+ type: string
1348
+ description: |-
1349
+ Optional pointer to the document field that caused the error.
1350
+ Used by structural validation errors (`missing_required_field`,
1351
+ `invalid_ref`) to indicate which field is at fault
1352
+ (e.g. `_id`, `type`, `http.baseURI`).
1353
+ source:
1354
+ type: string
1355
+ description: |-
1356
+ Optional origin layer for the error — e.g. `application` when
1357
+ the error came from the remote system the adaptor called,
1358
+ `connector` when the adaptor itself rejected the request.
1359
+ required:
1360
+ - message
1361
+ required:
1362
+ - errors
1363
+ Request:
1364
+ type: object
1365
+ description: Writable fields for creating or updating a topic.
1366
+ required:
1367
+ - name
1368
+ x-celigo-ai-guidance:
1369
+ - |-
1370
+ Always send name — the server does not enforce it and creates a topic with an empty name
1371
+ that cannot be told apart in lists. On PUT send the whole document: omitted fields are
1372
+ cleared (description, externalId) and retentionMs falls back to seven days.
1373
+ - |-
1374
+ Unknown top-level fields are dropped silently, so a misspelled field does not fail the
1375
+ request — read the response body back to confirm what was stored.
1376
+ properties:
1377
+ name:
1378
+ type: string
1379
+ maxLength: 200
1380
+ description: |-
1381
+ Display name shown in the UI and recorded as `deletedInfo.name` on audit entries. Names need
1382
+ not be unique — exports and imports bind to the topic id, so renaming never breaks a
1383
+ subscription. Script tags and other unsafe HTML are stripped on save.
1384
+ examples:
1385
+ - orders.created
1386
+ description:
1387
+ type:
1388
+ - string
1389
+ - 'null'
1390
+ maxLength: 5120
1391
+ description: |-
1392
+ What the topic carries and which flows consume it. Shown in the UI only; it plays no part in
1393
+ routing. Send null to clear a previous value.
1394
+ examples:
1395
+ - One event per order placed. Consumed by the fulfillment and finance flows.
1396
+ retentionMs:
1397
+ type: integer
1398
+ minimum: 3600000
1399
+ maximum: 7776000000
1400
+ default: 604800000
1401
+ description: |-
1402
+ How long a published message stays readable, in milliseconds, before it is dropped from the
1403
+ stream whether or not a listener consumed it. The default keeps a week of messages, enough for
1404
+ a listener that is paused over a weekend to catch up; the ceiling is further capped by the
1405
+ account license's `topics.retentionCeilingDays`. Changing it on an existing topic
1406
+ re-configures the stream, so messages older than the new window are no longer retained.
1407
+ examples:
1408
+ - 604800000
1409
+ - 3600000
1410
+ x-celigo-ai-guidance:
1411
+ - |-
1412
+ A value above the account's ceiling fails with 422 `topics_retention_exceeds_entitlement`;
1413
+ read the ceiling from `GET /v1/licenses` (`topics.retentionCeilingDays`) before asking for
1414
+ long retention. Below one hour fails with 422 `min`.
1415
+ externalId:
1416
+ type: string
1417
+ maxLength: 1024
1418
+ description: |-
1419
+ Caller-chosen key for finding the topic again without storing its id — filter the list with
1420
+ `GET /v1/topics?externalId=…`. Integration Apps use it to locate a topic across installs.
1421
+ examples:
1422
+ - erp-orders-created
1423
+ __integrationIds:
1424
+ type: array
1425
+ maxItems: 100
1426
+ items:
1427
+ type: string
1428
+ format: objectId
1429
+ x-celigo-refModel: integrations
1430
+ description: |-
1431
+ Integrations to register the new topic on immediately after creation, so flows in those
1432
+ integrations can subscribe to it. Honored only on `POST /v1/topics` (ignored on PUT), never
1433
+ persisted, and not echoed back. Ids are validated before the topic is saved; registration
1434
+ runs after the save, and per-integration failures are reported in
1435
+ `__failedIntegrationRegistrations` on the 201 response without rolling back the new topic.
1436
+ x-celigo-ai-guidance:
1437
+ - |-
1438
+ Invalid input rejects the whole request without creating the topic: a non-array value or
1439
+ duplicate ids fail with 422 `invalid_request`, an element that is not a valid ObjectId fails
1440
+ with 422 `invalid_ref` naming `__integrationIds[i]`, and an integration that does not exist
1441
+ in the account fails with 404.
1442
+ - To register an existing topic instead, use `PUT /v1/integrations/{_id}/topics/{_topicId}/register`.
1443
+ examples:
1444
+ - - 6ab1f4a138d7733b45998d99
1445
+ JsonPatchOperation:
1446
+ type: object
1447
+ description: A single JSON Patch operation (RFC 6902).
1448
+ required:
1449
+ - op
1450
+ - path
1451
+ properties:
1452
+ op:
1453
+ type: string
1454
+ enum:
1455
+ - replace
1456
+ - add
1457
+ - remove
1458
+ x-enumDescriptions:
1459
+ replace: Replaces the value at the specified path.
1460
+ add: Sets the value at the specified path.
1461
+ remove: Removes the value at the specified path.
1462
+ description: The operation to perform.
1463
+ path:
1464
+ type: string
1465
+ description: |-
1466
+ JSON Pointer (RFC 6901) to the field to patch. Only
1467
+ whitelisted paths are accepted — unlisted paths return
1468
+ `422` with `"<path> is not a whitelisted property"`.
1469
+ value:
1470
+ description: The new value to set. Required for `replace` and `add`, omit for `remove`.
1471
+ JsonPatchRequest:
1472
+ type: array
1473
+ description: |-
1474
+ A JSON Patch document (RFC 6902). Send an array of patch
1475
+ operations on whitelisted fields — all other paths are rejected
1476
+ with 422.
1477
+ minItems: 1
1478
+ items:
1479
+ $ref: '#/components/schemas/JsonPatchOperation'
1480
+ TopicMessage:
1481
+ type: object
1482
+ description: One retained message, in publish order.
1483
+ required:
1484
+ - timestamp
1485
+ - payload
1486
+ properties:
1487
+ timestamp:
1488
+ type: string
1489
+ format: date-time
1490
+ description: Timestamp when the message was appended to the stream; the value `time_gt` and `time_lte` filter on.
1491
+ examples:
1492
+ - '2026-09-22T03:24:35.992Z'
1493
+ payload:
1494
+ description: |-
1495
+ The message exactly as it was published — normally the JSON object sent in `messages[]`.
1496
+ A value that was not valid JSON is returned verbatim as a string.
1497
+ examples:
1498
+ - orderId: SO-1001
1499
+ total: 42.5
1500
+ TopicMessagesResponse:
1501
+ type: object
1502
+ description: One page of retained messages.
1503
+ required:
1504
+ - messages
1505
+ properties:
1506
+ messages:
1507
+ type: array
1508
+ description: |-
1509
+ Messages in the requested window, oldest first. Empty when the topic has never received a
1510
+ message, when everything has aged out of `retentionMs`, or when the continuation cursor is
1511
+ already at the end of the stream.
1512
+ items:
1513
+ $ref: '#/components/schemas/TopicMessage'
1514
+ nextPageURL:
1515
+ type: string
1516
+ description: |-
1517
+ Relative URL of the next page, carrying the same filters plus an `afterOffset` cursor.
1518
+ Follow it as-is rather than building the cursor yourself. Absent on the last page.
1519
+ examples:
1520
+ - /v1/topics/6ab1f44d7c4b4e699fe84b0a/messages?limit=50&afterOffset=49
1521
+ PurgeMessagesResponse:
1522
+ type: object
1523
+ description: Result of purging a topic's retained messages.
1524
+ required:
1525
+ - deleted
1526
+ properties:
1527
+ deleted:
1528
+ type: boolean
1529
+ description: |-
1530
+ When true, the topic's stream was cleared — also reported when it held no messages at the time.
1531
+ False only for a topic that has never received a message, so there was no stream to clear.
1532
+ examples:
1533
+ - true
1534
+ PublishRequest:
1535
+ type: object
1536
+ description: Messages to append to the topic.
1537
+ required:
1538
+ - messages
1539
+ x-celigo-ai-guidance:
1540
+ - |-
1541
+ The body must be an object with a messages array — a bare array or a missing/non-array
1542
+ messages field fails with 400 `invalid_messages`. Other top-level keys are ignored.
1543
+ properties:
1544
+ messages:
1545
+ type: array
1546
+ description: |-
1547
+ Messages to append, in order; each becomes one record that listeners receive. An empty array
1548
+ is accepted and publishes nothing. Every message is serialized as JSON and may be at most
1549
+ 1 MiB; oversized messages are reported per entry in the response and the rest are still
1550
+ published.
1551
+ items:
1552
+ type: object
1553
+ description: One message. Any JSON object; the platform stores it as-is and returns it as `payload` when read back.
1554
+ examples:
1555
+ - - orderId: SO-1001
1556
+ total: 42.5
1557
+ - orderId: SO-1002
1558
+ total: 18
1559
+ PublishResponse:
1560
+ type: object
1561
+ description: |-
1562
+ Per-message outcome of a publish call. The HTTP status is 200 whenever the request body was
1563
+ valid; inspect each entry's `statusCode` to see which messages were appended.
1564
+ required:
1565
+ - responses
1566
+ properties:
1567
+ responses:
1568
+ type: array
1569
+ description: One entry per element of `messages`, in the same order. Empty when `messages` was empty.
1570
+ items:
1571
+ type: object
1572
+ required:
1573
+ - statusCode
1574
+ properties:
1575
+ statusCode:
1576
+ type: integer
1577
+ description: |-
1578
+ Outcome for this message: 200 when it was appended, 422 when it was rejected before
1579
+ publishing (for example because it exceeds the size limit), 500 when the stream
1580
+ refused the batch it belonged to.
1581
+ examples:
1582
+ - 200
1583
+ - 422
1584
+ _json:
1585
+ type: object
1586
+ description: Present when `statusCode` is 200. Currently always an empty object.
1587
+ examples:
1588
+ - {}
1589
+ errors:
1590
+ type: array
1591
+ description: Present when `statusCode` is not 200. Why this message was not published.
1592
+ items:
1593
+ type: object
1594
+ required:
1595
+ - code
1596
+ - message
1597
+ properties:
1598
+ code:
1599
+ type: string
1600
+ description: |-
1601
+ Machine-readable reason. `topic_publish_event_too_large` when the serialized
1602
+ message exceeds 1 MiB; `topic_publish_failed` when the stream rejected the batch.
1603
+ examples:
1604
+ - topic_publish_event_too_large
1605
+ message:
1606
+ type: string
1607
+ description: Human-readable explanation, naming the message index.
1608
+ examples:
1609
+ - Message at index 0 exceeds the maximum allowed size of 1048576 bytes.
1610
+ source:
1611
+ type: string
1612
+ description: Layer that produced the error — `resource` for size rejections, `internal` for stream failures.
1613
+ examples:
1614
+ - resource
1615
+ resolved:
1616
+ type: boolean
1617
+ description: Always false here; publish errors are not retried by the platform.
1618
+ examples:
1619
+ - false
1620
+ occurredAt:
1621
+ type: integer
1622
+ description: Unix epoch milliseconds when the error was raised.
1623
+ examples:
1624
+ - 1790047646930
1625
+ TopicExportOffsets:
1626
+ type: object
1627
+ description: Read position of one topic export (listener) on a topic.
1628
+ required:
1629
+ - hasCursor
1630
+ - offset
1631
+ properties:
1632
+ hasCursor:
1633
+ type: boolean
1634
+ description: |-
1635
+ When true, the export has committed a read position on this topic and its next run resumes
1636
+ from `offset`. False when the export has never consumed the topic, when its last committed
1637
+ position has expired from the stream, or when it does not listen to this topic at all — a
1638
+ listener without a cursor starts from its own `topic.startPosition` (`latest` or `earliest`).
1639
+ examples:
1640
+ - true
1641
+ - false
1642
+ offset:
1643
+ type: integer
1644
+ minimum: -1
1645
+ description: |-
1646
+ Zero-based position of the next message the export will read. `-1` when `hasCursor` is
1647
+ false.
1648
+ examples:
1649
+ - 1287
1650
+ - -1
1651
+ DependencyEntry:
1652
+ type: object
1653
+ description: A single resource that depends on the queried resource.
1654
+ properties:
1655
+ id:
1656
+ type: string
1657
+ description: Unique identifier of the dependent resource.
1658
+ examples:
1659
+ - 61f92026dd053843b5d72350
1660
+ name:
1661
+ type: string
1662
+ description: Display name of the dependent resource.
1663
+ examples:
1664
+ - Import Orders to NetSuite
1665
+ type:
1666
+ type: string
1667
+ description: |-
1668
+ Sub-type of the dependent resource when its collection distinguishes one, such as
1669
+ `stream` for a listener export. Only present for resource types that carry a `type`.
1670
+ examples:
1671
+ - stream
1672
+ paths:
1673
+ type: array
1674
+ description: |-
1675
+ Dot-notation paths within the dependent resource that reference
1676
+ the target resource. `[*]` denotes array elements.
1677
+ items:
1678
+ type: string
1679
+ examples:
1680
+ - - hooks.preSavePage._scriptId
1681
+ accessLevel:
1682
+ type: string
1683
+ description: The caller's access level on the dependent resource.
1684
+ examples:
1685
+ - manage
1686
+ dependencyIds:
1687
+ type: object
1688
+ description: |-
1689
+ Map of resource types to arrays of IDs that this dependent
1690
+ resource references on the target. Keys are singular or plural
1691
+ resource type strings; values are arrays of ID strings.
1692
+ additionalProperties:
1693
+ type: array
1694
+ items:
1695
+ type: string
1696
+ example:
1697
+ script:
1698
+ - 64ff4b21612a134bd2f45531
1699
+ required:
1700
+ - id
1701
+ - name
1702
+ - paths
1703
+ - accessLevel
1704
+ - dependencyIds
1705
+ DependencyResponse:
1706
+ type: object
1707
+ description: |
1708
+ Map of dependent-resource types to arrays of dependency entries.
1709
+ Keys are plural resource type strings (e.g. `flows`, `imports`,
1710
+ `connections`). An empty object `{}` means no dependents.
1711
+ additionalProperties:
1712
+ type: array
1713
+ items:
1714
+ $ref: '#/components/schemas/DependencyEntry'
1715
+ example:
1716
+ exports:
1717
+ - id: 64ff4b21612a134bd2f45534
1718
+ name: Bank FTP Export
1719
+ paths:
1720
+ - hooks.preSavePage._scriptId
1721
+ accessLevel: manage
1722
+ dependencyIds:
1723
+ script:
1724
+ - 64ff4b21612a134bd2f45531
1725
+ flows:
1726
+ - id: 64ff4b22612a134bd2f45538
1727
+ name: CAMT-053 to Celigo CAM Format
1728
+ paths:
1729
+ - pageGenerators[*]._exportId
1730
+ accessLevel: manage
1731
+ dependencyIds:
1732
+ export:
1733
+ - 64ff4b21612a134bd2f45534
1734
+ responses:
1735
+ 401-unauthorized:
1736
+ description: |-
1737
+ Unauthorized. The request lacks a valid bearer token, or the provided token
1738
+ failed to authenticate.
1739
+
1740
+ Note: the 401 response is produced by the auth middleware **before** the
1741
+ request reaches the endpoint handler, so it does **not** follow the
1742
+ standard `{errors: [...]}` envelope. Instead the body is a bare
1743
+ `{message: string}` object with no `code`, no `errors` array. Callers
1744
+ handling 401s should key off the HTTP status and the `message` string,
1745
+ not try to destructure an `errors[]`.
1746
+ content:
1747
+ application/json:
1748
+ schema:
1749
+ type: object
1750
+ properties:
1751
+ message:
1752
+ type: string
1753
+ description: |-
1754
+ Human-readable description of the auth failure. Known values:
1755
+ - `"Unauthorized"` — no `Authorization` header on the request.
1756
+ - `"Bearer Authentication Failed"` — header present but token
1757
+ is invalid, revoked, or expired.
1758
+ required:
1759
+ - message
1760
+ examples:
1761
+ missing_token:
1762
+ summary: No Authorization header sent
1763
+ value:
1764
+ message: Unauthorized
1765
+ invalid_token:
1766
+ summary: Bearer token invalid or revoked
1767
+ value:
1768
+ message: Bearer Authentication Failed
1769
+ 404-not-found:
1770
+ description: |
1771
+ Not found. The requested resource does not exist or is not visible to the caller.
1772
+ content:
1773
+ application/json:
1774
+ schema:
1775
+ $ref: '#/components/schemas/Error'
1776
+ examples:
1777
+ default:
1778
+ value:
1779
+ errors:
1780
+ - code: not_found
1781
+ message: The requested resource was not found.
1782
+ x-internal: false
1783
+ x-enable-proxy: true