@celigo/api-specs 0.2.3 → 0.2.4-IO-168454-EPIC-fb

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 (52) hide show
  1. package/README.md +71 -80
  2. package/dist/account.yml +456 -55
  3. package/dist/agent.yml +15 -0
  4. package/dist/ai-agent.yml +1000 -192
  5. package/dist/alert.yml +1226 -0
  6. package/dist/api.yml +6375 -178
  7. package/dist/apim.yml +0 -4
  8. package/dist/asynchelper.yml +441 -62
  9. package/dist/audit.yml +57 -2
  10. package/dist/bartendertemplate.yml +508 -0
  11. package/dist/connection.yml +2533 -189
  12. package/dist/connector.yml +8 -0
  13. package/dist/ediprofile.yml +15 -0
  14. package/dist/editransaction.yml +250 -14
  15. package/dist/enduser.yml +6063 -47
  16. package/dist/environment.yml +8 -0
  17. package/dist/eventreport.yml +8 -0
  18. package/dist/export.yml +1624 -1804
  19. package/dist/filedefinition.yml +47 -0
  20. package/dist/filedefinitionrules.yml +722 -0
  21. package/dist/fileserver.yml +1457 -0
  22. package/dist/filestorage.yml +1087 -535
  23. package/dist/flow.yml +896 -209
  24. package/dist/guardrail.yml +310 -499
  25. package/dist/httpconnector.yml +8 -0
  26. package/dist/httpconnectorendpoint.yml +610 -126
  27. package/dist/httpconnectorresource.yml +1160 -84
  28. package/dist/iclient.yml +245 -114
  29. package/dist/import.yml +2583 -448
  30. package/dist/integration.yml +1114 -45
  31. package/dist/job.yml +188 -92
  32. package/dist/lookupcache.yml +45 -14
  33. package/dist/marketplace.yml +352 -107
  34. package/dist/mcp-oauth-provider.yml +15 -30
  35. package/dist/mcp-server.yml +7004 -68
  36. package/dist/networkpolicy.yml +1221 -0
  37. package/dist/notification.yml +59 -9
  38. package/dist/processor.yml +8 -3
  39. package/dist/recyclebin.yml +32 -2
  40. package/dist/script.yml +91 -16
  41. package/dist/stack.yml +642 -5
  42. package/dist/storagequery.yml +935 -0
  43. package/dist/subscription.yml +428 -67
  44. package/dist/sync.yml +435 -79
  45. package/dist/tag.yml +8 -0
  46. package/dist/template.yml +47 -1
  47. package/dist/tool.yml +7932 -3273
  48. package/dist/topic.yml +1806 -0
  49. package/dist/tradingpartnerconnector.yml +18 -0
  50. package/dist/user.yml +465 -42
  51. package/package.json +13 -1
  52. package/schemas.json +2358 -1887
@@ -0,0 +1,935 @@
1
+ openapi: 3.2.0
2
+ info:
3
+ version: 1.0.0
4
+ title: Storage Query
5
+ description: Run read-only SQL over files in Celigo Storage and page through the results.
6
+ x-celigo-ai-guidance:
7
+ - |-
8
+ API for querying files already in Celigo Storage with SQL. Submit one SELECT with
9
+ `POST /v1/storage/query`, poll `GET /v1/storage/query/{_id}/status` until `status` is
10
+ `completed`, then read rows a page at a time from `GET /v1/storage/query/{_id}/results`.
11
+ Nothing is written to storage; a query can only read files the caller can already read.
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: Storage Query
25
+ description: |-
26
+ Storage Query runs a single read-only SQL `SELECT` over CSV, JSON, NDJSON, and Parquet files held in Celigo Storage. A file or folder is referenced by its storage path, written where a table name would go (`FROM "orders/2026/september.csv"`) or passed to a reader function such as `read_csv_auto`. Submitting a query validates and authorizes it synchronously, then runs it in the background: poll the job's status until it completes and fetch the rows page by page. The account's license must include the Storage Query entitlement (`filesql`); every call on an account without it answers `403 STORAGE_QUERY_NOT_ENTITLED`.
27
+
28
+ ## Storage query job schema
29
+
30
+ {% openapi-schemas spec="storagequery" schemas="StorageQueryJob" grouped="true" %}
31
+ paths:
32
+ /v1/storage/query:
33
+ post:
34
+ x-internal: false
35
+ operationId: submitStorageQuery
36
+ tags:
37
+ - Storage Query
38
+ summary: Submit a storage query
39
+ description: |-
40
+ Validates one read-only SQL `SELECT`, resolves every storage path it references
41
+ with the caller's own permissions, and queues it for execution. The response is
42
+ the new job in `queued` state; poll `GET /v1/storage/query/{_id}/status` until it
43
+ is `completed`, then read rows from `GET /v1/storage/query/{_id}/results`.
44
+
45
+ Everything that can be checked before running is checked here and answered
46
+ synchronously, and a rejected submit creates no job: the statement must parse, be
47
+ exactly one `SELECT` (a `DESCRIBE <query>` or `SUMMARIZE <query>` over a storage
48
+ file is accepted as well and returns the column or summary rows), use only
49
+ allow-listed functions, reference files only through
50
+ bare storage paths or the storage reader functions, and every path must resolve to
51
+ a file — or a folder of same-format files — the caller can read. A statement that
52
+ references no file is accepted only when it is a pure constant expression. Supported
53
+ file formats are CSV/TSV, JSON, NDJSON/JSONL, and Parquet; the reader is chosen from
54
+ the file's extension (or its MIME type), and an explicit reader function must match
55
+ it. A folder is referenced with a trailing slash and contributes its direct child
56
+ files only; wildcard paths are not supported.
57
+
58
+ Read options are named arguments of the reader call, checked against a per-reader
59
+ allowlist — for `read_csv`/`read_csv_auto`: `header`, `delim`, `quote`, `escape`,
60
+ `sample_size`, `types`, `names`, `dateformat`, `timestampformat`, `ignore_errors`,
61
+ `null_padding`, `all_varchar`, `nullstr`, `allow_quoted_nulls`, `compression`,
62
+ `union_by_name`; for the JSON and NDJSON readers: `sample_size`, `ignore_errors`,
63
+ `dateformat`, `timestampformat`, `map_inference_threshold`, `maximum_depth`,
64
+ `maximum_sample_files`, `maximum_object_size`, `columns`, `format`, `records`,
65
+ `convert_strings_to_integers`, `compression`, `union_by_name`; for `read_parquet`:
66
+ `union_by_name`. Option values must be literals.
67
+
68
+ Submissions are rate-limited per account; over the limit the route answers
69
+ `429 STORAGE_QUERY_SUBMIT_RATE_LIMITED` with a `Retry-After` header, and every
70
+ submit — accepted or rejected — counts toward it. The number of distinct files a
71
+ statement may reference, the number of files a referenced folder may hold, and the
72
+ total bytes a statement may read are each capped; the 422 that reports an exceeded
73
+ cap names the current limit. Requires the account's license to include the Storage
74
+ Query entitlement (`filesql`).
75
+ requestBody:
76
+ required: true
77
+ content:
78
+ application/json:
79
+ schema:
80
+ $ref: '#/components/schemas/StorageQueryRequest'
81
+ examples:
82
+ filePath:
83
+ summary: Aggregate a CSV file by storage path
84
+ value:
85
+ sql: SELECT customer_id, SUM(total) AS spend FROM "orders/2026/september.csv" GROUP BY customer_id ORDER BY spend DESC LIMIT 100
86
+ readerOptions:
87
+ summary: Read a semicolon-delimited CSV through a reader function
88
+ value:
89
+ sql: SELECT * FROM read_csv_auto('exports/inventory.csv', header = true, delim = ';') WHERE quantity < 10
90
+ constant:
91
+ summary: Constant expression (no file) — connectivity check
92
+ value:
93
+ sql: SELECT 1 AS one, 'a' AS letter, 2.5 AS num, TRUE AS flag
94
+ responses:
95
+ '202':
96
+ description: Query accepted and queued. Poll the status route with `jobId`.
97
+ content:
98
+ application/json:
99
+ schema:
100
+ type: object
101
+ required:
102
+ - jobId
103
+ - status
104
+ properties:
105
+ jobId:
106
+ type: string
107
+ format: objectId
108
+ description: Identifier of the new job — the `{_id}` for the status and results routes.
109
+ examples:
110
+ - 6ab5a7d0c772d334c44701be
111
+ status:
112
+ type: string
113
+ enum:
114
+ - queued
115
+ x-enumDescriptions:
116
+ queued: The only state a submit returns; execution has not started yet.
117
+ description: Initial lifecycle state of the job.
118
+ examples:
119
+ default:
120
+ value:
121
+ jobId: 6ab5a7d0c772d334c44701be
122
+ status: queued
123
+ '400':
124
+ description: |-
125
+ The body or the statement is malformed: `sql` is missing or not a non-empty
126
+ string (`STORAGE_QUERY_SQL_REQUIRED`), the statement does not parse
127
+ (`STORAGE_QUERY_INVALID_SQL` — the message carries the parser's position), or it
128
+ exceeds the size cap (`STORAGE_QUERY_SQL_TOO_LARGE`).
129
+ content:
130
+ application/json:
131
+ schema:
132
+ $ref: '#/components/schemas/Error'
133
+ examples:
134
+ sqlRequired:
135
+ summary: Missing or non-string sql
136
+ value:
137
+ errors:
138
+ - code: STORAGE_QUERY_SQL_REQUIRED
139
+ message: sql is required and must be a non-empty string
140
+ invalidSql:
141
+ summary: Statement does not parse
142
+ value:
143
+ errors:
144
+ - code: STORAGE_QUERY_INVALID_SQL
145
+ message: syntax error at or near "SELEC"
146
+ '401':
147
+ $ref: '#/components/responses/401-unauthorized'
148
+ '403':
149
+ description: |-
150
+ The account's license does not include the Storage Query entitlement
151
+ (`STORAGE_QUERY_NOT_ENTITLED`). Also returned when the caller's role,
152
+ environment, or account-share context does not permit the query.
153
+ content:
154
+ application/json:
155
+ schema:
156
+ $ref: '#/components/schemas/Error'
157
+ examples:
158
+ notEntitled:
159
+ value:
160
+ errors:
161
+ - code: STORAGE_QUERY_NOT_ENTITLED
162
+ message: Storage query is not enabled for this account
163
+ '404':
164
+ description: |-
165
+ A referenced storage path did not resolve to a file the caller can read
166
+ (`STORAGE_QUERY_SOURCE_NOT_FOUND`). A path outside the caller's reach looks
167
+ exactly like a missing one.
168
+ content:
169
+ application/json:
170
+ schema:
171
+ $ref: '#/components/schemas/Error'
172
+ examples:
173
+ sourceNotFound:
174
+ value:
175
+ errors:
176
+ - code: STORAGE_QUERY_SOURCE_NOT_FOUND
177
+ message: No storage file found at path "orders/2026/september.csv"
178
+ '422':
179
+ description: |-
180
+ The statement parsed but is outside the supported surface. As-built cases:
181
+ not a `SELECT` (`STORAGE_QUERY_NOT_SELECT`); more than one statement
182
+ (`STORAGE_QUERY_MULTIPLE_STATEMENTS`); a table function other than the storage
183
+ readers, `unnest`, `generate_series`, or `range`
184
+ (`STORAGE_QUERY_TABLE_FUNCTION_NOT_ALLOWED`); a scalar function outside the
185
+ allowlist (`STORAGE_QUERY_FUNCTION_NOT_ALLOWED`); a reader option the reader does
186
+ not accept, or a positional option (`STORAGE_QUERY_INVALID_READ_OPTION`); a reader
187
+ whose first argument is not a literal path or list of paths
188
+ (`STORAGE_QUERY_READER_PATH_NOT_LITERAL`); a reader that does not match the
189
+ file's format (`STORAGE_QUERY_READER_FORMAT_MISMATCH`); a row generator with no
190
+ file reference (`STORAGE_QUERY_NO_STORAGE_REFERENCE`) or one that would generate
191
+ more rows than allowed (`STORAGE_QUERY_GENERATOR_TOO_LARGE`); a schema- or
192
+ catalog-qualified table name, or a path carrying a wildcard
193
+ (`STORAGE_QUERY_INVALID_SOURCE`); a folder path without its trailing slash
194
+ (`STORAGE_NOT_A_FILE`) or a file path with one (`STORAGE_ITEM_NOT_FOLDER`); an
195
+ unsupported file type (`STORAGE_QUERY_UNSUPPORTED_FILE_TYPE`); a folder that is
196
+ empty, mixes formats, or holds too many files (`STORAGE_QUERY_FOLDER_EMPTY`,
197
+ `STORAGE_QUERY_MIXED_FORMAT_FOLDER`, `STORAGE_QUERY_FOLDER_TOO_MANY_FILES`); too
198
+ many distinct files (`STORAGE_QUERY_TOO_MANY_SOURCES`); or more input bytes than
199
+ the cap (`STORAGE_QUERY_INPUT_TOO_LARGE`).
200
+ content:
201
+ application/json:
202
+ schema:
203
+ $ref: '#/components/schemas/Error'
204
+ examples:
205
+ notSelect:
206
+ summary: Statement is not a SELECT
207
+ value:
208
+ errors:
209
+ - code: STORAGE_QUERY_NOT_SELECT
210
+ message: Only SELECT statements are supported
211
+ multipleStatements:
212
+ summary: More than one statement
213
+ value:
214
+ errors:
215
+ - code: STORAGE_QUERY_MULTIPLE_STATEMENTS
216
+ message: Exactly one SQL statement is supported per request
217
+ tableFunctionNotAllowed:
218
+ summary: Table function outside the storage readers
219
+ value:
220
+ errors:
221
+ - code: STORAGE_QUERY_TABLE_FUNCTION_NOT_ALLOWED
222
+ message: Table functions are not allowed; reference Celigo Storage file paths instead
223
+ functionNotAllowed:
224
+ summary: Scalar function outside the allowlist
225
+ value:
226
+ errors:
227
+ - code: STORAGE_QUERY_FUNCTION_NOT_ALLOWED
228
+ message: Function "version" is not allowed
229
+ invalidReadOption:
230
+ summary: Reader option the reader does not accept
231
+ value:
232
+ errors:
233
+ - code: STORAGE_QUERY_INVALID_READ_OPTION
234
+ message: Option "foo" is not supported for read_csv_auto
235
+ noStorageReference:
236
+ summary: Row generator without a file reference
237
+ value:
238
+ errors:
239
+ - code: STORAGE_QUERY_NO_STORAGE_REFERENCE
240
+ message: A query that generates rows must read at least one Celigo Storage file; only constant expressions may omit a file reference
241
+ wildcardPath:
242
+ summary: Wildcard in a storage path
243
+ value:
244
+ errors:
245
+ - code: STORAGE_QUERY_INVALID_SOURCE
246
+ message: FROM target "orders/2026/*.csv" is not a valid Celigo Storage file path
247
+ folderWithoutSlash:
248
+ summary: Folder path missing its trailing slash
249
+ value:
250
+ errors:
251
+ - code: STORAGE_NOT_A_FILE
252
+ message: Storage item "orders/2026" is not a file
253
+ '429':
254
+ description: |-
255
+ Too many submits for this account in the current window
256
+ (`STORAGE_QUERY_SUBMIT_RATE_LIMITED`). Wait for the number of seconds in the
257
+ `Retry-After` header before submitting again.
258
+ headers:
259
+ Retry-After:
260
+ description: Seconds to wait before the next submit.
261
+ schema:
262
+ type: integer
263
+ content:
264
+ application/json:
265
+ schema:
266
+ $ref: '#/components/schemas/Error'
267
+ examples:
268
+ submitRateLimited:
269
+ value:
270
+ errors:
271
+ - code: STORAGE_QUERY_SUBMIT_RATE_LIMITED
272
+ message: Too many queries submitted for this account; retry after 42 seconds
273
+ x-celigo-ai-guidance:
274
+ - |-
275
+ A 202 means only that the statement was accepted; the rows come from the status
276
+ and results routes. Poll GET /v1/storage/query/{jobId}/status until status is
277
+ completed — a results request on a queued or running job answers 409
278
+ STORAGE_QUERY_JOB_NOT_READY.
279
+ - |-
280
+ A 4xx from this route carries no jobId, so there is nothing to poll after a
281
+ rejected submit; fix the statement and resubmit. Read options such as header = true
282
+ or delim = ';' are accepted as named arguments of read_csv_auto — the submit only
283
+ fails later, on path resolution, if the file does not exist.
284
+ /v1/storage/query/{_id}/status:
285
+ get:
286
+ x-internal: false
287
+ operationId: getStorageQueryStatus
288
+ tags:
289
+ - Storage Query
290
+ summary: Get a storage query job's status
291
+ description: |-
292
+ Returns the job's lifecycle state and timestamps. Once `status` is `completed` the
293
+ response also carries the result manifest — `rowCount`, `pageCount`, `truncated`,
294
+ `columns`, and `executionMs` — which is everything needed to page through
295
+ `GET /v1/storage/query/{_id}/results`. A `failed` job carries `error` instead.
296
+ Jobs are scoped to the submitting account: another account's job, or one that has
297
+ expired, answers 404 exactly like an unknown id. Requires the account's license to
298
+ include the Storage Query entitlement (`filesql`).
299
+ parameters:
300
+ - name: _id
301
+ in: path
302
+ required: true
303
+ description: The `jobId` returned by `POST /v1/storage/query`.
304
+ schema:
305
+ type: string
306
+ format: objectId
307
+ examples:
308
+ - 6ab5a7d0c772d334c44701be
309
+ responses:
310
+ '200':
311
+ description: Current state of the job.
312
+ content:
313
+ application/json:
314
+ schema:
315
+ $ref: '#/components/schemas/StorageQueryJob'
316
+ examples:
317
+ completed:
318
+ summary: Completed — manifest present
319
+ value:
320
+ jobId: 6ab5a7d0c772d334c44701be
321
+ status: completed
322
+ createdAt: '2026-09-24T22:44:32.845Z'
323
+ startedAt: '2026-09-24T22:44:32.927Z'
324
+ completedAt: '2026-09-24T22:44:33.004Z'
325
+ executionMs: 67
326
+ rowCount: 1
327
+ truncated: false
328
+ pageCount: 1
329
+ columns:
330
+ - name: one
331
+ type: INTEGER
332
+ - name: letter
333
+ type: VARCHAR
334
+ - name: num
335
+ type: DECIMAL(2,1)
336
+ - name: flag
337
+ type: BOOLEAN
338
+ completedEmpty:
339
+ summary: Completed with no matching rows
340
+ value:
341
+ jobId: 6ab5a7d2c772d334c44701c6
342
+ status: completed
343
+ createdAt: '2026-09-24T22:44:34.948Z'
344
+ startedAt: '2026-09-24T22:44:34.962Z'
345
+ completedAt: '2026-09-24T22:44:34.982Z'
346
+ executionMs: 5
347
+ rowCount: 0
348
+ truncated: false
349
+ pageCount: 0
350
+ columns:
351
+ - name: one
352
+ type: INTEGER
353
+ queued:
354
+ summary: Still waiting for a worker
355
+ value:
356
+ jobId: 6ab5a84349aea63c4022909e
357
+ status: queued
358
+ createdAt: '2026-09-24T22:46:27.239Z'
359
+ '400':
360
+ description: The path segment is not a valid job identifier (`STORAGE_QUERY_INVALID_JOB_ID`).
361
+ content:
362
+ application/json:
363
+ schema:
364
+ $ref: '#/components/schemas/Error'
365
+ examples:
366
+ invalidJobId:
367
+ value:
368
+ errors:
369
+ - code: STORAGE_QUERY_INVALID_JOB_ID
370
+ message: jobId "not-an-id" is not a valid identifier
371
+ '401':
372
+ $ref: '#/components/responses/401-unauthorized'
373
+ '403':
374
+ description: The account's license does not include the Storage Query entitlement (`STORAGE_QUERY_NOT_ENTITLED`).
375
+ content:
376
+ application/json:
377
+ schema:
378
+ $ref: '#/components/schemas/Error'
379
+ examples:
380
+ notEntitled:
381
+ value:
382
+ errors:
383
+ - code: STORAGE_QUERY_NOT_ENTITLED
384
+ message: Storage query is not enabled for this account
385
+ '404':
386
+ description: No job with this id is visible to the caller (`STORAGE_QUERY_JOB_NOT_FOUND`) — unknown, expired, or submitted by another account.
387
+ content:
388
+ application/json:
389
+ schema:
390
+ $ref: '#/components/schemas/Error'
391
+ examples:
392
+ jobNotFound:
393
+ value:
394
+ errors:
395
+ - code: STORAGE_QUERY_JOB_NOT_FOUND
396
+ message: No query job found with id "000000000000000000000000"
397
+ '429':
398
+ description: Too many status or results reads for this account (`STORAGE_QUERY_RATE_LIMITED`). Wait for the seconds in `Retry-After`.
399
+ headers:
400
+ Retry-After:
401
+ description: Seconds to wait before the next read.
402
+ schema:
403
+ type: integer
404
+ content:
405
+ application/json:
406
+ schema:
407
+ $ref: '#/components/schemas/Error'
408
+ examples:
409
+ rateLimited:
410
+ value:
411
+ errors:
412
+ - code: STORAGE_QUERY_RATE_LIMITED
413
+ message: Too many requests for this account; retry after 1 seconds
414
+ /v1/storage/query/{_id}/results:
415
+ get:
416
+ x-internal: false
417
+ operationId: getStorageQueryResults
418
+ tags:
419
+ - Storage Query
420
+ summary: Get a page of storage query results
421
+ description: |-
422
+ Returns one page of a completed job's rows. Pages run from 1 to the job's
423
+ `pageCount`; omit `page` for the first one and keep requesting `page + 1` while
424
+ `hasMore` is true. A page holds as many whole rows as fit the service's page size,
425
+ which is a byte budget rather than a row count — a result of several hundred
426
+ thousand small rows can arrive as a single page — and no parameter changes it, so a
427
+ caller that must hold a page in memory bounds the result with `LIMIT` in the
428
+ statement. A completed job that matched nothing has `pageCount` 0 and still serves
429
+ page 1 as an empty page, so an empty result set never looks like a bad request. Rows exist only for a `completed` job: a `queued` or `running` job answers
430
+ 409 until it finishes, and a `failed` job answers 409 permanently — read its `error`
431
+ from the status route instead. Jobs are scoped to the submitting account, and an
432
+ expired job answers 404. Requires the account's license to include the Storage
433
+ Query entitlement (`filesql`).
434
+ parameters:
435
+ - name: _id
436
+ in: path
437
+ required: true
438
+ description: The `jobId` returned by `POST /v1/storage/query`.
439
+ schema:
440
+ type: string
441
+ format: objectId
442
+ examples:
443
+ - 6ab5a7d0c772d334c44701be
444
+ - name: page
445
+ in: query
446
+ required: false
447
+ description: |-
448
+ Page to return, from 1 to the job's `pageCount`. Defaults to 1 when omitted.
449
+ Anything that is not a positive integer within range — `0`, a non-numeric
450
+ value, or a number past `pageCount` — answers 400 rather than being coerced.
451
+ schema:
452
+ type: integer
453
+ minimum: 1
454
+ default: 1
455
+ examples:
456
+ - 1
457
+ responses:
458
+ '200':
459
+ description: One page of rows.
460
+ content:
461
+ application/json:
462
+ schema:
463
+ $ref: '#/components/schemas/StorageQueryResultsPage'
464
+ examples:
465
+ singlePage:
466
+ summary: Single-page result set
467
+ value:
468
+ page: 1
469
+ pageCount: 1
470
+ rowCount: 1
471
+ hasMore: false
472
+ rows:
473
+ - one: 1
474
+ letter: a
475
+ num: '2.5'
476
+ flag: true
477
+ empty:
478
+ summary: Page 1 of a job that matched no rows
479
+ value:
480
+ page: 1
481
+ pageCount: 0
482
+ rowCount: 0
483
+ hasMore: false
484
+ rows: []
485
+ '400':
486
+ description: |-
487
+ `page` is not a positive integer within `1..pageCount`
488
+ (`STORAGE_QUERY_PAGE_OUT_OF_RANGE` — the message names the job's page count),
489
+ or the path segment is not a valid job identifier (`STORAGE_QUERY_INVALID_JOB_ID`).
490
+ content:
491
+ application/json:
492
+ schema:
493
+ $ref: '#/components/schemas/Error'
494
+ examples:
495
+ pageOutOfRange:
496
+ value:
497
+ errors:
498
+ - code: STORAGE_QUERY_PAGE_OUT_OF_RANGE
499
+ message: page "2" is out of range; this job has 1 result page(s)
500
+ invalidJobId:
501
+ value:
502
+ errors:
503
+ - code: STORAGE_QUERY_INVALID_JOB_ID
504
+ message: jobId "not-an-id" is not a valid identifier
505
+ '401':
506
+ $ref: '#/components/responses/401-unauthorized'
507
+ '403':
508
+ description: The account's license does not include the Storage Query entitlement (`STORAGE_QUERY_NOT_ENTITLED`).
509
+ content:
510
+ application/json:
511
+ schema:
512
+ $ref: '#/components/schemas/Error'
513
+ examples:
514
+ notEntitled:
515
+ value:
516
+ errors:
517
+ - code: STORAGE_QUERY_NOT_ENTITLED
518
+ message: Storage query is not enabled for this account
519
+ '404':
520
+ description: No job with this id is visible to the caller (`STORAGE_QUERY_JOB_NOT_FOUND`) — unknown, expired, or submitted by another account.
521
+ content:
522
+ application/json:
523
+ schema:
524
+ $ref: '#/components/schemas/Error'
525
+ examples:
526
+ jobNotFound:
527
+ value:
528
+ errors:
529
+ - code: STORAGE_QUERY_JOB_NOT_FOUND
530
+ message: No query job found with id "000000000000000000000000"
531
+ '409':
532
+ description: |-
533
+ The job has not produced rows: it is still `queued` or `running`, or it `failed`
534
+ (`STORAGE_QUERY_JOB_NOT_READY` — the message names the current status). Poll the
535
+ status route; retry here only once it reports `completed`.
536
+ content:
537
+ application/json:
538
+ schema:
539
+ $ref: '#/components/schemas/Error'
540
+ examples:
541
+ notReady:
542
+ value:
543
+ errors:
544
+ - code: STORAGE_QUERY_JOB_NOT_READY
545
+ message: Query job "6ab5a84349aea63c4022909e" is "running"; results are available only once it has completed
546
+ '429':
547
+ description: Too many status or results reads for this account (`STORAGE_QUERY_RATE_LIMITED`). Wait for the seconds in `Retry-After`.
548
+ headers:
549
+ Retry-After:
550
+ description: Seconds to wait before the next read.
551
+ schema:
552
+ type: integer
553
+ content:
554
+ application/json:
555
+ schema:
556
+ $ref: '#/components/schemas/Error'
557
+ examples:
558
+ rateLimited:
559
+ value:
560
+ errors:
561
+ - code: STORAGE_QUERY_RATE_LIMITED
562
+ message: Too many requests for this account; retry after 1 seconds
563
+ x-celigo-ai-guidance:
564
+ - |-
565
+ Read pageCount from the completed status first, then fetch pages 1..pageCount; a
566
+ page past the end answers 400 STORAGE_QUERY_PAGE_OUT_OF_RANGE. When pageCount is 0
567
+ the result set is empty — page 1 returns rows: [] and there is nothing else to fetch.
568
+ components:
569
+ securitySchemes:
570
+ bearerAuth:
571
+ type: http
572
+ scheme: bearer
573
+ schemas:
574
+ StorageQueryRequest:
575
+ type: object
576
+ description: |-
577
+ One read-only SQL statement to run over files in Celigo Storage. The body carries
578
+ nothing else — reader options such as CSV delimiters belong inside the SQL, as
579
+ named arguments of the reader function that reads the file.
580
+ required:
581
+ - sql
582
+ properties:
583
+ sql:
584
+ type: string
585
+ description: |-
586
+ A single `SELECT` statement. Storage files are its tables: write a file or
587
+ folder path where a table name would go, quoted as an identifier
588
+ (`FROM "orders/2026/september.csv"`) or as a string literal, or pass the path as
589
+ the first, literal argument of a reader function (`read_csv_auto`, `read_csv`,
590
+ `read_json_auto`, `read_json`, `read_ndjson_auto`, `read_ndjson`, `read_parquet`)
591
+ when the file needs explicit read options. Paths are relative to the account's
592
+ storage root and case-sensitive; a leading `/` is accepted. A folder is
593
+ referenced with a trailing `/` (`FROM "orders/2026/"`) and reads its direct
594
+ child files — not its subfolders — as one table; a folder path without the
595
+ slash is refused at submit with 422 `STORAGE_NOT_A_FILE`, a file path with one
596
+ with 422 `STORAGE_ITEM_NOT_FOLDER`. Wildcards are not supported: a `*` or `?`
597
+ in a path answers 422 `STORAGE_QUERY_INVALID_SOURCE`. Anything other than one
598
+ `SELECT` — an `UPDATE`, two statements, a table function that is not a storage
599
+ reader, or a function outside the allowlist — is rejected at submit with a 4xx
600
+ and creates no job; `DESCRIBE <query>` and `SUMMARIZE <query>` are accepted and
601
+ run as ordinary jobs. A statement that references no file is accepted only when
602
+ it is a pure constant expression.
603
+ examples:
604
+ - SELECT customer_id, SUM(total) AS spend FROM "orders/2026/september.csv" GROUP BY customer_id ORDER BY spend DESC LIMIT 100
605
+ - SELECT status, COUNT(*) AS orders FROM "orders/2026/" GROUP BY status
606
+ x-celigo-ai-guidance:
607
+ - |-
608
+ Quote storage paths as identifiers relative to the account root: FROM
609
+ "folder/file.csv". A path that does not resolve fails the submit with 404
610
+ STORAGE_QUERY_SOURCE_NOT_FOUND and the response carries no jobId.
611
+ - |-
612
+ End a folder path with a slash — FROM "folder/" — to read its direct child files
613
+ as one table; "folder" without the slash fails the submit with 422
614
+ STORAGE_NOT_A_FILE. Never write a wildcard such as "folder/*.csv": it fails with
615
+ 422 STORAGE_QUERY_INVALID_SOURCE.
616
+ - |-
617
+ Put read options inside the SQL as named arguments of the reader call, e.g.
618
+ read_csv_auto('folder/file.csv', header = true, delim = ';'). An option the reader
619
+ does not accept fails the submit with 422 STORAGE_QUERY_INVALID_READ_OPTION naming
620
+ the option and the function.
621
+ - |-
622
+ A row generator such as generate_series is accepted only alongside at least one
623
+ storage file reference; on its own it fails the submit with 422
624
+ STORAGE_QUERY_NO_STORAGE_REFERENCE. A constant SELECT with no FROM (SELECT 1 AS one)
625
+ is accepted and completes in well under a second — useful as a connectivity check.
626
+ Error:
627
+ type: object
628
+ description: Standard error response envelope returned by integrator.io APIs.
629
+ properties:
630
+ errors:
631
+ type: array
632
+ description: List of errors that occurred while processing the request.
633
+ items:
634
+ type: object
635
+ properties:
636
+ code:
637
+ oneOf:
638
+ - type: string
639
+ - type: integer
640
+ description: |-
641
+ Machine-readable error code. Usually a string like
642
+ `invalid_ref`, `missing_required_field`, or `unauthorized`;
643
+ may be an **integer** when the error mirrors an upstream HTTP
644
+ status (e.g. `500`) — most commonly returned by connection-ping
645
+ and adaptor-proxy responses.
646
+ message:
647
+ type: string
648
+ description: Human-readable description of the error.
649
+ field:
650
+ type: string
651
+ description: |-
652
+ Optional pointer to the document field that caused the error.
653
+ Used by structural validation errors (`missing_required_field`,
654
+ `invalid_ref`) to indicate which field is at fault
655
+ (e.g. `_id`, `type`, `http.baseURI`).
656
+ source:
657
+ type: string
658
+ description: |-
659
+ Optional origin layer for the error — e.g. `application` when
660
+ the error came from the remote system the adaptor called,
661
+ `connector` when the adaptor itself rejected the request.
662
+ required:
663
+ - message
664
+ required:
665
+ - errors
666
+ StorageQueryJob:
667
+ type: object
668
+ description: |-
669
+ A submitted query and its progress. Created by `POST /v1/storage/query`, read from
670
+ `GET /v1/storage/query/{_id}/status`. The result manifest (`rowCount`, `pageCount`,
671
+ `columns`, …) appears once the job completes; rows are fetched separately from
672
+ `GET /v1/storage/query/{_id}/results`. Jobs are visible only to the account that
673
+ submitted them and expire on their own after a retention period, after which the
674
+ status and results routes answer 404.
675
+ required:
676
+ - jobId
677
+ - status
678
+ - createdAt
679
+ properties:
680
+ jobId:
681
+ type: string
682
+ format: objectId
683
+ readOnly: true
684
+ description: Identifier of the query job. Use it as `{_id}` on the status and results routes.
685
+ examples:
686
+ - 6ab5a7d0c772d334c44701be
687
+ status:
688
+ type: string
689
+ enum:
690
+ - queued
691
+ - running
692
+ - completed
693
+ - failed
694
+ x-enumDescriptions:
695
+ queued: Accepted and waiting for a worker; the results route answers 409 until the job completes.
696
+ running: A worker is executing the statement; the results route still answers 409.
697
+ completed: Rows are available — read `pageCount` and fetch pages from the results route.
698
+ failed: The query did not produce a result; `error` explains why. There are no pages to fetch.
699
+ description: |-
700
+ Lifecycle of the job. Every job starts `queued` (the submit response) and moves
701
+ to `running` when a worker claims it, then to `completed` or `failed`; there is
702
+ no cancel. Constant queries usually complete within a few hundred milliseconds of
703
+ submission, so a status read straight after the submit may already show
704
+ `completed`.
705
+ examples:
706
+ - completed
707
+ createdAt:
708
+ type: string
709
+ format: date-time
710
+ readOnly: true
711
+ description: Timestamp when the submit accepted the query.
712
+ examples:
713
+ - '2026-09-24T22:44:32.845Z'
714
+ startedAt:
715
+ type: string
716
+ format: date-time
717
+ readOnly: true
718
+ description: Timestamp when a worker began executing the statement. Absent while the job is `queued`.
719
+ examples:
720
+ - '2026-09-24T22:44:32.927Z'
721
+ completedAt:
722
+ type: string
723
+ format: date-time
724
+ readOnly: true
725
+ description: Timestamp when the job reached `completed` or `failed`. Absent until then.
726
+ examples:
727
+ - '2026-09-24T22:44:33.004Z'
728
+ executionMs:
729
+ type: integer
730
+ minimum: 0
731
+ readOnly: true
732
+ description: Only present when `status` is `completed`. Milliseconds the statement took to execute, excluding time spent queued.
733
+ examples:
734
+ - 67
735
+ rowCount:
736
+ type: integer
737
+ minimum: 0
738
+ readOnly: true
739
+ description: |-
740
+ Only present when `status` is `completed`. Total rows in the result set across
741
+ all pages; 0 when the query matched nothing, in which case `pageCount` is also 0
742
+ and page 1 of the results route returns an empty page.
743
+ examples:
744
+ - 1
745
+ truncated:
746
+ type: boolean
747
+ readOnly: true
748
+ description: |-
749
+ Only present when `status` is `completed`. When true, the result set hit the
750
+ service's row cap and `rowCount` counts only the rows that were kept; narrow the
751
+ query (a `WHERE`, or a `LIMIT` with `ORDER BY`) to see the rest.
752
+ examples:
753
+ - false
754
+ pageCount:
755
+ type: integer
756
+ minimum: 0
757
+ readOnly: true
758
+ description: Only present when `status` is `completed`. Number of result pages to fetch, numbered from 1; 0 for an empty result set.
759
+ examples:
760
+ - 1
761
+ columns:
762
+ type: array
763
+ readOnly: true
764
+ description: |-
765
+ Only present when `status` is `completed`. Result columns in `SELECT` order, each
766
+ with the engine's type name for the column — the key each row object uses.
767
+ Present, and possibly non-empty, even when `rowCount` is 0.
768
+ items:
769
+ type: object
770
+ required:
771
+ - name
772
+ - type
773
+ properties:
774
+ name:
775
+ type: string
776
+ description: Column name as projected by the statement (the alias when one was given).
777
+ examples:
778
+ - spend
779
+ type:
780
+ type: string
781
+ description: |-
782
+ SQL type of the column as reported by the engine, for example `INTEGER`,
783
+ `VARCHAR`, `BOOLEAN`, `DECIMAL(2,1)`, or `TIMESTAMP`. Parameterized types
784
+ carry their parameters, so treat the value as free text rather than a fixed
785
+ set.
786
+ examples:
787
+ - DECIMAL(2,1)
788
+ error:
789
+ type: object
790
+ readOnly: true
791
+ description: |-
792
+ Only present when `status` is `failed`. `code` names the failure class — for
793
+ example `STORAGE_QUERY_TIMEOUT` when the statement exceeded the execution
794
+ budget, `STORAGE_QUERY_EXECUTION_FAILED` when the engine rejected it while
795
+ running, or `STORAGE_QUERY_JOB_INTERRUPTED` when the worker holding it went away
796
+ (resubmit the same statement) — and `message` explains it.
797
+ required:
798
+ - code
799
+ - message
800
+ properties:
801
+ code:
802
+ type: string
803
+ description: Machine-readable failure code.
804
+ examples:
805
+ - STORAGE_QUERY_TIMEOUT
806
+ message:
807
+ type: string
808
+ description: Human-readable explanation of the failure.
809
+ examples:
810
+ - Query exceeded the maximum execution time of 300 seconds
811
+ StorageQueryResultsPage:
812
+ type: object
813
+ description: |-
814
+ One page of a completed job's rows, as returned by
815
+ `GET /v1/storage/query/{_id}/results?page=N`. Pages are numbered from 1 up to the
816
+ job's `pageCount`; fetch them in turn until `hasMore` is false.
817
+ required:
818
+ - page
819
+ - pageCount
820
+ - rowCount
821
+ - hasMore
822
+ - rows
823
+ properties:
824
+ page:
825
+ type: integer
826
+ minimum: 1
827
+ description: Page number served. 1 when the `page` query parameter was omitted.
828
+ examples:
829
+ - 1
830
+ pageCount:
831
+ type: integer
832
+ minimum: 0
833
+ description: Total pages in the result set — the same value as `pageCount` on the job's status. 0 when the query matched nothing.
834
+ examples:
835
+ - 1
836
+ rowCount:
837
+ type: integer
838
+ minimum: 0
839
+ description: Number of rows on this page (not the job-wide total the status route reports).
840
+ examples:
841
+ - 1
842
+ hasMore:
843
+ type: boolean
844
+ description: When true, a further page exists — request `page + 1`. False on the last page and on an empty result set.
845
+ examples:
846
+ - false
847
+ rows:
848
+ type: array
849
+ description: |-
850
+ Rows on this page, in the statement's output order. Each row is an object keyed
851
+ by column name (see `columns` on the job's status). `TINYINT`, `SMALLINT`,
852
+ `INTEGER`, `FLOAT`, `DOUBLE` and `BOOLEAN` values arrive as JSON numbers and
853
+ booleans. `BIGINT`, `UBIGINT`, `HUGEINT` and `DECIMAL` values arrive as strings so
854
+ no precision is lost (`"9007199254740993"`, `"1.50"`) — and every whole-number
855
+ column inferred from a CSV, JSON or NDJSON file is `BIGINT`, as are `COUNT`, `SUM`
856
+ over integer columns and the ranking window functions, so those come back as
857
+ strings such as `"40"`. `DATE`, `TIME` and `TIMESTAMP` values arrive as strings
858
+ (`2026-09-01`, `10:00:00`, `2026-09-01 10:00:00`). A list column (`INTEGER[]`,
859
+ `VARCHAR[]` — including a JSON array the reader typed as a list) arrives as a JSON
860
+ array, a `STRUCT` as a JSON object, a `MAP` as an array of `{"key", "value"}`
861
+ pairs, an `INTERVAL` as `{"months", "days", "micros"}` where `months` and `days`
862
+ are numbers and `micros` is a string (`{"months": 0, "days": 1, "micros": "0"}`
863
+ for `INTERVAL 1 DAY`). Empty on an empty result set.
864
+ items:
865
+ type: object
866
+ additionalProperties: true
867
+ examples:
868
+ - - one: 1
869
+ letter: a
870
+ num: '2.5'
871
+ flag: true
872
+ - - customer_id: C001
873
+ orders: '7'
874
+ spend: 1840.5
875
+ - - h: '170141183460469231731687303715884105727'
876
+ l:
877
+ - 1
878
+ - 2
879
+ - 3
880
+ s:
881
+ a: 1
882
+ b: x
883
+ tm: '10:00:00'
884
+ iv:
885
+ months: 0
886
+ days: 1
887
+ micros: '0'
888
+ x-celigo-ai-guidance:
889
+ - |-
890
+ Read the type from columns on the job's status before using a value: a
891
+ COUNT(*) or SUM over an integer column is BIGINT and arrives as the string
892
+ "40", not the number 40. When the consumer needs a JSON number, cast in the
893
+ statement — COUNT(*)::DOUBLE and COUNT(*)::INTEGER both arrive as the number
894
+ 40. A cast to INTEGER fails the job when the BIGINT value is outside the
895
+ 32-bit range: `SELECT 2147483648::INTEGER` fails with
896
+ STORAGE_QUERY_EXECUTION_FAILED ("Type INT64 with value 2147483648 can't be
897
+ cast because the value is out of range for the destination type INT32"), so
898
+ prefer DOUBLE for counts and sums whose size is unknown.
899
+ responses:
900
+ 401-unauthorized:
901
+ description: |-
902
+ Unauthorized. The request lacks a valid bearer token, or the provided token
903
+ failed to authenticate.
904
+
905
+ Note: the 401 response is produced by the auth middleware **before** the
906
+ request reaches the endpoint handler, so it does **not** follow the
907
+ standard `{errors: [...]}` envelope. Instead the body is a bare
908
+ `{message: string}` object with no `code`, no `errors` array. Callers
909
+ handling 401s should key off the HTTP status and the `message` string,
910
+ not try to destructure an `errors[]`.
911
+ content:
912
+ application/json:
913
+ schema:
914
+ type: object
915
+ properties:
916
+ message:
917
+ type: string
918
+ description: |-
919
+ Human-readable description of the auth failure. Known values:
920
+ - `"Unauthorized"` — no `Authorization` header on the request.
921
+ - `"Bearer Authentication Failed"` — header present but token
922
+ is invalid, revoked, or expired.
923
+ required:
924
+ - message
925
+ examples:
926
+ missing_token:
927
+ summary: No Authorization header sent
928
+ value:
929
+ message: Unauthorized
930
+ invalid_token:
931
+ summary: Bearer token invalid or revoked
932
+ value:
933
+ message: Bearer Authentication Failed
934
+ x-internal: false
935
+ x-enable-proxy: true