@celigo/api-specs 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/account.yml +592 -0
- package/dist/agent.yml +908 -0
- package/dist/ai-agent.yml +5471 -0
- package/dist/api.yml +4140 -0
- package/dist/apim.yml +1286 -0
- package/dist/asynchelper.yml +3391 -0
- package/dist/audit.yml +2006 -0
- package/dist/connection.yml +8665 -0
- package/dist/connector.yml +1406 -0
- package/dist/ediprofile.yml +911 -0
- package/dist/editransaction.yml +1210 -0
- package/dist/enduser.yml +1724 -0
- package/dist/environment.yml +568 -0
- package/dist/eventreport.yml +692 -0
- package/dist/export.yml +17610 -0
- package/dist/filedefinition.yml +1396 -0
- package/dist/filestorage.yml +3102 -0
- package/dist/flow.yml +7928 -0
- package/dist/guardrail.yml +2763 -0
- package/dist/httpconnector.yml +2277 -0
- package/dist/httpconnectorendpoint.yml +722 -0
- package/dist/httpconnectorresource.yml +396 -0
- package/dist/iclient.yml +4452 -0
- package/dist/import.yml +15381 -0
- package/dist/integration.yml +4406 -0
- package/dist/job.yml +2014 -0
- package/dist/lookupcache.yml +1325 -0
- package/dist/marketplace.yml +685 -0
- package/dist/mcp-oauth-provider.yml +590 -0
- package/dist/mcp-server.yml +2656 -0
- package/dist/notification.yml +488 -0
- package/dist/processor.yml +1253 -0
- package/dist/profile.yml +455 -0
- package/dist/recyclebin.yml +768 -0
- package/dist/script.yml +1128 -0
- package/dist/stack.yml +1291 -0
- package/dist/state.yml +894 -0
- package/dist/subscription.yml +1405 -0
- package/dist/sync.yml +4857 -0
- package/dist/tag.yml +553 -0
- package/dist/template.yml +897 -0
- package/dist/tool.yml +33656 -0
- package/dist/tradingpartnerconnector.yml +1490 -0
- package/dist/user.yml +831 -0
- package/package.json +41 -0
- package/schemas.json +8420 -0
package/dist/state.yml
ADDED
|
@@ -0,0 +1,894 @@
|
|
|
1
|
+
openapi: 3.2.0
|
|
2
|
+
info:
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
title: State
|
|
5
|
+
description: API for the Celigo key-value state store — persists JSON objects or arrays across flow runs, globally or per resource.
|
|
6
|
+
servers:
|
|
7
|
+
- url: https://api.integrator.io
|
|
8
|
+
description: Production (US / default region)
|
|
9
|
+
- url: https://api.eu.integrator.io
|
|
10
|
+
description: Production (EU region)
|
|
11
|
+
- url: https://api.au.integrator.io
|
|
12
|
+
description: Production (AU region)
|
|
13
|
+
- url: https://api.ca.integrator.io
|
|
14
|
+
description: Production (CA region)
|
|
15
|
+
security:
|
|
16
|
+
- bearerAuth: []
|
|
17
|
+
tags:
|
|
18
|
+
- name: State
|
|
19
|
+
description: |-
|
|
20
|
+
Key-value state store for persisting JSON objects or arrays across flow
|
|
21
|
+
runs. Common use cases include tracking sequence numbers, storing cursors
|
|
22
|
+
for delta syncs, caching lookup values, and passing state between runs.
|
|
23
|
+
|
|
24
|
+
**Lookup Caches are now the preferred mechanism** for storing and
|
|
25
|
+
retrieving data during flow execution. Prefer Lookup Caches for new
|
|
26
|
+
integrations; State remains supported for existing flows.
|
|
27
|
+
|
|
28
|
+
State supports two scopes:
|
|
29
|
+
|
|
30
|
+
- **Global** — account-wide keys visible to all flows and scripts.
|
|
31
|
+
- **Resource-scoped** — keys namespaced under a specific export, import,
|
|
32
|
+
or integration. Resource-scoped keys are isolated from the global
|
|
33
|
+
key listing.
|
|
34
|
+
|
|
35
|
+
Values must be non-empty JSON objects or arrays. Bare primitives,
|
|
36
|
+
`null`, and empty containers (`{}`, `[]`) are rejected.
|
|
37
|
+
|
|
38
|
+
Prefer resource-scoped state over global state when the data belongs
|
|
39
|
+
to a specific export, import, or integration. State keys are upserted —
|
|
40
|
+
PUT creates if absent, replaces if present. There is no PATCH; send the
|
|
41
|
+
full value each time.
|
|
42
|
+
|
|
43
|
+
## State schema
|
|
44
|
+
|
|
45
|
+
{% openapi-schemas spec="state" schemas="State" grouped="true" %}
|
|
46
|
+
paths:
|
|
47
|
+
/v1/state:
|
|
48
|
+
get:
|
|
49
|
+
x-internal: false
|
|
50
|
+
operationId: listGlobalStateKeys
|
|
51
|
+
tags:
|
|
52
|
+
- State
|
|
53
|
+
summary: List global state keys
|
|
54
|
+
description: |-
|
|
55
|
+
Returns all global state key names. Does not return resource-scoped
|
|
56
|
+
keys — use `GET /v1/{resourceType}/{_id}/state` for those.
|
|
57
|
+
|
|
58
|
+
Lists key names only, not values. Call `GET /v1/state/{key}` to
|
|
59
|
+
retrieve a specific value.
|
|
60
|
+
responses:
|
|
61
|
+
'200':
|
|
62
|
+
description: Object containing an array of key names.
|
|
63
|
+
content:
|
|
64
|
+
application/json:
|
|
65
|
+
schema:
|
|
66
|
+
type: object
|
|
67
|
+
required:
|
|
68
|
+
- keys
|
|
69
|
+
properties:
|
|
70
|
+
keys:
|
|
71
|
+
type: array
|
|
72
|
+
items:
|
|
73
|
+
type: string
|
|
74
|
+
example:
|
|
75
|
+
keys:
|
|
76
|
+
- sequence_number
|
|
77
|
+
- last_sync_time
|
|
78
|
+
'204':
|
|
79
|
+
description: No global state keys exist.
|
|
80
|
+
'401':
|
|
81
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
82
|
+
delete:
|
|
83
|
+
x-internal: false
|
|
84
|
+
operationId: deleteAllGlobalState
|
|
85
|
+
tags:
|
|
86
|
+
- State
|
|
87
|
+
summary: Delete all global state keys
|
|
88
|
+
description: |-
|
|
89
|
+
Deletes **all** global state keys and their values. This is a
|
|
90
|
+
destructive operation and cannot be undone.
|
|
91
|
+
|
|
92
|
+
Prefer `DELETE /v1/state/{key}` to remove individual keys.
|
|
93
|
+
responses:
|
|
94
|
+
'204':
|
|
95
|
+
description: All global state deleted.
|
|
96
|
+
'401':
|
|
97
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
98
|
+
/v1/state/{key}:
|
|
99
|
+
get:
|
|
100
|
+
x-internal: false
|
|
101
|
+
operationId: getGlobalStateValue
|
|
102
|
+
tags:
|
|
103
|
+
- State
|
|
104
|
+
summary: Get a global state value
|
|
105
|
+
description: |-
|
|
106
|
+
Returns the JSON value stored under the given global key.
|
|
107
|
+
|
|
108
|
+
Returns the raw JSON value (object or array), not wrapped in an envelope.
|
|
109
|
+
parameters:
|
|
110
|
+
- name: key
|
|
111
|
+
in: path
|
|
112
|
+
required: true
|
|
113
|
+
schema:
|
|
114
|
+
type: string
|
|
115
|
+
examples:
|
|
116
|
+
- sequence_number
|
|
117
|
+
description: The state key name.
|
|
118
|
+
responses:
|
|
119
|
+
'200':
|
|
120
|
+
description: The stored value (a JSON object or array).
|
|
121
|
+
content:
|
|
122
|
+
application/json:
|
|
123
|
+
schema:
|
|
124
|
+
$ref: '#/components/schemas/State'
|
|
125
|
+
examples:
|
|
126
|
+
object:
|
|
127
|
+
summary: Object value
|
|
128
|
+
value:
|
|
129
|
+
lastSyncTime: '2025-08-10T14:22:33.000Z'
|
|
130
|
+
sequenceNumber: 4207
|
|
131
|
+
array:
|
|
132
|
+
summary: Array value
|
|
133
|
+
value:
|
|
134
|
+
- sku: WIDGET-100
|
|
135
|
+
price: 29.99
|
|
136
|
+
- sku: WIDGET-200
|
|
137
|
+
price: 49.99
|
|
138
|
+
'401':
|
|
139
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
140
|
+
'404':
|
|
141
|
+
description: The key does not exist.
|
|
142
|
+
content:
|
|
143
|
+
application/json:
|
|
144
|
+
schema:
|
|
145
|
+
$ref: '#/components/schemas/Error'
|
|
146
|
+
example:
|
|
147
|
+
errors:
|
|
148
|
+
- message: State not found for key.
|
|
149
|
+
put:
|
|
150
|
+
x-internal: false
|
|
151
|
+
operationId: setGlobalStateValue
|
|
152
|
+
tags:
|
|
153
|
+
- State
|
|
154
|
+
summary: Create or update a global state value
|
|
155
|
+
description: |-
|
|
156
|
+
Sets the value for a global state key. Creates the key if it does
|
|
157
|
+
not exist; replaces the value if it does.
|
|
158
|
+
|
|
159
|
+
The request body must be a non-empty JSON object or array. Bare
|
|
160
|
+
JSON primitives (strings, numbers, booleans, `null`) and empty
|
|
161
|
+
containers (`{}`, `[]`) are rejected.
|
|
162
|
+
|
|
163
|
+
This is an upsert — check the status code to distinguish create (201)
|
|
164
|
+
from update (200). The response body is plain text, not JSON. If the
|
|
165
|
+
state belongs to a specific export, import, or integration, use the
|
|
166
|
+
resource-scoped endpoint instead.
|
|
167
|
+
parameters:
|
|
168
|
+
- name: key
|
|
169
|
+
in: path
|
|
170
|
+
required: true
|
|
171
|
+
schema:
|
|
172
|
+
type: string
|
|
173
|
+
examples:
|
|
174
|
+
- sequence_number
|
|
175
|
+
description: The state key name.
|
|
176
|
+
requestBody:
|
|
177
|
+
required: true
|
|
178
|
+
content:
|
|
179
|
+
application/json:
|
|
180
|
+
schema:
|
|
181
|
+
description: |-
|
|
182
|
+
A non-empty JSON object or array to store. Bare primitives
|
|
183
|
+
and empty containers are not accepted.
|
|
184
|
+
$ref: '#/components/schemas/State'
|
|
185
|
+
examples:
|
|
186
|
+
object:
|
|
187
|
+
summary: Store an object
|
|
188
|
+
value:
|
|
189
|
+
lastSyncTime: '2025-08-10T14:22:33.000Z'
|
|
190
|
+
sequenceNumber: 4207
|
|
191
|
+
array:
|
|
192
|
+
summary: Store an array
|
|
193
|
+
value:
|
|
194
|
+
- sku: WIDGET-100
|
|
195
|
+
price: 29.99
|
|
196
|
+
- sku: WIDGET-200
|
|
197
|
+
price: 49.99
|
|
198
|
+
responses:
|
|
199
|
+
'200':
|
|
200
|
+
description: Existing key updated.
|
|
201
|
+
content:
|
|
202
|
+
text/plain:
|
|
203
|
+
schema:
|
|
204
|
+
type: string
|
|
205
|
+
enum:
|
|
206
|
+
- OK
|
|
207
|
+
x-enumDescriptions:
|
|
208
|
+
OK: The existing key was updated successfully.
|
|
209
|
+
'201':
|
|
210
|
+
description: New key created.
|
|
211
|
+
content:
|
|
212
|
+
text/plain:
|
|
213
|
+
schema:
|
|
214
|
+
type: string
|
|
215
|
+
enum:
|
|
216
|
+
- Created
|
|
217
|
+
x-enumDescriptions:
|
|
218
|
+
Created: A new key was created successfully.
|
|
219
|
+
'400':
|
|
220
|
+
description: |-
|
|
221
|
+
Invalid request body. The body is not valid JSON, or is a bare
|
|
222
|
+
primitive (string, number, boolean, or `null`).
|
|
223
|
+
content:
|
|
224
|
+
application/json:
|
|
225
|
+
schema:
|
|
226
|
+
$ref: '#/components/schemas/Error'
|
|
227
|
+
example:
|
|
228
|
+
errors:
|
|
229
|
+
- message: Unexpected token '"', ""just a string"" is not valid JSON
|
|
230
|
+
'401':
|
|
231
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
232
|
+
'415':
|
|
233
|
+
description: |-
|
|
234
|
+
The `Content-Type` header is missing or is not
|
|
235
|
+
`application/json`.
|
|
236
|
+
content:
|
|
237
|
+
application/json:
|
|
238
|
+
schema:
|
|
239
|
+
$ref: '#/components/schemas/Error'
|
|
240
|
+
example:
|
|
241
|
+
errors:
|
|
242
|
+
- message: Content-Type should equal application/json
|
|
243
|
+
'422':
|
|
244
|
+
description: |-
|
|
245
|
+
The request body is empty, or is an empty container (`{}` or
|
|
246
|
+
`[]`).
|
|
247
|
+
content:
|
|
248
|
+
application/json:
|
|
249
|
+
schema:
|
|
250
|
+
$ref: '#/components/schemas/Error'
|
|
251
|
+
example:
|
|
252
|
+
errors:
|
|
253
|
+
- code: missing_request_body
|
|
254
|
+
message: Please send state as request body in the PUT request.
|
|
255
|
+
delete:
|
|
256
|
+
x-internal: false
|
|
257
|
+
operationId: deleteGlobalStateKey
|
|
258
|
+
tags:
|
|
259
|
+
- State
|
|
260
|
+
summary: Delete a global state key
|
|
261
|
+
description: |-
|
|
262
|
+
Deletes a specific global state key and its value. Returns `404`
|
|
263
|
+
if the key does not exist.
|
|
264
|
+
parameters:
|
|
265
|
+
- name: key
|
|
266
|
+
in: path
|
|
267
|
+
required: true
|
|
268
|
+
schema:
|
|
269
|
+
type: string
|
|
270
|
+
examples:
|
|
271
|
+
- sequence_number
|
|
272
|
+
description: The state key name.
|
|
273
|
+
responses:
|
|
274
|
+
'204':
|
|
275
|
+
description: Key deleted.
|
|
276
|
+
'401':
|
|
277
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
278
|
+
'404':
|
|
279
|
+
description: The key does not exist.
|
|
280
|
+
content:
|
|
281
|
+
application/json:
|
|
282
|
+
schema:
|
|
283
|
+
$ref: '#/components/schemas/Error'
|
|
284
|
+
example:
|
|
285
|
+
errors:
|
|
286
|
+
- message: State not found for key.
|
|
287
|
+
/v1/{resourceType}/{_resourceId}/state:
|
|
288
|
+
get:
|
|
289
|
+
x-internal: false
|
|
290
|
+
operationId: listResourceStateKeys
|
|
291
|
+
tags:
|
|
292
|
+
- State
|
|
293
|
+
summary: List state keys for a resource
|
|
294
|
+
description: |-
|
|
295
|
+
Returns the list of state key names stored under the specified
|
|
296
|
+
resource. These keys are separate from global state.
|
|
297
|
+
|
|
298
|
+
Returns `204 No Content` when no keys exist for the resource.
|
|
299
|
+
|
|
300
|
+
Only `exports`, `imports`, and `integrations` support
|
|
301
|
+
resource-scoped state. Other resource types return `403`.
|
|
302
|
+
|
|
303
|
+
This only lists key names, not values. Call
|
|
304
|
+
`GET /v1/{resourceType}/{_resourceId}/state/{key}` to retrieve a
|
|
305
|
+
specific value.
|
|
306
|
+
parameters:
|
|
307
|
+
- name: resourceType
|
|
308
|
+
in: path
|
|
309
|
+
required: true
|
|
310
|
+
schema:
|
|
311
|
+
type: string
|
|
312
|
+
enum:
|
|
313
|
+
- exports
|
|
314
|
+
- imports
|
|
315
|
+
- integrations
|
|
316
|
+
x-enumDescriptions:
|
|
317
|
+
exports: State scoped to a specific export
|
|
318
|
+
imports: State scoped to a specific import
|
|
319
|
+
integrations: State scoped to a specific integration
|
|
320
|
+
description: |-
|
|
321
|
+
The resource type. Only `exports`, `imports`, and
|
|
322
|
+
`integrations` are supported.
|
|
323
|
+
- name: _resourceId
|
|
324
|
+
in: path
|
|
325
|
+
required: true
|
|
326
|
+
schema:
|
|
327
|
+
type: string
|
|
328
|
+
format: objectId
|
|
329
|
+
examples:
|
|
330
|
+
- 66a1f2c3b4d5e6f7a8b9c0d1
|
|
331
|
+
description: The resource ID.
|
|
332
|
+
responses:
|
|
333
|
+
'200':
|
|
334
|
+
description: Object containing an array of key names.
|
|
335
|
+
content:
|
|
336
|
+
application/json:
|
|
337
|
+
schema:
|
|
338
|
+
type: object
|
|
339
|
+
required:
|
|
340
|
+
- keys
|
|
341
|
+
properties:
|
|
342
|
+
keys:
|
|
343
|
+
type: array
|
|
344
|
+
items:
|
|
345
|
+
type: string
|
|
346
|
+
example:
|
|
347
|
+
keys:
|
|
348
|
+
- sequence_number
|
|
349
|
+
- last_sync_time
|
|
350
|
+
'204':
|
|
351
|
+
description: No state keys exist for this resource.
|
|
352
|
+
'400':
|
|
353
|
+
description: The resource ID is not a valid identifier.
|
|
354
|
+
content:
|
|
355
|
+
application/json:
|
|
356
|
+
schema:
|
|
357
|
+
$ref: '#/components/schemas/Error'
|
|
358
|
+
example:
|
|
359
|
+
errors:
|
|
360
|
+
- code: invalid_ref
|
|
361
|
+
message: Please provide a valid _id.
|
|
362
|
+
'401':
|
|
363
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
364
|
+
'403':
|
|
365
|
+
description: |-
|
|
366
|
+
The resource type does not support state. Only `exports`,
|
|
367
|
+
`imports`, and `integrations` are allowed.
|
|
368
|
+
content:
|
|
369
|
+
application/json:
|
|
370
|
+
schema:
|
|
371
|
+
$ref: '#/components/schemas/Error'
|
|
372
|
+
example:
|
|
373
|
+
errors:
|
|
374
|
+
- code: invalid_ref
|
|
375
|
+
message: State not available for the given model.
|
|
376
|
+
'404':
|
|
377
|
+
description: The resource was not found.
|
|
378
|
+
content:
|
|
379
|
+
application/json:
|
|
380
|
+
schema:
|
|
381
|
+
$ref: '#/components/schemas/Error'
|
|
382
|
+
example:
|
|
383
|
+
errors:
|
|
384
|
+
- code: invalid_ref
|
|
385
|
+
message: Export not found.
|
|
386
|
+
delete:
|
|
387
|
+
x-internal: false
|
|
388
|
+
operationId: deleteAllResourceState
|
|
389
|
+
tags:
|
|
390
|
+
- State
|
|
391
|
+
summary: Delete all state keys for a resource
|
|
392
|
+
description: |-
|
|
393
|
+
Deletes **all** state keys and values stored under the specified
|
|
394
|
+
resource. This is destructive and cannot be undone.
|
|
395
|
+
|
|
396
|
+
Prefer `DELETE /v1/{resourceType}/{_resourceId}/state/{key}` to remove
|
|
397
|
+
individual keys.
|
|
398
|
+
parameters:
|
|
399
|
+
- name: resourceType
|
|
400
|
+
in: path
|
|
401
|
+
required: true
|
|
402
|
+
schema:
|
|
403
|
+
type: string
|
|
404
|
+
enum:
|
|
405
|
+
- exports
|
|
406
|
+
- imports
|
|
407
|
+
- integrations
|
|
408
|
+
x-enumDescriptions:
|
|
409
|
+
exports: State scoped to a specific export
|
|
410
|
+
imports: State scoped to a specific import
|
|
411
|
+
integrations: State scoped to a specific integration
|
|
412
|
+
description: |-
|
|
413
|
+
The resource type. Only `exports`, `imports`, and
|
|
414
|
+
`integrations` are supported.
|
|
415
|
+
- name: _resourceId
|
|
416
|
+
in: path
|
|
417
|
+
required: true
|
|
418
|
+
schema:
|
|
419
|
+
type: string
|
|
420
|
+
format: objectId
|
|
421
|
+
examples:
|
|
422
|
+
- 66a1f2c3b4d5e6f7a8b9c0d1
|
|
423
|
+
description: The resource ID.
|
|
424
|
+
responses:
|
|
425
|
+
'204':
|
|
426
|
+
description: All resource state deleted.
|
|
427
|
+
'400':
|
|
428
|
+
description: The resource ID is not a valid identifier.
|
|
429
|
+
content:
|
|
430
|
+
application/json:
|
|
431
|
+
schema:
|
|
432
|
+
$ref: '#/components/schemas/Error'
|
|
433
|
+
example:
|
|
434
|
+
errors:
|
|
435
|
+
- code: invalid_ref
|
|
436
|
+
message: Please provide a valid _id.
|
|
437
|
+
'401':
|
|
438
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
439
|
+
'403':
|
|
440
|
+
description: The resource type does not support state.
|
|
441
|
+
content:
|
|
442
|
+
application/json:
|
|
443
|
+
schema:
|
|
444
|
+
$ref: '#/components/schemas/Error'
|
|
445
|
+
example:
|
|
446
|
+
errors:
|
|
447
|
+
- code: invalid_ref
|
|
448
|
+
message: State not available for the given model.
|
|
449
|
+
'404':
|
|
450
|
+
description: The resource was not found.
|
|
451
|
+
content:
|
|
452
|
+
application/json:
|
|
453
|
+
schema:
|
|
454
|
+
$ref: '#/components/schemas/Error'
|
|
455
|
+
example:
|
|
456
|
+
errors:
|
|
457
|
+
- code: invalid_ref
|
|
458
|
+
message: Export not found.
|
|
459
|
+
/v1/{resourceType}/{_resourceId}/state/{key}:
|
|
460
|
+
get:
|
|
461
|
+
x-internal: false
|
|
462
|
+
operationId: getResourceStateValue
|
|
463
|
+
tags:
|
|
464
|
+
- State
|
|
465
|
+
summary: Get a resource-scoped state value
|
|
466
|
+
description: |-
|
|
467
|
+
Returns the JSON value stored under the given key for a specific
|
|
468
|
+
resource.
|
|
469
|
+
|
|
470
|
+
Only `exports`, `imports`, and `integrations` support
|
|
471
|
+
resource-scoped state.
|
|
472
|
+
|
|
473
|
+
Returns the raw JSON value (object or array), not wrapped in an envelope.
|
|
474
|
+
A 403 means the resource type doesn't support state, not a permissions
|
|
475
|
+
issue.
|
|
476
|
+
parameters:
|
|
477
|
+
- name: resourceType
|
|
478
|
+
in: path
|
|
479
|
+
required: true
|
|
480
|
+
schema:
|
|
481
|
+
type: string
|
|
482
|
+
enum:
|
|
483
|
+
- exports
|
|
484
|
+
- imports
|
|
485
|
+
- integrations
|
|
486
|
+
x-enumDescriptions:
|
|
487
|
+
exports: State scoped to a specific export
|
|
488
|
+
imports: State scoped to a specific import
|
|
489
|
+
integrations: State scoped to a specific integration
|
|
490
|
+
description: |-
|
|
491
|
+
The resource type. Only `exports`, `imports`, and
|
|
492
|
+
`integrations` are supported.
|
|
493
|
+
- name: _resourceId
|
|
494
|
+
in: path
|
|
495
|
+
required: true
|
|
496
|
+
schema:
|
|
497
|
+
type: string
|
|
498
|
+
format: objectId
|
|
499
|
+
examples:
|
|
500
|
+
- 66a1f2c3b4d5e6f7a8b9c0d1
|
|
501
|
+
description: The resource ID.
|
|
502
|
+
- name: key
|
|
503
|
+
in: path
|
|
504
|
+
required: true
|
|
505
|
+
schema:
|
|
506
|
+
type: string
|
|
507
|
+
examples:
|
|
508
|
+
- sequence_number
|
|
509
|
+
description: The state key name.
|
|
510
|
+
responses:
|
|
511
|
+
'200':
|
|
512
|
+
description: The stored value (a JSON object or array).
|
|
513
|
+
content:
|
|
514
|
+
application/json:
|
|
515
|
+
schema:
|
|
516
|
+
$ref: '#/components/schemas/State'
|
|
517
|
+
examples:
|
|
518
|
+
object:
|
|
519
|
+
summary: Object value
|
|
520
|
+
value:
|
|
521
|
+
cursor: '2025-08-10T14:22:33.000Z'
|
|
522
|
+
pageToken: abc123
|
|
523
|
+
array:
|
|
524
|
+
summary: Array value
|
|
525
|
+
value:
|
|
526
|
+
- id: 1001
|
|
527
|
+
status: synced
|
|
528
|
+
- id: 1002
|
|
529
|
+
status: pending
|
|
530
|
+
'400':
|
|
531
|
+
description: The resource ID is not a valid identifier.
|
|
532
|
+
content:
|
|
533
|
+
application/json:
|
|
534
|
+
schema:
|
|
535
|
+
$ref: '#/components/schemas/Error'
|
|
536
|
+
example:
|
|
537
|
+
errors:
|
|
538
|
+
- code: invalid_ref
|
|
539
|
+
message: Please provide a valid _id.
|
|
540
|
+
'401':
|
|
541
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
542
|
+
'403':
|
|
543
|
+
description: The resource type does not support state.
|
|
544
|
+
content:
|
|
545
|
+
application/json:
|
|
546
|
+
schema:
|
|
547
|
+
$ref: '#/components/schemas/Error'
|
|
548
|
+
example:
|
|
549
|
+
errors:
|
|
550
|
+
- code: invalid_ref
|
|
551
|
+
message: State not available for the given model.
|
|
552
|
+
'404':
|
|
553
|
+
description: The resource or key was not found.
|
|
554
|
+
content:
|
|
555
|
+
application/json:
|
|
556
|
+
schema:
|
|
557
|
+
$ref: '#/components/schemas/Error'
|
|
558
|
+
example:
|
|
559
|
+
errors:
|
|
560
|
+
- message: State not found for key.
|
|
561
|
+
put:
|
|
562
|
+
x-internal: false
|
|
563
|
+
operationId: setResourceStateValue
|
|
564
|
+
tags:
|
|
565
|
+
- State
|
|
566
|
+
summary: Create or update a resource-scoped state value
|
|
567
|
+
description: |-
|
|
568
|
+
Sets the value for a state key under a specific resource. Creates
|
|
569
|
+
the key if it does not exist; replaces the value if it does.
|
|
570
|
+
|
|
571
|
+
The request body must be a non-empty JSON object or array. Bare
|
|
572
|
+
JSON primitives (strings, numbers, booleans, `null`) and empty
|
|
573
|
+
containers (`{}`, `[]`) are rejected.
|
|
574
|
+
|
|
575
|
+
Only `exports`, `imports`, and `integrations` support
|
|
576
|
+
resource-scoped state.
|
|
577
|
+
|
|
578
|
+
This is an upsert — check the status code to distinguish create (201)
|
|
579
|
+
from update (200). The response body is plain text, not JSON.
|
|
580
|
+
parameters:
|
|
581
|
+
- name: resourceType
|
|
582
|
+
in: path
|
|
583
|
+
required: true
|
|
584
|
+
schema:
|
|
585
|
+
type: string
|
|
586
|
+
enum:
|
|
587
|
+
- exports
|
|
588
|
+
- imports
|
|
589
|
+
- integrations
|
|
590
|
+
x-enumDescriptions:
|
|
591
|
+
exports: State scoped to a specific export
|
|
592
|
+
imports: State scoped to a specific import
|
|
593
|
+
integrations: State scoped to a specific integration
|
|
594
|
+
description: |-
|
|
595
|
+
The resource type. Only `exports`, `imports`, and
|
|
596
|
+
`integrations` are supported.
|
|
597
|
+
- name: _resourceId
|
|
598
|
+
in: path
|
|
599
|
+
required: true
|
|
600
|
+
schema:
|
|
601
|
+
type: string
|
|
602
|
+
format: objectId
|
|
603
|
+
examples:
|
|
604
|
+
- 66a1f2c3b4d5e6f7a8b9c0d1
|
|
605
|
+
description: The resource ID.
|
|
606
|
+
- name: key
|
|
607
|
+
in: path
|
|
608
|
+
required: true
|
|
609
|
+
schema:
|
|
610
|
+
type: string
|
|
611
|
+
examples:
|
|
612
|
+
- sequence_number
|
|
613
|
+
description: The state key name.
|
|
614
|
+
requestBody:
|
|
615
|
+
required: true
|
|
616
|
+
content:
|
|
617
|
+
application/json:
|
|
618
|
+
schema:
|
|
619
|
+
description: |-
|
|
620
|
+
A non-empty JSON object or array to store. Bare primitives
|
|
621
|
+
and empty containers are not accepted.
|
|
622
|
+
$ref: '#/components/schemas/State'
|
|
623
|
+
examples:
|
|
624
|
+
object:
|
|
625
|
+
summary: Store an object
|
|
626
|
+
value:
|
|
627
|
+
cursor: '2025-08-10T14:22:33.000Z'
|
|
628
|
+
pageToken: abc123
|
|
629
|
+
array:
|
|
630
|
+
summary: Store an array
|
|
631
|
+
value:
|
|
632
|
+
- id: 1001
|
|
633
|
+
status: synced
|
|
634
|
+
- id: 1002
|
|
635
|
+
status: pending
|
|
636
|
+
responses:
|
|
637
|
+
'200':
|
|
638
|
+
description: Existing key updated.
|
|
639
|
+
content:
|
|
640
|
+
text/plain:
|
|
641
|
+
schema:
|
|
642
|
+
type: string
|
|
643
|
+
enum:
|
|
644
|
+
- OK
|
|
645
|
+
x-enumDescriptions:
|
|
646
|
+
OK: The existing key was updated successfully.
|
|
647
|
+
'201':
|
|
648
|
+
description: New key created.
|
|
649
|
+
content:
|
|
650
|
+
text/plain:
|
|
651
|
+
schema:
|
|
652
|
+
type: string
|
|
653
|
+
enum:
|
|
654
|
+
- Created
|
|
655
|
+
x-enumDescriptions:
|
|
656
|
+
Created: A new key was created successfully.
|
|
657
|
+
'400':
|
|
658
|
+
description: |-
|
|
659
|
+
Invalid request. The body is not valid JSON, is a bare
|
|
660
|
+
primitive, or the resource ID is invalid.
|
|
661
|
+
content:
|
|
662
|
+
application/json:
|
|
663
|
+
schema:
|
|
664
|
+
$ref: '#/components/schemas/Error'
|
|
665
|
+
examples:
|
|
666
|
+
invalid_json:
|
|
667
|
+
summary: Body is not valid JSON (bare primitive)
|
|
668
|
+
value:
|
|
669
|
+
errors:
|
|
670
|
+
- message: Unexpected token '"', ""just a string"" is not valid JSON
|
|
671
|
+
invalid_id:
|
|
672
|
+
summary: Resource ID is not a valid identifier
|
|
673
|
+
value:
|
|
674
|
+
errors:
|
|
675
|
+
- code: invalid_ref
|
|
676
|
+
message: Please provide a valid _id.
|
|
677
|
+
'401':
|
|
678
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
679
|
+
'403':
|
|
680
|
+
description: The resource type does not support state.
|
|
681
|
+
content:
|
|
682
|
+
application/json:
|
|
683
|
+
schema:
|
|
684
|
+
$ref: '#/components/schemas/Error'
|
|
685
|
+
example:
|
|
686
|
+
errors:
|
|
687
|
+
- code: invalid_ref
|
|
688
|
+
message: State not available for the given model.
|
|
689
|
+
'404':
|
|
690
|
+
description: The resource was not found.
|
|
691
|
+
content:
|
|
692
|
+
application/json:
|
|
693
|
+
schema:
|
|
694
|
+
$ref: '#/components/schemas/Error'
|
|
695
|
+
example:
|
|
696
|
+
errors:
|
|
697
|
+
- code: invalid_ref
|
|
698
|
+
message: Export not found.
|
|
699
|
+
'415':
|
|
700
|
+
description: |-
|
|
701
|
+
The `Content-Type` header is missing or is not
|
|
702
|
+
`application/json`.
|
|
703
|
+
content:
|
|
704
|
+
application/json:
|
|
705
|
+
schema:
|
|
706
|
+
$ref: '#/components/schemas/Error'
|
|
707
|
+
example:
|
|
708
|
+
errors:
|
|
709
|
+
- message: Content-Type should equal application/json
|
|
710
|
+
'422':
|
|
711
|
+
description: |-
|
|
712
|
+
The request body is empty, or is an empty container (`{}` or
|
|
713
|
+
`[]`).
|
|
714
|
+
content:
|
|
715
|
+
application/json:
|
|
716
|
+
schema:
|
|
717
|
+
$ref: '#/components/schemas/Error'
|
|
718
|
+
example:
|
|
719
|
+
errors:
|
|
720
|
+
- code: missing_request_body
|
|
721
|
+
message: Please send state as request body in the PUT request.
|
|
722
|
+
delete:
|
|
723
|
+
x-internal: false
|
|
724
|
+
operationId: deleteResourceStateKey
|
|
725
|
+
tags:
|
|
726
|
+
- State
|
|
727
|
+
summary: Delete a resource-scoped state key
|
|
728
|
+
description: |-
|
|
729
|
+
Deletes a specific state key and its value from the resource.
|
|
730
|
+
Returns `404` if the key does not exist.
|
|
731
|
+
parameters:
|
|
732
|
+
- name: resourceType
|
|
733
|
+
in: path
|
|
734
|
+
required: true
|
|
735
|
+
schema:
|
|
736
|
+
type: string
|
|
737
|
+
enum:
|
|
738
|
+
- exports
|
|
739
|
+
- imports
|
|
740
|
+
- integrations
|
|
741
|
+
x-enumDescriptions:
|
|
742
|
+
exports: State scoped to a specific export
|
|
743
|
+
imports: State scoped to a specific import
|
|
744
|
+
integrations: State scoped to a specific integration
|
|
745
|
+
description: |-
|
|
746
|
+
The resource type. Only `exports`, `imports`, and
|
|
747
|
+
`integrations` are supported.
|
|
748
|
+
- name: _resourceId
|
|
749
|
+
in: path
|
|
750
|
+
required: true
|
|
751
|
+
schema:
|
|
752
|
+
type: string
|
|
753
|
+
format: objectId
|
|
754
|
+
examples:
|
|
755
|
+
- 66a1f2c3b4d5e6f7a8b9c0d1
|
|
756
|
+
description: The resource ID.
|
|
757
|
+
- name: key
|
|
758
|
+
in: path
|
|
759
|
+
required: true
|
|
760
|
+
schema:
|
|
761
|
+
type: string
|
|
762
|
+
examples:
|
|
763
|
+
- sequence_number
|
|
764
|
+
description: The state key name.
|
|
765
|
+
responses:
|
|
766
|
+
'204':
|
|
767
|
+
description: Key deleted.
|
|
768
|
+
'400':
|
|
769
|
+
description: The resource ID is not a valid identifier.
|
|
770
|
+
content:
|
|
771
|
+
application/json:
|
|
772
|
+
schema:
|
|
773
|
+
$ref: '#/components/schemas/Error'
|
|
774
|
+
example:
|
|
775
|
+
errors:
|
|
776
|
+
- code: invalid_ref
|
|
777
|
+
message: Please provide a valid _id.
|
|
778
|
+
'401':
|
|
779
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
780
|
+
'403':
|
|
781
|
+
description: The resource type does not support state.
|
|
782
|
+
content:
|
|
783
|
+
application/json:
|
|
784
|
+
schema:
|
|
785
|
+
$ref: '#/components/schemas/Error'
|
|
786
|
+
example:
|
|
787
|
+
errors:
|
|
788
|
+
- code: invalid_ref
|
|
789
|
+
message: State not available for the given model.
|
|
790
|
+
'404':
|
|
791
|
+
description: The resource or key was not found.
|
|
792
|
+
content:
|
|
793
|
+
application/json:
|
|
794
|
+
schema:
|
|
795
|
+
$ref: '#/components/schemas/Error'
|
|
796
|
+
example:
|
|
797
|
+
errors:
|
|
798
|
+
- message: State not found for key.
|
|
799
|
+
components:
|
|
800
|
+
schemas:
|
|
801
|
+
State:
|
|
802
|
+
description: |-
|
|
803
|
+
A stored state value. Values must be non-empty JSON objects or arrays —
|
|
804
|
+
bare primitives, `null`, and empty containers (`{}`, `[]`) are rejected.
|
|
805
|
+
Keys are upserted: PUT creates the key if absent and replaces the value
|
|
806
|
+
if present.
|
|
807
|
+
oneOf:
|
|
808
|
+
- title: object
|
|
809
|
+
type: object
|
|
810
|
+
minProperties: 1
|
|
811
|
+
- title: array
|
|
812
|
+
type: array
|
|
813
|
+
minItems: 1
|
|
814
|
+
Error:
|
|
815
|
+
type: object
|
|
816
|
+
description: Standard error response envelope returned by integrator.io APIs.
|
|
817
|
+
properties:
|
|
818
|
+
errors:
|
|
819
|
+
type: array
|
|
820
|
+
description: List of errors that occurred while processing the request.
|
|
821
|
+
items:
|
|
822
|
+
type: object
|
|
823
|
+
properties:
|
|
824
|
+
code:
|
|
825
|
+
oneOf:
|
|
826
|
+
- type: string
|
|
827
|
+
- type: integer
|
|
828
|
+
description: |-
|
|
829
|
+
Machine-readable error code. Usually a string like
|
|
830
|
+
`invalid_ref`, `missing_required_field`, or `unauthorized`;
|
|
831
|
+
may be an **integer** when the error mirrors an upstream HTTP
|
|
832
|
+
status (e.g. `500`) — most commonly returned by connection-ping
|
|
833
|
+
and adaptor-proxy responses.
|
|
834
|
+
message:
|
|
835
|
+
type: string
|
|
836
|
+
description: Human-readable description of the error.
|
|
837
|
+
field:
|
|
838
|
+
type: string
|
|
839
|
+
description: |-
|
|
840
|
+
Optional pointer to the document field that caused the error.
|
|
841
|
+
Used by structural validation errors (`missing_required_field`,
|
|
842
|
+
`invalid_ref`) to indicate which field is at fault
|
|
843
|
+
(e.g. `_id`, `type`, `http.baseURI`).
|
|
844
|
+
source:
|
|
845
|
+
type: string
|
|
846
|
+
description: |-
|
|
847
|
+
Optional origin layer for the error — e.g. `application` when
|
|
848
|
+
the error came from the remote system the adaptor called,
|
|
849
|
+
`connector` when the adaptor itself rejected the request.
|
|
850
|
+
required:
|
|
851
|
+
- message
|
|
852
|
+
required:
|
|
853
|
+
- errors
|
|
854
|
+
securitySchemes:
|
|
855
|
+
bearerAuth:
|
|
856
|
+
type: http
|
|
857
|
+
scheme: bearer
|
|
858
|
+
responses:
|
|
859
|
+
401-unauthorized:
|
|
860
|
+
description: |-
|
|
861
|
+
Unauthorized. The request lacks a valid bearer token, or the provided token
|
|
862
|
+
failed to authenticate.
|
|
863
|
+
|
|
864
|
+
Note: the 401 response is produced by the auth middleware **before** the
|
|
865
|
+
request reaches the endpoint handler, so it does **not** follow the
|
|
866
|
+
standard `{errors: [...]}` envelope. Instead the body is a bare
|
|
867
|
+
`{message: string}` object with no `code`, no `errors` array. Callers
|
|
868
|
+
handling 401s should key off the HTTP status and the `message` string,
|
|
869
|
+
not try to destructure an `errors[]`.
|
|
870
|
+
content:
|
|
871
|
+
application/json:
|
|
872
|
+
schema:
|
|
873
|
+
type: object
|
|
874
|
+
properties:
|
|
875
|
+
message:
|
|
876
|
+
type: string
|
|
877
|
+
description: |-
|
|
878
|
+
Human-readable description of the auth failure. Known values:
|
|
879
|
+
- `"Unauthorized"` — no `Authorization` header on the request.
|
|
880
|
+
- `"Bearer Authentication Failed"` — header present but token
|
|
881
|
+
is invalid, revoked, or expired.
|
|
882
|
+
required:
|
|
883
|
+
- message
|
|
884
|
+
examples:
|
|
885
|
+
missing_token:
|
|
886
|
+
summary: No Authorization header sent
|
|
887
|
+
value:
|
|
888
|
+
message: Unauthorized
|
|
889
|
+
invalid_token:
|
|
890
|
+
summary: Bearer token invalid or revoked
|
|
891
|
+
value:
|
|
892
|
+
message: Bearer Authentication Failed
|
|
893
|
+
x-enable-proxy: true
|
|
894
|
+
x-internal: false
|