@proveanything/smartlinks 3.0.0-alpha.1 → 3.0.0-alpha.3

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 (272) hide show
  1. package/README.md +741 -741
  2. package/dist/README.md +573 -573
  3. package/dist/adminCardsView.js +55 -55
  4. package/dist/api/analytics.d.ts +5 -4
  5. package/dist/api/analytics.js +5 -4
  6. package/dist/api/appConfiguration.d.ts +23 -18
  7. package/dist/api/appConfiguration.js +24 -18
  8. package/dist/api/appObjects.d.ts +54 -10
  9. package/dist/api/appObjects.js +75 -40
  10. package/dist/api/asset.d.ts +28 -22
  11. package/dist/api/asset.js +45 -56
  12. package/dist/api/attestation.d.ts +11 -3
  13. package/dist/api/attestation.js +12 -3
  14. package/dist/api/attestations.d.ts +12 -8
  15. package/dist/api/attestations.js +18 -21
  16. package/dist/api/authKit.d.ts +15 -10
  17. package/dist/api/authKit.js +17 -11
  18. package/dist/api/batch.d.ts +36 -25
  19. package/dist/api/batch.js +46 -39
  20. package/dist/api/bookings.d.ts +67 -11
  21. package/dist/api/bookings.js +82 -15
  22. package/dist/api/broadcasts.js +3 -17
  23. package/dist/api/claimSet.d.ts +26 -12
  24. package/dist/api/claimSet.js +32 -24
  25. package/dist/api/collection.d.ts +15 -10
  26. package/dist/api/collection.js +17 -11
  27. package/dist/api/comms.d.ts +12 -6
  28. package/dist/api/comms.js +12 -6
  29. package/dist/api/conditions.d.ts +7 -6
  30. package/dist/api/conditions.js +8 -6
  31. package/dist/api/contact.d.ts +6 -2
  32. package/dist/api/contact.js +25 -60
  33. package/dist/api/containers.d.ts +14 -10
  34. package/dist/api/containers.js +19 -14
  35. package/dist/api/crate.js +7 -9
  36. package/dist/api/dpp.d.ts +20 -13
  37. package/dist/api/dpp.js +23 -15
  38. package/dist/api/facets.d.ts +38 -13
  39. package/dist/api/facets.js +40 -15
  40. package/dist/api/files.d.ts +5 -2
  41. package/dist/api/files.js +7 -4
  42. package/dist/api/form.d.ts +8 -5
  43. package/dist/api/form.js +9 -5
  44. package/dist/api/index.d.ts +1 -1
  45. package/dist/api/index.js +1 -1
  46. package/dist/api/integrations.d.ts +29 -17
  47. package/dist/api/integrations.js +32 -25
  48. package/dist/api/interactions.d.ts +11 -6
  49. package/dist/api/interactions.js +14 -23
  50. package/dist/api/jobs.d.ts +16 -6
  51. package/dist/api/jobs.js +30 -20
  52. package/dist/api/journeys.js +2 -14
  53. package/dist/api/journeysAnalytics.d.ts +8 -5
  54. package/dist/api/journeysAnalytics.js +8 -5
  55. package/dist/api/knowledge.d.ts +20 -14
  56. package/dist/api/knowledge.js +22 -15
  57. package/dist/api/location.d.ts +6 -3
  58. package/dist/api/location.js +8 -22
  59. package/dist/api/lots.d.ts +9 -5
  60. package/dist/api/lots.js +22 -26
  61. package/dist/api/loyalty.d.ts +25 -16
  62. package/dist/api/loyalty.js +33 -32
  63. package/dist/api/nfc.d.ts +3 -1
  64. package/dist/api/nfc.js +3 -1
  65. package/dist/api/order.d.ts +45 -39
  66. package/dist/api/order.js +48 -65
  67. package/dist/api/partner.d.ts +17 -14
  68. package/dist/api/partner.js +21 -22
  69. package/dist/api/payments.d.ts +60 -0
  70. package/dist/api/payments.js +94 -0
  71. package/dist/api/products.d.ts +35 -12
  72. package/dist/api/products.js +36 -13
  73. package/dist/api/proof.d.ts +41 -19
  74. package/dist/api/proof.js +44 -23
  75. package/dist/api/realtime.d.ts +3 -0
  76. package/dist/api/realtime.js +10 -2
  77. package/dist/api/segments.js +3 -15
  78. package/dist/api/serviceAccounts.d.ts +8 -5
  79. package/dist/api/serviceAccounts.js +9 -6
  80. package/dist/api/shop.d.ts +7 -5
  81. package/dist/api/shop.js +13 -19
  82. package/dist/api/subscriptions.d.ts +12 -10
  83. package/dist/api/subscriptions.js +17 -25
  84. package/dist/api/tags.d.ts +23 -20
  85. package/dist/api/tags.js +40 -52
  86. package/dist/api/template.d.ts +16 -11
  87. package/dist/api/template.js +19 -13
  88. package/dist/api/translations.js +2 -12
  89. package/dist/api/userGroups.d.ts +26 -16
  90. package/dist/api/userGroups.js +43 -30
  91. package/dist/api/variant.d.ts +10 -7
  92. package/dist/api/variant.js +11 -7
  93. package/dist/api/wallet.d.ts +14 -11
  94. package/dist/api/wallet.js +15 -12
  95. package/dist/baseline.css +194 -194
  96. package/dist/dataChanged.d.ts +74 -0
  97. package/dist/dataChanged.js +162 -0
  98. package/dist/docs/API_SUMMARY.md +1443 -1409
  99. package/dist/docs/admin-cards.md +189 -189
  100. package/dist/docs/agent-tools.md +156 -156
  101. package/dist/docs/ai-tools-and-skills.md +180 -180
  102. package/dist/docs/ai.md +1721 -1721
  103. package/dist/docs/analytics.md +1 -1
  104. package/dist/docs/api-versions.md +85 -85
  105. package/dist/docs/app-data-storage.md +277 -277
  106. package/dist/docs/app-docs.md +73 -73
  107. package/dist/docs/app-manifest.md +852 -852
  108. package/dist/docs/app-objects.md +4 -4
  109. package/dist/docs/app-records-pattern.md +388 -388
  110. package/dist/docs/appConfig.md +550 -550
  111. package/dist/docs/assistant-apps.md +172 -172
  112. package/dist/docs/assistant-context.md +119 -119
  113. package/dist/docs/attestations.md +8 -8
  114. package/dist/docs/bookings.md +105 -8
  115. package/dist/docs/caching.md +32 -3
  116. package/dist/docs/comms.md +689 -689
  117. package/dist/docs/connectors.md +340 -340
  118. package/dist/docs/contact-search.md +2 -3
  119. package/dist/docs/css-baseline.md +133 -133
  120. package/dist/docs/customer-guide.md +70 -70
  121. package/dist/docs/data-changed.md +91 -0
  122. package/dist/docs/deploying-apps.md +340 -340
  123. package/dist/docs/dpp.md +115 -115
  124. package/dist/docs/entitlements.md +90 -90
  125. package/dist/docs/files.md +69 -69
  126. package/dist/docs/host-dependency-contract.md +252 -252
  127. package/dist/docs/iframe-responder.md +11 -0
  128. package/dist/docs/integrations.md +322 -322
  129. package/dist/docs/interactions.md +544 -544
  130. package/dist/docs/item-context.md +181 -181
  131. package/dist/docs/knowledge.md +105 -105
  132. package/dist/docs/lists.md +157 -114
  133. package/dist/docs/lots.md +112 -112
  134. package/dist/docs/loyalty.md +348 -348
  135. package/dist/docs/members.md +183 -183
  136. package/dist/docs/memberships.md +150 -150
  137. package/dist/docs/mobile-admin-container.md +693 -693
  138. package/dist/docs/operations.md +281 -281
  139. package/dist/docs/overview.md +487 -485
  140. package/dist/docs/payments.md +94 -0
  141. package/dist/docs/proof-comms-triggers.md +142 -142
  142. package/dist/docs/proof-ownership-transfer.md +155 -155
  143. package/dist/docs/proof-product-data-scoping.md +462 -462
  144. package/dist/docs/proof-share-grants.md +305 -305
  145. package/dist/docs/realtime.md +149 -139
  146. package/dist/docs/records-admin-pattern.md +304 -304
  147. package/dist/docs/service-accounts.md +64 -64
  148. package/dist/docs/standard-query.md +196 -187
  149. package/dist/docs/tag-codes.md +97 -97
  150. package/dist/docs/tag-ranges.md +106 -106
  151. package/dist/docs/theme-tokens.md +252 -252
  152. package/dist/docs/upgrading-to-3.md +550 -430
  153. package/dist/docs/wallet-passes.md +107 -107
  154. package/dist/docs/websites.md +123 -123
  155. package/dist/http.d.ts +6 -3
  156. package/dist/http.js +48 -19
  157. package/dist/iframeResponder.d.ts +7 -0
  158. package/dist/iframeResponder.js +10 -0
  159. package/dist/index.d.ts +2 -0
  160. package/dist/index.js +2 -0
  161. package/dist/list.d.ts +12 -0
  162. package/dist/list.js +59 -0
  163. package/dist/openapi.yaml +722 -660
  164. package/dist/testing/bookingsMemory.d.ts +29 -1
  165. package/dist/testing/bookingsMemory.js +89 -1
  166. package/dist/testing/index.js +4 -1
  167. package/dist/theme-boot.js +82 -82
  168. package/dist/theme.css +75 -75
  169. package/dist/types/analytics.d.ts +7 -3
  170. package/dist/types/appManifest.d.ts +26 -4
  171. package/dist/types/appObjects.d.ts +27 -12
  172. package/dist/types/appOptions.d.ts +2 -2
  173. package/dist/types/asset.d.ts +5 -6
  174. package/dist/types/attestations.d.ts +7 -9
  175. package/dist/types/batch.d.ts +5 -5
  176. package/dist/types/bookings.d.ts +109 -6
  177. package/dist/types/comms.d.ts +9 -5
  178. package/dist/types/contact.d.ts +7 -4
  179. package/dist/types/containers.d.ts +2 -1
  180. package/dist/types/facets.d.ts +14 -2
  181. package/dist/types/files.d.ts +3 -2
  182. package/dist/types/index.d.ts +1 -0
  183. package/dist/types/index.js +1 -0
  184. package/dist/types/integrations.d.ts +2 -1
  185. package/dist/types/interaction.d.ts +15 -7
  186. package/dist/types/jobs.d.ts +1 -1
  187. package/dist/types/journeysAnalytics.d.ts +3 -2
  188. package/dist/types/knowledge.d.ts +6 -3
  189. package/dist/types/knowledge.js +0 -1
  190. package/dist/types/list.d.ts +30 -2
  191. package/dist/types/location.d.ts +7 -2
  192. package/dist/types/location.js +0 -1
  193. package/dist/types/lots.d.ts +5 -2
  194. package/dist/types/lots.js +0 -6
  195. package/dist/types/order.d.ts +22 -20
  196. package/dist/types/payments.d.ts +101 -0
  197. package/dist/types/payments.js +5 -0
  198. package/dist/types/product.d.ts +28 -11
  199. package/dist/types/proof.d.ts +7 -8
  200. package/dist/types/realtime.d.ts +5 -1
  201. package/dist/types/tags.d.ts +5 -3
  202. package/dist/types/userGroups.d.ts +3 -3
  203. package/dist/types/userGroups.js +0 -4
  204. package/dist/version.d.ts +1 -1
  205. package/dist/version.js +1 -1
  206. package/docs/API_SUMMARY.md +1443 -1409
  207. package/docs/admin-cards.md +189 -189
  208. package/docs/agent-tools.md +156 -156
  209. package/docs/ai-tools-and-skills.md +180 -180
  210. package/docs/ai.md +1721 -1721
  211. package/docs/analytics.md +1 -1
  212. package/docs/api-versions.md +85 -85
  213. package/docs/app-data-storage.md +277 -277
  214. package/docs/app-docs.md +73 -73
  215. package/docs/app-manifest.md +852 -852
  216. package/docs/app-objects.md +4 -4
  217. package/docs/app-records-pattern.md +388 -388
  218. package/docs/appConfig.md +550 -550
  219. package/docs/assistant-apps.md +172 -172
  220. package/docs/assistant-context.md +119 -119
  221. package/docs/attestations.md +8 -8
  222. package/docs/bookings.md +105 -8
  223. package/docs/caching.md +32 -3
  224. package/docs/comms.md +689 -689
  225. package/docs/connectors.md +340 -340
  226. package/docs/contact-search.md +2 -3
  227. package/docs/css-baseline.md +133 -133
  228. package/docs/customer-guide.md +70 -70
  229. package/docs/data-changed.md +91 -0
  230. package/docs/deploying-apps.md +340 -340
  231. package/docs/dpp.md +115 -115
  232. package/docs/entitlements.md +90 -90
  233. package/docs/files.md +69 -69
  234. package/docs/host-dependency-contract.md +252 -252
  235. package/docs/iframe-responder.md +11 -0
  236. package/docs/integrations.md +322 -322
  237. package/docs/interactions.md +544 -544
  238. package/docs/item-context.md +181 -181
  239. package/docs/knowledge.md +105 -105
  240. package/docs/lists.md +157 -114
  241. package/docs/lots.md +112 -112
  242. package/docs/loyalty.md +348 -348
  243. package/docs/members.md +183 -183
  244. package/docs/memberships.md +150 -150
  245. package/docs/mobile-admin-container.md +693 -693
  246. package/docs/operations.md +281 -281
  247. package/docs/overview.md +487 -485
  248. package/docs/payments.md +94 -0
  249. package/docs/proof-comms-triggers.md +142 -142
  250. package/docs/proof-ownership-transfer.md +155 -155
  251. package/docs/proof-product-data-scoping.md +462 -462
  252. package/docs/proof-share-grants.md +305 -305
  253. package/docs/realtime.md +149 -139
  254. package/docs/service-accounts.md +64 -64
  255. package/docs/standard-query.md +196 -187
  256. package/docs/tag-codes.md +97 -97
  257. package/docs/tag-ranges.md +106 -106
  258. package/docs/theme-lookbook.v1.json +120 -120
  259. package/docs/theme-tokens.md +252 -252
  260. package/docs/upgrading-to-3.md +550 -430
  261. package/docs/wallet-passes.md +107 -107
  262. package/docs/websites.md +123 -123
  263. package/openapi.yaml +722 -660
  264. package/package.json +91 -91
  265. package/scripts/headless-check.mjs +87 -87
  266. package/scripts/lib/bare-imports.mjs +57 -57
  267. package/scripts/lib/keyed-app-data.mjs +21 -21
  268. package/scripts/lib/upgrade.mjs +708 -512
  269. package/scripts/publish.mjs +272 -272
  270. package/scripts/register-release.mjs +91 -91
  271. package/scripts/upgrade.mjs +79 -56
  272. package/upgrade/3.json +2731 -2213
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 3.0.0-alpha.1 | Generated: 2026-11-24T15:23:46.728Z
3
+ Version: 3.0.0-alpha.3 | Generated: 2026-12-04T21:06:10.095Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -141,7 +141,6 @@ The Smartlinks SDK is organized into the following namespaces:
141
141
  - **adminCards** - Functions for adminCards operations
142
142
  - **aiGuide** - Functions for aiGuide operations
143
143
  - **analytics** - Functions for analytics operations
144
- - **async** - Functions for async operations
145
144
  - **attestation** - Functions for attestation operations
146
145
  - **attestations** - Functions for attestations operations
147
146
  - **bookings** - Functions for bookings operations
@@ -164,6 +163,7 @@ The Smartlinks SDK is organized into the following namespaces:
164
163
  - **operations** - Functions for operations operations
165
164
  - **order** - Functions for order operations
166
165
  - **partner** - Functions for partner operations
166
+ - **payments** - Functions for payments operations
167
167
  - **places** - Functions for places operations
168
168
  - **products** - Functions for products operations
169
169
  - **realtime** - Functions for realtime operations
@@ -210,17 +210,17 @@ The release channel explicitly set for this app build (initializeApi({ appChanne
210
210
  **setAppChannel**(channel: string | undefined) → `void`
211
211
  Set (or clear) the release channel SL.functions calls target.
212
212
 
213
- **initializeApi**(options: {
214
- baseURL: string
215
- apiKey?: string
216
- bearerToken?: string
217
- proxyMode?: boolean
218
- ngrokSkipBrowserWarning?: boolean
219
- extraHeaders?: Record<string, string>
220
- /**
221
- * Declares the host platform. Set to `'native'` on native/Capacitor hosts to opt into
222
- * AuthKit refresh tokens — the SDK then sends `X-Client-Platform: native` on every
223
- * request, so login endpoints return `refreshToken`/`refreshTokenExpiresAt` and a
213
+ **initializeApi**(options: {
214
+ baseURL: string
215
+ apiKey?: string
216
+ bearerToken?: string
217
+ proxyMode?: boolean
218
+ ngrokSkipBrowserWarning?: boolean
219
+ extraHeaders?: Record<string, string>
220
+ /**
221
+ * Declares the host platform. Set to `'native'` on native/Capacitor hosts to opt into
222
+ * AuthKit refresh tokens — the SDK then sends `X-Client-Platform: native` on every
223
+ * request, so login endpoints return `refreshToken`/`refreshTokenExpiresAt` and a
224
224
  * short-lived access token. Omit (or `'web'`) → `void`
225
225
  Call this once (e.g. at app startup) to configure baseURL/auth.
226
226
 
@@ -251,56 +251,56 @@ Returns true if initializeApi() has been called at least once. Useful for guards
251
251
  **hasAuthCredentials**() → `boolean`
252
252
  Returns true if the SDK currently has any auth credential set (bearer token or API key). Use this as a cheap pre-flight check before calling endpoints that require authentication, to avoid issuing a network request that you already know will return a 401. ```ts if (hasAuthCredentials()) { const account = await auth.getAccount() } ```
253
253
 
254
- **configureSdkCache**(options: {
255
- enabled?: boolean
256
- ttlMs?: number
257
- maxEntries?: number
258
- persistence?: 'none' | 'indexeddb'
259
- persistenceTtlMs?: number
260
- serveStaleOnOffline?: boolean
261
- clearOnPageLoad?: boolean
254
+ **configureSdkCache**(options: {
255
+ enabled?: boolean
256
+ ttlMs?: number
257
+ maxEntries?: number
258
+ persistence?: 'none' | 'indexeddb'
259
+ persistenceTtlMs?: number
260
+ serveStaleOnOffline?: boolean
261
+ clearOnPageLoad?: boolean
262
262
  }) → `void`
263
- Configure the SDK's built-in in-memory GET cache. The cache is transparent — it sits inside the HTTP layer and requires no changes to your existing API calls. All GET requests benefit automatically. Per-resource rules (collections/products → 1 h, proofs → 30 s, etc.) override this value. in-memory only (`'none'`, default). Ignored in Node.js. fallback, from the original fetch time (default: 7 days). `SmartlinksOfflineError` with stale data instead of propagating the network error. caches on page load/refresh. IndexedDB persists for offline. ```ts // Enable IndexedDB persistence for offline support configureSdkCache({ persistence: 'indexeddb' }) // Disable cache entirely in test environments configureSdkCache({ enabled: false }) // Keep caches across page refreshes (not recommended for production) configureSdkCache({ clearOnPageLoad: false }) ```
263
+ Configure the SDK's built-in in-memory GET cache. The cache is transparent — it sits inside the HTTP layer and requires no changes to your existing API calls. Public GET requests benefit automatically. Admin GETs (`/admin/...`) are never kept, whatever is set here: see docs/caching.md. Per-resource rules (collections/products → 1 h, proofs → 30 s, etc.) override this value. in-memory only (`'none'`, default). Ignored in Node.js. fallback, from the original fetch time (default: 7 days). `SmartlinksOfflineError` with stale data instead of propagating the network error. caches on page load/refresh. IndexedDB persists for offline. ```ts // Enable IndexedDB persistence for offline support configureSdkCache({ persistence: 'indexeddb' }) // Disable cache entirely in test environments configureSdkCache({ enabled: false }) // Keep caches across page refreshes (not recommended for production) configureSdkCache({ clearOnPageLoad: false }) ```
264
264
 
265
265
  **invalidateCache**(urlPattern?: string, options?: InvalidateCacheOptions) → `void`
266
266
  Manually invalidate entries in the SDK's GET cache. Note: the GET cache is **in-memory, per page load** (with an optional L2 IndexedDB layer when persistence is enabled) — it does not persist across reloads unless you opt into persistence, so it rarely needs disabling "for correctness". *contains* this string is removed). With `{ exact: true }`, matches the path precisely. Omit to wipe the entire cache. ```ts invalidateCache() // clear everything invalidateCache('/collection/abc123') // that collection AND everything under it invalidateCache('/collection/abc123', { exact: true }) // ONLY that collection entry invalidateCache('/products/') // all canonical plural product responses ```
267
267
 
268
- **proxyUploadFormData**(path: string,
269
- formData: FormData,
268
+ **proxyUploadFormData**(path: string,
269
+ formData: FormData,
270
270
  onProgress?: (percent: number) → `void`
271
271
  Upload a FormData payload via proxy with progress events using chunked postMessage. Parent is expected to implement the counterpart protocol.
272
272
 
273
273
  **request**(path: string) → `Promise<T>`
274
- Internal helper that performs a GET request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. Cache pipeline (when caching is not skipped): L1 hit → return from memory (no I/O) L2 hit → return from IndexedDB, promote to L1 (no network) Miss → fetch from network, store in L1 + L2 Offline → serve stale L2 entry via SmartlinksOfflineError (if persistence enabled) Concurrent identical GETs share one in-flight promise (deduplication). Node-safe: IndexedDB calls are no-ops when IDB is unavailable.
274
+ Internal helper that performs a GET request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. Cache pipeline (when caching is not skipped): L1 hit → return from memory (no I/O) L2 hit → return from IndexedDB, promote to L1 (no network) Miss → fetch from network, store in L1 + L2 Offline → serve stale L2 entry via SmartlinksOfflineError (if persistence enabled) Admin paths (`/admin/...`) are never kept (see isAdminPath): every call goes to the network. Concurrent identical GETs share one in-flight promise (deduplication), admin ones included. Node-safe: IndexedDB calls are no-ops when IDB is unavailable.
275
275
 
276
- **post**(path: string,
277
- body: any,
276
+ **post**(path: string,
277
+ body: any,
278
278
  extraHeaders?: Record<string, string>) → `Promise<T>`
279
279
  Internal helper that performs a POST request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. If body is FormData, Content-Type is not set. Returns the parsed JSON as T, or throws an Error.
280
280
 
281
- **put**(path: string,
282
- body: any,
281
+ **put**(path: string,
282
+ body: any,
283
283
  extraHeaders?: Record<string, string>) → `Promise<T>`
284
284
  Internal helper that performs a PUT request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. If body is FormData, Content-Type is not set. Returns the parsed JSON as T, or throws an Error.
285
285
 
286
- **patch**(path: string,
287
- body: any,
286
+ **patch**(path: string,
287
+ body: any,
288
288
  extraHeaders?: Record<string, string>) → `Promise<T>`
289
289
  Internal helper that performs a PATCH request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. If body is FormData, Content-Type is not set. Returns the parsed JSON as T, or throws an Error.
290
290
 
291
- **requestWithOptions**(path: string,
291
+ **requestWithOptions**(path: string,
292
292
  options: RequestInit) → `Promise<T>`
293
293
  Internal helper that performs a request to `${baseURL}${path}` with custom options, injecting headers for apiKey or bearerToken if present. Returns the parsed JSON as T, or throws an Error.
294
294
 
295
- **requestStream**(path: string,
296
- options?: {
297
- method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
298
- body?: any
299
- headers?: Record<string, string>
295
+ **requestStream**(path: string,
296
+ options?: {
297
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
298
+ body?: any
299
+ headers?: Record<string, string>
300
300
  }) → `Promise<AsyncIterable<T>>`
301
301
  Internal helper that performs a streaming request using the shared auth and proxy transport. The response is expected to be `text/event-stream` with JSON payloads in `data:` frames.
302
302
 
303
- **del**(path: string,
303
+ **del**(path: string,
304
304
  extraHeaders?: Record<string, string>) → `Promise<T>`
305
305
  Internal helper that performs a DELETE request to `${baseURL}${path}`, injecting headers for apiKey or bearerToken if present. Returns the parsed JSON as T, or throws an Error.
306
306
 
@@ -2761,8 +2761,10 @@ interface ServerFunctionBookings {
2761
2761
  query(params?: BookingListQueryParams): Promise<PaginatedResponse<Booking>>;
2762
2762
  mine(params?: BookingListQueryParams): Promise<PaginatedResponse<Booking>>;
2763
2763
  update(bookingId: string, fields: UpdateBookingInput): Promise<Booking>;
2764
- confirm(bookingId: string): Promise<Booking>;
2765
- cancel(bookingId: string, opts?: { reason?: string }): Promise<Booking>;
2764
+ confirm(bookingId: string, opts?: { payment?: 'waive' }): Promise<Booking>;
2765
+ cancel(bookingId: string, opts?: { reason?: string; refund?: 'full' | 'none' | number }): Promise<Booking>;
2766
+ checkout(input: BookingCheckoutInput): Promise<Omit<BookingCheckoutResult, 'editToken'> & { replayed?: boolean }>;
2767
+ refund(bookingId: string, opts?: { amount?: number; reason?: string }): Promise<{ booking: Booking; refunded: number; pending: boolean }>;
2766
2768
  move(bookingId: string, input: MoveBookingInput): Promise<Booking>;
2767
2769
  extendHold(bookingId: string, holdMinutes: number): Promise<Booking>;
2768
2770
  complete(bookingId: string): Promise<Booking>;
@@ -3774,6 +3776,7 @@ interface MatchRecordsInput {
3774
3776
  strategy?: 'all' | 'best'
3775
3777
  recordType?: string
3776
3778
  limit?: number
3779
+ cursor?: string
3777
3780
  includeScheduled?: boolean
3778
3781
  includeExpired?: boolean
3779
3782
  at?: string
@@ -3889,6 +3892,7 @@ interface ResolveAllParams {
3889
3892
  recordType?: string
3890
3893
  tiers?: Array<'proof' | 'batch' | 'variant' | 'product' | 'rule' | 'facet' | 'collection'>
3891
3894
  limit?: number
3895
+ cursor?: string
3892
3896
  at?: string
3893
3897
  includeScheduled?: boolean
3894
3898
  includeExpired?: boolean
@@ -4109,18 +4113,6 @@ interface UploadFromUrlOptions {
4109
4113
  }
4110
4114
  ```
4111
4115
 
4112
- **ListAssetsOptions** (interface)
4113
- ```typescript
4114
- interface ListAssetsOptions {
4115
- scope:
4116
- | { type: 'collection'; collectionId: string }
4117
- | { type: 'product'; collectionId: string; productId: string }
4118
- | { type: 'proof'; collectionId: string; productId: string; proofId: string }
4119
- appId?: string
4120
- limit?: number
4121
- }
4122
- ```
4123
-
4124
4116
  **GetAssetOptions** (interface)
4125
4117
  ```typescript
4126
4118
  interface GetAssetOptions {
@@ -4493,8 +4485,7 @@ interface AttestationSummaryParams {
4493
4485
  attestationType: string
4494
4486
  valueField?: string
4495
4487
  groupBy?: AttestationGroupBy
4496
- recordedAfter?: string
4497
- recordedBefore?: string
4488
+ recordedAt?: DateRange
4498
4489
  limit?: number
4499
4490
  }
4500
4491
  ```
@@ -4523,8 +4514,7 @@ interface AttestationTreeSummaryParams {
4523
4514
  attestationType: string
4524
4515
  valueField?: string
4525
4516
  groupBy?: AttestationGroupBy
4526
- recordedAfter?: string
4527
- recordedBefore?: string
4517
+ recordedAt?: DateRange
4528
4518
  limit?: number
4529
4519
  includeItems?: boolean
4530
4520
  }
@@ -5382,15 +5372,6 @@ interface BatchUpdateRequest {
5382
5372
  }
5383
5373
  ```
5384
5374
 
5385
- **SearchBatchesRequest** (interface)
5386
- ```typescript
5387
- interface SearchBatchesRequest {
5388
- search?: string // Search term (batch ID or name)
5389
- productId?: string // Filter by specific product
5390
- limit?: number // Max results (default: 100)
5391
- }
5392
- ```
5393
-
5394
5375
  **BatchTag** (interface)
5395
5376
  ```typescript
5396
5377
  interface BatchTag {
@@ -5457,6 +5438,7 @@ interface Booking {
5457
5438
  admin?: Record<string, any>
5458
5439
  allocations: BookingAllocation[]
5459
5440
  editToken?: string
5441
+ payment?: BookingPayment
5460
5442
  }
5461
5443
  ```
5462
5444
 
@@ -5731,6 +5713,87 @@ interface StandardSchedule {
5731
5713
  }
5732
5714
  ```
5733
5715
 
5716
+ **BookingPaymentLine** (interface)
5717
+ ```typescript
5718
+ interface BookingPaymentLine {
5719
+ priceId: string
5720
+ label: string
5721
+ unitAmount: number
5722
+ quantity: number
5723
+ }
5724
+ ```
5725
+
5726
+ **BookingPayment** (interface)
5727
+ ```typescript
5728
+ interface BookingPayment {
5729
+ status: 'awaiting' | 'paid' | 'partially_refunded' | 'refunded' | 'waived'
5730
+ total: number
5731
+ currency: string
5732
+ refunded: number
5733
+ lines: BookingPaymentLine[]
5734
+ paidAt?: string
5735
+ payBy?: string
5736
+ requested?: boolean
5737
+ link?: string
5738
+ }
5739
+ ```
5740
+
5741
+ **BookingPrice** (interface)
5742
+ ```typescript
5743
+ interface BookingPrice {
5744
+ id: string
5745
+ label: string
5746
+ amount: number
5747
+ durationMinutes?: number
5748
+ resourceIds?: string[]
5749
+ }
5750
+ ```
5751
+
5752
+ **BookingPaymentsConfig** (interface)
5753
+ ```typescript
5754
+ interface BookingPaymentsConfig {
5755
+ required?: boolean
5756
+ currency?: string
5757
+ prices?: BookingPrice[]
5758
+ sessionMinutes?: number
5759
+ ownerCancelRefund?: 'full' | 'none'
5760
+ payWithinHours?: number
5761
+ successUrl?: string
5762
+ cancelUrl?: string
5763
+ allowedHosts?: string[]
5764
+ }
5765
+ ```
5766
+
5767
+ **BookingPriceLine** (interface)
5768
+ ```typescript
5769
+ interface BookingPriceLine {
5770
+ priceId: string
5771
+ quantity?: number
5772
+ }
5773
+ ```
5774
+
5775
+ **BookingCheckoutResult** (interface)
5776
+ ```typescript
5777
+ interface BookingCheckoutResult {
5778
+ booking: Booking
5779
+ editToken?: string
5780
+ checkoutUrl: string | null
5781
+ expiresAt: string | null
5782
+ total: number
5783
+ currency: string | null
5784
+ request?: boolean
5785
+ }
5786
+ ```
5787
+
5788
+ **BookingPayLinkResult** (interface)
5789
+ ```typescript
5790
+ interface BookingPayLinkResult {
5791
+ checkoutUrl?: string
5792
+ done?: 'paid' | 'closed'
5793
+ url?: string | null
5794
+ }
5795
+ ```
5796
+
5734
5797
  **BookingStatus** = ``
5735
5798
 
5736
5799
  **BookingVisibility** = `'public' | 'owner' | 'admin'`
@@ -5754,6 +5817,8 @@ type BookingResourceRef = { type: string; id: string }
5754
5817
 
5755
5818
  **ScheduleDay** = `'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'`
5756
5819
 
5820
+ **BookingRefundResult** = `Booking & { refunded: number`
5821
+
5757
5822
  ### broadcasts
5758
5823
 
5759
5824
  **BroadcastRecord** (interface)
@@ -6462,17 +6527,6 @@ interface CommunicationEvent {
6462
6527
  }
6463
6528
  ```
6464
6529
 
6465
- **CommsQueryByUser** (interface)
6466
- ```typescript
6467
- interface CommsQueryByUser {
6468
- userId?: string
6469
- contactId?: string
6470
- from?: string
6471
- to?: string
6472
- limit?: number
6473
- }
6474
- ```
6475
-
6476
6530
  **RecipientWithOutcome** (interface)
6477
6531
  ```typescript
6478
6532
  interface RecipientWithOutcome {
@@ -6480,18 +6534,6 @@ interface RecipientWithOutcome {
6480
6534
  }
6481
6535
  ```
6482
6536
 
6483
- **CommsRecipientIdsQuery** (interface)
6484
- ```typescript
6485
- interface CommsRecipientIdsQuery {
6486
- broadcastId?: string
6487
- journeyId?: string
6488
- idField?: IdField
6489
- from?: string
6490
- to?: string
6491
- limit?: number
6492
- }
6493
- ```
6494
-
6495
6537
  **CommsRecipientsWithoutInteractionQuery** (interface)
6496
6538
  ```typescript
6497
6539
  interface CommsRecipientsWithoutInteractionQuery {
@@ -6503,6 +6545,7 @@ interface CommsRecipientsWithoutInteractionQuery {
6503
6545
  from?: string
6504
6546
  to?: string
6505
6547
  limit?: number
6548
+ cursor?: string
6506
6549
  }
6507
6550
  ```
6508
6551
 
@@ -6519,6 +6562,7 @@ interface CommsRecipientsWithInteractionQuery {
6519
6562
  from?: string
6520
6563
  to?: string
6521
6564
  limit?: number
6565
+ cursor?: string
6522
6566
  }
6523
6567
  ```
6524
6568
 
@@ -6876,527 +6920,531 @@ interface TransactionalSendError {
6876
6920
 
6877
6921
  **EmailAttachmentSpec** = ``
6878
6922
 
6879
- **TransactionalSendResult** = `// src/types/comms.ts
6880
- // Communication and notification types for the Smartlinks API
6881
- import type { IdField } from './common'
6882
- import type { BroadcastChannel } from './broadcasts'
6883
- import type { ListResult } from './list'
6884
-
6885
- /**
6886
- * Target subject for notifications (product, collection, etc.)
6887
- */
6888
- export interface NotificationSubjectTarget {
6889
- /** Type of target entity */
6890
- type: 'product' | 'collection' | 'user' | 'batch' | 'proof'
6891
- /** ID of the target entity */
6892
- id: string
6893
- }
6894
-
6895
-
6896
- // Analytics & logging (communication events)
6897
-
6898
- export interface CommunicationEvent {
6899
- orgId: string
6900
- broadcastId?: string
6901
- journeyId?: string
6902
- userId?: string
6903
- contactId?: string
6904
- channel?: string
6905
- timestamp: string
6906
- eventType: string
6907
- outcome?: string | null
6908
- templateId?: string | null
6909
- [k: string]: any
6910
- }
6911
-
6912
- export interface CommsQueryByUser {
6913
- userId?: string
6914
- contactId?: string
6915
- from?: string
6916
- to?: string
6917
- limit?: number
6918
- }
6919
-
6920
- export type RecipientId = string
6921
- export interface RecipientWithOutcome { id: string; outcome: string }
6923
+ **TransactionalSendResult** = `// src/types/comms.ts
6924
+ // Communication and notification types for the Smartlinks API
6925
+ import type { IdField } from './common'
6926
+ import type { BroadcastChannel } from './broadcasts'
6927
+ import type { ListResult, ListOptions } from './list'
6928
+
6929
+ /**
6930
+ * Target subject for notifications (product, collection, etc.)
6931
+ */
6932
+ export interface NotificationSubjectTarget {
6933
+ /** Type of target entity */
6934
+ type: 'product' | 'collection' | 'user' | 'batch' | 'proof'
6935
+ /** ID of the target entity */
6936
+ id: string
6937
+ }
6938
+
6939
+
6940
+ // Analytics & logging (communication events)
6941
+
6942
+ export interface CommunicationEvent {
6943
+ orgId: string
6944
+ broadcastId?: string
6945
+ journeyId?: string
6946
+ userId?: string
6947
+ contactId?: string
6948
+ channel?: string
6949
+ timestamp: string
6950
+ eventType: string
6951
+ outcome?: string | null
6952
+ templateId?: string | null
6953
+ [k: string]: any
6954
+ }
6955
+
6956
+ /** `comms.queryByUser` options: who, the time window (`from` / `to`), plus `limit` and `cursor`. */
6957
+ export interface CommsQueryByUser extends ListOptions {
6958
+ userId?: string
6959
+ contactId?: string
6960
+ from?: string
6961
+ to?: string
6962
+ }
6963
+
6964
+ export type RecipientId = string
6965
+ export interface RecipientWithOutcome { id: string; outcome: string }
6966
+
6967
+ /** `comms.queryRecipientIds` options: the source, the time window (`from` / `to`), plus `limit` and `cursor`. */
6968
+ export interface CommsRecipientIdsQuery extends ListOptions {
6969
+ broadcastId?: string
6970
+ journeyId?: string
6971
+ idField?: IdField
6972
+ from?: string
6973
+ to?: string
6974
+ }
6975
+
6976
+ /** Who a broadcast or journey reached that did NOT then do an interaction. */
6977
+ export interface CommsRecipientsWithoutInteractionQuery {
6978
+ broadcastId?: string
6979
+ journeyId?: string
6980
+ /** The interaction to look for (its id). */
6981
+ interactionId?: string
6982
+ appId?: string
6983
+ idField?: IdField
6984
+ from?: string
6985
+ to?: string
6986
+ limit?: number
6987
+ /** A `nextCursor` from the previous page. */
6988
+ cursor?: string
6989
+ }
6990
+
6991
+ /** Who a broadcast or journey reached that then did an interaction. */
6992
+ export interface CommsRecipientsWithInteractionQuery {
6993
+ broadcastId?: string
6994
+ journeyId?: string
6995
+ /** The interaction to look for (its id). */
6996
+ interactionId?: string
6997
+ appId?: string
6998
+ outcome?: string
6999
+ idField?: IdField
7000
+ includeOutcome?: boolean
7001
+ from?: string
7002
+ to?: string
7003
+ limit?: number
7004
+ /** A `nextCursor` from the previous page. */
7005
+ cursor?: string
7006
+ }
7007
+
7008
+ export interface LogCommunicationEventBody {
7009
+ broadcastId?: string
7010
+ journeyId?: string
7011
+ userId?: string
7012
+ contactId?: string
7013
+ channel?: string
7014
+ eventType: string
7015
+ outcome?: string
7016
+ templateId?: string
7017
+ timestamp?: string
7018
+ [k: string]: any
7019
+ }
7020
+
7021
+ export interface LogBulkCommunicationEventsBody {
7022
+ params: { broadcastId?: string; journeyId?: string; [k: string]: any }
7023
+ ids: string[]
7024
+ idField?: IdField
7025
+ }
7026
+
7027
+ export interface AppendResult { success: true }
7028
+ export interface AppendBulkResult { success: true; count: number }
7029
+
7030
+ // Common recipient type used by segments and broadcasts
7031
+ export type Recipient = import('./contact').Contact
7032
+
7033
+ // Shared page response shape for recipient listings
7034
+ export interface RecipientsPage {
7035
+ items: Recipient[]
7036
+ total: number
7037
+ limit: number
7038
+ offset: number
7039
+ note?: string
7040
+ }
7041
+
7042
+ // Web Push (public client registration)
7043
+
7044
+ export interface PushSubscriptionJSON {
7045
+ endpoint: string
7046
+ keys?: {
7047
+ p256dh?: string
7048
+ auth?: string
7049
+ }
7050
+ }
7051
+
7052
+ export interface PushVapidResponse { publicKey: string }
7053
+ export interface PushSubscribeResponse { ok: true; id: string }
7054
+
7055
+ // Public: register a push contact method
7056
+ export interface RegisterPushMethodRequest {
7057
+ /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7058
+ contactId?: string
7059
+ endpoint: string
7060
+ keys: { p256dh: string; auth: string }
7061
+ meta?: Record<string, any>
7062
+ }
7063
+
7064
+ // Admin Comms Settings
7065
+
7066
+ export interface CommsSettings {
7067
+ unsub?: {
7068
+ requireToken?: boolean
7069
+ /** Secret for token generation; omitted unless includeSecret=true */
7070
+ secret?: string
7071
+ /** Convenience flag indicating a secret is set (masked responses) */
7072
+ hasSecret?: boolean
7073
+ }
7074
+ /** Map of topic keys to topic config */
7075
+ topics?: Record<string, TopicConfig>
7076
+ [k: string]: any
7077
+ }
7078
+
7079
+ export interface TopicConfig {
7080
+ label?: string
7081
+ description?: string
7082
+ /** Optional UI-only grouping labels */
7083
+ labels?: string[]
7084
+ /** Classification for UI and default policy guidance */
7085
+ classification?: 'transactional' | 'marketing'
7086
+ defaults?: {
7087
+ channels?: Partial<Record<BroadcastChannel, boolean>>
7088
+ topics?: Record<string, boolean | undefined>
7089
+ /** Default consent policy when explicit preferences are absent */
7090
+ policy?: 'opt-in' | 'opt-out'
7091
+ /** Per-channel default policy (overrides policy when present) */
7092
+ byChannel?: Partial<Record<BroadcastChannel, 'opt-in' | 'opt-out'>>
7093
+ }
7094
+ rules?: {
7095
+ allowChannels?: BroadcastChannel[]
7096
+ allowUnsubscribe?: boolean
7097
+ required?: boolean
7098
+ }
7099
+ [k: string]: any
7100
+ }
7101
+
7102
+ export interface CommsSettingsGetResponse {
7103
+ ok: true
7104
+ settings: CommsSettings
7105
+ }
7106
+
7107
+ export type CommsSettingsPatchBody = Partial<CommsSettings>
7108
+
7109
+ // Public types listing (array form for public API)
7110
+ export interface CommsPublicTopicsResponse { ok: true; topics: Record<string, TopicConfig> }
7111
+
7112
+ export interface UnsubscribeQuery {
7113
+ /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7114
+ contactId?: string
7115
+ topic?: string
7116
+ channel?: BroadcastChannel
7117
+ token?: string
7118
+ }
7119
+
7120
+ export interface UnsubscribeResponse { ok: true; applied?: { channels?: Record<string, boolean>; topics?: Record<string, boolean> } }
7121
+
7122
+ // Public sign-up (double opt-in)
7123
+ export interface CommsSignupRequest {
7124
+ email: string
7125
+ /**
7126
+ * Required: YOUR app's confirmation email — a template in this collection (SL.template) whose body
7127
+ * uses `{{ action_url }}` for the confirm link (`{{ topics }}` lists what they signed up for). The
7128
+ * platform sends no default sign-up email.
7129
+ */
7130
+ templateId: string
7131
+ /** Topic ids from the collection's comm settings (e.g. ["newsletter"]). */
7132
+ topics?: string[]
7133
+ firstName?: string
7134
+ /**
7135
+ * The form's other answers — firstName/lastName/displayName/company/locale/timezone and
7136
+ * `customFields`. Applied to the contact when the address is confirmed, and only where the contact
7137
+ * has no value yet (never overwritten). Small: ~2 KB.
7138
+ */
7139
+ fields?: { firstName?: string; lastName?: string; displayName?: string; company?: string; locale?: string; timezone?: string; customFields?: Record<string, string | number | boolean> }
7140
+ /** Your app id, recorded with the sent email. */
7141
+ appId?: string
7142
+ }
7143
+ export interface CommsSignupResponse { ok: true; pending: true }
7144
+
7145
+ // Public consent/preferences/subscribe
7146
+ export type ConsentChannels = Partial<Record<BroadcastChannel, boolean>>
7147
+ type SubjectType = import('./contact').SubjectType
7148
+
7149
+ export interface CommsConsentUpsertRequest {
7150
+ /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7151
+ contactId?: string
7152
+ channels?: ConsentChannels
7153
+ topics?: Record<string, boolean>
7154
+ topicsByChannel?: Partial<Record<BroadcastChannel, Record<string, boolean>>>
7155
+ }
7156
+
7157
+ export interface CommsPreferencesUpsertRequest {
7158
+ /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7159
+ contactId?: string
7160
+ subject?: { type: SubjectType; id: string; productId?: string }
7161
+ channels?: ConsentChannels
7162
+ topics?: Record<string, boolean>
7163
+ topicsByChannel?: Partial<Record<BroadcastChannel, Record<string, boolean>>>
7164
+ }
7165
+
7166
+ export interface CommsSubscribeRequest {
7167
+ /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7168
+ contactId?: string
7169
+ subject: { type: SubjectType; id: string; productId?: string }
7170
+ subscribe: boolean
7171
+ source?: string
7172
+ }
7173
+ export interface CommsSubscribeResponse { ok: true; subscriptionId: string }
7174
+
7175
+ export interface CommsSubscriptionCheckQuery {
7176
+ /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7177
+ contactId?: string
7178
+ subjectType: SubjectType
7179
+ subjectId: string
7180
+ productId?: string
7181
+ }
7182
+ export interface CommsSubscriptionCheckResponse { ok: true; subscribed: boolean }
7183
+
7184
+ export interface CommsListMethodsQuery {
7185
+ /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7186
+ contactId?: string
7187
+ type?: BroadcastChannel
7188
+ }
7189
+ /** What `comms.listMethods` returns: the contact's registered methods in `items` (all of them; `nextCursor` is always null). */
7190
+ export type CommsListMethodsResponse = ListResult<import('./contact').CommMethod>
7191
+
7192
+ export interface RegisterEmailMethodRequest { contactId?: string; email?: string; userId?: string }
7193
+ export interface RegisterSmsMethodRequest { contactId?: string; phone?: string; userId?: string }
7194
+ export interface RegisterMethodResponse { ok: true; contactId: string }
7195
+
7196
+ export interface SubscriptionsResolveRequest {
7197
+ subject: { type: SubjectType; id: string; productId?: string }
7198
+ hints: { userId?: string; pushEndpoint?: string; email?: string }
7199
+ }
7200
+ export interface SubscriptionsResolveResponse {
7201
+ ok: true
7202
+ subject: { type: SubjectType; id: string; productId?: string }
7203
+ contacts: Array<{
7204
+ contactId: string
7205
+ subscribed: boolean
7206
+ channels?: Partial<Record<BroadcastChannel, boolean>>
7207
+ }>
7208
+ anySubscribed: boolean
7209
+ anyMethods: boolean
7210
+ }
7211
+
7212
+ // Transactional send (single-contact, single-message)
7213
+
7214
+ /**
7215
+ * Send a single message to one contact using a template.
7216
+ * No broadcast record is created; the send is logged directly to the
7217
+ * contact's communication history with sourceType: 'transactional'.
7218
+ *
7219
+ * POST /admin/collection/:collectionId/comm/send
7220
+ */
7221
+ export interface TransactionalSendRequest {
7222
+ /** CRM contact UUID */
7223
+ contactId: string
7224
+ /** A saved template's id. Give this or `message`. */
7225
+ templateId?: string
7226
+ /**
7227
+ * A typed message instead of a template: plain text, Liquid allowed (`{{ contact.firstName }}`).
7228
+ * `sms` is the shorter text for SMS and WhatsApp (defaults to `body`).
7229
+ */
7230
+ message?: TypedMessage
7231
+ /**
7232
+ * Channel to send on. Defaults to 'preferred', which auto-selects the
7233
+ * contact's best available channel respecting consent, suppression, and
7234
+ * template availability.
7235
+ */
7236
+ channel?: 'email' | 'sms' | 'whatsapp' | 'push' | 'wallet' | 'preferred'
7237
+ /** Extra Liquid variables merged into the top-level render context */
7238
+ props?: Record<string, unknown>
7239
+ /** Context objects to hydrate into the Liquid template */
7240
+ include?: {
7241
+ /** Hydrate {{ collection }}. Default: true */
7242
+ collection?: boolean
7243
+ /** Hydrate {{ product }} from this product ID */
7244
+ productId?: string
7245
+ /** Hydrate {{ proof }} (requires productId) */
7246
+ proofId?: string
7247
+ /** Hydrate {{ user }} from contact.userId */
7248
+ user?: boolean
7249
+ /** Hydrate {{ appCase }} from this case UUID */
7250
+ appCase?: string
7251
+ /** Hydrate {{ appThread }} from this thread UUID */
7252
+ appThread?: string
7253
+ /** Hydrate {{ appRecord }} from this record UUID */
7254
+ appRecord?: string
7255
+ }
7256
+ /** Arbitrary label stored on the comms-events row (e.g. 'warranty-step-2') */
7257
+ ref?: string
7258
+ /** App context stored on the comms-events row */
7259
+ appId?: string
7260
+ /**
7261
+ * What the message is about: the record it was sent for and the admin screen that shows it, so it is a
7262
+ * link in Messages, on the contact's Activity, and on the conversation a reply opens. `appId` defaults
7263
+ * to the sending app.
7264
+ */
7265
+ about?: MessageAbout
7266
+ /**
7267
+ * `'service'` (a confirmation, a reminder, an update): an asked-for channel the person turned off, or a
7268
+ * suppressed email, is refused (`transactional.opted_out`). Marketing goes out as a campaign.
7269
+ */
7270
+ category?: 'service'
7271
+ /**
7272
+ * Files to attach (email only; at most 5, 10 MB in all). What can't be made is left out and listed in
7273
+ * `attachmentsLeftOut` — the email still goes.
7274
+ */
7275
+ attach?: EmailAttachmentSpec[]
7276
+ }
7277
+
7278
+ /**
7279
+ * One file for an email:
7280
+ * - `'calendar'` — the booking's `.ics` calendar invite (needs `include.booking` and `appId`)
7281
+ * - `{ asset }` — a file uploaded to this collection's assets
7282
+ * - `{ function }` — the app's (`appId`) own server function makes it (see server-functions.md, "Making an email attachment")
7283
+ * - `{ filename, contentType, content }` — a file you made, base64 (PDF, Office documents, images, text, CSV, calendar)
7284
+ * - `{ filename, file }` — a private file you made (e.g. `pdf.create` with `return: 'signedUrl'`)
7285
+ */
7286
+ export type EmailAttachmentSpec =
7287
+ | 'calendar'
7288
+ | { asset: string }
7289
+ | { function: string }
7290
+ | { filename: string; contentType: string; content: string }
7291
+ | { filename: string; contentType?: string; file: string }
7292
+
7293
+ export interface TransactionalSendResponse {
7294
+ ok: true
7295
+ /** The channel the message was actually sent on */
7296
+ channel: 'email' | 'sms' | 'whatsapp' | 'push' | 'wallet'
7297
+ /** Provider message ID (email/SMS/WhatsApp); absent for push/wallet */
7298
+ messageId?: string
7299
+ /** Attachments that couldn't be made, and why (the email went without them) */
7300
+ attachmentsLeftOut?: string[]
7301
+ }
7302
+
7303
+ /** A message written there and then rather than a saved template. */
7304
+ export interface TypedMessage {
7305
+ subject?: string
7306
+ body: string
7307
+ /** The shorter text for SMS and WhatsApp (defaults to `body`). */
7308
+ sms?: string
7309
+ }
7310
+
7311
+ /**
7312
+ * What a message is about (docs/comms.md, "What a message is about"). Ids only, never content.
7313
+ * `view` and `params` name one of the app's admin views (manifest `adminViews`, docs/admin-views.md).
7314
+ */
7315
+ export interface MessageAbout {
7316
+ appId?: string
7317
+ /** What kind of record: `'booking'`, `'entry'`, `'case'`. */
7318
+ type: string
7319
+ id: string
7320
+ view?: string
7321
+ params?: Record<string, string>
7322
+ /** A short label to show without looking the record up: `'Sat 3pm, table for 4'`. */
7323
+ label?: string
7324
+ }
7325
+
7326
+ export interface TransactionalSendError {
7327
+ ok: false
7328
+ /**
7329
+ * Error code. Known values:
7330
+ * - `transactional.contact_not_found`
7331
+ * - `transactional.template_not_found`
7332
+ * - `transactional.no_channel_available`
7333
+ * - `transactional.email_missing`
7334
+ * - `transactional.phone_missing`
7335
+ * - `transactional.whatsapp_missing`
7336
+ * - `transactional.no_push_methods`
7337
+ * - `transactional.no_wallet_passes` (`channel: 'wallet'`: the person has no wallet passes from this app)
7338
+ * - `transactional.opted_out` (category `'service'`: the person turned that channel off, or the email is suppressed)
7339
+ * - `transactional.template_or_message` / `transactional.message_invalid` / `transactional.about_invalid`
7340
+ */
7341
+ error: string
7342
+ }
7343
+
7344
+ export type TransactionalSendResult =`
6922
7345
 
6923
- export interface CommsRecipientIdsQuery {
6924
- broadcastId?: string
6925
- journeyId?: string
6926
- idField?: IdField
6927
- from?: string
6928
- to?: string
6929
- limit?: number
6930
- }
7346
+ ### config
6931
7347
 
6932
- /** Who a broadcast or journey reached that did NOT then do an interaction. */
6933
- export interface CommsRecipientsWithoutInteractionQuery {
6934
- broadcastId?: string
6935
- journeyId?: string
6936
- /** The interaction to look for (its id). */
6937
- interactionId?: string
6938
- appId?: string
6939
- idField?: IdField
6940
- from?: string
6941
- to?: string
6942
- limit?: number
7348
+ **FieldOption** (interface)
7349
+ ```typescript
7350
+ interface FieldOption {
7351
+ label: string
7352
+ value: string
6943
7353
  }
7354
+ ```
6944
7355
 
6945
- /** Who a broadcast or journey reached that then did an interaction. */
6946
- export interface CommsRecipientsWithInteractionQuery {
6947
- broadcastId?: string
6948
- journeyId?: string
6949
- /** The interaction to look for (its id). */
6950
- interactionId?: string
6951
- appId?: string
6952
- outcome?: string
6953
- idField?: IdField
6954
- includeOutcome?: boolean
6955
- from?: string
6956
- to?: string
6957
- limit?: number
7356
+ **FieldDefinition** (interface)
7357
+ ```typescript
7358
+ interface FieldDefinition {
7359
+ id: string
7360
+ label: string
7361
+ storageKey?: string
7362
+ type: FieldType
7363
+ options?: FieldOption[]
7364
+ required?: boolean
7365
+ col?: number
7366
+ placeholder?: string
7367
+ help?: string
7368
+ min?: number
7369
+ max?: number
7370
+ step?: number
7371
+ rows?: number
7372
+ autoGrow?: boolean
7373
+ accept?: string
7374
+ clearable?: boolean
7375
+ disabled?: boolean
7376
+ showIf?: { field: string; equals: unknown }
6958
7377
  }
7378
+ ```
6959
7379
 
6960
- export interface LogCommunicationEventBody {
6961
- broadcastId?: string
6962
- journeyId?: string
6963
- userId?: string
6964
- contactId?: string
6965
- channel?: string
6966
- eventType: string
6967
- outcome?: string
6968
- templateId?: string
6969
- timestamp?: string
6970
- [k: string]: any
7380
+ **ProofTypeDefinition** (interface)
7381
+ ```typescript
7382
+ interface ProofTypeDefinition {
7383
+ id: string
7384
+ name: string
7385
+ description?: string
7386
+ category?: string
7387
+ active?: boolean
7388
+ group: boolean
7389
+ proofTypes?: ProofMechanism[]
7390
+ proofType?: ProofMechanism
7391
+ groupFields?: string[]
7392
+ proofFields?: string[]
7393
+ listFields?: Record<string, boolean>
7394
+ freeApps?: string[]
7395
+ apps?: string[]
7396
+ collection?: string
7397
+ action?: string
7398
+ bound?: 'soul'
7399
+ translations?: Record<string, string>
7400
+ hideProductTools?: boolean
6971
7401
  }
7402
+ ```
6972
7403
 
6973
- export interface LogBulkCommunicationEventsBody {
6974
- params: { broadcastId?: string; journeyId?: string; [k: string]: any }
6975
- ids: string[]
6976
- idField?: IdField
6977
- }
7404
+ **FieldType** = ``
6978
7405
 
6979
- export interface AppendResult { success: true }
6980
- export interface AppendBulkResult { success: true; count: number }
7406
+ **ProofMechanism** = ``
6981
7407
 
6982
- // Common recipient type used by segments and broadcasts
6983
- export type Recipient = import('./contact').Contact
7408
+ ### contact
6984
7409
 
6985
- // Shared page response shape for recipient listings
6986
- export interface RecipientsPage {
6987
- items: Recipient[]
6988
- total: number
6989
- limit: number
6990
- offset: number
6991
- note?: string
7410
+ **Contact** (interface)
7411
+ ```typescript
7412
+ interface Contact {
7413
+ contactId: string
7414
+ orgId: string
7415
+ userId: string | null
7416
+ firstName: string | null
7417
+ lastName: string | null
7418
+ displayName: string | null
7419
+ company: string | null
7420
+ email: string | null
7421
+ phone: string | null
7422
+ emails?: string[]
7423
+ phones?: string[]
7424
+ tags?: string[]
7425
+ source?: string | null
7426
+ notes?: string | null
7427
+ avatarUrl?: string | null
7428
+ locale?: string | null
7429
+ timezone?: string | null
7430
+ externalIds?: Record<string, any>
7431
+ comms?: CommsState
7432
+ customFields: ContactCustomFields
7433
+ createdAt: string
7434
+ updatedAt: string
7435
+ deletedAt: string | null
7436
+ erasedAt: string | null
6992
7437
  }
7438
+ ```
6993
7439
 
6994
- // Web Push (public client registration)
6995
-
6996
- export interface PushSubscriptionJSON {
6997
- endpoint: string
6998
- keys?: {
6999
- p256dh?: string
7000
- auth?: string
7001
- }
7440
+ **ContactDuplicatePair** (interface)
7441
+ ```typescript
7442
+ interface ContactDuplicatePair {
7443
+ keep: Contact
7444
+ merge: Contact
7445
+ matchedOn: "email" | "phone"
7002
7446
  }
7003
-
7004
- export interface PushVapidResponse { publicKey: string }
7005
- export interface PushSubscribeResponse { ok: true; id: string }
7006
-
7007
- // Public: register a push contact method
7008
- export interface RegisterPushMethodRequest {
7009
- /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7010
- contactId?: string
7011
- endpoint: string
7012
- keys: { p256dh: string; auth: string }
7013
- meta?: Record<string, any>
7014
- }
7015
-
7016
- // Admin Comms Settings
7017
-
7018
- export interface CommsSettings {
7019
- unsub?: {
7020
- requireToken?: boolean
7021
- /** Secret for token generation; omitted unless includeSecret=true */
7022
- secret?: string
7023
- /** Convenience flag indicating a secret is set (masked responses) */
7024
- hasSecret?: boolean
7025
- }
7026
- /** Map of topic keys to topic config */
7027
- topics?: Record<string, TopicConfig>
7028
- [k: string]: any
7029
- }
7030
-
7031
- export interface TopicConfig {
7032
- label?: string
7033
- description?: string
7034
- /** Optional UI-only grouping labels */
7035
- labels?: string[]
7036
- /** Classification for UI and default policy guidance */
7037
- classification?: 'transactional' | 'marketing'
7038
- defaults?: {
7039
- channels?: Partial<Record<BroadcastChannel, boolean>>
7040
- topics?: Record<string, boolean | undefined>
7041
- /** Default consent policy when explicit preferences are absent */
7042
- policy?: 'opt-in' | 'opt-out'
7043
- /** Per-channel default policy (overrides policy when present) */
7044
- byChannel?: Partial<Record<BroadcastChannel, 'opt-in' | 'opt-out'>>
7045
- }
7046
- rules?: {
7047
- allowChannels?: BroadcastChannel[]
7048
- allowUnsubscribe?: boolean
7049
- required?: boolean
7050
- }
7051
- [k: string]: any
7052
- }
7053
-
7054
- export interface CommsSettingsGetResponse {
7055
- ok: true
7056
- settings: CommsSettings
7057
- }
7058
-
7059
- export type CommsSettingsPatchBody = Partial<CommsSettings>
7060
-
7061
- // Public types listing (array form for public API)
7062
- export interface CommsPublicTopicsResponse { ok: true; topics: Record<string, TopicConfig> }
7063
-
7064
- export interface UnsubscribeQuery {
7065
- /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7066
- contactId?: string
7067
- topic?: string
7068
- channel?: BroadcastChannel
7069
- token?: string
7070
- }
7071
-
7072
- export interface UnsubscribeResponse { ok: true; applied?: { channels?: Record<string, boolean>; topics?: Record<string, boolean> } }
7073
-
7074
- // Public sign-up (double opt-in)
7075
- export interface CommsSignupRequest {
7076
- email: string
7077
- /**
7078
- * Required: YOUR app's confirmation email — a template in this collection (SL.template) whose body
7079
- * uses `{{ action_url }}` for the confirm link (`{{ topics }}` lists what they signed up for). The
7080
- * platform sends no default sign-up email.
7081
- */
7082
- templateId: string
7083
- /** Topic ids from the collection's comm settings (e.g. ["newsletter"]). */
7084
- topics?: string[]
7085
- firstName?: string
7086
- /**
7087
- * The form's other answers — firstName/lastName/displayName/company/locale/timezone and
7088
- * `customFields`. Applied to the contact when the address is confirmed, and only where the contact
7089
- * has no value yet (never overwritten). Small: ~2 KB.
7090
- */
7091
- fields?: { firstName?: string; lastName?: string; displayName?: string; company?: string; locale?: string; timezone?: string; customFields?: Record<string, string | number | boolean> }
7092
- /** Your app id, recorded with the sent email. */
7093
- appId?: string
7094
- }
7095
- export interface CommsSignupResponse { ok: true; pending: true }
7096
-
7097
- // Public consent/preferences/subscribe
7098
- export type ConsentChannels = Partial<Record<BroadcastChannel, boolean>>
7099
- type SubjectType = import('./contact').SubjectType
7100
-
7101
- export interface CommsConsentUpsertRequest {
7102
- /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7103
- contactId?: string
7104
- channels?: ConsentChannels
7105
- topics?: Record<string, boolean>
7106
- topicsByChannel?: Partial<Record<BroadcastChannel, Record<string, boolean>>>
7107
- }
7108
-
7109
- export interface CommsPreferencesUpsertRequest {
7110
- /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7111
- contactId?: string
7112
- subject?: { type: SubjectType; id: string; productId?: string }
7113
- channels?: ConsentChannels
7114
- topics?: Record<string, boolean>
7115
- topicsByChannel?: Partial<Record<BroadcastChannel, Record<string, boolean>>>
7116
- }
7117
-
7118
- export interface CommsSubscribeRequest {
7119
- /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7120
- contactId?: string
7121
- subject: { type: SubjectType; id: string; productId?: string }
7122
- subscribe: boolean
7123
- source?: string
7124
- }
7125
- export interface CommsSubscribeResponse { ok: true; subscriptionId: string }
7126
-
7127
- export interface CommsSubscriptionCheckQuery {
7128
- /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7129
- contactId?: string
7130
- subjectType: SubjectType
7131
- subjectId: string
7132
- productId?: string
7133
- }
7134
- export interface CommsSubscriptionCheckResponse { ok: true; subscribed: boolean }
7135
-
7136
- export interface CommsListMethodsQuery {
7137
- /** Optional: defaults to the signed-in user's own contact. Only collection admins may name another contact. */
7138
- contactId?: string
7139
- type?: BroadcastChannel
7140
- }
7141
- /** What `comms.listMethods` returns: the contact's registered methods in `items` (all of them; `nextCursor` is always null). */
7142
- export type CommsListMethodsResponse = ListResult<import('./contact').CommMethod>
7143
-
7144
- export interface RegisterEmailMethodRequest { contactId?: string; email?: string; userId?: string }
7145
- export interface RegisterSmsMethodRequest { contactId?: string; phone?: string; userId?: string }
7146
- export interface RegisterMethodResponse { ok: true; contactId: string }
7147
-
7148
- export interface SubscriptionsResolveRequest {
7149
- subject: { type: SubjectType; id: string; productId?: string }
7150
- hints: { userId?: string; pushEndpoint?: string; email?: string }
7151
- }
7152
- export interface SubscriptionsResolveResponse {
7153
- ok: true
7154
- subject: { type: SubjectType; id: string; productId?: string }
7155
- contacts: Array<{
7156
- contactId: string
7157
- subscribed: boolean
7158
- channels?: Partial<Record<BroadcastChannel, boolean>>
7159
- }>
7160
- anySubscribed: boolean
7161
- anyMethods: boolean
7162
- }
7163
-
7164
- // Transactional send (single-contact, single-message)
7165
-
7166
- /**
7167
- * Send a single message to one contact using a template.
7168
- * No broadcast record is created; the send is logged directly to the
7169
- * contact's communication history with sourceType: 'transactional'.
7170
- *
7171
- * POST /admin/collection/:collectionId/comm/send
7172
- */
7173
- export interface TransactionalSendRequest {
7174
- /** CRM contact UUID */
7175
- contactId: string
7176
- /** A saved template's id. Give this or `message`. */
7177
- templateId?: string
7178
- /**
7179
- * A typed message instead of a template: plain text, Liquid allowed (`{{ contact.firstName }}`).
7180
- * `sms` is the shorter text for SMS and WhatsApp (defaults to `body`).
7181
- */
7182
- message?: TypedMessage
7183
- /**
7184
- * Channel to send on. Defaults to 'preferred', which auto-selects the
7185
- * contact's best available channel respecting consent, suppression, and
7186
- * template availability.
7187
- */
7188
- channel?: 'email' | 'sms' | 'whatsapp' | 'push' | 'wallet' | 'preferred'
7189
- /** Extra Liquid variables merged into the top-level render context */
7190
- props?: Record<string, unknown>
7191
- /** Context objects to hydrate into the Liquid template */
7192
- include?: {
7193
- /** Hydrate {{ collection }}. Default: true */
7194
- collection?: boolean
7195
- /** Hydrate {{ product }} from this product ID */
7196
- productId?: string
7197
- /** Hydrate {{ proof }} (requires productId) */
7198
- proofId?: string
7199
- /** Hydrate {{ user }} from contact.userId */
7200
- user?: boolean
7201
- /** Hydrate {{ appCase }} from this case UUID */
7202
- appCase?: string
7203
- /** Hydrate {{ appThread }} from this thread UUID */
7204
- appThread?: string
7205
- /** Hydrate {{ appRecord }} from this record UUID */
7206
- appRecord?: string
7207
- }
7208
- /** Arbitrary label stored on the comms-events row (e.g. 'warranty-step-2') */
7209
- ref?: string
7210
- /** App context stored on the comms-events row */
7211
- appId?: string
7212
- /**
7213
- * What the message is about: the record it was sent for and the admin screen that shows it, so it is a
7214
- * link in Messages, on the contact's Activity, and on the conversation a reply opens. `appId` defaults
7215
- * to the sending app.
7216
- */
7217
- about?: MessageAbout
7218
- /**
7219
- * `'service'` (a confirmation, a reminder, an update): an asked-for channel the person turned off, or a
7220
- * suppressed email, is refused (`transactional.opted_out`). Marketing goes out as a campaign.
7221
- */
7222
- category?: 'service'
7223
- /**
7224
- * Files to attach (email only; at most 5, 10 MB in all). What can't be made is left out and listed in
7225
- * `attachmentsLeftOut` — the email still goes.
7226
- */
7227
- attach?: EmailAttachmentSpec[]
7228
- }
7229
-
7230
- /**
7231
- * One file for an email:
7232
- * - `'calendar'` — the booking's `.ics` calendar invite (needs `include.booking` and `appId`)
7233
- * - `{ asset }` — a file uploaded to this collection's assets
7234
- * - `{ function }` — the app's (`appId`) own server function makes it (see server-functions.md, "Making an email attachment")
7235
- * - `{ filename, contentType, content }` — a file you made, base64 (PDF, Office documents, images, text, CSV, calendar)
7236
- * - `{ filename, file }` — a private file you made (e.g. `pdf.create` with `return: 'signedUrl'`)
7237
- */
7238
- export type EmailAttachmentSpec =
7239
- | 'calendar'
7240
- | { asset: string }
7241
- | { function: string }
7242
- | { filename: string; contentType: string; content: string }
7243
- | { filename: string; contentType?: string; file: string }
7244
-
7245
- export interface TransactionalSendResponse {
7246
- ok: true
7247
- /** The channel the message was actually sent on */
7248
- channel: 'email' | 'sms' | 'whatsapp' | 'push' | 'wallet'
7249
- /** Provider message ID (email/SMS/WhatsApp); absent for push/wallet */
7250
- messageId?: string
7251
- /** Attachments that couldn't be made, and why (the email went without them) */
7252
- attachmentsLeftOut?: string[]
7253
- }
7254
-
7255
- /** A message written there and then rather than a saved template. */
7256
- export interface TypedMessage {
7257
- subject?: string
7258
- body: string
7259
- /** The shorter text for SMS and WhatsApp (defaults to `body`). */
7260
- sms?: string
7261
- }
7262
-
7263
- /**
7264
- * What a message is about (docs/comms.md, "What a message is about"). Ids only, never content.
7265
- * `view` and `params` name one of the app's admin views (manifest `adminViews`, docs/admin-views.md).
7266
- */
7267
- export interface MessageAbout {
7268
- appId?: string
7269
- /** What kind of record: `'booking'`, `'entry'`, `'case'`. */
7270
- type: string
7271
- id: string
7272
- view?: string
7273
- params?: Record<string, string>
7274
- /** A short label to show without looking the record up: `'Sat 3pm, table for 4'`. */
7275
- label?: string
7276
- }
7277
-
7278
- export interface TransactionalSendError {
7279
- ok: false
7280
- /**
7281
- * Error code. Known values:
7282
- * - `transactional.contact_not_found`
7283
- * - `transactional.template_not_found`
7284
- * - `transactional.no_channel_available`
7285
- * - `transactional.email_missing`
7286
- * - `transactional.phone_missing`
7287
- * - `transactional.whatsapp_missing`
7288
- * - `transactional.no_push_methods`
7289
- * - `transactional.no_wallet_passes` (`channel: 'wallet'`: the person has no wallet passes from this app)
7290
- * - `transactional.opted_out` (category `'service'`: the person turned that channel off, or the email is suppressed)
7291
- * - `transactional.template_or_message` / `transactional.message_invalid` / `transactional.about_invalid`
7292
- */
7293
- error: string
7294
- }
7295
-
7296
- export type TransactionalSendResult =`
7297
-
7298
- ### config
7299
-
7300
- **FieldOption** (interface)
7301
- ```typescript
7302
- interface FieldOption {
7303
- label: string
7304
- value: string
7305
- }
7306
- ```
7307
-
7308
- **FieldDefinition** (interface)
7309
- ```typescript
7310
- interface FieldDefinition {
7311
- id: string
7312
- label: string
7313
- storageKey?: string
7314
- type: FieldType
7315
- options?: FieldOption[]
7316
- required?: boolean
7317
- col?: number
7318
- placeholder?: string
7319
- help?: string
7320
- min?: number
7321
- max?: number
7322
- step?: number
7323
- rows?: number
7324
- autoGrow?: boolean
7325
- accept?: string
7326
- clearable?: boolean
7327
- disabled?: boolean
7328
- showIf?: { field: string; equals: unknown }
7329
- }
7330
- ```
7331
-
7332
- **ProofTypeDefinition** (interface)
7333
- ```typescript
7334
- interface ProofTypeDefinition {
7335
- id: string
7336
- name: string
7337
- description?: string
7338
- category?: string
7339
- active?: boolean
7340
- group: boolean
7341
- proofTypes?: ProofMechanism[]
7342
- proofType?: ProofMechanism
7343
- groupFields?: string[]
7344
- proofFields?: string[]
7345
- listFields?: Record<string, boolean>
7346
- freeApps?: string[]
7347
- apps?: string[]
7348
- collection?: string
7349
- action?: string
7350
- bound?: 'soul'
7351
- translations?: Record<string, string>
7352
- hideProductTools?: boolean
7353
- }
7354
- ```
7355
-
7356
- **FieldType** = ``
7357
-
7358
- **ProofMechanism** = ``
7359
-
7360
- ### contact
7361
-
7362
- **Contact** (interface)
7363
- ```typescript
7364
- interface Contact {
7365
- contactId: string
7366
- orgId: string
7367
- userId: string | null
7368
- firstName: string | null
7369
- lastName: string | null
7370
- displayName: string | null
7371
- company: string | null
7372
- email: string | null
7373
- phone: string | null
7374
- emails?: string[]
7375
- phones?: string[]
7376
- tags?: string[]
7377
- source?: string | null
7378
- notes?: string | null
7379
- avatarUrl?: string | null
7380
- locale?: string | null
7381
- timezone?: string | null
7382
- externalIds?: Record<string, any>
7383
- comms?: CommsState
7384
- customFields: ContactCustomFields
7385
- createdAt: string
7386
- updatedAt: string
7387
- deletedAt: string | null
7388
- erasedAt: string | null
7389
- }
7390
- ```
7391
-
7392
- **ContactDuplicatePair** (interface)
7393
- ```typescript
7394
- interface ContactDuplicatePair {
7395
- keep: Contact
7396
- merge: Contact
7397
- matchedOn: "email" | "phone"
7398
- }
7399
- ```
7447
+ ```
7400
7448
 
7401
7449
  **ContactMergeResponse** (interface)
7402
7450
  ```typescript
@@ -7741,15 +7789,6 @@ interface GetContainerParams {
7741
7789
  }
7742
7790
  ```
7743
7791
 
7744
- **FindContainersForItemParams** (interface)
7745
- ```typescript
7746
- interface FindContainersForItemParams {
7747
- itemType: ContainerItemType
7748
- itemId: string
7749
- productId?: string
7750
- }
7751
- ```
7752
-
7753
7792
  **ContainerStatus** = `'active' | 'archived' | string`
7754
7793
 
7755
7794
  **ContainerItemType** = `'tag' | 'proof'`
@@ -8162,6 +8201,9 @@ interface FacetQueryRequest {
8162
8201
  includeEmpty?: boolean
8163
8202
  includeDeleted?: boolean
8164
8203
  namespace?: string | null
8204
+ q?: string
8205
+ createdAt?: DateRange
8206
+ updatedAt?: DateRange
8165
8207
  query?: ProductQueryRequest["query"] & {
8166
8208
  facetEquals?: Record<string, JsonValue | JsonValue[]>
8167
8209
  }
@@ -8203,13 +8245,6 @@ interface FacetGetParams {
8203
8245
  }
8204
8246
  ```
8205
8247
 
8206
- **FacetValueListParams** (interface)
8207
- ```typescript
8208
- interface FacetValueListParams {
8209
- includeDeleted?: boolean
8210
- }
8211
- ```
8212
-
8213
8248
  **FacetValueGetParams** (interface)
8214
8249
  ```typescript
8215
8250
  interface FacetValueGetParams {
@@ -8249,17 +8284,6 @@ interface FetchFileRequest {
8249
8284
  }
8250
8285
  ```
8251
8286
 
8252
- **ListFilesQuery** (interface)
8253
- ```typescript
8254
- interface ListFilesQuery {
8255
- origin?: "upload" | "fetched" | "derived" | "generated"
8256
- retention?: "temporary" | "permanent"
8257
- appId?: string
8258
- derivedFromId?: string
8259
- limit?: number
8260
- }
8261
- ```
8262
-
8263
8287
  **ExtractFileRequest** (interface)
8264
8288
  ```typescript
8265
8289
  interface ExtractFileRequest {
@@ -8803,15 +8827,6 @@ interface CreateFlowInput {
8803
8827
  }
8804
8828
  ```
8805
8829
 
8806
- **ListFlowsQuery** (interface)
8807
- ```typescript
8808
- interface ListFlowsQuery {
8809
- direction?: FlowDirection
8810
- status?: FlowStatus
8811
- appId?: string
8812
- }
8813
- ```
8814
-
8815
8830
  **RunFlowInput** (interface)
8816
8831
  ```typescript
8817
8832
  interface RunFlowInput {
@@ -9100,27 +9115,6 @@ interface RecordTypeInfo {
9100
9115
 
9101
9116
  ### interaction
9102
9117
 
9103
- **AdminInteractionsQueryRequest** (interface)
9104
- ```typescript
9105
- interface AdminInteractionsQueryRequest {
9106
- userId?: string
9107
- contactId?: string
9108
- appId?: string
9109
- interactionId?: string
9110
- scope?: string
9111
- interactionIds?: string[]
9112
- broadcastId?: string
9113
- outcome?: string | null
9114
- from?: string
9115
- to?: string
9116
- limit?: number
9117
- includeDeleted?: boolean
9118
- latestPerEventId?: boolean
9119
- order?: 'ASC' | 'DESC'
9120
- include?: Array<'interaction'>
9121
- }
9122
- ```
9123
-
9124
9118
  **AdminInteractionsCountsByOutcomeRequest** (interface)
9125
9119
  ```typescript
9126
9120
  interface AdminInteractionsCountsByOutcomeRequest {
@@ -9193,17 +9187,6 @@ interface PublicInteractionsCountsByOutcomeRequest {
9193
9187
  }
9194
9188
  ```
9195
9189
 
9196
- **PublicInteractionsByUserRequest** (interface)
9197
- ```typescript
9198
- interface PublicInteractionsByUserRequest {
9199
- appId?: string
9200
- interactionId?: string
9201
- from?: string
9202
- to?: string
9203
- limit?: number
9204
- }
9205
- ```
9206
-
9207
9190
  **InteractionEventRow** (interface)
9208
9191
  ```typescript
9209
9192
  interface InteractionEventRow {
@@ -9599,19 +9582,6 @@ interface JourneyStatsResponse {
9599
9582
  }
9600
9583
  ```
9601
9584
 
9602
- **JourneyStepRecipientsRequest** (interface)
9603
- ```typescript
9604
- interface JourneyStepRecipientsRequest {
9605
- status?: 'entered' | 'completed' | 'pending'
9606
- idField?: IdField
9607
- interactionId?: string
9608
- outcome?: string
9609
- from?: string
9610
- to?: string
9611
- limit?: number
9612
- }
9613
- ```
9614
-
9615
9585
  **JourneyFunnelReportRequest** (interface)
9616
9586
  ```typescript
9617
9587
  interface JourneyFunnelReportRequest {
@@ -9724,16 +9694,6 @@ interface KnowledgeDocument {
9724
9694
  }
9725
9695
  ```
9726
9696
 
9727
- **KnowledgeSearchRequest** (interface)
9728
- ```typescript
9729
- interface KnowledgeSearchRequest {
9730
- query: string
9731
- sets?: string[]
9732
- filters?: Record<string, any>
9733
- k?: number
9734
- }
9735
- ```
9736
-
9737
9697
  **KnowledgeSearchResult** (interface)
9738
9698
  ```typescript
9739
9699
  interface KnowledgeSearchResult {
@@ -9782,6 +9742,16 @@ interface ListOptions {
9782
9742
  }
9783
9743
  ```
9784
9744
 
9745
+ **DateRange** (interface)
9746
+ ```typescript
9747
+ interface DateRange {
9748
+ gte?: string | Date
9749
+ lte?: string | Date
9750
+ }
9751
+ ```
9752
+
9753
+ **SortDirection** = `'asc' | 'desc'`
9754
+
9785
9755
  ### location
9786
9756
 
9787
9757
  **Location** (interface)
@@ -9806,18 +9776,6 @@ interface Location {
9806
9776
  }
9807
9777
  ```
9808
9778
 
9809
- **LocationSearchQuery** (interface)
9810
- ```typescript
9811
- interface LocationSearchQuery {
9812
- q?: string
9813
- category?: string
9814
- countryCode?: string
9815
- countryName?: string
9816
- limit?: number // default 20; max 100
9817
- sort?: 'name' | 'countryCode' | 'countryName' // default 'name'
9818
- }
9819
- ```
9820
-
9821
9779
  **Geofence** = ``
9822
9780
 
9823
9781
  **LocationPayload** = `Omit<`
@@ -9866,19 +9824,9 @@ interface LotCreateInput {
9866
9824
  description?: string
9867
9825
  selector?: LotSelector
9868
9826
  payload?: LotPayload
9869
- destination?: Record<string, any> | null
9870
- status?: LotStatus
9871
- id?: string
9872
- }
9873
- ```
9874
-
9875
- **ListLotsParams** (interface)
9876
- ```typescript
9877
- interface ListLotsParams {
9827
+ destination?: Record<string, any> | null
9878
9828
  status?: LotStatus
9879
- search?: string
9880
- productId?: string
9881
- includeDeleted?: boolean
9829
+ id?: string
9882
9830
  }
9883
9831
  ```
9884
9832
 
@@ -10759,23 +10707,6 @@ interface TagScanEvent {
10759
10707
  }
10760
10708
  ```
10761
10709
 
10762
- **TimelineRequest** (interface)
10763
- ```typescript
10764
- interface TimelineRequest {
10765
- limit?: number // Max results (default: 1000)
10766
- from?: string // ISO 8601 start date filter
10767
- to?: string // ISO 8601 end date filter
10768
- isAdmin?: boolean // Filter by admin scans only
10769
- }
10770
- ```
10771
-
10772
- **LocationRequest** (interface)
10773
- ```typescript
10774
- interface LocationRequest {
10775
- limit?: number // Max results (default: 1000)
10776
- }
10777
- ```
10778
-
10779
10710
  **BulkAnalyticsRequest** (interface)
10780
10711
  ```typescript
10781
10712
  interface BulkAnalyticsRequest {
@@ -10850,6 +10781,110 @@ interface CollectionSummaryResponse {
10850
10781
 
10851
10782
  **OrderDirection** = `'sales' | 'purchase'`
10852
10783
 
10784
+ ### payments
10785
+
10786
+ **PaymentsPublicConfig** (interface)
10787
+ ```typescript
10788
+ interface PaymentsPublicConfig {
10789
+ ready: boolean
10790
+ publishableKey: string | null
10791
+ accountId: string | null
10792
+ }
10793
+ ```
10794
+
10795
+ **PaymentIntentInput** (interface)
10796
+ ```typescript
10797
+ interface PaymentIntentInput {
10798
+ appId: string
10799
+ amount: number
10800
+ currency: string
10801
+ email?: string
10802
+ description?: string
10803
+ reference?: string
10804
+ metadata?: Record<string, string | number | boolean>
10805
+ cardOnly?: boolean
10806
+ idempotencyKey?: string
10807
+ }
10808
+ ```
10809
+
10810
+ **PaymentIntentResult** (interface)
10811
+ ```typescript
10812
+ interface PaymentIntentResult {
10813
+ paymentIntentId: string
10814
+ clientSecret: string
10815
+ publishableKey: string
10816
+ accountId: string
10817
+ amount: number
10818
+ currency: string
10819
+ fee: number
10820
+ }
10821
+ ```
10822
+
10823
+ **PaymentsStatus** (interface)
10824
+ ```typescript
10825
+ interface PaymentsStatus {
10826
+ connected: boolean
10827
+ accountId?: string
10828
+ chargesEnabled?: boolean | null
10829
+ detailsSubmitted?: boolean | null
10830
+ payoutsEnabled?: boolean | null
10831
+ platformReady: boolean
10832
+ publishableKeySet: boolean
10833
+ fees: Array<{ appId: string; bps: number; percent: number }>
10834
+ }
10835
+ ```
10836
+
10837
+ **PaymentsConnectInput** (interface)
10838
+ ```typescript
10839
+ interface PaymentsConnectInput {
10840
+ returnUrl: string
10841
+ refreshUrl: string
10842
+ country?: string
10843
+ }
10844
+ ```
10845
+
10846
+ **PaymentRecord** (interface)
10847
+ ```typescript
10848
+ interface PaymentRecord {
10849
+ id: string
10850
+ amount: number
10851
+ amountReceived: number
10852
+ currency: string
10853
+ status: string
10854
+ created: string
10855
+ email: string | null
10856
+ metadata: Record<string, string>
10857
+ }
10858
+ ```
10859
+
10860
+ **PaymentListParams** (interface)
10861
+ ```typescript
10862
+ interface PaymentListParams {
10863
+ appId?: string
10864
+ since?: string
10865
+ limit?: number
10866
+ after?: string
10867
+ }
10868
+ ```
10869
+
10870
+ **PaymentList** (interface)
10871
+ ```typescript
10872
+ interface PaymentList {
10873
+ data: PaymentRecord[]
10874
+ hasMore: boolean
10875
+ next: string | null
10876
+ }
10877
+ ```
10878
+
10879
+ **PaymentDomainResult** (interface)
10880
+ ```typescript
10881
+ interface PaymentDomainResult {
10882
+ domain: string
10883
+ applePay: string
10884
+ googlePay: string
10885
+ }
10886
+ ```
10887
+
10853
10888
  ### product
10854
10889
 
10855
10890
  **ProductKey** (interface)
@@ -11037,16 +11072,6 @@ interface ProofCreateRequest {
11037
11072
  }
11038
11073
  ```
11039
11074
 
11040
- **ProofFindQuery** (interface)
11041
- ```typescript
11042
- interface ProofFindQuery {
11043
- limit?: number
11044
- filterBy?: Array<{ field: string; value: JsonValue }>
11045
- includes?: string[]
11046
- [key: string]: any
11047
- }
11048
- ```
11049
-
11050
11075
  **ProofValuesUpdateRequest** (interface)
11051
11076
  ```typescript
11052
11077
  interface ProofValuesUpdateRequest {
@@ -12100,24 +12125,6 @@ interface LookupTagsQueryRequest {
12100
12125
  }
12101
12126
  ```
12102
12127
 
12103
- **ByRefRequest** (interface)
12104
- ```typescript
12105
- interface ByRefRequest {
12106
- refType: string
12107
- refId: string
12108
- embed?: string
12109
- }
12110
- ```
12111
-
12112
- **ReverseTagLookupParams** (interface)
12113
- ```typescript
12114
- interface ReverseTagLookupParams {
12115
- refType: string
12116
- refId: string
12117
- embed?: string
12118
- }
12119
- ```
12120
-
12121
12128
  **PublicGetTagResponse** (interface)
12122
12129
  ```typescript
12123
12130
  interface PublicGetTagResponse {
@@ -12428,17 +12435,6 @@ interface UserGroupChange {
12428
12435
  }
12429
12436
  ```
12430
12437
 
12431
- **UserGroupHistoryParams** (interface)
12432
- ```typescript
12433
- interface UserGroupHistoryParams {
12434
- userGroupId?: string
12435
- userId?: string
12436
- from?: string
12437
- to?: string
12438
- limit?: number
12439
- }
12440
- ```
12441
-
12442
12438
  **AddUserGroupMemberRequest** = ``
12443
12439
 
12444
12440
  **UserGroupChangeType** = ``
@@ -12707,36 +12703,36 @@ interface GuideStartOptions {
12707
12703
 
12708
12704
  **AppConfigOptions** (type)
12709
12705
  ```typescript
12710
- type AppConfigOptions = {
12711
- /** The app ID */
12712
- appId: string
12713
-
12714
- /** Collection ID (required for most operations) */
12715
- collectionId?: string
12716
- /** Product ID (optional - for product-scoped config) */
12717
- productId?: string
12718
- /** Variant ID (optional - for variant-scoped config) */
12719
- variantId?: string
12720
- /** Batch ID (optional - for batch-scoped config) */
12721
- batchId?: string
12722
-
12723
- /** Item ID - required for getDataItem/deleteDataItem */
12724
- itemId?: string
12725
-
12726
- /**
12727
- * Use admin endpoints instead of public.
12728
- * This selects which endpoint is called; it does not by itself make root-level config fields private.
12729
- */
12730
- admin?: boolean
12731
-
12732
- /**
12733
- * Configuration object for setConfig.
12734
- * For admin-only values in app config, store them under a top-level `admin` object.
12735
- * Public reads return the root config but omit `config.admin`.
12736
- */
12737
- config?: any
12738
- /** Data object for setDataItem. Best for small keyed scoped documents rather than richer app domain objects. */
12739
- data?: any
12706
+ type AppConfigOptions = {
12707
+ /** The app ID */
12708
+ appId: string
12709
+
12710
+ /** Collection ID (required for most operations) */
12711
+ collectionId?: string
12712
+ /** Product ID (optional - for product-scoped config) */
12713
+ productId?: string
12714
+ /** Variant ID (optional - for variant-scoped config) */
12715
+ variantId?: string
12716
+ /** Batch ID (optional - for batch-scoped config) */
12717
+ batchId?: string
12718
+
12719
+ /** Item ID - required for getDataItem/deleteDataItem */
12720
+ itemId?: string
12721
+
12722
+ /**
12723
+ * Use admin endpoints instead of public.
12724
+ * This selects which endpoint is called; it does not by itself make root-level config fields private.
12725
+ */
12726
+ admin?: boolean
12727
+
12728
+ /**
12729
+ * Configuration object for setConfig.
12730
+ * For admin-only values in app config, store them under a top-level `admin` object.
12731
+ * Public reads return the root config but omit `config.admin`.
12732
+ */
12733
+ config?: any
12734
+ /** Data object for setDataItem. Best for small keyed scoped documents rather than richer app domain objects. */
12735
+ data?: any
12740
12736
  }
12741
12737
  ```
12742
12738
 
@@ -13060,59 +13056,59 @@ List the tools the agent can use (optionally scoped by capability / name). Retur
13060
13056
 
13061
13057
  **events**(collectionId: string,
13062
13058
  body: AnalyticsEventsRequest) → `Promise<AnalyticsEventsResponse>`
13063
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13059
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13064
13060
 
13065
13061
  **web**(collectionId: string,
13066
13062
  body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
13067
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13063
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13068
13064
 
13069
13065
  **clicks**(collectionId: string,
13070
13066
  body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
13071
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13067
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13072
13068
 
13073
13069
  **tagScans**(collectionId: string,
13074
13070
  body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
13075
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13071
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13076
13072
 
13077
13073
  **products**(collectionId: string,
13078
13074
  body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsProductsResponse>`
13079
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13075
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13080
13076
 
13081
13077
  **qrCodes**(collectionId: string,
13082
13078
  body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsQrCodesResponse>`
13083
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13079
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13084
13080
 
13085
13081
  **tags**(collectionId: string,
13086
13082
  body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsTagsResponse>`
13087
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13083
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13088
13084
 
13089
13085
  **weekly**(collectionId: string,
13090
13086
  body: AnalyticsWeeklyRequest = {}) → `Promise<AnalyticsTimeseriesResponse>`
13091
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13087
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13092
13088
 
13093
13089
  **country**(collectionId: string,
13094
13090
  body: AnalyticsCountryRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
13095
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13091
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13096
13092
 
13097
13093
  **topPages**(collectionId: string,
13098
13094
  body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
13099
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13095
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13100
13096
 
13101
13097
  **topReferrers**(collectionId: string,
13102
13098
  body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
13103
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13099
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13104
13100
 
13105
13101
  **topCampaigns**(collectionId: string,
13106
13102
  body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
13107
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13103
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13108
13104
 
13109
13105
  **topSources**(collectionId: string,
13110
13106
  body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
13111
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13107
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13112
13108
 
13113
13109
  **topDestinations**(collectionId: string,
13114
13110
  body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
13115
- The raw events behind the reports, newest first unless `sort` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. ```typescript let page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100 }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { source: 'events', eventType: 'page_view', limit: 100, cursor: page.nextCursor }) } ```
13111
+ The raw events behind the reports, newest first unless `orderBy` says otherwise. Returns `{ items, nextCursor, source, sort }`: the event rows are in `items`; `nextCursor` is `null` on the last page. Page with `limit` and `cursor`; the time window is `from` / `to`. ```typescript const query = { source: 'events' as const, eventType: 'page_view', from: '2026-11-01T00:00:00Z', limit: 100 } let page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }] }) while (page.nextCursor) { page = await analytics.admin.events(collectionId, { ...query, orderBy: [{ timestamp: 'asc' }], cursor: page.nextCursor }) } ```
13116
13112
 
13117
13113
  ### analytics.browser
13118
13114
 
@@ -13174,70 +13170,70 @@ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when availabl
13174
13170
 
13175
13171
  Workflow-oriented app objects for issues, requests, claims, and tasks that move through statuses and often need assignment or history.
13176
13172
 
13177
- **create**(collectionId: string,
13178
- appId: string,
13179
- input: CreateCaseInput,
13173
+ **create**(collectionId: string,
13174
+ appId: string,
13175
+ input: CreateCaseInput,
13180
13176
  admin: boolean = false) → `Promise<AppCase>`
13181
13177
  Create a new case POST /cases
13182
13178
 
13183
- **list**(collectionId: string,
13184
- appId: string,
13185
- params?: CaseListQueryParams,
13179
+ **list**(collectionId: string,
13180
+ appId: string,
13181
+ params?: CaseListQueryParams,
13186
13182
  admin: boolean = false) → `Promise<ListResult<AppCase>>`
13187
- List cases with optional query parameters GET /cases Returns `{ items, nextCursor, count }`: the cases are in `items`, `count` is how many match in all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. `includeDeleted`, `contactId` and `assignedTo` are for admin calls (`admin = true`) only: the public list refuses a parameter it does not read. ```typescript let page = await app.cases.list(collectionId, appId, { status: 'open', limit: 50 }) console.log(page.items, page.count) while (page.nextCursor) { page = await app.cases.list(collectionId, appId, { status: 'open', limit: 50, cursor: page.nextCursor }) } ```
13183
+ List cases with optional query parameters GET /cases Returns `{ items, nextCursor, count }`: the cases are in `items`, `count` is how many match in all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. Sort with `orderBy`. A date field (`createdAt`, `updatedAt`, `closedAt`) takes a range: `{ gte, lte }`. `includeDeleted`, `contactId` and `assignedTo` are for admin calls (`admin = true`) only: the public list refuses a parameter it does not read. ```typescript let page = await app.cases.list(collectionId, appId, { status: 'open', limit: 50 }) console.log(page.items, page.count) while (page.nextCursor) { page = await app.cases.list(collectionId, appId, { status: 'open', limit: 50, cursor: page.nextCursor }) } // This month's cases, most urgent first await app.cases.list(collectionId, appId, { createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' }, orderBy: [{ priority: 'desc' }, { createdAt: 'asc' }], }) ```
13188
13184
 
13189
- **get**(collectionId: string,
13190
- appId: string,
13191
- caseId: string,
13185
+ **get**(collectionId: string,
13186
+ appId: string,
13187
+ caseId: string,
13192
13188
  admin: boolean = false) → `Promise<AppCase>`
13193
13189
  Get a single case by ID GET /cases/:caseId
13194
13190
 
13195
- **update**(collectionId: string,
13196
- appId: string,
13197
- caseId: string,
13198
- input: UpdateCaseInput,
13191
+ **update**(collectionId: string,
13192
+ appId: string,
13193
+ caseId: string,
13194
+ input: UpdateCaseInput,
13199
13195
  admin: boolean = false) → `Promise<AppCase>`
13200
13196
  Update a case PATCH /cases/:caseId Admin can update any field, public (owner) can only update data and owner zones
13201
13197
 
13202
- **remove**(collectionId: string,
13203
- appId: string,
13204
- caseId: string,
13198
+ **remove**(collectionId: string,
13199
+ appId: string,
13200
+ caseId: string,
13205
13201
  admin: boolean = false) → `Promise<`
13206
13202
  Soft delete a case DELETE /cases/:caseId
13207
13203
 
13208
- **aggregate**(collectionId: string,
13209
- appId: string,
13210
- request: AggregateRequest,
13204
+ **aggregate**(collectionId: string,
13205
+ appId: string,
13206
+ request: AggregateRequest,
13211
13207
  admin: boolean = false) → `Promise<AggregateResponse>`
13212
13208
  Get aggregate statistics for cases POST /cases/aggregate
13213
13209
 
13214
- **summary**(collectionId: string,
13215
- appId: string,
13210
+ **summary**(collectionId: string,
13211
+ appId: string,
13216
13212
  request?: CaseSummaryRequest) → `Promise<CaseSummaryResponse>`
13217
13213
  Get case summary (admin only) POST /cases/summary
13218
13214
 
13219
- **appendHistory**(collectionId: string,
13220
- appId: string,
13221
- caseId: string,
13215
+ **appendHistory**(collectionId: string,
13216
+ appId: string,
13217
+ caseId: string,
13222
13218
  input: AppendHistoryInput) → `Promise<AppCase>`
13223
13219
  Append an entry to case history (admin only) POST /cases/:caseId/history
13224
13220
 
13225
- **related**(collectionId: string,
13226
- appId: string,
13221
+ **related**(collectionId: string,
13222
+ appId: string,
13227
13223
  caseId: string) → `Promise<RelatedResponse>`
13228
13224
  Get related threads and records for a case (admin only) GET /cases/:caseId/related
13229
13225
 
13230
13226
  ### app.options
13231
13227
 
13232
- **get**(collectionId: string,
13233
- appId: string,
13234
- source: string,
13235
- opts: { q?: string; version?: string; admin?: boolean } = {},) → `Promise<import('../types/appOptions').AppOptionsList>`
13236
- `source` = `type:<record type or declared type id>` | `list:<list id>`. Admins (`admin: true`) see every entry; the public API lists public records and lists the app declares public. Hold on to `version` and pass it back to get `{ unchanged: true }` when nothing changed. Returns `{ items, nextCursor, count?, version, mode }`: the entries are in `items`, already sorted. A picker is not paged, so `nextCursor` is always `null`. ```typescript const res = await app.options.get(collectionId, appId, 'type:machine', { admin: true }) if (!res.unchanged) { options = res.items; version = res.version } ```
13237
-
13238
- **saveList**(collectionId: string,
13239
- appId: string,
13240
- listId: string,
13228
+ **get**(collectionId: string,
13229
+ appId: string,
13230
+ source: string,
13231
+ opts: ListOptions & { q?: string; version?: string; admin?: boolean } = {},) → `Promise<import('../types/appOptions').AppOptionsList>`
13232
+ `source` = `type:<record type or declared type id>` | `list:<list id>`. Admins (`admin: true`) see every entry; the public API lists public records and lists the app declares public. Hold on to `version` and pass it back to get `{ unchanged: true }` when nothing changed. Returns `{ items, nextCursor, count?, version, mode }`: the entries are in `items`, already sorted, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. `q` searches the entries. ```typescript const res = await app.options.get(collectionId, appId, 'type:machine', { admin: true, limit: 200 }) if (!res.unchanged) { options = res.items; version = res.version } // A type too large to send whole: search it const found = await app.options.get(collectionId, appId, 'type:machine', { q: 'mix', limit: 20 }) ```
13233
+
13234
+ **saveList**(collectionId: string,
13235
+ appId: string,
13236
+ listId: string,
13241
13237
  values: import('../types/appOptions') → `void`
13242
13238
  Save a value list's values, in order (admins). Codes never change and are never lost: a value left out stays, switched off, at the end. → the list as saved.
13243
13239
 
@@ -13245,92 +13241,92 @@ Save a value list's values, in order (admins). Codes never change and are never
13245
13241
 
13246
13242
  General-purpose structured app objects. Use these when a simple scoped data item grows into something queryable, lifecycle-aware, or access-controlled.
13247
13243
 
13248
- **create**(collectionId: string,
13249
- appId: string,
13250
- input: CreateRecordInput,
13244
+ **create**(collectionId: string,
13245
+ appId: string,
13246
+ input: CreateRecordInput,
13251
13247
  admin: boolean = false) → `Promise<CreateRecordResponse>`
13252
13248
  Create a new record POST /records When called on the public endpoint (admin = false) with an anonymous caller, and the app's `publicCreate.records.anonymous.edit.editToken` policy is enabled, the response includes a one-time `editToken` string. Store it immediately — it is never returned again.
13253
13249
 
13254
- **query**(collectionId: string,
13255
- appId: string,
13250
+ **query**(collectionId: string,
13251
+ appId: string,
13256
13252
  body: StandardQuery = {}) → `Promise<QueryResult>`
13257
13253
  The standard query on an app's records (admin only): filter, sort, page, count and total in one call, reaching into a record's own fields by path, and following a record to its `product` and its `contact`. POST /admin/collection/:collectionId/app/:appId/records/query Fields: id, recordType, ref, status, visibility, customId, productId, variantId, batchId, proofId, contactId, authorId, parentType, parentId, createdAt, updatedAt, startsAt, expiresAt, and the documents data, owner and admin, reached by path: `"data.status"`, `"data.line.name"`. ```typescript // How many work orders by status, and how many units on each await app.records.query(collectionId, appId, { where: { recordType: 'work_order' }, groupBy: ['data.status'], aggregates: { orders: { count: true }, units: { sum: 'data.qty' } }, }) ```
13258
13254
 
13259
13255
  **queryFields**(collectionId: string, appId: string) → `Promise<QueryDescription>`
13260
13256
  What a records query can use: its fields, what each can filter, sort, group or total, and its links. GET /admin/collection/:collectionId/app/:appId/records/query
13261
13257
 
13262
- **list**(collectionId: string,
13263
- appId: string,
13264
- params?: RecordListQueryParams,
13258
+ **list**(collectionId: string,
13259
+ appId: string,
13260
+ params?: RecordListQueryParams,
13265
13261
  admin: boolean = false) → `Promise<ListResult<AppRecord>>`
13266
- List records with optional query parameters GET /records Returns `{ items, nextCursor, count }`: the records are in `items`, `count` is how many match in all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. Public/owner callers only receive records with `status: "active"`. Admin callers can query all statuses (for example `draft`/`archived`). `qFields`, `dataFilter`, `contactId` and `includeDeleted` are for admin calls (`admin = true`) only: the public list refuses a parameter it does not read. ```typescript let page = await app.records.list(collectionId, appId, { recordType: 'tip', limit: 100 }) console.log(page.items, page.count) while (page.nextCursor) { page = await app.records.list(collectionId, appId, { recordType: 'tip', limit: 100, cursor: page.nextCursor }) } ```
13262
+ List records with optional query parameters GET /records Returns `{ items, nextCursor, count }`: the records are in `items`, `count` is how many match in all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. Search with `q`, sort with `orderBy`. A date field (`createdAt`, `updatedAt`, `startsAt`, `expiresAt`) takes a range: `{ gte, lte }`. Public/owner callers only receive records with `status: "active"`. Admin callers can query all statuses (for example `draft`/`archived`). `qFields`, `dataFilter`, `contactId` and `includeDeleted` are for admin calls (`admin = true`) only: the public list refuses a parameter it does not read. ```typescript let page = await app.records.list(collectionId, appId, { recordType: 'tip', limit: 100 }) console.log(page.items, page.count) while (page.nextCursor) { page = await app.records.list(collectionId, appId, { recordType: 'tip', limit: 100, cursor: page.nextCursor }) } // Tips about watering, changed this month, newest change first await app.records.list(collectionId, appId, { recordType: 'tip', q: 'watering', updatedAt: { gte: '2026-11-01T00:00:00Z' }, orderBy: [{ updatedAt: 'desc' }], }) ```
13267
13263
 
13268
- **get**(collectionId: string,
13269
- appId: string,
13270
- recordId: string,
13264
+ **get**(collectionId: string,
13265
+ appId: string,
13266
+ recordId: string,
13271
13267
  admin: boolean = false) → `Promise<AppRecord>`
13272
13268
  Get a single record by ID GET /records/:recordId
13273
13269
 
13274
- **update**(collectionId: string,
13275
- appId: string,
13276
- recordId: string,
13277
- input: UpdateRecordInput,
13270
+ **update**(collectionId: string,
13271
+ appId: string,
13272
+ recordId: string,
13273
+ input: UpdateRecordInput,
13278
13274
  admin: boolean = false) → `Promise<AppRecord>`
13279
13275
  Update a record PATCH /records/:recordId Admin can update any field, public (owner) can only update data and owner
13280
13276
 
13281
- **updateWithToken**(collectionId: string,
13282
- appId: string,
13283
- recordId: string,
13284
- data: Record<string, unknown>,
13277
+ **updateWithToken**(collectionId: string,
13278
+ appId: string,
13279
+ recordId: string,
13280
+ data: Record<string, unknown>,
13285
13281
  editToken: string) → `Promise<AppRecord>`
13286
13282
  Amend the `data` zone of a record using an anonymous edit token. PATCH /records/:recordId (public endpoint, no auth) This is the follow-up call after an anonymous `create()` that returned an `editToken`. Present the token via `X-Edit-Token` — the server validates it with a constant-time comparison and, if `windowMinutes` is configured in the policy, checks that the token has not expired. **Scope:** only the `data` zone may be modified via this path. `owner`, `admin`, `status`, `visibility`, and indexed fields are immutable to anonymous token holders. ```ts const record = await app.records.create(collectionId, appId, { recordType: 'payment', visibility: 'public', data: { amount: 9900, currency: 'USD' }, }) const { editToken } = record // store this immediately! // Later, once the payment gateway confirms: const updated = await app.records.updateWithToken( collectionId, appId, record.id, { amount: 9900, currency: 'USD', transactionId: 'txn_abc123' }, editToken, ) ``` ### Error codes | HTTP | `errorCode` | Meaning | |------|-----------------------|---------------------------------------------------| | 401 | `UNAUTHORIZED` | No auth token and no `X-Edit-Token` header | | 403 | `FORBIDDEN` | Policy not enabled, or token does not match | | 403 | `EDIT_WINDOW_EXPIRED` | `windowMinutes` elapsed since record creation | | 404 | `NOT_FOUND` | Record does not exist |
13287
13283
 
13288
- **remove**(collectionId: string,
13289
- appId: string,
13290
- recordId: string,
13284
+ **remove**(collectionId: string,
13285
+ appId: string,
13286
+ recordId: string,
13291
13287
  admin: boolean = false) → `Promise<`
13292
13288
  Soft delete a record DELETE /records/:recordId
13293
13289
 
13294
- **aggregate**(collectionId: string,
13295
- appId: string,
13296
- request: AggregateRequest,
13290
+ **aggregate**(collectionId: string,
13291
+ appId: string,
13292
+ request: AggregateRequest,
13297
13293
  admin: boolean = false) → `Promise<AggregateResponse>`
13298
13294
  Get aggregate statistics for records POST /records/aggregate
13299
13295
 
13300
- **restore**(collectionId: string,
13301
- appId: string,
13296
+ **restore**(collectionId: string,
13297
+ appId: string,
13302
13298
  recordId: string) → `Promise<AppRecord>`
13303
13299
  Restore a soft-deleted record. POST /records/:recordId/restore (admin only)
13304
13300
 
13305
- **upsert**(collectionId: string,
13306
- appId: string,
13301
+ **upsert**(collectionId: string,
13302
+ appId: string,
13307
13303
  input: UpsertRecordInput) → `Promise<UpsertRecordResponse>`
13308
13304
  Upsert a record by ref — creates if no record with that ref exists, otherwise updates. Scope, specificity, and ref are canonicalized on write. POST /records/upsert (admin only)
13309
13305
 
13310
- **match**(collectionId: string,
13311
- appId: string,
13312
- input: MatchRecordsInput,
13306
+ **match**(collectionId: string,
13307
+ appId: string,
13308
+ input: MatchRecordsInput,
13313
13309
  admin: boolean = false) → `Promise<MatchResult>`
13314
- Match records against a runtime target scope. Returns `{ items, nextCursor, count, strategy }`: `items` are the records whose scope is satisfied by the target, most specific first, and `count` is how many matched. It is not paged (`nextCursor` is always `null`); cap the answer with `limit`. POST /records/match ```ts const { items } = await app.records.match(collectionId, appId, { target: { productId: 'prod_abc', facets: { tier: ['gold'] } }, strategy: 'best', recordType: 'nutrition', }, true); const best = items[0] // the single highest-specificity nutrition record ```
13310
+ Match records against a runtime target scope. Returns `{ items, nextCursor, count, strategy }`: `items` are the records whose scope is satisfied by the target, most specific first, and `count` is how many matched. Without a `limit` it answers up to 100. Give a `limit` (in `input`) to page: when there are more, pass `nextCursor` back as `cursor`. POST /records/match ```ts const { items } = await app.records.match(collectionId, appId, { target: { productId: 'prod_abc', facets: { tier: ['gold'] } }, strategy: 'best', recordType: 'nutrition', }, true); const best = items[0] // the single highest-specificity nutrition record // 50 at a time const target = { productId: 'prod_abc' } let page = await app.records.match(collectionId, appId, { target, limit: 50 }) while (page.nextCursor) { page = await app.records.match(collectionId, appId, { target, limit: 50, cursor: page.nextCursor }) } ```
13315
13311
 
13316
- **bulkUpsert**(collectionId: string,
13317
- appId: string,
13312
+ **bulkUpsert**(collectionId: string,
13313
+ appId: string,
13318
13314
  records: BulkUpsertItem[]) → `Promise<BulkUpsertResult>`
13319
13315
  Upsert up to 500 records in a single transaction. Each row is individually error-isolated — a failure on one row does not abort the others. POST /records/bulk-upsert (admin only)
13320
13316
 
13321
- **bulkDelete**(collectionId: string,
13322
- appId: string,
13317
+ **bulkDelete**(collectionId: string,
13318
+ appId: string,
13323
13319
  input: BulkDeleteInput) → `Promise<BulkDeleteResult>`
13324
13320
  Soft-delete records in bulk. Supports two modes: - **refs mode**: explicit list of refs (max 1000) - **scope mode**: delete by scope anchor (productId / variantId / etc.) POST /records/bulk-delete (admin only) ```ts // Refs mode await app.records.bulkDelete(collectionId, appId, { refs: ['product:prod_abc', 'product:prod_xyz'], recordType: 'nutrition', }); // Scope mode await app.records.bulkDelete(collectionId, appId, { scope: { productId: 'prod_abc' }, }); ```
13325
13321
 
13326
- **resolveAll**(collectionId: string,
13327
- appId: string,
13328
- input: ResolveAllParams,
13322
+ **resolveAll**(collectionId: string,
13323
+ appId: string,
13324
+ input: ResolveAllParams,
13329
13325
  admin: boolean = false) → `Promise<ResolveAllResult>`
13330
- Resolve every applicable record for a product context in one call. Returns `{ items, nextCursor, count, context, truncated }`: `items` are the records across all tiers (proof, batch, variant, product, rule, facet, collection), deduplicated and sorted by specificity descending, each as `{ record, matchedAt, specificity }`. It is not paged (`nextCursor` is always `null`); `truncated` says the answer was cut at `limit`. POST /records/resolve-all ```ts const { items, truncated } = await app.records.resolveAll(collectionId, appId, { context: { productId: 'prod_abc' }, recordType: 'nutrition', }) for (const { record, matchedAt } of items) console.log(matchedAt, record.data) ```
13326
+ Resolve every applicable record for a product context in one call. Returns `{ items, nextCursor, count, context, truncated }`: `items` are the records across all tiers (proof, batch, variant, product, rule, facet, collection), deduplicated and sorted by specificity descending, each as `{ record, matchedAt, specificity }`. Without a `limit` it answers up to 500. Give a `limit` (in `input`) to page: when there are more, pass `nextCursor` back as `cursor`. POST /records/resolve-all ```ts const { items } = await app.records.resolveAll(collectionId, appId, { context: { productId: 'prod_abc' }, recordType: 'nutrition', }) for (const { record, matchedAt } of items) console.log(matchedAt, record.data) // 100 at a time const context = { productId: 'prod_abc' } let page = await app.records.resolveAll(collectionId, appId, { context, limit: 100 }) while (page.nextCursor) { page = await app.records.resolveAll(collectionId, appId, { context, limit: 100, cursor: page.nextCursor }) } ```
13331
13327
 
13332
- **previewRule**(collectionId: string,
13333
- appId: string,
13328
+ **previewRule**(collectionId: string,
13329
+ appId: string,
13334
13330
  input: PreviewRuleParams) → `Promise<PreviewRuleResult>`
13335
13331
  Preview which products in the collection match a given facetRule. Admin only. Use for live "matches N products" feedback while authoring a rule. POST /records/preview-rule
13336
13332
 
@@ -13338,54 +13334,54 @@ Preview which products in the collection match a given facetRule. Admin only. Us
13338
13334
 
13339
13335
  Conversation-oriented app objects for comments, discussions, Q&A, and reply-driven experiences.
13340
13336
 
13341
- **create**(collectionId: string,
13342
- appId: string,
13343
- input: CreateThreadInput,
13337
+ **create**(collectionId: string,
13338
+ appId: string,
13339
+ input: CreateThreadInput,
13344
13340
  admin: boolean = false) → `Promise<AppThread>`
13345
13341
  Create a new thread POST /threads
13346
13342
 
13347
- **list**(collectionId: string,
13348
- appId: string,
13349
- params?: ThreadListQueryParams,
13343
+ **list**(collectionId: string,
13344
+ appId: string,
13345
+ params?: ThreadListQueryParams,
13350
13346
  admin: boolean = false) → `Promise<ListResult<AppThread>>`
13351
- List threads with optional query parameters GET /threads Returns `{ items, nextCursor, count }`: the threads are in `items`, `count` is how many match in all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. `includeDeleted` and `contactId` are for admin calls (`admin = true`) only: the public list refuses a parameter it does not read. ```typescript let page = await app.threads.list(collectionId, appId, { parentType: 'case', parentId: caseId, limit: 50 }) console.log(page.items, page.count) while (page.nextCursor) { page = await app.threads.list(collectionId, appId, { parentType: 'case', parentId: caseId, limit: 50, cursor: page.nextCursor }) } ```
13347
+ List threads with optional query parameters GET /threads Returns `{ items, nextCursor, count }`: the threads are in `items`, `count` is how many match in all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`. Sort with `orderBy`. A date field (`createdAt`, `updatedAt`) takes a range: `{ gte, lte }`. `includeDeleted` and `contactId` are for admin calls (`admin = true`) only: the public list refuses a parameter it does not read. ```typescript let page = await app.threads.list(collectionId, appId, { parentType: 'case', parentId: caseId, limit: 50 }) console.log(page.items, page.count) while (page.nextCursor) { page = await app.threads.list(collectionId, appId, { parentType: 'case', parentId: caseId, limit: 50, cursor: page.nextCursor }) } // The threads with the newest replies, started this month await app.threads.list(collectionId, appId, { createdAt: { gte: '2026-11-01T00:00:00Z' }, orderBy: [{ lastReplyAt: 'desc' }], }) ```
13352
13348
 
13353
- **get**(collectionId: string,
13354
- appId: string,
13355
- threadId: string,
13349
+ **get**(collectionId: string,
13350
+ appId: string,
13351
+ threadId: string,
13356
13352
  admin: boolean = false) → `Promise<AppThread>`
13357
13353
  Get a single thread by ID GET /threads/:threadId
13358
13354
 
13359
- **update**(collectionId: string,
13360
- appId: string,
13361
- threadId: string,
13362
- input: UpdateThreadInput,
13355
+ **update**(collectionId: string,
13356
+ appId: string,
13357
+ threadId: string,
13358
+ input: UpdateThreadInput,
13363
13359
  admin: boolean = false) → `Promise<AppThread>`
13364
13360
  Update a thread PATCH /threads/:threadId Admin can update any field, public (owner) can only update body, tags, data, owner
13365
13361
 
13366
- **remove**(collectionId: string,
13367
- appId: string,
13368
- threadId: string,
13362
+ **remove**(collectionId: string,
13363
+ appId: string,
13364
+ threadId: string,
13369
13365
  admin: boolean = false) → `Promise<`
13370
13366
  Soft delete a thread DELETE /threads/:threadId
13371
13367
 
13372
- **reply**(collectionId: string,
13373
- appId: string,
13374
- threadId: string,
13375
- input: ReplyInput,
13368
+ **reply**(collectionId: string,
13369
+ appId: string,
13370
+ threadId: string,
13371
+ input: ReplyInput,
13376
13372
  admin: boolean = false) → `Promise<AppThread>`
13377
13373
  Add a reply to a thread POST /threads/:threadId/reply Atomically appends to replies array, increments replyCount, updates lastReplyAt
13378
13374
 
13379
- **deleteReply**(collectionId: string,
13380
- appId: string,
13381
- threadId: string,
13382
- replyId: string,
13375
+ **deleteReply**(collectionId: string,
13376
+ appId: string,
13377
+ threadId: string,
13378
+ replyId: string,
13383
13379
  admin: boolean = false) → `Promise<AppThread>`
13384
13380
  Delete a single reply from a thread by its reply id (moderation). DELETE /threads/:threadId/reply/:replyId Authorised for the reply's author, the proof owner, or a collection admin.
13385
13381
 
13386
- **aggregate**(collectionId: string,
13387
- appId: string,
13388
- request: AggregateRequest,
13382
+ **aggregate**(collectionId: string,
13383
+ appId: string,
13384
+ request: AggregateRequest,
13389
13385
  admin: boolean = false) → `Promise<AggregateResponse>`
13390
13386
  Get aggregate statistics for threads POST /threads/aggregate
13391
13387
 
@@ -13408,8 +13404,8 @@ Set app configuration for a collection/product scope. Requires admin authenticat
13408
13404
  **deleteConfig**(opts: AppConfigOptions) → `Promise<void>`
13409
13405
  Delete app configuration for a collection/product scope. Requires admin authentication. ```typescript await appConfiguration.deleteConfig({ appId: 'warranty-portal', collectionId: 'my-collection', admin: true }); ```
13410
13406
 
13411
- **getData**(opts: AppConfigOptions) → `Promise<ListResult<any>>`
13412
- Get all keyed data items for an app within a scope. Best for a small set of standalone documents such as FAQs, menus, lookup tables, or content fragments where the caller typically knows the item IDs. If you are modelling richer app entities that need filtering, lifecycle fields, visibility, ownership, or relationships, prefer `app.records`, `app.cases`, or `app.threads` instead. `nextCursor` is always `null`. ```typescript const { items } = await appConfiguration.getData({ appId: 'product-docs', collectionId: 'my-collection', productId: 'product-123' }); ```
13407
+ **getData**(opts: AppConfigOptions & ListOptions) → `Promise<ListResult<any>>`
13408
+ Get all keyed data items for an app within a scope. Best for a small set of standalone documents such as FAQs, menus, lookup tables, or content fragments where the caller typically knows the item IDs. If you are modelling richer app entities that need filtering, lifecycle fields, visibility, ownership, or relationships, prefer `app.records`, `app.cases`, or `app.threads` instead. `limit` and `cursor` give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const scope = { appId: 'product-docs', collectionId: 'my-collection', productId: 'product-123' } let page = await appConfiguration.getData({ ...scope, limit: 100 }); while (page.nextCursor) { page = await appConfiguration.getData({ ...scope, limit: 100, cursor: page.nextCursor }); } ```
13413
13409
 
13414
13410
  **getDataItem**(opts: AppConfigOptions) → `Promise<any>`
13415
13411
  Get a single keyed data item by ID within a scope. This is ideal when you already know the exact ID of a simple scoped document. For richer domain objects that users browse or query, prefer `app.records`, `app.cases`, or `app.threads`. ```typescript const item = await appConfiguration.getDataItem({ appId: 'product-docs', collectionId: 'my-collection', productId: 'product-123', itemId: 'manual-1' }); ```
@@ -13420,19 +13416,19 @@ Set/create a keyed data item within a scope. Requires admin authentication. Use
13420
13416
  **deleteDataItem**(opts: AppConfigOptions) → `Promise<void>`
13421
13417
  Delete a keyed data item by ID within a scope. Requires admin authentication. ```typescript await appConfiguration.deleteDataItem({ appId: 'product-docs', collectionId: 'my-collection', productId: 'product-123', admin: true, itemId: 'manual-1' }); ```
13422
13418
 
13423
- **getWidgets**(collectionId: string,
13419
+ **getWidgets**(collectionId: string,
13424
13420
  options?: GetCollectionWidgetsOptions) → `Promise<CollectionWidgetsResponse>`
13425
- Fetches ALL widget data (manifests + bundle files) for a collection in one call. Returns everything needed to render widgets with zero additional requests. This solves N+1 query problems by fetching manifests, JavaScript bundles, and CSS files in parallel on the server. and bundle files. The list is not paged, so `nextCursor` is always `null`. ```typescript // Fetch all widget data for a collection const { items: apps } = await Api.AppConfiguration.getWidgets(collectionId); // apps: [{ appId, manifest, widget, container, admin }, ...] // widget / container: { js: { umd?, esm? }, css?, source?, styles? } // source / styles - the bundle inlined (when small enough); js / css - URLs otherwise. // admin - URL of the app's app.admin.json (setup / tunable options), or null. // Bundles don't ship React: they resolve shared libraries from the HOST's globals // (host-dependency-contract.md), so loading one is a host's job. // // Inside a host (Portal / Hub), an app showing ANOTHER app's widget should not load // bundles itself - use the host-provided EmbeddedWidget prop: // <EmbeddedWidget appId="raffle" size="standard" /> (docs/widgets.md) // Force refresh all widgets const { items: fresh } = await Api.AppConfiguration.getWidgets(collectionId, { force: true }); ```
13421
+ Fetches ALL widget data (manifests + bundle files) for a collection in one call. Returns everything needed to render widgets with zero additional requests. This solves N+1 query problems by fetching manifests, JavaScript bundles, and CSS files in parallel on the server. and bundle files. It always comes back whole: there is no `limit` or `cursor`, and `nextCursor` is always `null`. ```typescript // Fetch all widget data for a collection const { items: apps } = await Api.AppConfiguration.getWidgets(collectionId); // apps: [{ appId, manifest, widget, container, admin }, ...] // widget / container: { js: { umd?, esm? }, css?, source?, styles? } // source / styles - the bundle inlined (when small enough); js / css - URLs otherwise. // admin - URL of the app's app.admin.json (setup / tunable options), or null. // Bundles don't ship React: they resolve shared libraries from the HOST's globals // (host-dependency-contract.md), so loading one is a host's job. // // Inside a host (Portal / Hub), an app showing ANOTHER app's widget should not load // bundles itself - use the host-provided EmbeddedWidget prop: // <EmbeddedWidget appId="raffle" size="standard" /> (docs/widgets.md) // Force refresh all widgets const { items: fresh } = await Api.AppConfiguration.getWidgets(collectionId, { force: true }); ```
13426
13422
 
13427
13423
  **resolveFeature**(system: SystemBlock | undefined, flag: string) → `boolean`
13428
13424
  Resolve whether a feature flag is on, applying the `accountType` default: `enterprise` accounts default every flag to **on** unless `features[flag]` is explicitly `false`; `standard` accounts (or missing `accountType`) default every flag to **off** unless `features[flag]` is explicitly `true`. An explicit value always wins over the default either way. This is the same logic `isFeatureEnabled()` / `isFeatureEnabledSync()` use internally — call those instead in normal code. `system.features` and `accountType` are public data (no admin-only feature-check path exists), so there's no reason to fetch differently for an admin surface. This is exposed separately only for the rare case where you already have a `system` block in hand from somewhere other than `getAppConfig()` (e.g. server-rendered props) and want to resolve a flag from it directly. ```typescript const enabled = appConfiguration.resolveFeature(someSystemBlock, 'custom_domain'); ```
13429
13425
 
13430
- **getAppConfig**(collectionId: string,
13426
+ **getAppConfig**(collectionId: string,
13431
13427
  options?: { force?: boolean }) → `Promise<AppsConfigResponse>`
13432
13428
  Fetch the collection's app catalog + `appConfig` entitlements data in one call — installed modules (`apps`), resolved entitlements (`system.features`, `system.meters`, etc.), and item-handling settings. This is `/public/collection/:id/app/config` (`collection.getAppsConfig()`), which now carries both; there's no need to separately call `appConfiguration.getConfig({ appId: 'appConfig' })` for public reads. Cached in-memory (and sessionStorage) for `ttl` so repeated calls across a page/session are cheap; pass `force` to bypass the cache after a mutation (e.g. after `entitlements-reconcile`). For admin-only data (`systemPrivate`), use `appConfiguration.getConfig({ collectionId, appId: 'appConfig', admin: true })` directly — this endpoint is public-only and never returns it. See docs/appConfig.md for the full contract. ```typescript const cfg = await appConfiguration.getAppConfig(collectionId); console.log(cfg.system?.features); ```
13433
13429
 
13434
- **isFeatureEnabled**(collectionId: string,
13435
- flag: string,
13430
+ **isFeatureEnabled**(collectionId: string,
13431
+ flag: string,
13436
13432
  options?: { force?: boolean }) → `Promise<boolean>`
13437
13433
  Check whether a feature flag is enabled for a collection, per `appConfig.system.features` — applying the `accountType` default (see `resolveFeature()`): enterprise accounts default every flag to on unless explicitly set to `false`. This is the standard way for subapps to gate features — it reads through the same cache as `getAppConfig`, so calling it repeatedly (e.g. once per component) does not re-fetch on every call. This is always async because the very first call for a collection has nothing to read yet. If you need a synchronous check (e.g. inside a render function), call this once during app init to warm the cache, then use `isFeatureEnabledSync()` afterwards. ```typescript if (await appConfiguration.isFeatureEnabled(collectionId, 'custom_domain')) { enableCustomDomainUI(); } ```
13438
13434
 
@@ -13460,32 +13456,35 @@ Upload an asset from a URL The server will fetch the file from the provided URL
13460
13456
  assetId: string) → `Promise<AssetResponse>`
13461
13457
  Upload an asset from a URL The server will fetch the file from the provided URL and store it permanently in your CDN. This solves CORS issues and ensures files are permanently stored. ```typescript // Upload AI-generated image const asset = await asset.uploadFromUrl({ url: 'https://oaidalleapiprodscus.blob.core.windows.net/...', scope: { type: 'collection', collectionId: 'my-collection' }, metadata: { name: 'AI Generated Image', app: 'gallery' } }); // Upload stock photo const asset = await asset.uploadFromUrl({ url: 'https://images.unsplash.com/photo-...', scope: { type: 'product', collectionId: 'my-collection', productId: 'wine-bottle' }, folder: 'images', metadata: { name: 'Product Photo' } }); ```
13462
13458
 
13463
- **listForCollection**(collectionId: string) → `Promise<ListResult<AssetResponse>>`
13464
- The collection's own assets (public). Returns `{ items, nextCursor }`: the assets are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items } = await asset.listForCollection('my-collection') ```
13459
+ **listForCollection**(collectionId: string,
13460
+ options: ListOptions = {}) → `Promise<ListResult<AssetResponse>>`
13461
+ The collection's own assets (public). Returns `{ items, nextCursor, count }`: the assets are in `items`, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await asset.listForCollection('my-collection', { limit: 100 }) while (page.nextCursor) page = await asset.listForCollection('my-collection', { limit: 100, cursor: page.nextCursor }) ```
13465
13462
 
13466
13463
  **getForProduct**(collectionId: string,
13467
13464
  productId: string,
13468
13465
  assetId: string) → `Promise<AssetResponse>`
13469
- The collection's own assets (public). Returns `{ items, nextCursor }`: the assets are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items } = await asset.listForCollection('my-collection') ```
13466
+ The collection's own assets (public). Returns `{ items, nextCursor, count }`: the assets are in `items`, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await asset.listForCollection('my-collection', { limit: 100 }) while (page.nextCursor) page = await asset.listForCollection('my-collection', { limit: 100, cursor: page.nextCursor }) ```
13470
13467
 
13471
13468
  **listForProduct**(collectionId: string,
13472
- productId: string) → `Promise<ListResult<AssetResponse>>`
13473
- A product's assets (public). Returns `{ items, nextCursor }`: the assets are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items } = await asset.listForProduct('my-collection', 'wine-bottle') ```
13469
+ productId: string,
13470
+ options: ListOptions = {}) → `Promise<ListResult<AssetResponse>>`
13471
+ A product's assets (public). Returns `{ items, nextCursor, count }`: the assets are in `items`, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await asset.listForProduct('my-collection', 'wine-bottle', { limit: 100 }) ```
13474
13472
 
13475
13473
  **getForProof**(collectionId: string,
13476
13474
  productId: string,
13477
13475
  proofId: string,
13478
13476
  assetId: string) → `Promise<AssetResponse>`
13479
- A product's assets (public). Returns `{ items, nextCursor }`: the assets are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items } = await asset.listForProduct('my-collection', 'wine-bottle') ```
13477
+ A product's assets (public). Returns `{ items, nextCursor, count }`: the assets are in `items`, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await asset.listForProduct('my-collection', 'wine-bottle', { limit: 100 }) ```
13480
13478
 
13481
13479
  **listForProof**(collectionId: string,
13482
13480
  productId: string,
13483
13481
  proofId: string,
13484
- appId?: string) → `Promise<ListResult<AssetResponse>>`
13485
- A proof's assets (public), optionally only one app's. Returns `{ items, nextCursor }`: the assets are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items } = await asset.listForProof('my-collection', 'wine-bottle', proofId, 'gallery') ```
13482
+ appId?: string,
13483
+ options: ListOptions = {}) → `Promise<ListResult<AssetResponse>>`
13484
+ A proof's assets (public), optionally only one app's. Returns `{ items, nextCursor, count }`: the assets are in `items`, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await asset.listForProof('my-collection', 'wine-bottle', proofId, 'gallery', { limit: 100 }) ```
13486
13485
 
13487
13486
  **list**(options: ListAssetsOptions) → `Promise<ListResult<Asset>>`
13488
- List assets for a given scope (a collection, a product or a proof). Returns `{ items, nextCursor }`: the assets are in `items`. These lists are not paged, so `nextCursor` is always `null`. ```typescript const { items } = await asset.list({ scope: { type: 'product', collectionId: 'my-collection', productId: 'wine-bottle' }, appId: 'gallery', }) ```
13487
+ List assets for a given scope (a collection, a product or a proof). Returns `{ items, nextCursor, count }`: the assets are in `items`, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const scope = { type: 'product', collectionId: 'my-collection', productId: 'wine-bottle' } as const let page = await asset.list({ scope, appId: 'gallery', limit: 100 }) while (page.nextCursor) page = await asset.list({ scope, appId: 'gallery', limit: 100, cursor: page.nextCursor }) ```
13489
13488
 
13490
13489
  **get**(options: GetAssetOptions) → `Promise<Asset>`
13491
13490
  Get an asset by id within a scope (public)
@@ -13494,7 +13493,7 @@ Get an asset by id within a scope (public)
13494
13493
  Remove an asset by id within a scope (admin)
13495
13494
 
13496
13495
  **listAdmin**(options: AdminListAssetsOptions) → `Promise<ListResult<Asset>>`
13497
- List assets for a collection with full filtering options (admin). Returns `{ items, nextCursor }`: the assets are in `items`, 50 at a time unless you give a `limit` (at most 200). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. `count` (how many match in all) is there when you gave a `limit` or a `cursor`. ```typescript let page = await asset.listAdmin({ collectionId: 'my-collection', assetType: 'Image', limit: 20 }) console.log(`${page.count} images`) while (page.nextCursor) { page = await asset.listAdmin({ collectionId: 'my-collection', assetType: 'Image', limit: 20, cursor: page.nextCursor }) } ```
13496
+ List assets for a collection with full filtering options (admin). Returns `{ items, nextCursor }`: the assets are in `items`, 50 at a time unless you give a `limit` (at most 200). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. `count` (how many match in all) is there when you gave a `limit` or a `cursor`. Sort with `orderBy` (`createdAt`, `name`, `size` or `assetType`). ```typescript let page = await asset.listAdmin({ collectionId: 'my-collection', assetType: 'Image', orderBy: [{ name: 'asc' }], limit: 20 }) console.log(`${page.count} images`) while (page.nextCursor) { page = await asset.listAdmin({ collectionId: 'my-collection', assetType: 'Image', orderBy: [{ name: 'asc' }], limit: 20, cursor: page.nextCursor }) } ```
13498
13497
 
13499
13498
  **getAdmin**(collectionId: string, assetId: string) → `Promise<Asset>`
13500
13499
  Get a single asset by ID (admin).
@@ -13529,22 +13528,13 @@ Open a resumable upload for a large file (e.g. video). The bytes are chunked dir
13529
13528
  **resumeUpload**(handleId: string, file: File) → `Promise<ResumableUploadHandle>`
13530
13529
  Resume a previously-created resumable upload after a reload/app restart. Pass the persisted `handle.id` and the same `File`; the transfer continues from the offset storage already holds rather than restarting.
13531
13530
 
13532
- ### async
13533
-
13534
- **enqueueAsyncJob**(collectionId: string,
13535
- params: EnqueueAsyncJobRequest) → `Promise<EnqueueAsyncJobResponse>`
13536
- Enqueue a background job for a collection POST /admin/collection/:collectionId/async/jobs (202)
13537
-
13538
- **getAsyncJobStatus**(collectionId: string,
13539
- jobId: number) → `Promise<Job>`
13540
- Get job status by ID (may return 404 if completed/removed) GET /admin/collection/:collectionId/async/jobs/:jobId
13541
-
13542
13531
  ### attestation
13543
13532
 
13544
13533
  **list**(collectionId: string,
13545
13534
  productId: string,
13546
- proofId: string) → `Promise<ListResult<AttestationResponse>>`
13547
- List all attestations for a proof, in one list (no pages): `{ items, nextCursor: null }`.
13535
+ proofId: string,
13536
+ options: ListOptions = {}) → `Promise<ListResult<AttestationResponse>>`
13537
+ List the attestations for a proof: `{ items, nextCursor, count }`, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await attestation.list('coll_123', 'prod_abc', 'proof_1', { limit: 100 }) while (page.nextCursor) page = await attestation.list('coll_123', 'prod_abc', 'proof_1', { limit: 100, cursor: page.nextCursor }) ```
13548
13538
 
13549
13539
  **get**(collectionId: string,
13550
13540
  productId: string,
@@ -13583,11 +13573,11 @@ Batch-create attestations (admin). Sends an array of `CreateAttestationInput` ob
13583
13573
 
13584
13574
  **list**(collectionId: string,
13585
13575
  params: ListAttestationsParams) → `Promise<ListAttestationsResponse>`
13586
- List attestations for a subject (admin). Returns all three data zones. Supports filtering by type and date range. `limit` and `cursor` ```typescript let page = await attestations.list('coll_123', { subjectType: 'container', subjectId: 'uuid-of-cask', attestationType: 'temperature', recordedAfter: '2025-01-01T00:00:00Z', limit: 50, }) const records = page.items // next page: pass the cursor back with the same filters if (page.nextCursor) page = await attestations.list('coll_123', { ...filters, limit: 50, cursor: page.nextCursor }) ```
13576
+ List attestations for a subject (admin). Returns all three data zones. Supports filtering by type and by when it was recorded (`recordedAt: { gte, lte }`). `limit` and `cursor` ```typescript const filters = { subjectType: 'container', subjectId: 'uuid-of-cask', attestationType: 'temperature', recordedAt: { gte: '2025-01-01T00:00:00Z' }, } as const let page = await attestations.list('coll_123', { ...filters, limit: 50 }) const records = page.items // next page: pass the cursor back with the same filters if (page.nextCursor) page = await attestations.list('coll_123', { ...filters, limit: 50, cursor: page.nextCursor }) ```
13587
13577
 
13588
13578
  **summary**(collectionId: string,
13589
13579
  params: AttestationSummaryParams) → `Promise<AttestationSummaryResponse>`
13590
- Time-series summary of attestations (admin). Aggregates attestation counts (and optionally a numeric `value` field) into time buckets. Useful for charting trends. `attestationType` are required ```typescript const { summary } = await attestations.summary('coll_123', { subjectType: 'container', subjectId: 'uuid-of-cask', attestationType: 'temperature', valueField: 'celsius', groupBy: 'day', recordedAfter: '2025-01-01T00:00:00Z', }) ```
13580
+ Time-series summary of attestations (admin). Aggregates attestation counts (and optionally a numeric `value` field) into time buckets. Useful for charting trends. `attestationType` are required ```typescript const { summary } = await attestations.summary('coll_123', { subjectType: 'container', subjectId: 'uuid-of-cask', attestationType: 'temperature', valueField: 'celsius', groupBy: 'day', recordedAt: { gte: '2025-01-01T00:00:00Z' }, }) ```
13591
13581
 
13592
13582
  **latest**(collectionId: string,
13593
13583
  params: AttestationLatestParams) → `Promise<AttestationLatestResponse>`
@@ -13607,7 +13597,7 @@ Tree latest snapshot — most-recent record per type across a container subtree
13607
13597
 
13608
13598
  **publicList**(collectionId: string,
13609
13599
  params: ListAttestationsParams) → `Promise<PublicListAttestationsResponse>`
13610
- List attestations for a subject (public). Records with `visibility='admin'` are always excluded. Records with `visibility='owner'` are included only when the caller provides a valid Firebase ID token that resolves to the subject owner. The `audience` field in the response indicates the tier that was served. `limit` and `cursor` `null` on the last page ```typescript const { items: records, nextCursor, audience } = await attestations.publicList('coll_123', { subjectType: 'proof', subjectId: 'proof-uuid', }) ```
13600
+ List attestations for a subject (public). Records with `visibility='admin'` are always excluded. Records with `visibility='owner'` are included only when the caller provides a valid Firebase ID token that resolves to the subject owner. The `audience` field in the response indicates the tier that was served. `limit` and `cursor`; filter by when it was recorded with `recordedAt: { gte, lte }` `null` on the last page ```typescript const { items: records, nextCursor, audience } = await attestations.publicList('coll_123', { subjectType: 'proof', subjectId: 'proof-uuid', recordedAt: { gte: '2025-01-01T00:00:00Z', lte: '2025-12-31T23:59:59Z' }, limit: 50, }) ```
13611
13601
 
13612
13602
  **publicCreate**(collectionId: string,
13613
13603
  data: OwnerAttestationInput) → `Promise<CreateOwnerAttestationResponse>`
@@ -13637,7 +13627,7 @@ Tree latest snapshot (public).
13637
13627
  **publicContainerList**(collectionId: string,
13638
13628
  containerId: string,
13639
13629
  params?: Omit<ListAttestationsParams, 'subjectType' | 'subjectId'>) → `Promise<PublicListAttestationsResponse>`
13640
- List attestations for a specific container (public shortcut). Equivalent to `publicList` with `subjectType='container'` and `subjectId=containerId` pre-filled. ```typescript const { items: records, nextCursor } = await attestations.publicContainerList('coll_123', containerId, { attestationType: 'temperature', limit: 50, }) ```
13630
+ List attestations for a specific container (public shortcut). Equivalent to `publicList` with `subjectType='container'` and `subjectId=containerId` pre-filled. ```typescript const { items: records, nextCursor } = await attestations.publicContainerList('coll_123', containerId, { attestationType: 'temperature', recordedAt: { gte: '2025-01-01T00:00:00Z' }, limit: 50, }) ```
13641
13631
 
13642
13632
  **publicContainerSummary**(collectionId: string,
13643
13633
  containerId: string,
@@ -13832,8 +13822,8 @@ Generate a fresh set of recovery codes, invalidating any previous set (authentic
13832
13822
  **removeMfaFactor**(clientId: string, factor: MfaFactor, password: string) → `Promise<SuccessResponse>`
13833
13823
  Remove an enrolled MFA factor (authenticated). Server route is DELETE with a body.
13834
13824
 
13835
- **listTrustedDevices**(clientId: string) → `Promise<ListResult<TrustedDevice>>`
13836
- List devices trusted to skip MFA challenges for the current user (authenticated). Returns `{ items, nextCursor }`: the devices are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items: devices } = await authKit.listTrustedDevices(clientId) ```
13825
+ **listTrustedDevices**(clientId: string, options: ListOptions = {}) → `Promise<ListResult<TrustedDevice>>`
13826
+ List devices trusted to skip MFA challenges for the current user (authenticated), a page at a time. Returns `{ items, nextCursor }`: the devices are in `items`. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await authKit.listTrustedDevices(clientId, { limit: 50 }) page.items // TrustedDevice[] while (page.nextCursor) page = await authKit.listTrustedDevices(clientId, { limit: 50, cursor: page.nextCursor }) ```
13837
13827
 
13838
13828
  **revokeTrustedDevice**(clientId: string, id: string) → `Promise<SuccessResponse>`
13839
13829
  Revoke a single trusted device by id (authenticated).
@@ -13844,8 +13834,8 @@ Load the **public** AuthKit config for a client (no auth). Returns branding + th
13844
13834
  **get**(collectionId: string, authKitId: string) → `Promise<AuthKitConfig>`
13845
13835
  Get the full AuthKit config, including admin-only fields like `security.lockout` (admin auth).
13846
13836
 
13847
- **list**(collectionId: string) → `Promise<ListResult<AuthKitConfig>>`
13848
- List a collection's AuthKit configs (admin). Returns `{ items, nextCursor }`: the configs are in `items`. The list is not paged, so `nextCursor` is always `null`. There is no public list. ```typescript const { items: kits } = await authKit.list('coll_123') ```
13837
+ **list**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<AuthKitConfig>>`
13838
+ List a collection's AuthKit configs (admin), a page at a time. Returns `{ items, nextCursor }`: the configs are in `items`. Page with `limit` (50 unless you say) and `cursor`. There is no public list. ```typescript let page = await authKit.list('coll_123', { limit: 50 }) page.items // AuthKitConfig[] while (page.nextCursor) page = await authKit.list('coll_123', { limit: 50, cursor: page.nextCursor }) ```
13849
13839
 
13850
13840
  **create**(collectionId: string, data: AuthKitConfigInput) → `Promise<AuthKitConfig>`
13851
13841
  Create an AuthKit client config (admin). Accepts the account `security` policy — see {@link AuthKitConfigInput}.
@@ -13894,8 +13884,9 @@ An account email as it would be sent now — or with draft settings (`emailTempl
13894
13884
  Get a single batch by ID for a collection and product (admin only).
13895
13885
 
13896
13886
  **list**(collectionId: string,
13897
- productId: string) → `Promise<ListResult<BatchResponse>>`
13898
- List all batches for a collection and product (admin only). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await batch.list('coll_123', 'prod_abc') console.log(`${items.length} batches`) ```
13887
+ productId: string,
13888
+ options: ListOptions = {}) → `Promise<ListResult<BatchResponse>>`
13889
+ List the batches for a collection and product (admin only), 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await batch.list('coll_123', 'prod_abc', { limit: 100 }) console.log(`${page.count} batches`) while (page.nextCursor) page = await batch.list('coll_123', 'prod_abc', { limit: 100, cursor: page.nextCursor }) ```
13899
13890
 
13900
13891
  **create**(collectionId: string,
13901
13892
  productId: string,
@@ -13933,7 +13924,7 @@ Look up a serial number by code for a batch (admin only).
13933
13924
 
13934
13925
  **searchInCollection**(collectionId: string,
13935
13926
  params?: SearchBatchesRequest) → `Promise<ListResult<BatchResponse>>`
13936
- Search for batches across all products in a collection. Allows searching by batch ID or name, with optional product filtering. The matches come back in one answer (`nextCursor` is always null); `limit` is the most it returns. ```typescript // Search for batches containing "2024" const { items: batches } = await batch.searchInCollection('coll_123', { search: 'BATCH-2024', limit: 50 }) // Filter batches for a specific product const productBatches = await batch.searchInCollection('coll_123', { productId: 'prod_abc', limit: 100 }) // Get all batches in collection const allBatches = await batch.searchInCollection('coll_123') // Check for expired batches (expiryDate is an ISO 8601 string) batches.forEach(batch => { if (batch.expiryDate && new Date(batch.expiryDate) < new Date()) { console.log(`Batch ${batch.id} is expired`) } }) ```
13927
+ Search for batches across all products in a collection. Allows searching by batch ID or name (`q`), with optional product filtering. `limit` is how many it returns (100 unless you say). When there are more, pass `nextCursor` back as `cursor` for the next ones; `null` means there are no more. ```typescript // Search for batches containing "2024", 50 at a time let page = await batch.searchInCollection('coll_123', { q: 'BATCH-2024', limit: 50 }) const batches = [...page.items] while (page.nextCursor) { page = await batch.searchInCollection('coll_123', { q: 'BATCH-2024', limit: 50, cursor: page.nextCursor }) batches.push(...page.items) } // Filter batches for a specific product const productBatches = await batch.searchInCollection('coll_123', { productId: 'prod_abc', limit: 100 }) // The first batches in the collection const firstBatches = await batch.searchInCollection('coll_123') // Check for expired batches (expiryDate is an ISO 8601 string) batches.forEach(batch => { if (batch.expiryDate && new Date(batch.expiryDate) < new Date()) { console.log(`Batch ${batch.id} is expired`) } }) ```
13937
13928
 
13938
13929
  **findInCollection**(collectionId: string,
13939
13930
  batchId: string) → `Promise<BatchResponse>`
@@ -13941,8 +13932,9 @@ Find a specific batch by ID across all products in a collection. Returns the bat
13941
13932
 
13942
13933
  **getBatchTags**(collectionId: string,
13943
13934
  batchId: string,
13944
- claimSetId?: string) → `Promise<ListResult<BatchTag>>`
13945
- Get all tags/codes assigned to a specific batch. Shows which claim set codes have been assigned to this batch. All of them come back in one answer: `nextCursor` is always null. ```typescript // Get all tags assigned to a batch const { items: tags } = await batch.getBatchTags('coll_123', 'BATCH-2024-001') console.log(`Batch has ${tags.length} tags assigned`) tags.forEach(tag => { console.log(`Code: ${tag.code}, ClaimSet: ${tag.claimSetId}, TagID: ${tag.tagId}`) }) // Get tags from a specific claim set const claimSetTags = await batch.getBatchTags('coll_123', 'BATCH-2024-001', '000001') ```
13935
+ claimSetId?: string,
13936
+ options: ListOptions = {}) → `Promise<ListResult<BatchTag>>`
13937
+ Get all tags/codes assigned to a specific batch. Shows which claim set codes have been assigned to this batch, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. `count` is how many there are in all. ```typescript // The tags assigned to a batch, 200 at a time let page = await batch.getBatchTags('coll_123', 'BATCH-2024-001', undefined, { limit: 200 }) console.log(`Batch has ${page.count} tags assigned`) page.items.forEach(tag => { console.log(`Code: ${tag.code}, ClaimSet: ${tag.claimSetId}, TagID: ${tag.tagId}`) }) while (page.nextCursor) { page = await batch.getBatchTags('coll_123', 'BATCH-2024-001', undefined, { limit: 200, cursor: page.nextCursor }) } // Get tags from a specific claim set const claimSetTags = await batch.getBatchTags('coll_123', 'BATCH-2024-001', '000001') ```
13946
13938
 
13947
13939
  ### bookings
13948
13940
 
@@ -13950,10 +13942,10 @@ Get all tags/codes assigned to a specific batch. Shows which claim set codes hav
13950
13942
  Book. All claims succeed together or nothing is written; a clash fails with 409 (`SLOT_FULL`, `RESOURCE_TAKEN`, `PER_CONTACT_LIMIT`, …). Pass `idempotencyKey` so a retry never books twice. Public (admin = false): the app's `publicCreate.bookings` rules decide the status and limits; an anonymous guest may get `editToken` back (once) to manage the booking later. POST /bookings
13951
13943
 
13952
13944
  **list**(collectionId: string, appId: string, params?: BookingListOptions, admin: boolean = true) → `Promise<ListResult<Booking>>`
13953
- List bookings (admin), a page at a time. `count` is how many match in all. There is no public list: a signed-in booker uses {@link mine}. GET /bookings ```typescript let page = await bookings.list(collectionId, appId, { status: 'confirmed', from: new Date(), limit: 50 }) page.items // Booking[] page.count // how many match in all while (page.nextCursor) { page = await bookings.list(collectionId, appId, { status: 'confirmed', from: new Date(), limit: 50, cursor: page.nextCursor }) } ```
13945
+ List bookings (admin), a page at a time. `count` is how many match in all. `from` / `to` pick the bookings overlapping that time; `orderBy` sorts (earliest start first unless you say). There is no public list: a signed-in booker uses {@link mine}. GET /bookings ```typescript const from = new Date() let page = await bookings.list(collectionId, appId, { status: 'confirmed', from, orderBy: [{ startsAt: 'desc' }], limit: 50 }) page.items // Booking[] page.count // how many match in all while (page.nextCursor) { page = await bookings.list(collectionId, appId, { status: 'confirmed', from, orderBy: [{ startsAt: 'desc' }], limit: 50, cursor: page.nextCursor }) } ```
13954
13946
 
13955
13947
  **mine**(collectionId: string, appId: string, params?: Omit<BookingListOptions, 'contactId'>) → `Promise<ListResult<Booking>>`
13956
- The signed-in caller's own bookings (public), a page at a time. GET /bookings/mine ```typescript const { items, nextCursor, count } = await bookings.mine(collectionId, appId, { from: new Date() }) ```
13948
+ The signed-in caller's own bookings (public), a page at a time. Takes the same options as {@link list}, except `contactId`. GET /bookings/mine ```typescript const { items, nextCursor, count } = await bookings.mine(collectionId, appId, { from: new Date(), orderBy: [{ startsAt: 'asc' }], limit: 20 }) ```
13957
13949
 
13958
13950
  **get**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions) → `Promise<Booking>`
13959
13951
  Get one booking. Public: the signed-in booker, or a guest passing `{ editToken }`. GET /bookings/:bookingId
@@ -13961,11 +13953,23 @@ Get one booking. Public: the signed-in booker, or a guest passing `{ editToken }
13961
13953
  **update**(collectionId: string, appId: string, bookingId: string, input: UpdateBookingInput, admin: boolean = true) → `Promise<Booking>`
13962
13954
  Update zones and descriptive fields (admin). PATCH /bookings/:bookingId
13963
13955
 
13964
- **confirm**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions) → `Promise<Booking>`
13965
- held / pending / waitlisted → confirmed (idempotent). A held booking whose hold has run out fails with HOLD_EXPIRED. Public: only the booker's own hold, when `ownerActions.bookings.confirm` allows. POST /bookings/:bookingId/confirm
13956
+ **confirm**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions & { payment?: 'waive' }) → `Promise<Booking>`
13957
+ held / pending / waitlisted → confirmed (idempotent). A held booking whose hold has run out fails with HOLD_EXPIRED. Public: only the booker's own hold, when `ownerActions.bookings.confirm` allows. Paid bookings: a booking waiting for its payment is confirmed by the payment (PAYMENT_REQUIRED otherwise). Admin confirming a REQUEST that has a price turns it into a hold with a pay link for the booker (`payment.link`, emailed through `booking.payment_requested`); `{ payment: 'waive' }` confirms without payment (paid in cash, a free place). POST /bookings/:bookingId/confirm
13958
+
13959
+ **cancel**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions & { reason?: string; refund?: 'full' | 'none' | number }) → `Promise<Booking>`
13960
+ Cancel and give the places back (idempotent). Public: per `ownerActions.bookings.cancel` and its cutoff. `reason` is admin-only (public cancels record 'owner'). Paid bookings are refunded: the booker's cancel follows the app's `bookingPayments.ownerCancelRefund` (full by default); staff choose with `refund`: 'full' (default) | 'none' | an amount in minor units. POST /bookings/:bookingId/cancel
13961
+
13962
+ **checkout**(collectionId: string, appId: string, input: BookingCheckoutInput) → `Promise<BookingCheckoutResult>`
13963
+ Book and pay. The same rules as `create` (public), then the app's `bookingPayments` decide: - pay now (the rules book as held / confirmed): the booking is held while the person pays on Stripe's page → go to `checkoutUrl`; Stripe's webhook confirms it. - a request (the rules book as pending): priced, nothing paid, `checkoutUrl: null`; staff approving it sends the booker a pay link. - free (no prices): booked the normal way, `checkoutUrl: null`. Name prices by id (`lines` for ticket types on a slot, `priceId` for an appointment's service); the server sets every amount. POST /bookings/checkout
13966
13964
 
13967
- **cancel**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions & { reason?: string }) → `Promise<Booking>`
13968
- Cancel and give the places back (idempotent). Public: per `ownerActions.bookings.cancel` and its cutoff. `reason` is admin-only (public cancels record 'owner'). POST /bookings/:bookingId/cancel
13965
+ **bySession**(collectionId: string, appId: string, sessionId: string) → `Promise<Booking &`
13966
+ The thank-you page: the booking a Checkout Session paid for (`session_id` in the success address). `confirming: true` while Stripe's webhook is still on its way: show "confirming your payment…" and read again in a moment. GET /bookings/by-session/:sessionId
13967
+
13968
+ **pay**(collectionId: string, appId: string, bookingId: string, token: string) → `Promise<BookingPayLinkResult>`
13969
+ An approved request's pay link, for an app with its own pay page (the link in the email goes straight to Stripe). `token` is the `t` of `payment.link`. → `{ checkoutUrl }`, or `{ done: 'paid' | 'closed', url }`. POST /bookings/:bookingId/pay
13970
+
13971
+ **refund**(collectionId: string, appId: string, bookingId: string, opts?: { amount?: number; reason?: string }) → `Promise<BookingRefundResult>`
13972
+ Refund a paid booking without cancelling it (admin): all that's left, or `amount` (minor units). A refund Stripe can't take now is retried by the platform (`refundPending: true`). POST /bookings/:bookingId/refund
13969
13973
 
13970
13974
  **move**(collectionId: string, appId: string, bookingId: string, input: MoveBookingInput, admin: boolean = false, opts?: BookingAccessOptions) → `Promise<Booking>`
13971
13975
  Move to a new slot / time, all-or-nothing (a failed move leaves the booking as it was). Public: per `ownerActions.bookings.move`; the create rules are re-checked for the new time. POST /bookings/:bookingId/move
@@ -13990,10 +13994,10 @@ Message the people booked (admin): a template to everyone on a slot, or everyone
13990
13994
  **create**(collectionId: string, appId: string, input: CreateBlockInput) → `Promise<BookingAllocation>`
13991
13995
 
13992
13996
  **list**(collectionId: string, appId: string, params?: BlockListOptions) → `Promise<ListResult<BookingAllocation>>`
13993
- The blocks on a resource and/or in a date range, a page at a time. GET /bookings/blocks ```typescript const { items, nextCursor } = await bookings.blocks.list(collectionId, appId, { resourceType: 'record', resourceId: 'staff-1' }) ```
13997
+ The blocks on a resource and/or in a date range (`from` / `to`), a page at a time (`limit`, `cursor`). GET /bookings/blocks ```typescript const { items, nextCursor } = await bookings.blocks.list(collectionId, appId, { resourceType: 'record', resourceId: 'staff-1', from: '2026-12-01T00:00:00Z', to: '2027-01-01T00:00:00Z', limit: 50, }) ```
13994
13998
 
13995
13999
  **remove**(collectionId: string, appId: string, blockId: string) → `Promise<`
13996
- The blocks on a resource and/or in a date range, a page at a time. GET /bookings/blocks ```typescript const { items, nextCursor } = await bookings.blocks.list(collectionId, appId, { resourceType: 'record', resourceId: 'staff-1' }) ```
14000
+ The blocks on a resource and/or in a date range (`from` / `to`), a page at a time (`limit`, `cursor`). GET /bookings/blocks ```typescript const { items, nextCursor } = await bookings.blocks.list(collectionId, appId, { resourceType: 'record', resourceId: 'staff-1', from: '2026-12-01T00:00:00Z', to: '2027-01-01T00:00:00Z', limit: 50, }) ```
13997
14001
 
13998
14002
  ### bookings.slots
13999
14003
 
@@ -14004,7 +14008,7 @@ Create a slot (admin). POST /bookings/slots
14004
14008
  Create many slots at once — a series — all-or-nothing (admin, max 500). POST /bookings/slots/batch
14005
14009
 
14006
14010
  **list**(collectionId: string, appId: string, params?: SlotListOptions, admin: boolean = false) → `Promise<ListResult<BookingSlot>>`
14007
- List slots, a page at a time. Public: open, public slots only, each with `remaining`. GET /bookings/slots ```typescript const { items, nextCursor, count } = await bookings.slots.list(collectionId, appId, { from, to, available: true }) ```
14011
+ List slots, a page at a time. Public: open, public slots only, each with `remaining`. `from` / `to` pick the slots in that time; `orderBy` sorts them. GET /bookings/slots ```typescript const { items, nextCursor, count } = await bookings.slots.list(collectionId, appId, { from, to, available: true, orderBy: [{ startsAt: 'asc' }], limit: 50, }) ```
14008
14012
 
14009
14013
  **get**(collectionId: string, appId: string, slotId: string, admin: boolean = false) → `Promise<BookingSlot>`
14010
14014
  GET /bookings/slots/:slotId
@@ -14072,20 +14076,20 @@ The contacts a broadcast goes to (its segment), a page at a time. `count` is how
14072
14076
 
14073
14077
  ### chat.completions
14074
14078
 
14075
- **create**(collectionId: string,
14079
+ **create**(collectionId: string,
14076
14080
  request: ChatCompletionRequest) → `Promise<ChatCompletionResponse | AsyncIterable<ChatCompletionChunk>>`
14077
14081
  Create a chat completion (streaming or non-streaming)
14078
14082
 
14079
14083
  ### chat.responses
14080
14084
 
14081
- **create**(collectionId: string,
14085
+ **create**(collectionId: string,
14082
14086
  request: ResponsesRequest) → `Promise<ResponsesResult | AsyncIterable<ResponsesStreamEvent>>`
14083
14087
  Create a Responses API request (streaming or non-streaming)
14084
14088
 
14085
14089
  ### claimSet
14086
14090
 
14087
- **getAll**(collectionId?: string) → `Promise<ListResult<any>>`
14088
- Get all claim sets. Returns `{ items, nextCursor }`: the claim sets are in `items`. The list is not paged, so `nextCursor` is always `null`. When collectionId is provided, returns claim sets for that collection. When omitted, returns all claim sets owned by the authenticated user. ```typescript const { items } = await claimSet.getAll('coll_123') ```
14091
+ **getAll**(collectionId?: string, options: ListOptions = {}) → `Promise<ListResult<any>>`
14092
+ Get all claim sets, a page at a time. Returns `{ items, nextCursor }`: the claim sets are in `items`; pass `nextCursor` back as `cursor` for the next page (`null` means that was the last one). When collectionId is provided, returns claim sets for that collection. When omitted, returns all claim sets owned by the authenticated user. ```typescript let page = await claimSet.getAll('coll_123', { limit: 50 }) while (page.nextCursor) page = await claimSet.getAll('coll_123', { limit: 50, cursor: page.nextCursor }) // Your own claim sets (no collection) const { items } = await claimSet.getAll(undefined, { limit: 50 }) ```
14089
14093
 
14090
14094
  **get**(claimSetId: string, collectionId?: string) → `Promise<any>`
14091
14095
  Get a specific claim set by ID.
@@ -14102,8 +14106,8 @@ Delete (soft-delete) a claim set.
14102
14106
  **getAllTags**(claimSetId: string, collectionId?: string) → `Promise<any>`
14103
14107
  Get all tags for a claim set (including data). This is not one of the SDK 3 lists: the answer is the claim set itself with its tags inside. Without a collectionId (your own claim set) they are in `tags`; with one they are in `codes` (the tag ids), or in `codeMap` (id → key) for a secure set.
14104
14108
 
14105
- **getAssignedTags**(claimSetId: string, collectionId?: string) → `Promise<ListResult<any> & Record<string, any>>`
14106
- Get assigned tags for a claim set — tags soft-assigned to a collection or product. Returns `{ items, nextCursor }` with the claim set's own fields (`id`, `name`, …) beside them: the tags are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items, name } = await claimSet.getAssignedTags('12', 'coll_123') console.log(`${items.length} tags of ${name} are assigned`) ```
14109
+ **getAssignedTags**(claimSetId: string, collectionId?: string, options: ListOptions = {}) → `Promise<ListResult<any> & Record<string, any>>`
14110
+ Get assigned tags for a claim set — tags soft-assigned to a collection or product. Returns `{ items, nextCursor }` with the claim set's own fields (`id`, `name`, …) beside them: the tags are in `items`, a page at a time. Pass `nextCursor` back as `cursor` for the next page (`null` means that was the last one). ```typescript let page = await claimSet.getAssignedTags('12', 'coll_123', { limit: 50 }) console.log(`Assigned tags of ${page.name}:`, page.items) while (page.nextCursor) { page = await claimSet.getAssignedTags('12', 'coll_123', { limit: 50, cursor: page.nextCursor }) } ```
14107
14111
 
14108
14112
  **createTag**(claimSetId: string,
14109
14113
  data: CreateClaimSetTagRequest,
@@ -14135,8 +14139,8 @@ Update claim data for a claim set (collection-scoped).
14135
14139
 
14136
14140
  ### claimSet.ranges
14137
14141
 
14138
- **list**(scope: ClaimSetScope, claimSetId: string) → `Promise<ListResult<ClaimSetRange>>`
14139
- The ranges in a set, lowest index first. Returns `{ items, nextCursor }`: the ranges are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items: ranges } = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12') ```
14142
+ **list**(scope: ClaimSetScope, claimSetId: string, options: ListOptions = {}) → `Promise<ListResult<ClaimSetRange>>`
14143
+ The ranges in a set, lowest index first, a page at a time (50 unless you give a `limit`). Returns `{ items, nextCursor }`: the ranges are in `items`; pass `nextCursor` back as `cursor` for the next page (`null` means that was the last one). ```typescript let page = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12', { limit: 50 }) while (page.nextCursor) { page = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12', { limit: 50, cursor: page.nextCursor }) } ```
14140
14144
 
14141
14145
  **create**(scope: ClaimSetScope, claimSetId: string, params: CreateClaimSetRangeRequest) → `Promise<ClaimSetRange>`
14142
14146
  Reserve the set's next indexes and mint a code (and, for NTAG 424, a key) for each.
@@ -14178,8 +14182,8 @@ What the collection's installed apps need and whether it's there (sign-in, custo
14178
14182
  **get**(collectionId: string, admin?: boolean) → `Promise<CollectionResponse>`
14179
14183
  Retrieves a single Collection by its ID.
14180
14184
 
14181
- **list**() → `Promise<ListResult<CollectionResponse>>`
14182
- The collections the signed-in user can work on (admin). All of them come back in one answer: `nextCursor` is always null. There is no public list of collections: read one with `collection.get`. ```typescript const { items } = await collection.list() items.forEach(c => console.log(c.id, c.title)) ```
14185
+ **list**(options: ListOptions = {}) → `Promise<ListResult<CollectionResponse>>`
14186
+ The collections the signed-in user can work on (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. There is no public list of collections: read one with `collection.get`. ```typescript let page = await collection.list({ limit: 50 }) page.items.forEach(c => console.log(c.id, c.title)) while (page.nextCursor) page = await collection.list({ limit: 50, cursor: page.nextCursor }) ```
14183
14187
 
14184
14188
  **getShortId**(shortId: string) → `Promise<CollectionResponse>`
14185
14189
  Retrieve a collection by its shortId (public endpoint).
@@ -14237,8 +14241,8 @@ Look up a serial number by code for a collection (admin only).
14237
14241
  value: any) → `Promise<any>`
14238
14242
  Assign a value to a serial number for a collection (admin only).
14239
14243
 
14240
- **getUsers**(collectionId: string) → `Promise<ListResult<CollectionUser>>`
14241
- List the users with access to a collection, each with their access level (admin only). Access is stored in the collection's `roles` map (userId → level); this resolves each to name/email. All of them come back in one answer: `nextCursor` is always null. GET /admin/collection/:collectionId/getUsers ```typescript const { items: users } = await collection.getUsers('coll_123') users.forEach(u => console.log(u.email, u.access)) ```
14244
+ **getUsers**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<CollectionUser>>`
14245
+ List the users with access to a collection, each with their access level (admin only). Access is stored in the collection's `roles` map (userId → level); this resolves each to name/email. A page at a time: page with `limit` (50 unless you say) and `cursor`. GET /admin/collection/:collectionId/getUsers ```typescript let page = await collection.getUsers('coll_123', { limit: 50 }) page.items.forEach(u => console.log(u.email, u.access)) while (page.nextCursor) page = await collection.getUsers('coll_123', { limit: 50, cursor: page.nextCursor }) ```
14242
14246
 
14243
14247
  **setUserAccess**(collectionId: string,
14244
14248
  userId: string,
@@ -14254,93 +14258,93 @@ Invite a user to a collection by email (admin only). Creates or links their acco
14254
14258
  **getPushVapidPublicKey**(collectionId: string) → `Promise<import("../types/comms").PushVapidResponse>`
14255
14259
  Public: Get VAPID public key used for Web Push subscriptions. GET /public/collection/:collectionId/comm/push/vapidPublicKey Note: Key may be global; path is collection-scoped for consistency.
14256
14260
 
14257
- **registerPush**(collectionId: string,
14261
+ **registerPush**(collectionId: string,
14258
14262
  body: import("../types/comms") → `void`
14259
14263
  Public: Register a Web Push subscription under unified comms. POST /public/collection/:collectionId/comm/push/register
14260
14264
 
14261
- **getSettings**(collectionId: string,
14265
+ **getSettings**(collectionId: string,
14262
14266
  opts: { includeSecret?: boolean } = {}) → `Promise<import("../types/comms").CommsSettingsGetResponse>`
14263
14267
  Admin: Get current comms settings for a collection. GET /admin/collection/:collectionId/comm.settings Optional query: includeSecret=true to include unsub.secret in response.
14264
14268
 
14265
- **patchSettings**(collectionId: string,
14269
+ **patchSettings**(collectionId: string,
14266
14270
  body: import("../types/comms") → `void`
14267
14271
  Admin: Patch comms settings for a collection. PATCH /admin/collection/:collectionId/comm.settings
14268
14272
 
14269
14273
  **getPublicTopics**(collectionId: string) → `Promise<import("../types/comms").CommsPublicTopicsResponse>`
14270
14274
  Public: Fetch configured topics for a collection. GET /public/collection/:collectionId/comm/topics
14271
14275
 
14272
- **unsubscribe**(collectionId: string,
14276
+ **unsubscribe**(collectionId: string,
14273
14277
  query: import("../types/comms") → `void`
14274
14278
  Public: Unsubscribe a contact from a category or channel. GET /public/collection/:collectionId/comm/unsubscribe
14275
14279
 
14276
- **signup**(collectionId: string,
14280
+ **signup**(collectionId: string,
14277
14281
  body: import("../types/comms") → `void`
14278
14282
  Public: sign an email address up for topics (a newsletter, updates) — works signed out. Double opt-in: nothing is consented until the address's owner clicks the confirmation link SmartLinks emails them. Always answers `{ ok: true, pending: true }` (it never reveals whether the address is already known). Topics must be ones configured in the collection's comm settings. Set comm settings `signup.confirmedUrl` to send people to your own page after confirming. POST /public/collection/:collectionId/comm/signup
14279
14283
 
14280
- **upsertConsent**(collectionId: string,
14284
+ **upsertConsent**(collectionId: string,
14281
14285
  body: import("../types/comms") → `void`
14282
14286
  Public: Upsert default consent for a contact. POST /public/collection/:collectionId/comm/consent
14283
14287
 
14284
- **upsertPreferences**(collectionId: string,
14288
+ **upsertPreferences**(collectionId: string,
14285
14289
  body: import("../types/comms") → `void`
14286
14290
  Public: Upsert preferences for a specific subject (or default if subject omitted). POST /public/collection/:collectionId/comm/preferences
14287
14291
 
14288
- **subscribe**(collectionId: string,
14292
+ **subscribe**(collectionId: string,
14289
14293
  body: import("../types/comms") → `void`
14290
14294
  Public: Subscribe/unsubscribe contact to a subject. POST /public/collection/:collectionId/comm/subscribe
14291
14295
 
14292
- **checkSubscription**(collectionId: string,
14296
+ **checkSubscription**(collectionId: string,
14293
14297
  query: import("../types/comms") → `void`
14294
14298
  Public: Check subscription status for a subject. GET /public/collection/:collectionId/comm/subscription/check
14295
14299
 
14296
- **listMethods**(collectionId: string,
14300
+ **listMethods**(collectionId: string,
14297
14301
  query: import("../types/comms") → `void`
14298
14302
  Public: List registered contact methods. All of them come back in one answer: `nextCursor` is always null. GET /public/collection/:collectionId/comm/methods ```typescript const { items: methods } = await comms.listMethods(collectionId, { type: 'email' }) ```
14299
14303
 
14300
- **registerEmail**(collectionId: string,
14304
+ **registerEmail**(collectionId: string,
14301
14305
  body: import("../types/comms") → `void`
14302
14306
  Public: Register email method for a contact. POST /public/collection/:collectionId/comm/email/register
14303
14307
 
14304
- **registerSms**(collectionId: string,
14308
+ **registerSms**(collectionId: string,
14305
14309
  body: import("../types/comms") → `void`
14306
14310
  Public: Register SMS method for a contact. POST /public/collection/:collectionId/comm/sms/register
14307
14311
 
14308
- **resolveSubscriptions**(collectionId: string,
14312
+ **resolveSubscriptions**(collectionId: string,
14309
14313
  body: import("../types/comms") → `void`
14310
14314
  Public: Resolve contacts for a subject with identity hints. POST /public/collection/:collectionId/comm/subscriptions/resolve
14311
14315
 
14312
- **queryByUser**(collectionId: string,
14316
+ **queryByUser**(collectionId: string,
14313
14317
  body: CommsQueryByUser = {}) → `Promise<ListResult<CommunicationEvent>>`
14314
- Analytics: Query communication events by user or contact. The events come back in one answer (`nextCursor` is always null); `limit` is the most it returns. POST /admin/collection/:collectionId/comm/query/by-user ```typescript const { items: events } = await comms.queryByUser(collectionId, { contactId, from: '2026-01-01', limit: 200 }) ```
14318
+ Analytics: Query communication events by user or contact, a page at a time (`limit` and `cursor` in the body). The time window is `from` / `to`. POST /admin/collection/:collectionId/comm/query/by-user ```typescript const query = { contactId, from: '2026-01-01T00:00:00Z', limit: 200 } let page = await comms.queryByUser(collectionId, query) page.items // CommunicationEvent[] while (page.nextCursor) page = await comms.queryByUser(collectionId, { ...query, cursor: page.nextCursor }) ```
14315
14319
 
14316
- **queryRecipientIds**(collectionId: string,
14320
+ **queryRecipientIds**(collectionId: string,
14317
14321
  body: CommsRecipientIdsQuery) → `Promise<ListResult<RecipientId>>`
14318
- Analytics: Recipient IDs for a communication source. The ids come back in one answer (`nextCursor` is always null); `limit` is the most it returns. POST /admin/collection/:collectionId/comm/query/recipient-ids ```typescript const { items: ids } = await comms.queryRecipientIds(collectionId, { broadcastId, idField: 'contactId' }) ```
14322
+ Analytics: Recipient IDs for a communication source, a page at a time (`limit` and `cursor` in the body). The time window is `from` / `to`. POST /admin/collection/:collectionId/comm/query/recipient-ids ```typescript const query = { broadcastId, idField: 'contactId' as const, limit: 500 } let page = await comms.queryRecipientIds(collectionId, query) page.items // the ids while (page.nextCursor) page = await comms.queryRecipientIds(collectionId, { ...query, cursor: page.nextCursor }) ```
14319
14323
 
14320
- **queryRecipientsWithoutInteraction**(collectionId: string,
14324
+ **queryRecipientsWithoutInteraction**(collectionId: string,
14321
14325
  body: CommsRecipientsWithoutInteractionQuery) → `Promise<ListResult<RecipientId>>`
14322
14326
  Analytics: the recipients of a broadcast or journey who did NOT then do an interaction. The ids come back in one answer (`nextCursor` is always null); `limit` is the most it returns. POST /admin/collection/:collectionId/comm/query/recipients/without-interaction ```typescript const { items: ids } = await comms.queryRecipientsWithoutInteraction(collectionId, { broadcastId, interactionId: 'survey-done' }) ```
14323
14327
 
14324
- **queryRecipientsWithInteraction**(collectionId: string,
14328
+ **queryRecipientsWithInteraction**(collectionId: string,
14325
14329
  body: CommsRecipientsWithInteractionQuery) → `Promise<ListResult<RecipientId | RecipientWithOutcome>>`
14326
14330
  Analytics: the recipients of a broadcast or journey who then did an interaction. With `includeOutcome: true` each item is `{ id, outcome }` instead of an id. One answer, no pages. POST /admin/collection/:collectionId/comm/query/recipients/with-interaction ```typescript const { items } = await comms.queryRecipientsWithInteraction(collectionId, { broadcastId, interactionId: 'survey-done', includeOutcome: true }) ```
14327
14331
 
14328
- **sendTransactional**(collectionId: string,
14332
+ **sendTransactional**(collectionId: string,
14329
14333
  body: TransactionalSendRequest) → `Promise<TransactionalSendResult>`
14330
14334
  Send a single transactional message to one contact using a template. No broadcast record is created. The send is logged to the contact's communication history with sourceType: 'transactional'. POST /admin/collection/:collectionId/comm/send ```typescript const result = await comms.sendTransactional(collectionId, { contactId: 'e4f2a1b0-...', templateId: 'warranty-update', channel: 'preferred', props: { claimRef: 'CLM-0042', decision: 'approved' }, include: { productId: 'prod-abc123', appCase: 'c9d1e2f3-...' }, ref: 'warranty-decision-notification', appId: 'warrantyApp', }) if (result.ok) { console.log(`Sent via ${result.channel}`, result.messageId) } else { console.error('Send failed:', result.error) } ```
14331
14335
 
14332
- **logCommunicationEvent**(collectionId: string,
14336
+ **logCommunicationEvent**(collectionId: string,
14333
14337
  body: LogCommunicationEventBody) → `Promise<AppendResult>`
14334
14338
  Logging: Append a single communication event. POST /admin/collection/:collectionId/comm/log
14335
14339
 
14336
- **logBulkCommunicationEvents**(collectionId: string,
14340
+ **logBulkCommunicationEvents**(collectionId: string,
14337
14341
  body: LogBulkCommunicationEventsBody | ({ sourceId: string; ids: string[]; idField?: 'userId'|'contactId'; [k: string]: any }) → `void`
14338
14342
  Logging: Append many communication events for a list of IDs. POST /admin/collection/:collectionId/comm/log/bulk
14339
14343
 
14340
14344
  ### conditions
14341
14345
 
14342
- **list**(collectionId: string, admin = false) → `Promise<ListResult<SavedCondition>>`
14343
- Every saved condition in the collection (removed ones left out). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await conditions.list('coll_123') items.map(c => c.title) // ["UK only", "In the stadium"] ```
14346
+ **list**(collectionId: string, admin = false, options: ListOptions = {}) → `Promise<ListResult<SavedCondition>>`
14347
+ The collection's saved conditions (removed ones left out), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await conditions.list('coll_123') page.items.map(c => c.title) // ["UK only", "In the stadium"] while (page.nextCursor) page = await conditions.list('coll_123', false, { cursor: page.nextCursor }) ```
14344
14348
 
14345
14349
  **get**(collectionId: string, conditionId: string, admin = false) → `Promise<SavedCondition>`
14346
14350
  One saved condition. Public reads 404 for a removed one; an admin read returns it with `deleted: true`. ```typescript const ukOnly = await conditions.get('coll_123', 'nfCmuWDY') ```
@@ -14364,7 +14368,7 @@ Returns all proof type definitions. Proof types are templates that specify which
14364
14368
 
14365
14369
  ### contact
14366
14370
 
14367
- **query**(collectionId: string,
14371
+ **query**(collectionId: string,
14368
14372
  body: StandardQuery = {}) → `Promise<QueryResult>`
14369
14373
  The standard query on contacts (admin only): filter, sort, page, count and total in one call. POST /admin/collection/:collectionId/contacts/query Fields: contactId, userId, firstName, lastName, displayName, company, email, phone, tags, source, locale, createdAt, updatedAt. Email and phone are the contact's main one. Deleted and erased contacts are never returned. ```typescript await contact.query(collectionId, { where: { tags: { hasAny: ['vip', 'trade'] }, createdAt: { gte: '2026-01-01' } }, select: ['contactId', 'firstName', 'email'], count: true, }) await contact.query(collectionId, { groupBy: ['company'], aggregates: { people: { count: true } } }) ```
14370
14374
 
@@ -14374,64 +14378,49 @@ What a contacts query can use: its fields and what each can filter, sort, group
14374
14378
  **create**(collectionId: string, data: ContactCreateRequest) → `Promise<ContactResponse>`
14375
14379
  What a contacts query can use: its fields and what each can filter, sort, group or total. GET /admin/collection/:collectionId/contacts/query
14376
14380
 
14377
- **list**(collectionId: string,
14381
+ **list**(collectionId: string,
14378
14382
  params?: ListOptions & { includeDeleted?: boolean }) → `Promise<ListResult<ContactResponse>>`
14379
14383
  The collection's contacts, a page at a time (admin only). Pass `includeDeleted: true` to include deleted contacts. For filters, sorting and totals use `contact.query` or `contact.search`. GET /admin/collection/:collectionId/contacts ```typescript let page = await contact.list('coll_123', { limit: 50 }) page.items // Contact[] while (page.nextCursor) page = await contact.list('coll_123', { limit: 50, cursor: page.nextCursor }) ```
14380
14384
 
14381
- **search**({
14382
- collectionId,
14383
- q,
14384
- typeahead,
14385
- email,
14386
- phone,
14387
- id,
14388
- userId,
14389
- tags,
14390
- tagsAll,
14391
- source,
14392
- locale,
14393
- createdFrom,
14394
- createdTo,
14395
- externalIdKey,
14396
- externalIdValue,
14397
- customFieldKey,
14398
- customFieldValue,
14399
- limit,
14400
- cursor,
14385
+ **search**({
14386
+ collectionId,
14387
+ tags,
14388
+ tagsAll,
14389
+ ...rest
14401
14390
  }: ContactSearchParams) → `Promise<ListResult<ContactResponse>>`
14402
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14391
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14403
14392
 
14404
- **get**(collectionId: string,
14405
- contactId: string,
14393
+ **get**(collectionId: string,
14394
+ contactId: string,
14406
14395
  params?: { includeDeleted?: boolean }) → `Promise<ContactResponse>`
14407
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14396
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14408
14397
 
14409
- **update**(collectionId: string,
14410
- contactId: string,
14398
+ **update**(collectionId: string,
14399
+ contactId: string,
14411
14400
  data: ContactUpdateRequest) → `Promise<ContactResponse>`
14412
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14401
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14413
14402
 
14414
14403
  **remove**(collectionId: string, contactId: string) → `Promise<void>`
14415
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14404
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14416
14405
 
14417
- **lookup**(collectionId: string,
14406
+ **lookup**(collectionId: string,
14418
14407
  params: { email?: string; phone?: string }) → `Promise<ContactResponse>`
14419
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14408
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14420
14409
 
14421
- **upsert**(collectionId: string,
14410
+ **upsert**(collectionId: string,
14422
14411
  data: ContactCreateRequest) → `Promise<ContactResponse>`
14423
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14412
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14424
14413
 
14425
- **publicUpsert**(collectionId: string,
14414
+ **publicUpsert**(collectionId: string,
14426
14415
  data: PublicContactUpsertRequest) → `Promise<PublicContactUpsertResponse>`
14427
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14416
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14428
14417
 
14429
14418
  **publicGetMine**(collectionId: string) → `Promise<PublicGetMyContactResponse>`
14430
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14419
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14431
14420
 
14432
- **publicUpdateMine**(collectionId: string,
14421
+ **publicUpdateMine**(collectionId: string,
14433
14422
  data: ContactPatch) → `Promise<PublicUpdateMyContactResponse>`
14434
- Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source, dates and custom fields. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) ```
14423
+ Search the collection's contacts (admin only), a page at a time: free text (`q`, with `typeahead` for search-as-you-type), or filters on email, phone, id, tags, source and custom fields. Filter by when the contact was created with a range: `createdAt: { gte, lte }`. GET /admin/collection/:collectionId/contacts/search ```typescript let page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20 }) page.items // Contact[] if (page.nextCursor) page = await contact.search({ collectionId, q: 'joh', typeahead: true, limit: 20, cursor: page.nextCursor }) // Contacts created in November await contact.search({ collectionId, createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' } }) ```
14435
14424
 
14436
14425
  **publicGetSchema**(collectionId: string) → `Promise<ContactSchemaResponse>`
14437
14426
  Public: Get the contact schema for a collection. GET /public/collection/:collectionId/contact/schema Returns a ContactSchemaResponse describing all publicly visible contact fields. Core fields and collection-defined custom fields are merged into a single flat schema. Fields not in `publicVisibleFields` are stripped entirely from the response. Fields visible but not in `publicEditableFields` have `ui:disabled: true` in `uiSchema`. Use `fieldOrder` to render fields in the correct sequence, and `evaluateConditions` from the types package to handle conditional field visibility. ```typescript import { contact, evaluateConditions } from '@proveanything/smartlinks' const schema = await contact.publicGetSchema(collectionId) for (const fieldId of schema.fieldOrder) { const property = schema.schema.properties[fieldId] const ui = schema.uiSchema[fieldId] || {} const visible = evaluateConditions(property.conditions, property.showWhen, formValues) const disabled = ui['ui:disabled'] === true if (visible) renderField({ fieldId, property, ui, disabled }) } ```
@@ -14439,78 +14428,79 @@ Public: Get the contact schema for a collection. GET /public/collection/:collect
14439
14428
  **erase**(collectionId: string, contactId: string, body?: any) → `Promise<ContactResponse>`
14440
14429
  Public: Get the contact schema for a collection. GET /public/collection/:collectionId/contact/schema Returns a ContactSchemaResponse describing all publicly visible contact fields. Core fields and collection-defined custom fields are merged into a single flat schema. Fields not in `publicVisibleFields` are stripped entirely from the response. Fields visible but not in `publicEditableFields` have `ui:disabled: true` in `uiSchema`. Use `fieldOrder` to render fields in the correct sequence, and `evaluateConditions` from the types package to handle conditional field visibility. ```typescript import { contact, evaluateConditions } from '@proveanything/smartlinks' const schema = await contact.publicGetSchema(collectionId) for (const fieldId of schema.fieldOrder) { const property = schema.schema.properties[fieldId] const ui = schema.uiSchema[fieldId] || {} const visible = evaluateConditions(property.conditions, property.showWhen, formValues) const disabled = ui['ui:disabled'] === true if (visible) renderField({ fieldId, property, ui, disabled }) } ```
14441
14430
 
14442
- **findDuplicates**(collectionId: string,
14431
+ **findDuplicates**(collectionId: string,
14443
14432
  params?: ListOptions) → `Promise<ContactDuplicatesResponse>`
14444
14433
  Admin: pairs of contacts that look like one person. GET /admin/collection/:collectionId/contacts/duplicates The pattern it finds: someone the collection knew by email first (an import, a list, a form) who later signed in. Their sign-in got a second contact, which could not take the email the first one already held — so one contact has the email and no sign-in, the other the sign-in (and everything they did) and no email. The match is made on the server, on verified addresses only. Checks a window of contacts per call and returns the pairs found in it (`items`); `scanned` is how many contacts it checked. While `nextCursor` is not null, call again with it as `cursor` to check the next window. ```typescript const { items: pairs } = await contact.findDuplicates(collectionId) for (const pair of pairs) { await contact.merge(collectionId, pair.keep.contactId, pair.merge.contactId) } ```
14445
14434
 
14446
- **merge**(collectionId: string,
14447
- keepContactId: string,
14435
+ **merge**(collectionId: string,
14436
+ keepContactId: string,
14448
14437
  fromContactId: string) → `Promise<ContactMergeResponse>`
14449
14438
  Admin: fold contact `fromContactId` INTO contact `keepContactId`. POST /admin/collection/:collectionId/contacts/:keepContactId/merge The kept contact gains the other's sign-in, emails and phones, and anything it had no value for; its own values win. Everything recorded against the other contact moves to the kept one. Consent is never loosened: an opt-out on either contact stays an opt-out. The other contact is soft-deleted and marked with `customFields.mergedInto`. Refused (HTTP 409, `error` = a `ContactMergeErrorCode`) when the two have different sign-ins (`LOGIN_CONFLICT`) or are both members of the same loyalty scheme (`LOYALTY_CONFLICT`).
14450
14439
 
14451
- **linkLogin**(collectionId: string,
14440
+ **linkLogin**(collectionId: string,
14452
14441
  userId: string) → `Promise<ContactLinkLoginResponse>`
14453
14442
  Admin: the contact that carries a sign-in, attaching the sign-in first to the contact that already holds its verified email or phone. POST /admin/collection/:collectionId/contacts/link-login For a service about to create a contact for a `userId`: call this first and only create when it throws 404 (`NOTHING_TO_LINK`), so a person the collection already knows by email stays one contact. The address is read from the sign-in itself and must be verified; nothing the caller says about an email is used. Never creates a contact. ```typescript let contactId: string try { contactId = (await contact.linkLogin(collectionId, userId)).contactId } catch (err) { if (err.statusCode !== 404) throw err contactId = (await contact.create(collectionId, { userId, source: 'my-service' })).contactId } ```
14454
14443
 
14455
- **getUser**(collectionId: string,
14444
+ **getUser**(collectionId: string,
14456
14445
  userId: string,) → `Promise<UserSearchResponse>`
14457
14446
  Admin: the contact that carries a sign-in, attaching the sign-in first to the contact that already holds its verified email or phone. POST /admin/collection/:collectionId/contacts/link-login For a service about to create a contact for a `userId`: call this first and only create when it throws 404 (`NOTHING_TO_LINK`), so a person the collection already knows by email stays one contact. The address is read from the sign-in itself and must be verified; nothing the caller says about an email is used. Never creates a contact. ```typescript let contactId: string try { contactId = (await contact.linkLogin(collectionId, userId)).contactId } catch (err) { if (err.statusCode !== 404) throw err contactId = (await contact.create(collectionId, { userId, source: 'my-service' })).contactId } ```
14458
14447
 
14459
14448
  ### containers
14460
14449
 
14461
- **create**(collectionId: string,
14450
+ **create**(collectionId: string,
14462
14451
  data: CreateContainerInput) → `Promise<Container>`
14463
14452
  Create a new container (admin). ```typescript const cask = await containers.create('coll_123', { containerType: 'cask', ref: 'CASK-0042', name: 'Cask 42 — Single Malt', metadata: { distilleryYear: 2019, capacity: 200 }, }) ```
14464
14453
 
14465
- **list**(collectionId: string,
14454
+ **list**(collectionId: string,
14466
14455
  params?: ListContainersParams) → `Promise<ListResult<Container>>`
14467
14456
  List containers (admin), a page at a time. Supports filtering by type, status, ref, parent, and top-level flag. ```typescript // All active pallets let page = await containers.list('coll_123', { containerType: 'pallet', status: 'active', limit: 50, }) const pallets = page.items while (page.nextCursor) { page = await containers.list('coll_123', { containerType: 'pallet', status: 'active', limit: 50, cursor: page.nextCursor }) pallets.push(...page.items) } // Top-level containers only const { items: roots } = await containers.list('coll_123', { topLevel: true }) ```
14468
14457
 
14469
- **findForItem**(collectionId: string,
14458
+ **findForItem**(collectionId: string,
14470
14459
  params: FindContainersForItemParams) → `Promise<FindContainersForItemResponse>`
14471
- Reverse lookup — find all containers currently holding a specific item (admin). containers. All of them in one answer: `nextCursor` is always null. ```typescript const { containers: holding } = await containers.findForItem('coll_123', { itemType: 'proof', itemId: 'unit-0007', productId: 'drill', }) ```
14460
+ Reverse lookup — find all containers currently holding a specific item (admin). containers, a page at a time. Pass `nextCursor` back as `cursor` for the next page. ```typescript const { containers: holding, nextCursor } = await containers.findForItem('coll_123', { itemType: 'proof', itemId: 'unit-0007', productId: 'drill', limit: 50, }) ```
14472
14461
 
14473
- **get**(collectionId: string,
14474
- containerId: string,
14462
+ **get**(collectionId: string,
14463
+ containerId: string,
14475
14464
  params?: GetContainerParams) → `Promise<Container>`
14476
14465
  Get a single container by ID (admin). Pass `?tree=true` to recursively embed children, and/or `?includeContents=true` to embed the current item list. ```typescript // Flat const cask = await containers.get('coll_123', 'cask-uuid') // Full tree with contents const tree = await containers.get('coll_123', 'warehouse-uuid', { tree: true, treeDepth: 3, includeContents: true, }) ```
14477
14466
 
14478
- **update**(collectionId: string,
14479
- containerId: string,
14467
+ **update**(collectionId: string,
14468
+ containerId: string,
14480
14469
  data: UpdateContainerInput) → `Promise<Container>`
14481
14470
  Partially update a container (admin). Only fields present in the request body are modified. Pass `parentContainerId: null` to promote a container to top-level. ```typescript const updated = await containers.update('coll_123', 'cask-uuid', { status: 'archived', metadata: { bottledAt: '2025-04-01' }, }) ```
14482
14471
 
14483
- **remove**(collectionId: string,
14472
+ **remove**(collectionId: string,
14484
14473
  containerId: string) → `Promise<`
14485
14474
  Soft-delete a container (admin). Sets `deletedAt`; the record and its full item history remain queryable by admins. Public API responses automatically exclude deleted containers.
14486
14475
 
14487
- **listItems**(collectionId: string,
14488
- containerId: string,
14476
+ **listItems**(collectionId: string,
14477
+ containerId: string,
14489
14478
  params?: ListContainerItemsParams) → `Promise<ListResult<ContainerItem>>`
14490
14479
  List items currently (or historically) inside a container (admin). Pass `history: true` to include removed items and see the full membership log, a page at a time (`limit`, `cursor`). The current contents come back whole. ```typescript // Current contents const { items } = await containers.listItems('coll_123', 'cask-uuid') // Full history including removed items const { items: history, nextCursor } = await containers.listItems('coll_123', 'cask-uuid', { history: true, limit: 200 }) ```
14491
14480
 
14492
- **addItems**(collectionId: string,
14493
- containerId: string,
14481
+ **addItems**(collectionId: string,
14482
+ containerId: string,
14494
14483
  data: AddContainerItemsInput) → `Promise<AddContainerItemsResponse>`
14495
14484
  Add one or more items to a container (admin). Each item requires `itemType` and `itemId`. Pass `productId` / `proofId` for denormalisation convenience. ```typescript const { items } = await containers.addItems('coll_123', 'pallet-uuid', { items: [ { itemType: 'tag', itemId: 'NFC-00AABBCC' }, { itemType: 'proof', itemId: 'proof-uuid', productId: 'product-id' }, ], }) ```
14496
14485
 
14497
- **removeItems**(collectionId: string,
14498
- containerId: string,
14486
+ **removeItems**(collectionId: string,
14487
+ containerId: string,
14499
14488
  data: RemoveContainerItemsInput) → `Promise<RemoveContainerItemsResponse>`
14500
14489
  Soft-remove items from a container (admin). Sets `removedAt` on the specified `ContainerItem` records. The records are retained in the history log and can be queried with `history: true`. ```typescript const result = await containers.removeItems('coll_123', 'pallet-uuid', { ids: ['container-item-uuid-1', 'container-item-uuid-2'], }) console.log(`Removed ${result.removedCount} items`) ```
14501
14490
 
14502
- **publicList**(collectionId: string,
14491
+ **publicList**(collectionId: string,
14503
14492
  params?: PublicListContainersParams) → `Promise<ListResult<Container>>`
14504
14493
  List containers (public), a page at a time. Only active containers are listed; soft-deleted containers and containers with `metadata.publicListing === false` are excluded from results. ```typescript const { items, nextCursor } = await containers.publicList('coll_123', { containerType: 'cask', limit: 50 }) ```
14505
14494
 
14506
- **publicGet**(collectionId: string,
14507
- containerId: string,
14495
+ **publicGet**(collectionId: string,
14496
+ containerId: string,
14508
14497
  params?: GetContainerParams) → `Promise<Container>`
14509
14498
  Get a single container (public). Soft-deleted containers return a 404. Same `?tree` and `?includeContents` options as the admin version.
14510
14499
 
14511
- **publicListItems**(collectionId: string,
14512
- containerId: string) → `Promise<ListResult<ContainerItem>>`
14513
- List current contents of a container (public). Returns only items where `removedAt` is null. No `?history` option on the public side. All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await containers.publicListItems('coll_123', 'cask-uuid') ```
14500
+ **publicListItems**(collectionId: string,
14501
+ containerId: string,
14502
+ options: ListOptions = {}) → `Promise<ListResult<ContainerItem>>`
14503
+ List current contents of a container (public), a page at a time. Returns only items where `removedAt` is null. No `?history` option on the public side. ```typescript let page = await containers.publicListItems('coll_123', 'cask-uuid', { limit: 50 }) while (page.nextCursor) { page = await containers.publicListItems('coll_123', 'cask-uuid', { limit: 50, cursor: page.nextCursor }) } ```
14514
14504
 
14515
14505
  ### content
14516
14506
 
@@ -14546,7 +14536,7 @@ Delete a crate for a collection (admin only). This performs a soft delete. ```ty
14546
14536
  ### dpp
14547
14537
 
14548
14538
  **groups**(collectionId: string) → `Promise<ListResult<DppGroup>>`
14549
- What passports can be made: product groups, their kinds, and each view's fields and required fields. All of them in one answer (`nextCursor` is always null). GET /dpp/groups ```typescript const { items } = await dpp.groups(collectionId) items.map(g => g.productGroup) // ["BATTERIES", …] ```
14539
+ What passports can be made: product groups, their kinds, and each view's fields and required fields. A fixed set: always all of them in one answer (`nextCursor` is always null), so it takes no `limit` or `cursor`. GET /dpp/groups ```typescript const { items } = await dpp.groups(collectionId) items.map(g => g.productGroup) // ["BATTERIES", …] ```
14550
14540
 
14551
14541
  **read**(collectionId: string, passportId: string, opts: { version?: number } = {}) → `Promise<DppDocument>`
14552
14542
  Read a passport as the public sees it, at its address (the EU JSON document), or an earlier version of it. No sign-in needed. GET /public/dpp/:collectionId/:passportId
@@ -14574,8 +14564,8 @@ Publish the passport for a product, batch or item (`productId` / `batchId` / `pr
14574
14564
  **upsertMany**(collectionId: string, items: DppPassportUpsertInput[], opts: { merge?: boolean } = {}) → `Promise<DppPassportBulkResult>`
14575
14565
  `upsert` for up to 500 passports at once (e.g. one per battery); each answers on its own. POST /dpp/passports/bulk
14576
14566
 
14577
- **versions**(collectionId: string, passportId: string) → `Promise<ListResult<DppPassportVersion>>`
14578
- Its versions, newest first, all in one answer (`nextCursor` is always null); read one with `dpp.read(collectionId, id, { version })`. GET /dpp/passports/:id/versions ```typescript const { items } = await dpp.passports.versions(collectionId, passportId) const latest = items[0].version ```
14567
+ **versions**(collectionId: string, passportId: string, options: ListOptions = {}) → `Promise<ListResult<DppPassportVersion>>`
14568
+ Its versions, newest first, a page at a time (`limit` and `cursor`; 50 unless you say otherwise). Read one with `dpp.read(collectionId, id, { version })`. GET /dpp/passports/:id/versions ```typescript let page = await dpp.passports.versions(collectionId, passportId, { limit: 20 }) const latest = page.items[0].version while (page.nextCursor) { page = await dpp.passports.versions(collectionId, passportId, { limit: 20, cursor: page.nextCursor }) } ```
14579
14569
 
14580
14570
  **withdraw**(collectionId: string, passportId: string) → `Promise<DppPassport>`
14581
14571
  No longer valid: stays at its address, marked invalid (the registry keeps its record). POST /dpp/passports/:id/withdraw
@@ -14586,7 +14576,7 @@ Valid again. POST /dpp/passports/:id/restore
14586
14576
  ### dpp.registry
14587
14577
 
14588
14578
  **list**(collectionId: string) → `Promise<ListResult<DppRegistry>>`
14589
- Both environments, each with `nextStep` (what's left to connect). All of them in one answer (`nextCursor` is always null). GET /dpp/registry ```typescript const { items } = await dpp.registry.list(collectionId) const acc = items.find(r => r.environment === 'acc') ```
14579
+ Both environments, each with `nextStep` (what's left to connect). A fixed set: always all of them in one answer (`nextCursor` is always null), so it takes no `limit` or `cursor`. GET /dpp/registry ```typescript const { items } = await dpp.registry.list(collectionId) const acc = items.find(r => r.environment === 'acc') ```
14590
14580
 
14591
14581
  **get**(collectionId: string, env: DppEnvironment) → `Promise<DppRegistry>`
14592
14582
  One environment. GET /dpp/registry/:env
@@ -14605,8 +14595,8 @@ Sign in to the registry and read its product groups — proves the connection wo
14605
14595
 
14606
14596
  ### dpp.tasks
14607
14597
 
14608
- **list**(collectionId: string, env: DppEnvironment) → `Promise<ListResult<DppTask>>`
14609
- Requests sent to one environment, newest first, all in one answer (`nextCursor` is always null). GET /dpp/registry/:env/tasks ```typescript const { items } = await dpp.tasks.list(collectionId, 'acc') ```
14598
+ **list**(collectionId: string, env: DppEnvironment, options: ListOptions = {}) → `Promise<ListResult<DppTask>>`
14599
+ Requests sent to one environment, newest first, a page at a time (`limit` and `cursor`; 50 unless you say otherwise). GET /dpp/registry/:env/tasks ```typescript let page = await dpp.tasks.list(collectionId, 'acc', { limit: 20 }) while (page.nextCursor) { page = await dpp.tasks.list(collectionId, 'acc', { limit: 20, cursor: page.nextCursor }) } ```
14610
14600
 
14611
14601
  **refresh**(collectionId: string, env: DppEnvironment, taskId: string) → `Promise<DppTaskRefreshResult>`
14612
14602
  Ask the registry how a request went and record it on its passports. POST /dpp/registry/:env/tasks/:taskId/refresh
@@ -14619,89 +14609,90 @@ Ask the registry how a request went and record it on its passports. POST /dpp/re
14619
14609
 
14620
14610
  **list**(collectionId: string,
14621
14611
  params?: FacetListParams) → `Promise<FacetListResponse>`
14622
- The collection's facets (admin). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14612
+ The collection's facets (admin). A small fixed set: all of them come back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14623
14613
 
14624
14614
  **create**(collectionId: string,
14625
14615
  data: FacetDefinitionWriteInput) → `Promise<FacetDefinition>`
14626
- The collection's facets (admin). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14616
+ The collection's facets (admin). A small fixed set: all of them come back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14627
14617
 
14628
14618
  **get**(collectionId: string,
14629
14619
  facetKey: string,
14630
14620
  params?: FacetGetParams) → `Promise<FacetDefinition>`
14631
- The collection's facets (admin). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14621
+ The collection's facets (admin). A small fixed set: all of them come back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14632
14622
 
14633
14623
  **update**(collectionId: string,
14634
14624
  facetKey: string,
14635
14625
  data: FacetDefinitionWriteInput) → `Promise<FacetDefinition>`
14636
- The collection's facets (admin). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14626
+ The collection's facets (admin). A small fixed set: all of them come back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14637
14627
 
14638
14628
  **remove**(collectionId: string,
14639
14629
  facetKey: string) → `Promise<void>`
14640
- The collection's facets (admin). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14630
+ The collection's facets (admin). A small fixed set: all of them come back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. ```typescript const { items } = await facets.list('coll_123', { kind: 'custom' }) items.map(f => f.key) // ["brand", "material", …] ```
14641
14631
 
14642
14632
  **listValues**(collectionId: string,
14643
14633
  facetKey: string,
14644
14634
  params?: FacetValueListParams) → `Promise<FacetValueListResponse>`
14645
- One facet and all its values (admin). The values are in `items`; `nextCursor` is always null. ```typescript const { facet, items } = await facets.listValues('coll_123', 'brand') items.map(v => v.name) ```
14635
+ One facet and its values (admin), a page at a time. The values are in `items`; pass `nextCursor` back as `cursor` for the next page (null means that was the last one). ```typescript let page = await facets.listValues('coll_123', 'brand', { limit: 50 }) const names = page.items.map(v => v.name) while (page.nextCursor) { page = await facets.listValues('coll_123', 'brand', { limit: 50, cursor: page.nextCursor }) names.push(...page.items.map(v => v.name)) } ```
14646
14636
 
14647
14637
  **createValue**(collectionId: string,
14648
14638
  facetKey: string,
14649
14639
  data: FacetValueWriteInput) → `Promise<FacetValueResponse>`
14650
- One facet and all its values (admin). The values are in `items`; `nextCursor` is always null. ```typescript const { facet, items } = await facets.listValues('coll_123', 'brand') items.map(v => v.name) ```
14640
+ One facet and its values (admin), a page at a time. The values are in `items`; pass `nextCursor` back as `cursor` for the next page (null means that was the last one). ```typescript let page = await facets.listValues('coll_123', 'brand', { limit: 50 }) const names = page.items.map(v => v.name) while (page.nextCursor) { page = await facets.listValues('coll_123', 'brand', { limit: 50, cursor: page.nextCursor }) names.push(...page.items.map(v => v.name)) } ```
14651
14641
 
14652
14642
  **getValue**(collectionId: string,
14653
14643
  facetKey: string,
14654
14644
  valueKey: string,
14655
14645
  params?: FacetValueGetParams) → `Promise<FacetValueResponse>`
14656
- One facet and all its values (admin). The values are in `items`; `nextCursor` is always null. ```typescript const { facet, items } = await facets.listValues('coll_123', 'brand') items.map(v => v.name) ```
14646
+ One facet and its values (admin), a page at a time. The values are in `items`; pass `nextCursor` back as `cursor` for the next page (null means that was the last one). ```typescript let page = await facets.listValues('coll_123', 'brand', { limit: 50 }) const names = page.items.map(v => v.name) while (page.nextCursor) { page = await facets.listValues('coll_123', 'brand', { limit: 50, cursor: page.nextCursor }) names.push(...page.items.map(v => v.name)) } ```
14657
14647
 
14658
14648
  **updateValue**(collectionId: string,
14659
14649
  facetKey: string,
14660
14650
  valueKey: string,
14661
14651
  data: FacetValueWriteInput) → `Promise<FacetValueResponse>`
14662
- One facet and all its values (admin). The values are in `items`; `nextCursor` is always null. ```typescript const { facet, items } = await facets.listValues('coll_123', 'brand') items.map(v => v.name) ```
14652
+ One facet and its values (admin), a page at a time. The values are in `items`; pass `nextCursor` back as `cursor` for the next page (null means that was the last one). ```typescript let page = await facets.listValues('coll_123', 'brand', { limit: 50 }) const names = page.items.map(v => v.name) while (page.nextCursor) { page = await facets.listValues('coll_123', 'brand', { limit: 50, cursor: page.nextCursor }) names.push(...page.items.map(v => v.name)) } ```
14663
14653
 
14664
14654
  **removeValue**(collectionId: string,
14665
14655
  facetKey: string,
14666
14656
  valueKey: string) → `Promise<void>`
14667
- One facet and all its values (admin). The values are in `items`; `nextCursor` is always null. ```typescript const { facet, items } = await facets.listValues('coll_123', 'brand') items.map(v => v.name) ```
14657
+ One facet and its values (admin), a page at a time. The values are in `items`; pass `nextCursor` back as `cursor` for the next page (null means that was the last one). ```typescript let page = await facets.listValues('coll_123', 'brand', { limit: 50 }) const names = page.items.map(v => v.name) while (page.nextCursor) { page = await facets.listValues('coll_123', 'brand', { limit: 50, cursor: page.nextCursor }) names.push(...page.items.map(v => v.name)) } ```
14668
14658
 
14669
14659
  **query**(collectionId: string,
14670
14660
  body: FacetQueryRequest) → `Promise<FacetQueryResponse>`
14671
- Facet counts for a set of products (admin): each facet with its values in `items`, and the count for each value in `buckets`. Everything comes back in one answer: `nextCursor` is always null. ```typescript const { items, buckets, meta } = await facets.query('coll_123', { facetKeys: ['brand', 'material'], query: { facetEquals: { brand: 'acme' } }, }) ```
14661
+ Facet counts for a set of products (admin): each facet with its values in `items`, and the count for each value in `buckets`. Everything comes back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. Which products are counted: `q` (search text), `createdAt` / `updatedAt` (date ranges) and the filters in `query`, the same as `products.query`. ```typescript const { items, buckets, meta } = await facets.query('coll_123', { facetKeys: ['brand', 'material'], q: 'oak', createdAt: { gte: '2026-11-01T00:00:00Z' }, query: { facetEquals: { brand: 'acme' } }, }) ```
14672
14662
 
14673
14663
  **namespaces**(collectionId: string) → `Promise<FacetNamespaceListResponse>`
14674
- The facet namespaces in use (admin). The names are in `items`; `nextCursor` is always null. ```typescript const { items } = await facets.namespaces('coll_123') // items: string[] ```
14664
+ The facet namespaces in use (admin). A small fixed set: all the names are in `items`, there is no `limit` or `cursor`, and `nextCursor` is always null. ```typescript const { items } = await facets.namespaces('coll_123') // items: string[] ```
14675
14665
 
14676
14666
  **publicList**(collectionId: string,
14677
14667
  params?: PublicFacetListParams) → `Promise<FacetListResponse>`
14678
- The collection's facets (public). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await facets.publicList('coll_123', { namespace: 'catalog' }) ```
14668
+ The collection's facets (public). A small fixed set: all of them come back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. ```typescript const { items } = await facets.publicList('coll_123', { namespace: 'catalog' }) ```
14679
14669
 
14680
14670
  **publicGet**(collectionId: string,
14681
14671
  facetKey: string,
14682
14672
  params?: PublicFacetListParams) → `Promise<FacetDefinition>`
14683
- The collection's facets (public). All of them come back in one answer: `nextCursor` is always null. ```typescript const { items } = await facets.publicList('coll_123', { namespace: 'catalog' }) ```
14673
+ The collection's facets (public). A small fixed set: all of them come back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. ```typescript const { items } = await facets.publicList('coll_123', { namespace: 'catalog' }) ```
14684
14674
 
14685
14675
  **publicListValues**(collectionId: string,
14686
- facetKey: string) → `Promise<FacetValueListResponse>`
14687
- One facet and all its values (public). The values are in `items`; `nextCursor` is always null. ```typescript const { facet, items } = await facets.publicListValues('coll_123', 'brand') ```
14676
+ facetKey: string,
14677
+ options: ListOptions = {}) → `Promise<FacetValueListResponse>`
14678
+ One facet and its values (public), a page at a time. The values are in `items`; pass `nextCursor` back as `cursor` for the next page (null means that was the last one). ```typescript const { facet, items, nextCursor } = await facets.publicListValues('coll_123', 'brand', { limit: 50 }) ```
14688
14679
 
14689
14680
  **publicGetValue**(collectionId: string,
14690
14681
  facetKey: string,
14691
14682
  valueKey: string) → `Promise<FacetValueResponse>`
14692
- One facet and all its values (public). The values are in `items`; `nextCursor` is always null. ```typescript const { facet, items } = await facets.publicListValues('coll_123', 'brand') ```
14683
+ One facet and its values (public), a page at a time. The values are in `items`; pass `nextCursor` back as `cursor` for the next page (null means that was the last one). ```typescript const { facet, items, nextCursor } = await facets.publicListValues('coll_123', 'brand', { limit: 50 }) ```
14693
14684
 
14694
14685
  **publicQuery**(collectionId: string,
14695
14686
  body: FacetQueryRequest) → `Promise<FacetQueryResponse>`
14696
- Facet counts for a set of products (public): each facet with its values in `items`, and the count for each value in `buckets`. Everything comes back in one answer: `nextCursor` is always null. ```typescript const { items, buckets } = await facets.publicQuery('coll_123', { facetKeys: ['brand'] }) ```
14687
+ Facet counts for a set of products (public): each facet with its values in `items`, and the count for each value in `buckets`. Everything comes back in one answer, so there is no `limit` or `cursor` and `nextCursor` is always null. Which products are counted: `q` (search text), `createdAt` / `updatedAt` (date ranges) and the filters in `query`, the same as `products.query`. ```typescript const { items, buckets } = await facets.publicQuery('coll_123', { facetKeys: ['brand'], q: 'oak' }) ```
14697
14688
 
14698
14689
  **publicNamespaces**(collectionId: string) → `Promise<FacetNamespaceListResponse>`
14699
- The facet namespaces in use (public). The names are in `items`; `nextCursor` is always null. ```typescript const { items } = await facets.publicNamespaces('coll_123') // items: string[] ```
14690
+ The facet namespaces in use (public). A small fixed set: all the names are in `items`, there is no `limit` or `cursor`, and `nextCursor` is always null. ```typescript const { items } = await facets.publicNamespaces('coll_123') // items: string[] ```
14700
14691
 
14701
14692
  ### files
14702
14693
 
14703
14694
  **list**(collectionId: string, query: ListFilesQuery = {}) → `Promise<ListResult<FileRecord>>`
14704
- Files on this site that aren't ordinary uploads: temporary, fetched, derived or generated (admin). They come back in one answer (`nextCursor` is always null); `limit` is the most it returns. ```typescript const { items } = await files.list('coll_123', { appId: 'my-app', origin: 'fetched' }) ```
14695
+ Files on this site that aren't ordinary uploads: temporary, fetched, derived or generated (admin). A page at a time: `limit` says how many, `cursor` is the previous page's `nextCursor`. ```typescript let page = await files.list('coll_123', { appId: 'my-app', origin: 'fetched', limit: 50 }) while (page.nextCursor) { page = await files.list('coll_123', { appId: 'my-app', origin: 'fetched', limit: 50, cursor: page.nextCursor }) } ```
14705
14696
 
14706
14697
  **put**(collectionId: string, body: PutFileRequest) → `Promise<`
14707
14698
  A new file from text, base64 or JSON. Temporary (default 1 day) and private.
@@ -14732,8 +14723,8 @@ Remove a file (a kept file is deleted like any asset, and can be restored).
14732
14723
  **get**(collectionId: string, formId: string, admin?: boolean) → `Promise<any>`
14733
14724
  Get a single form by ID for a collection.
14734
14725
 
14735
- **list**(collectionId: string, admin?: boolean) → `Promise<ListResult<any>>`
14736
- List all forms for a collection. All of them come back in one answer: `nextCursor` is always null. ```typescript const { items: forms } = await form.list(collectionId, true) ```
14726
+ **list**(collectionId: string, admin?: boolean, options: ListOptions = {}) → `Promise<ListResult<any>>`
14727
+ List the forms for a collection, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await form.list(collectionId, true, { limit: 100 }) while (page.nextCursor) page = await form.list(collectionId, true, { limit: 100, cursor: page.nextCursor }) ```
14737
14728
 
14738
14729
  **create**(collectionId: string, data: any) → `Promise<any>`
14739
14730
  Create a new form for a collection (admin only).
@@ -14800,10 +14791,10 @@ Perform a DELETE request to any API endpoint.
14800
14791
  ### integrations
14801
14792
 
14802
14793
  **listFlows**(collectionId: string, query: ListFlowsQuery = {}) → `Promise<ListResult<IntegrationFlow>>`
14803
- List flows in a collection (all of them: this list has no pages). GET /integrations/flows ```typescript const { items } = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active' }) ```
14794
+ List flows in a collection, a page at a time (`limit` and `cursor`; 50 unless you say otherwise). GET /integrations/flows ```typescript let page = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active' }) while (page.nextCursor) { page = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active', cursor: page.nextCursor }) } ```
14804
14795
 
14805
14796
  **listRecordTypes**(collectionId: string) → `Promise<ListResult<RecordTypeInfo>>`
14806
- Discover the app-record types present in a collection + which app owns each (introspected), for picking a sub-record source/trigger. One list, no pages. GET /integrations/record-types ```typescript const { items } = await integrations.listRecordTypes('coll_123') // items: [{ appId: 'warranty', recordType: 'claim', count: 42 }, …] ```
14797
+ Discover the app-record types present in a collection + which app owns each (introspected), for picking a sub-record source/trigger. A fixed set: always all of them in one answer, so it takes no `limit` or `cursor`. GET /integrations/record-types ```typescript const { items } = await integrations.listRecordTypes('coll_123') // items: [{ appId: 'warranty', recordType: 'claim', count: 42 }, …] ```
14807
14798
 
14808
14799
  **createFlow**(collectionId: string, input: CreateFlowInput) → `Promise<IntegrationFlow>`
14809
14800
  Create a flow. POST /integrations/flows
@@ -14817,8 +14808,8 @@ Update whitelisted fields. PUT /integrations/flows/:id
14817
14808
  **deleteFlow**(collectionId: string, id: string) → `Promise<`
14818
14809
  Soft-delete a flow. DELETE /integrations/flows/:id
14819
14810
 
14820
- **runFlow**(collectionId: string,
14821
- id: string,
14811
+ **runFlow**(collectionId: string,
14812
+ id: string,
14822
14813
  options: RunFlowInput & { async?: boolean } = {}) → `Promise<RunFlowResult>`
14823
14814
  Run a flow now. POST /integrations/flows/:id/run - inline (default): resolves and returns the run summary. - options.async: enqueue on the worker, returns { enqueued: true }. Pass options.entityId to run for a single source entity.
14824
14815
 
@@ -14837,8 +14828,8 @@ Get one run's summary. GET /integrations/flows/:id/runs/:runId
14837
14828
  **listRunItems**(collectionId: string, flowId: string, runId: string, query: ListRunItemsQuery = {}) → `Promise<ListResult<FlowRunItem>>`
14838
14829
  List a run's per-record items. GET /integrations/flows/:id/runs/:runId/items `request`/`response` are populated only for items captured while enhanced logging was active (and before the 24h body purge). ```typescript const { items, nextCursor } = await integrations.listRunItems('coll_123', flowId, runId, { status: 'failed', limit: 100 }) ```
14839
14830
 
14840
- **listEntityRuns**(collectionId: string, entityId: string, query: { limit?: number } = {}) → `Promise<ListResult<FlowRun>>`
14841
- Every run touching an entity (e.g. a product), across flows, newest first. One list, no pages: `limit` says how many. GET /integrations/runs/entity/:entityId ```typescript const { items } = await integrations.listEntityRuns('coll_123', productId, { limit: 20 }) ```
14831
+ **listEntityRuns**(collectionId: string, entityId: string, query: ListOptions = {}) → `Promise<ListResult<FlowRun>>`
14832
+ Every run touching an entity (e.g. a product), across flows, newest first. A page at a time: `limit` says how many, `cursor` is the previous page's `nextCursor`. GET /integrations/runs/entity/:entityId ```typescript let page = await integrations.listEntityRuns('coll_123', productId, { limit: 20 }) while (page.nextCursor) { page = await integrations.listEntityRuns('coll_123', productId, { limit: 20, cursor: page.nextCursor }) } ```
14842
14833
 
14843
14834
  **getLogging**(collectionId: string, connectionId: string) → `Promise<`
14844
14835
  Is enhanced logging active for a connection? GET /integrations/logging/:connectionId
@@ -14846,10 +14837,10 @@ Is enhanced logging active for a connection? GET /integrations/logging/:connecti
14846
14837
  **setLogging**(collectionId: string, connectionId: string, input: SetLoggingInput = {}) → `Promise<`
14847
14838
  Enable enhanced logging. POST /integrations/logging/:connectionId (omit ttlMinutes = until cancelled)
14848
14839
 
14849
- **listFailed**(collectionId: string,
14850
- flowId: string,
14851
- query: { status?: 'failed' | 'dead'; limit?: number; cursor?: string } = {}) → `Promise<ListResult<FailedRecord> &`
14852
- A flow's failed / dead records, with the flow's `direction` beside the list. GET /integrations/flows/:id/failed ```typescript const { items, nextCursor, direction } = await integrations.listFailed('coll_123', flowId, { status: 'dead' }) ```
14840
+ **listFailed**(collectionId: string,
14841
+ flowId: string,
14842
+ query: ListOptions & { status?: 'failed' | 'dead' } = {}) → `Promise<ListResult<FailedRecord> &`
14843
+ A flow's failed / dead records, a page at a time (`limit` and `cursor`), with the flow's `direction` beside the list. GET /integrations/flows/:id/failed ```typescript let page = await integrations.listFailed('coll_123', flowId, { status: 'dead', limit: 100 }) page.direction // 'inbound' | 'outbound' while (page.nextCursor) { page = await integrations.listFailed('coll_123', flowId, { status: 'dead', limit: 100, cursor: page.nextCursor }) } ```
14853
14844
 
14854
14845
  **retryFailed**(collectionId: string, flowId: string, ids?: string[]) → `Promise<`
14855
14846
  Retry failed / dead records now (all of them when `ids` is omitted). POST /integrations/flows/:id/failed/retry
@@ -14870,32 +14861,32 @@ Resume a flow that paused itself (circuit open): held records go out now. POST /
14870
14861
  Cancel enhanced logging now. DELETE /integrations/logging/:connectionId
14871
14862
 
14872
14863
  **listConnectors**(collectionId: string) → `Promise<ListResult<InstalledConnector>>`
14873
- The collection's installed connector apps (all of them: this list has no pages). GET /integrations/connectors ```typescript const { items } = await integrations.listConnectors('coll_123') ```
14864
+ The collection's installed connector apps. A fixed set: always all of them in one answer, so it takes no `limit` or `cursor`. GET /integrations/connectors ```typescript const { items } = await integrations.listConnectors('coll_123') ```
14874
14865
 
14875
- **saveConnectorInstallation**(collectionId: string,
14876
- appId: string,
14866
+ **saveConnectorInstallation**(collectionId: string,
14867
+ appId: string,
14877
14868
  input: SaveConnectorInstallationInput) → `Promise<`
14878
14869
  Save a connector's non-secret Connect-form values and/or settings. PUT /integrations/connectors/:appId/installation
14879
14870
 
14880
- **runConnectorStep**(collectionId: string,
14881
- appId: string,
14882
- step: ConnectorConsoleStep,
14871
+ **runConnectorStep**(collectionId: string,
14872
+ appId: string,
14873
+ step: ConnectorConsoleStep,
14883
14874
  input: Record<string, unknown> & { flowId?: string } = {}) → `Promise<T>`
14884
14875
  Run a connector step from the console: `testConnection` → ConnectorTestResult, `describeTarget` → ConnectorTargetSchema, `sample` → ConnectorRecords, and dry runs of `shape` ({ records }) → ConnectorShapeResult and `serialize` ({ documents }) → ConnectorSerializeResult. The server adds the installation; pass `flowId` to layer that flow's settings. POST /integrations/connectors/:appId/steps/:step
14885
14876
 
14886
- **runConnectorAction**(collectionId: string,
14887
- appId: string,
14888
- action: string,
14877
+ **runConnectorAction**(collectionId: string,
14878
+ appId: string,
14879
+ action: string,
14889
14880
  input: Record<string, unknown> = {}) → `Promise<T>`
14890
14881
  Invoke a connector ACTION from the console (any visibility): redeem, enrol, adjust points, issue a coupon… The connector's function runs with its own credentials and is told who asked. POST /integrations/connectors/:appId/actions/:action { input }
14891
14882
 
14892
- **listConnectorActions**(collectionId: string,
14883
+ **listConnectorActions**(collectionId: string,
14893
14884
  appId: string) → `Promise<ListResult<`
14894
- PUBLIC (the Hub, a site): the connector actions the caller may invoke — those declared `public`, plus `member` ones when signed in. One list, no pages. GET /public/collection/:collectionId/connectors/:appId/actions ```typescript const { items } = await integrations.listConnectorActions('coll_123', 'sessionm') const canRedeem = items.some((a) => a.name === 'redeem') ```
14885
+ PUBLIC (the Hub, a site): the connector actions the caller may invoke — those declared `public`, plus `member` ones when signed in. A fixed set: always all of them in one answer, so it takes no `limit` or `cursor`. GET /public/collection/:collectionId/connectors/:appId/actions ```typescript const { items } = await integrations.listConnectorActions('coll_123', 'sessionm') const canRedeem = items.some((a) => a.name === 'redeem') ```
14895
14886
 
14896
- **callConnectorAction**(collectionId: string,
14897
- appId: string,
14898
- action: string,
14887
+ **callConnectorAction**(collectionId: string,
14888
+ appId: string,
14889
+ action: string,
14899
14890
  input: Record<string, unknown> = {}) → `Promise<T>`
14900
14891
  PUBLIC (the Hub, a site): invoke a connector action — e.g. redeem a reward for the signed-in member. 401 SIGN_IN_REQUIRED for a `member` action without a session; 403 for an admin-only one; 400 with `missing[]` when a required input is absent. POST /public/collection/:collectionId/connectors/:appId/actions/:action { input }
14901
14892
 
@@ -14903,7 +14894,7 @@ PUBLIC (the Hub, a site): invoke a connector action — e.g. redeem a reward for
14903
14894
 
14904
14895
  **query**(collectionId: string,
14905
14896
  body: AdminInteractionsQueryRequest) → `Promise<ListResult<InteractionEventRow>>`
14906
- POST /admin/collection/:collectionId/interactions/query Flexible query for interaction events with optional includes. One list, no pages: `limit` in the body says how many events to return. ```typescript const { items } = await interactions.query('coll_123', { appId: 'my-app', interactionId: voteTypeId, limit: 500 }) ```
14897
+ POST /admin/collection/:collectionId/interactions/query Flexible query for interaction events, a page at a time (`limit` and `cursor` in the body). The time window is `from` / `to`. Sort with `orderBy: [{ timestamp: 'asc' }]`; bring each event's interaction type along with `expand: ['interaction']`. ```typescript const query = { appId: 'my-app', interactionId: voteTypeId, from: '2026-11-01T00:00:00Z', limit: 500 } let page = await interactions.query('coll_123', { ...query, orderBy: [{ timestamp: 'desc' }], expand: ['interaction'] }) while (page.nextCursor) page = await interactions.query('coll_123', { ...query, cursor: page.nextCursor }) ```
14907
14898
 
14908
14899
  **countsByOutcome**(collectionId: string,
14909
14900
  query: AdminInteractionsCountsByOutcomeRequest = {}) → `Promise<OutcomeCount[]>`
@@ -14962,7 +14953,7 @@ Find this app's interaction type by its readable `key` (data.interactionType), o
14962
14953
  **publicMyInteractions**(collectionId: string,
14963
14954
  body: PublicInteractionsByUserRequest,
14964
14955
  authToken?: string) → `Promise<ListResult<InteractionEventRow>>`
14965
- The signed-in person's own interaction events (where the type allows it). One list, no pages: `limit` in the body says how many. POST /public/collection/:collectionId/interactions/by-user ```typescript const { items } = await interactions.publicMyInteractions('coll_123', { appId: 'my-app', interactionId: voteTypeId }) ```
14956
+ The signed-in person's own interaction events (where the type allows it), a page at a time (`limit` and `cursor` in the body). The time window is `from` / `to`. POST /public/collection/:collectionId/interactions/by-user ```typescript const query = { appId: 'my-app', interactionId: voteTypeId, limit: 50 } let page = await interactions.publicMyInteractions('coll_123', query) while (page.nextCursor) page = await interactions.publicMyInteractions('coll_123', { ...query, cursor: page.nextCursor }) ```
14966
14957
 
14967
14958
  **publicList**(collectionId: string,
14968
14959
  query: ListInteractionTypesQuery = {}) → `Promise<ListResult<InteractionTypeRecord>>`
@@ -14974,14 +14965,22 @@ Public: list the collection's interaction types, optionally only one app's. GET
14974
14965
 
14975
14966
  ### jobs
14976
14967
 
14977
- **listJobs**(collectionId: string,
14968
+ **list**(collectionId: string,
14978
14969
  query: ListJobsQuery = {}) → `Promise<ListResult<Job>>`
14979
- List visible jobs for a collection GET /admin/collection/:collectionId/jobs ```typescript let page = await jobs.listJobs('coll_123', { state: 'errored', limit: 50 }) while (page.nextCursor) page = await jobs.listJobs('coll_123', { state: 'errored', limit: 50, cursor: page.nextCursor }) ```
14970
+ List visible jobs for a collection, newest first. GET /admin/collection/:collectionId/jobs ```typescript let page = await jobs.list('coll_123', { state: 'errored', limit: 50 }) while (page.nextCursor) page = await jobs.list('coll_123', { state: 'errored', limit: 50, cursor: page.nextCursor }) ```
14980
14971
 
14981
- **getJob**(collectionId: string,
14972
+ **get**(collectionId: string,
14982
14973
  jobId: number) → `Promise<Job>`
14983
14974
  Get a single job GET /admin/collection/:collectionId/jobs/:jobId
14984
14975
 
14976
+ **enqueue**(collectionId: string,
14977
+ params: EnqueueAsyncJobRequest) → `Promise<EnqueueAsyncJobResponse>`
14978
+ Start a background job for a collection. POST /admin/collection/:collectionId/async/jobs (202)
14979
+
14980
+ **status**(collectionId: string,
14981
+ jobId: number) → `Promise<Job>`
14982
+ How a job you started is getting on (may answer 404 once it has finished and been cleared away). GET /admin/collection/:collectionId/async/jobs/:jobId
14983
+
14985
14984
  ### journeys
14986
14985
 
14987
14986
  **create**(collectionId: string,
@@ -15015,7 +15014,7 @@ POST /admin/collection/:collectionId/journeys.analytics/:journeyId/stats Compute
15015
15014
  journeyId: string,
15016
15015
  stepId: string,
15017
15016
  body: JourneyStepRecipientsRequest = {}) → `Promise<ListResult<string>>`
15018
- POST /admin/collection/:collectionId/journeys.analytics/:journeyId/steps/:stepId/recipients Returns recipient IDs for a given journey step, as a list of ids. One list, no pages: `limit` in the body says how many. For completed/pending, `interactionId` is required; outcome defaults to 'success'. ```typescript const { items: contactIds } = await journeysAnalytics.recipients('coll_123', journeyId, stepId, { status: 'completed', interactionId, idField: 'contactId', limit: 1000, }) ```
15017
+ POST /admin/collection/:collectionId/journeys.analytics/:journeyId/steps/:stepId/recipients Returns recipient IDs for a given journey step, a page at a time (`limit` and `cursor` in the body). The time window is `from` / `to`. For completed/pending, `interactionId` is required; outcome defaults to 'success'. ```typescript const query = { status: 'completed' as const, interactionId, idField: 'contactId' as const, limit: 1000 } let page = await journeysAnalytics.recipients('coll_123', journeyId, stepId, query) page.items // contact ids while (page.nextCursor) { page = await journeysAnalytics.recipients('coll_123', journeyId, stepId, { ...query, cursor: page.nextCursor }) } ```
15019
15018
 
15020
15019
  **funnelReport**(collectionId: string,
15021
15020
  journeyId: string,
@@ -15024,8 +15023,8 @@ POST /admin/collection/:collectionId/journeys.analytics/:journeyId/funnel-report
15024
15023
 
15025
15024
  ### knowledge
15026
15025
 
15027
- **listSets**(collectionId: string) → `Promise<ListResult<KnowledgeSet>>`
15028
- Every set, with its source and passage counts (admin). One list, no pages. ```typescript const { items } = await knowledge.listSets('coll_123') ```
15026
+ **listSets**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<KnowledgeSet>>`
15027
+ The collection's sets, with their source and passage counts (admin). A page at a time (`limit` and `cursor`; 50 unless you say otherwise). ```typescript let page = await knowledge.listSets('coll_123') while (page.nextCursor) page = await knowledge.listSets('coll_123', { cursor: page.nextCursor }) ```
15029
15028
 
15030
15029
  **saveSet**(collectionId: string, body: SaveKnowledgeSetRequest) → `Promise<KnowledgeSet>`
15031
15030
  Create a set, or update the one with this key (admin).
@@ -15039,8 +15038,8 @@ One set, by id or key (admin).
15039
15038
  **deleteSet**(collectionId: string, set: string) → `Promise<`
15040
15039
  Delete a set with its sources and passages (admin).
15041
15040
 
15042
- **listSources**(collectionId: string, set: string) → `Promise<ListResult<KnowledgeSource>>`
15043
- A set's sources, with their status (admin). One list, no pages. ```typescript const { items } = await knowledge.listSources('coll_123', 'manuals') ```
15041
+ **listSources**(collectionId: string, set: string, options: ListOptions = {}) → `Promise<ListResult<KnowledgeSource>>`
15042
+ A set's sources, with their status (admin). A page at a time (`limit` and `cursor`; 50 unless you say otherwise). ```typescript let page = await knowledge.listSources('coll_123', 'manuals') while (page.nextCursor) page = await knowledge.listSources('coll_123', 'manuals', { cursor: page.nextCursor }) ```
15044
15043
 
15045
15044
  **addSource**(collectionId: string, set: string, body: AddKnowledgeSourceRequest) → `Promise<KnowledgeSource>`
15046
15045
  Add a source; feeds and pages are read in the background (admin).
@@ -15060,13 +15059,13 @@ Push documents into a `documents` source; the same `ref` replaces its earlier ve
15060
15059
  **removeDocuments**(collectionId: string, sourceId: string, refs: string[]) → `Promise<`
15061
15060
  Remove pushed documents by `ref` (admin).
15062
15061
 
15063
- **search**(collectionId: string,
15062
+ **search**(collectionId: string,
15064
15063
  body: KnowledgeSearchRequest) → `Promise<ListResult<KnowledgeSearchResult> & Pick<KnowledgeSearchResponse, 'query' | 'mode'>>`
15065
- Search every set, staff ones included (admin). The matches come back as `items`, best first, with the `query` and the search `mode` beside them. There are no pages: `k` says how many matches to return. ```typescript const { items, mode } = await knowledge.search('coll_123', { query: 'how do I descale', k: 5 }) ```
15064
+ Search every set, staff ones included (admin). `q` is what to look for. The matches come back as `items`, best first, with the `query` and the search `mode` beside them. `limit` says how many matches to return (default 8, at most 25); `cursor` is the previous page's `nextCursor`. ```typescript const { items, mode } = await knowledge.search('coll_123', { q: 'how do I descale', limit: 5 }) ```
15066
15065
 
15067
- **publicSearch**(collectionId: string,
15066
+ **publicSearch**(collectionId: string,
15068
15067
  body: KnowledgeSearchRequest) → `Promise<ListResult<KnowledgeSearchResult> & Pick<KnowledgeSearchResponse, 'query' | 'mode'>>`
15069
- Search from a website, Portal or Hub: public sets, plus customer sets for a signed-in person. The answer has the same shape as the admin `search`: the matches come back as `items`, best first, with the `query` and the search `mode` beside them. There are no pages: `k` says how many matches to return. ```typescript const { items } = await knowledge.publicSearch('coll_123', { query: 'how do I descale', k: 5 }) for (const r of items) console.log(r.title, r.heading, r.url, r.snippet) ```
15068
+ Search from a website, Portal or Hub: public sets, plus customer sets for a signed-in person. The options and the answer are the same as the admin `search`: `q` is what to look for, and the matches come back as `items`, best first, with the `query` and the search `mode` beside them. `limit` says how many matches to return (default 8, at most 25); `cursor` is the previous page's `nextCursor`. ```typescript const { items } = await knowledge.publicSearch('coll_123', { q: 'how do I descale', limit: 5 }) for (const r of items) console.log(r.title, r.heading, r.url, r.snippet) ```
15070
15069
 
15071
15070
  ### location
15072
15071
 
@@ -15078,7 +15077,7 @@ Admin: Create a collection-scoped location POST /admin/collection/:collectionId/
15078
15077
 
15079
15078
  **search**(collectionId: string,
15080
15079
  query: LocationSearchQuery = {}) → `Promise<ListResult<Location>>`
15081
- Admin: Search locations to pick during setup (combines collection + global). One list, no pages: `limit` says how many (default 20, at most 100). GET /admin/collection/:collectionId/location/search ```typescript const { items } = await location.search('coll_123', { q: 'distillery', countryCode: 'GB', limit: 10 }) ```
15080
+ Admin: Search locations to pick during setup (combines collection + global). `q` is the search text. `limit` says how many (default 20, at most 100) and `cursor` is the previous page's `nextCursor`. `orderBy` sorts by one field: `name` (the default), `countryCode` or `countryName`. GET /admin/collection/:collectionId/location/search ```typescript const { items, nextCursor } = await location.search('coll_123', { q: 'distillery', countryCode: 'GB', limit: 10, orderBy: [{ countryName: 'asc' }], }) ```
15082
15081
 
15083
15082
  **getPublic**(locationId: string) → `Promise<Location>`
15084
15083
  Public: Fetch a global location by ID GET /public/location/:locationId
@@ -15093,7 +15092,7 @@ Public: Fetch a location for a collection; returns either a collection-owned or
15093
15092
  Create a lot (resolves its selector into members).
15094
15093
 
15095
15094
  **list**(collectionId: string, params: ListLotsParams = {}) → `Promise<ListResult<Lot>>`
15096
- List lots (summary rows; `payload`/`productIds` omitted). Filter by status, search, or containing productId. One list, no pages. ```typescript const { items } = await lots.list('coll_123', { status: 'open' }) ```
15095
+ List lots (summary rows; `payload`/`productIds` omitted), a page at a time. Filter by `status`, search text (`q`), or containing `productId`; page with `limit` (default 50) and `cursor`. ```typescript let page = await lots.list('coll_123', { status: 'open', q: 'spring', limit: 50 }) while (page.nextCursor) { page = await lots.list('coll_123', { status: 'open', q: 'spring', limit: 50, cursor: page.nextCursor }) } ```
15097
15096
 
15098
15097
  **get**(collectionId: string, lotId: string, opts: { includeDeleted?: boolean } = {}) → `Promise<Lot>`
15099
15098
  Get the full lot record. Pass `{ includeDeleted: true }` to fetch a soft-deleted one.
@@ -15120,13 +15119,13 @@ Re-resolve members from the current selector; returns the lot + a member diff.
15120
15119
  A lot's member products (summaries), a page at a time. `count` is how many members there are in all. ```typescript let page = await lots.listProducts('coll_123', lotId, { limit: 50 }) while (page.nextCursor) page = await lots.listProducts('coll_123', lotId, { limit: 50, cursor: page.nextCursor }) ```
15121
15120
 
15122
15121
  **publicList**(collectionId: string, params: Omit<ListLotsParams, 'includeDeleted'> = {}) → `Promise<ListResult<Lot>>`
15123
- List lots from a public context (summary rows). One list, no pages. ```typescript const { items } = await lots.publicList('coll_123', { productId: 'prod_789' }) ```
15122
+ List lots from a public context (summary rows), a page at a time. Filter by `status`, search text (`q`), or containing `productId`; page with `limit` (default 50) and `cursor`. ```typescript const { items, nextCursor } = await lots.publicList('coll_123', { productId: 'prod_789', limit: 50 }) ```
15124
15123
 
15125
15124
  **publicGet**(collectionId: string, lotId: string) → `Promise<Lot>`
15126
- List lots from a public context (summary rows). One list, no pages. ```typescript const { items } = await lots.publicList('coll_123', { productId: 'prod_789' }) ```
15125
+ List lots from a public context (summary rows), a page at a time. Filter by `status`, search text (`q`), or containing `productId`; page with `limit` (default 50) and `cursor`. ```typescript const { items, nextCursor } = await lots.publicList('coll_123', { productId: 'prod_789', limit: 50 }) ```
15127
15126
 
15128
15127
  **publicGetByNumber**(collectionId: string, lotNumber: string) → `Promise<Lot>`
15129
- List lots from a public context (summary rows). One list, no pages. ```typescript const { items } = await lots.publicList('coll_123', { productId: 'prod_789' }) ```
15128
+ List lots from a public context (summary rows), a page at a time. Filter by `status`, search text (`q`), or containing `productId`; page with `limit` (default 50) and `cursor`. ```typescript const { items, nextCursor } = await lots.publicList('coll_123', { productId: 'prod_789', limit: 50 }) ```
15130
15129
 
15131
15130
  **publicListProducts**(collectionId: string, lotId: string, opts: ListOptions = {}) → `Promise<ListResult<LotProductSummary>>`
15132
15131
  A lot's member products (summaries) from a public context, a page at a time. ```typescript const { items, nextCursor, count } = await lots.publicListProducts('coll_123', lotId, { limit: 50 }) ```
@@ -15135,94 +15134,97 @@ A lot's member products (summaries) from a public context, a page at a time. ```
15135
15134
 
15136
15135
  Loyalty programmes built on top of collections. Configure schemes and earning rules; contacts earn points automatically via interaction events. See the [Loyalty guide](loyalty.md) for the full walkthrough.
15137
15136
 
15138
- **list**(collectionId: string,
15139
- params: { includeDeleted?: boolean } = {}) → `Promise<ListResult<LoyaltyScheme>>`
15140
- The collection's loyalty schemes (admin). One list, no pages. ```typescript const { items } = await loyalty.list('coll_123') ```
15137
+ **list**(collectionId: string,
15138
+ params: ListOptions & { includeDeleted?: boolean } = {}) → `Promise<ListResult<LoyaltyScheme>>`
15139
+ The collection's loyalty schemes (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. Pass `includeDeleted: true` to include deleted schemes. ```typescript let page = await loyalty.list('coll_123', { limit: 50 }) while (page.nextCursor) page = await loyalty.list('coll_123', { limit: 50, cursor: page.nextCursor }) ```
15141
15140
 
15142
- **get**(collectionId: string,
15141
+ **get**(collectionId: string,
15143
15142
  schemeId: string) → `Promise<LoyaltyScheme>`
15144
- The collection's loyalty schemes (admin). One list, no pages. ```typescript const { items } = await loyalty.list('coll_123') ```
15143
+ The collection's loyalty schemes (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. Pass `includeDeleted: true` to include deleted schemes. ```typescript let page = await loyalty.list('coll_123', { limit: 50 }) while (page.nextCursor) page = await loyalty.list('coll_123', { limit: 50, cursor: page.nextCursor }) ```
15145
15144
 
15146
- **create**(collectionId: string,
15145
+ **create**(collectionId: string,
15147
15146
  body: CreateLoyaltySchemeBody) → `Promise<LoyaltyScheme>`
15148
- The collection's loyalty schemes (admin). One list, no pages. ```typescript const { items } = await loyalty.list('coll_123') ```
15147
+ The collection's loyalty schemes (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. Pass `includeDeleted: true` to include deleted schemes. ```typescript let page = await loyalty.list('coll_123', { limit: 50 }) while (page.nextCursor) page = await loyalty.list('coll_123', { limit: 50, cursor: page.nextCursor }) ```
15149
15148
 
15150
- **update**(collectionId: string,
15151
- schemeId: string,
15149
+ **update**(collectionId: string,
15150
+ schemeId: string,
15152
15151
  body: UpdateLoyaltySchemeBody) → `Promise<LoyaltyScheme>`
15153
- The collection's loyalty schemes (admin). One list, no pages. ```typescript const { items } = await loyalty.list('coll_123') ```
15152
+ The collection's loyalty schemes (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. Pass `includeDeleted: true` to include deleted schemes. ```typescript let page = await loyalty.list('coll_123', { limit: 50 }) while (page.nextCursor) page = await loyalty.list('coll_123', { limit: 50, cursor: page.nextCursor }) ```
15154
15153
 
15155
- **remove**(collectionId: string,
15154
+ **remove**(collectionId: string,
15156
15155
  schemeId: string) → `Promise<LoyaltyScheme>`
15157
- The collection's loyalty schemes (admin). One list, no pages. ```typescript const { items } = await loyalty.list('coll_123') ```
15156
+ The collection's loyalty schemes (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. Pass `includeDeleted: true` to include deleted schemes. ```typescript let page = await loyalty.list('coll_123', { limit: 50 }) while (page.nextCursor) page = await loyalty.list('coll_123', { limit: 50, cursor: page.nextCursor }) ```
15158
15157
 
15159
- **listEarningRules**(collectionId: string,
15160
- schemeId: string) → `Promise<ListResult<LoyaltyEarningRule>>`
15161
- A scheme's earning rules (admin). One list, no pages. ```typescript const { items } = await loyalty.listEarningRules('coll_123', schemeId) ```
15158
+ **listEarningRules**(collectionId: string,
15159
+ schemeId: string,
15160
+ options: ListOptions = {}) → `Promise<ListResult<LoyaltyEarningRule>>`
15161
+ A scheme's earning rules (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50 }) while (page.nextCursor) page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50, cursor: page.nextCursor }) ```
15162
15162
 
15163
- **getEarningRule**(collectionId: string,
15164
- schemeId: string,
15163
+ **getEarningRule**(collectionId: string,
15164
+ schemeId: string,
15165
15165
  ruleId: string) → `Promise<LoyaltyEarningRule>`
15166
- A scheme's earning rules (admin). One list, no pages. ```typescript const { items } = await loyalty.listEarningRules('coll_123', schemeId) ```
15166
+ A scheme's earning rules (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50 }) while (page.nextCursor) page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50, cursor: page.nextCursor }) ```
15167
15167
 
15168
- **createEarningRule**(collectionId: string,
15169
- schemeId: string,
15168
+ **createEarningRule**(collectionId: string,
15169
+ schemeId: string,
15170
15170
  body: CreateLoyaltyEarningRuleBody) → `Promise<LoyaltyEarningRule>`
15171
- A scheme's earning rules (admin). One list, no pages. ```typescript const { items } = await loyalty.listEarningRules('coll_123', schemeId) ```
15171
+ A scheme's earning rules (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50 }) while (page.nextCursor) page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50, cursor: page.nextCursor }) ```
15172
15172
 
15173
- **updateEarningRule**(collectionId: string,
15174
- schemeId: string,
15175
- ruleId: string,
15173
+ **updateEarningRule**(collectionId: string,
15174
+ schemeId: string,
15175
+ ruleId: string,
15176
15176
  body: UpdateLoyaltyEarningRuleBody) → `Promise<LoyaltyEarningRule>`
15177
- A scheme's earning rules (admin). One list, no pages. ```typescript const { items } = await loyalty.listEarningRules('coll_123', schemeId) ```
15177
+ A scheme's earning rules (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50 }) while (page.nextCursor) page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50, cursor: page.nextCursor }) ```
15178
15178
 
15179
- **removeEarningRule**(collectionId: string,
15180
- schemeId: string,
15179
+ **removeEarningRule**(collectionId: string,
15180
+ schemeId: string,
15181
15181
  ruleId: string) → `Promise<LoyaltyEarningRule>`
15182
- A scheme's earning rules (admin). One list, no pages. ```typescript const { items } = await loyalty.listEarningRules('coll_123', schemeId) ```
15182
+ A scheme's earning rules (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50 }) while (page.nextCursor) page = await loyalty.listEarningRules('coll_123', schemeId, { limit: 50, cursor: page.nextCursor }) ```
15183
15183
 
15184
- **listMembers**(collectionId: string,
15185
- schemeId: string,
15184
+ **listMembers**(collectionId: string,
15185
+ schemeId: string,
15186
15186
  params: ListOptions = {}) → `Promise<ListResult<LoyaltyMember>>`
15187
15187
  A scheme's members (admin), a page at a time (default 50, at most 200). ```typescript let page = await loyalty.listMembers('coll_123', schemeId, { limit: 100 }) while (page.nextCursor) page = await loyalty.listMembers('coll_123', schemeId, { limit: 100, cursor: page.nextCursor }) ```
15188
15188
 
15189
- **getMember**(collectionId: string,
15190
- schemeId: string,
15189
+ **getMember**(collectionId: string,
15190
+ schemeId: string,
15191
15191
  contactId: string) → `Promise<LoyaltyMember>`
15192
15192
  A scheme's members (admin), a page at a time (default 50, at most 200). ```typescript let page = await loyalty.listMembers('coll_123', schemeId, { limit: 100 }) while (page.nextCursor) page = await loyalty.listMembers('coll_123', schemeId, { limit: 100, cursor: page.nextCursor }) ```
15193
15193
 
15194
- **recordTransaction**(collectionId: string,
15195
- schemeId: string,
15196
- contactId: string,
15194
+ **recordTransaction**(collectionId: string,
15195
+ schemeId: string,
15196
+ contactId: string,
15197
15197
  body: RecordLoyaltyTransactionBody) → `Promise<LoyaltyTransactionResult>`
15198
15198
  Manually award or deduct points for a contact. - `points` must be a non-zero integer - Positive = award, negative = deduct - Deducting below zero returns HTTP 422 `INSUFFICIENT_BALANCE` - Supply `idempotencyKey` to safely retry without double-crediting Points earned via interaction events are awarded automatically by the server — this endpoint is for manual adjustments and admin overrides.
15199
15199
 
15200
- **getMemberHistory**(collectionId: string,
15201
- schemeId: string,
15202
- contactId: string,
15200
+ **getMemberHistory**(collectionId: string,
15201
+ schemeId: string,
15202
+ contactId: string,
15203
15203
  params: ListOptions = {}) → `Promise<ListResult<LoyaltyTransaction>>`
15204
15204
  One member's points transactions (admin), newest first, a page at a time. ```typescript const { items, nextCursor } = await loyalty.getMemberHistory('coll_123', schemeId, contactId, { limit: 50 }) ```
15205
15205
 
15206
- **publicList**(collectionId: string) → `Promise<ListResult<LoyaltyScheme>>`
15207
- List active schemes for a collection. No authentication required. One list, no pages. ```typescript const { items } = await loyalty.publicList('coll_123') ```
15206
+ **publicList**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<LoyaltyScheme>>`
15207
+ List active schemes for a collection, a page at a time. No authentication required. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await loyalty.publicList('coll_123', { limit: 50 }) while (page.nextCursor) page = await loyalty.publicList('coll_123', { limit: 50, cursor: page.nextCursor }) ```
15208
15208
 
15209
- **publicGet**(collectionId: string,
15209
+ **publicGet**(collectionId: string,
15210
15210
  schemeId: string) → `Promise<LoyaltyScheme>`
15211
15211
  Get a single active scheme. No authentication required.
15212
15212
 
15213
- **publicListEarningRules**(collectionId: string,
15214
- schemeId: string) → `Promise<ListResult<LoyaltyEarningRule>>`
15215
- List active earning rules for a scheme — useful for showing "how to earn" in a loyalty UI. No authentication required. One list, no pages. ```typescript const { items } = await loyalty.publicListEarningRules('coll_123', schemeId) ```
15213
+ **publicListEarningRules**(collectionId: string,
15214
+ schemeId: string,
15215
+ options: ListOptions = {}) → `Promise<ListResult<LoyaltyEarningRule>>`
15216
+ List active earning rules for a scheme — useful for showing "how to earn" in a loyalty UI. No authentication required. A page at a time: page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await loyalty.publicListEarningRules('coll_123', schemeId, { limit: 50 }) while (page.nextCursor) page = await loyalty.publicListEarningRules('coll_123', schemeId, { limit: 50, cursor: page.nextCursor }) ```
15216
15217
 
15217
- **publicGetMe**(collectionId: string) → `Promise<ListResult<LoyaltySchemeWithMembership>>`
15218
- Get all active schemes with the caller's membership embedded in each. This is the primary entry point for a loyalty widget — one call gives you everything needed to render a user's loyalty status across all programs in a collection. - Authenticated: `member` is populated with balance + lifetimePoints (or null if not yet enrolled in that scheme) - Unauthenticated: `member` is null on all schemes One list, no pages. ```typescript const { items } = await loyalty.publicGetMe('coll_123') for (const scheme of items) console.log(scheme.name, scheme.member?.balance ?? 0) ```
15218
+ **publicGetMe**(collectionId: string,
15219
+ options: ListOptions = {}) → `Promise<ListResult<LoyaltySchemeWithMembership>>`
15220
+ Get all active schemes with the caller's membership embedded in each. This is the primary entry point for a loyalty widget — one call gives you everything needed to render a user's loyalty status across all programs in a collection. - Authenticated: `member` is populated with balance + lifetimePoints (or null if not yet enrolled in that scheme) - Unauthenticated: `member` is null on all schemes A page at a time: page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await loyalty.publicGetMe('coll_123') for (const scheme of page.items) console.log(scheme.name, scheme.member?.balance ?? 0) while (page.nextCursor) page = await loyalty.publicGetMe('coll_123', { cursor: page.nextCursor }) ```
15219
15221
 
15220
- **publicGetMine**(collectionId: string,
15222
+ **publicGetMine**(collectionId: string,
15221
15223
  schemeId: string) → `Promise<LoyaltyMember>`
15222
15224
  Get the authenticated caller's membership (balance + lifetimePoints) on a specific scheme. Requires authentication.
15223
15225
 
15224
- **publicGetMineHistory**(collectionId: string,
15225
- schemeId: string,
15226
+ **publicGetMineHistory**(collectionId: string,
15227
+ schemeId: string,
15226
15228
  params: ListOptions = {}) → `Promise<ListResult<LoyaltyTransaction>>`
15227
15229
  Get the authenticated caller's transaction history on a specific scheme. Ordered newest first, a page at a time. Requires authentication. ```typescript let page = await loyalty.publicGetMineHistory('coll_123', schemeId, { limit: 20 }) while (page.nextCursor) page = await loyalty.publicGetMineHistory('coll_123', schemeId, { limit: 20, cursor: page.nextCursor }) ```
15228
15230
 
@@ -15248,7 +15250,7 @@ Claim an NFC tag (public). POST /public/nfc/claimTag
15248
15250
  Validate an NFC tag payload (public). POST /public/nfc/validate
15249
15251
 
15250
15252
  **lookupTag**(tagId: string) → `Promise<ListResult<NfcTagInfo>>`
15251
- Lookup a tag by its ID (public): every code that tag is known as. One list, no pages. GET /public/nfc/findByTag/:tagId ```typescript const { items } = await nfc.lookupTag('04A1B2C3D4E5F6') ```
15253
+ Lookup a tag by its ID (public): every code that tag is known as, a page at a time. GET /public/nfc/findByTag/:tagId ```typescript const { items } = await nfc.lookupTag('04A1B2C3D4E5F6') ```
15252
15254
 
15253
15255
  ### operations
15254
15256
 
@@ -15260,86 +15262,86 @@ What the server offers, by group: `{ workOrders: [...], stock: [...], boms: [...
15260
15262
 
15261
15263
  ### order
15262
15264
 
15263
- **create**(collectionId: string,
15265
+ **create**(collectionId: string,
15264
15266
  data: CreateOrderRequest) → `Promise<CreateOrderResponse>`
15265
15267
  Create a new order with items. ```typescript const order = await order.create('coll_123', { orderRef: 'ORD-12345', customerId: 'CUST-789', items: [ { itemType: 'tag', itemId: 'TAG001' }, { itemType: 'tag', itemId: 'TAG002' }, { itemType: 'serial', itemId: 'SN12345' } ], status: 'pending', metadata: { shipmentId: 'SHIP-789', destination: 'Warehouse B' } }) ```
15266
15268
 
15267
- **get**(collectionId: string,
15268
- orderId: string,
15269
+ **get**(collectionId: string,
15270
+ orderId: string,
15269
15271
  params?: GetOrderParams) → `Promise<GetOrderResponse>`
15270
15272
  Get a single order by ID. ```typescript // Get order without items (faster) const order = await order.get('coll_123', 'order_abc123') console.log(`Order has ${order.itemCount} items`) // Get order with items const orderWithItems = await order.get('coll_123', 'order_abc123', { includeItems: true }) console.log(orderWithItems.items) // Items array available ```
15271
15273
 
15272
- **update**(collectionId: string,
15273
- orderId: string,
15274
+ **update**(collectionId: string,
15275
+ orderId: string,
15274
15276
  data: UpdateOrderRequest) → `Promise<UpdateOrderResponse>`
15275
15277
  Update order status or metadata. Items are managed separately via addItems/removeItems. ```typescript const updated = await order.update('coll_123', 'order_abc123', { status: 'shipped', metadata: { trackingNumber: '1Z999AA10123456784', shippedAt: '2026-02-02T14:30:00Z' } }) ```
15276
15278
 
15277
- **remove**(collectionId: string,
15279
+ **remove**(collectionId: string,
15278
15280
  orderId: string) → `Promise<DeleteOrderResponse>`
15279
15281
  Delete an order and all its items (cascade delete). ```typescript await order.remove('coll_123', 'order_abc123') ```
15280
15282
 
15281
- **list**(collectionId: string,
15283
+ **list**(collectionId: string,
15282
15284
  params?: ListOrdersRequest) → `Promise<ListResult<Order>>`
15283
- List orders for a collection with optional filters, a page at a time (default 100). Orders are returned in descending order by createdAt (newest first). ```typescript // The first page of orders (without items for better performance) const { items } = await order.list('coll_123') // List with filters, page by page let page = await order.list('coll_123', { status: 'pending', limit: 50 }) while (page.nextCursor) { page = await order.list('coll_123', { status: 'pending', limit: 50, cursor: page.nextCursor }) } // Filter by customer with items const customerOrders = await order.list('coll_123', { customerId: 'CUST-789', includeItems: true }) // Purchase orders from one supplier const purchases = await order.list('coll_123', { direction: 'purchase', partyId: supplierId }) ```
15285
+ List orders for a collection with optional filters, a page at a time (default 100). Orders are returned in descending order by createdAt (newest first). ```typescript // The first page of orders (without items for better performance) const { items } = await order.list('coll_123') // List with filters, page by page let page = await order.list('coll_123', { status: 'pending', limit: 50 }) while (page.nextCursor) { page = await order.list('coll_123', { status: 'pending', limit: 50, cursor: page.nextCursor }) } // Filter by customer with items const customerOrders = await order.list('coll_123', { customerId: 'CUST-789', expand: ['items'] }) // Purchase orders from one supplier const purchases = await order.list('coll_123', { direction: 'purchase', partyId: supplierId }) ```
15284
15286
 
15285
- **getItems**(collectionId: string,
15286
- orderId: string,
15287
+ **getItems**(collectionId: string,
15288
+ orderId: string,
15287
15289
  params?: GetOrderItemsParams) → `Promise<ListResult<OrderItem>>`
15288
- Get items from an order with pagination support. Use this for orders with many items instead of includeItems. ```typescript // Get first page of items const page1 = await order.getItems('coll_123', 'order_abc123', { limit: 100 }) // Get next page if (page1.nextCursor) { const page2 = await order.getItems('coll_123', 'order_abc123', { limit: 100, cursor: page1.nextCursor }) } ```
15290
+ Get items from an order with pagination support. Use this for orders with many items instead of `expand: ['items']`. ```typescript // Get first page of items const page1 = await order.getItems('coll_123', 'order_abc123', { limit: 100 }) // Get next page if (page1.nextCursor) { const page2 = await order.getItems('coll_123', 'order_abc123', { limit: 100, cursor: page1.nextCursor }) } ```
15289
15291
 
15290
- **addItems**(collectionId: string,
15291
- orderId: string,
15292
+ **addItems**(collectionId: string,
15293
+ orderId: string,
15292
15294
  data: AddItemsRequest) → `Promise<AddItemsResponse>`
15293
15295
  Add additional items to an existing order. ```typescript const updated = await order.addItems('coll_123', 'order_abc123', { items: [ { itemType: 'tag', itemId: 'TAG003' }, { itemType: 'proof', itemId: 'proof_xyz' } ] }) console.log(`Order now has ${updated.itemCount} items`) ```
15294
15296
 
15295
15297
  **lineDone**(collectionId: string, orderId: string, itemId: string, by: number) → `Promise<OrderItem>`
15296
15298
  Add to (or take from) how much of a line has been shipped or received. Atomic, so two receipts at once both count; it can't go below zero. ```typescript // 20 more caps arrived against a purchase order line await order.lineDone('coll_123', orderId, lineId, 20) ```
15297
15299
 
15298
- **removeItems**(collectionId: string,
15299
- orderId: string,
15300
+ **removeItems**(collectionId: string,
15301
+ orderId: string,
15300
15302
  data: RemoveItemsRequest) → `Promise<RemoveItemsResponse>`
15301
15303
  Add to (or take from) how much of a line has been shipped or received. Atomic, so two receipts at once both count; it can't go below zero. ```typescript // 20 more caps arrived against a purchase order line await order.lineDone('coll_123', orderId, lineId, 20) ```
15302
15304
 
15303
- **query**(collectionId: string,
15305
+ **query**(collectionId: string,
15304
15306
  data: QueryOrdersRequest) → `Promise<ListResult<Order>>`
15305
- Advanced query for orders with order-level and item-level filtering. More powerful than the basic list() function. ```typescript // Find pending orders created in January 2026 const result = await order.query('coll_123', { query: { status: 'pending', createdAfter: '2026-01-01T00:00:00Z', createdBefore: '2026-02-01T00:00:00Z', sortBy: 'createdAt', sortOrder: 'desc' }, limit: 50 }) console.log(result.items.length) // The next page: the same query with the cursor if (result.nextCursor) { const next = await order.query('coll_123', { query: { status: 'pending', sortBy: 'createdAt', sortOrder: 'desc' }, limit: 50, cursor: result.nextCursor }) } // Find orders with specific metadata and item count const highPriority = await order.query('coll_123', { query: { metadata: { priority: 'high' }, minItemCount: 10, maxItemCount: 100 }, includeItems: true }) // Find orders containing a specific product batch const batchOrders = await order.query('coll_123', { query: { productId: 'prod_789', batchId: 'BATCH-2024-001' }, includeItems: true }) // Find an order containing one of several specific items const matched = await order.query('coll_123', { query: { items: [ { itemType: 'tag', itemId: 'TAG001' }, { itemType: 'serial', itemId: 'SN12345' } ] }, includeItems: true }) ```
15307
+ Advanced query for orders with order-level and item-level filtering. More powerful than the basic list() function. `expand: ['items']`, and `limit` and `cursor` for paging. These all sit beside `query`, not inside it. ```typescript // Find pending orders created in January 2026, newest first const result = await order.query('coll_123', { query: { status: 'pending' }, createdAt: { gte: '2026-01-01T00:00:00Z', lte: '2026-02-01T00:00:00Z' }, orderBy: [{ createdAt: 'desc' }], limit: 50 }) console.log(result.items.length) // The next page: the same query with the cursor if (result.nextCursor) { const next = await order.query('coll_123', { query: { status: 'pending' }, createdAt: { gte: '2026-01-01T00:00:00Z', lte: '2026-02-01T00:00:00Z' }, orderBy: [{ createdAt: 'desc' }], limit: 50, cursor: result.nextCursor }) } // Find orders with specific metadata and item count, with their items const highPriority = await order.query('coll_123', { query: { metadata: { priority: 'high' }, minItemCount: 10, maxItemCount: 100 }, expand: ['items'] }) // Find orders containing a specific product batch const batchOrders = await order.query('coll_123', { query: { productId: 'prod_789', batchId: 'BATCH-2024-001' }, expand: ['items'] }) // Find an order containing one of several specific items const matched = await order.query('coll_123', { query: { items: [ { itemType: 'tag', itemId: 'TAG001' }, { itemType: 'serial', itemId: 'SN12345' } ] }, expand: ['items'] }) ```
15306
15308
 
15307
- **reports**(collectionId: string,
15309
+ **reports**(collectionId: string,
15308
15310
  params?: ReportsParams) → `Promise<ReportsResponse>`
15309
15311
  Get reports and aggregations for orders. Provides analytics grouped by status, customer, product, date, etc. ```typescript // Get order counts by status const statusReport = await order.reports('coll_123', { groupByStatus: true }) console.log(statusReport.ordersByStatus) // { pending: 45, shipped: 123, completed: 789 } // Get comprehensive analytics const fullReport = await order.reports('coll_123', { groupByStatus: true, groupByProduct: true, includeItemStats: true, createdAfter: '2026-01-01T00:00:00Z' }) console.log(fullReport.itemStats?.avgItemsPerOrder) // Get top 10 customers by order count const topCustomers = await order.reports('coll_123', { groupByCustomer: true, topN: 10 }) ```
15310
15312
 
15311
- **getAnalytics**(collectionId: string,
15313
+ **getAnalytics**(collectionId: string,
15312
15314
  orderId: string) → `Promise<OrderAnalyticsResponse>`
15313
15315
  Get comprehensive scan analytics for all tags in an order. Returns scan counts, timestamps, locations, devices, and per-tag summaries. ```typescript const analytics = await order.getAnalytics('coll_123', 'order_abc123') if (analytics.analytics) { console.log(`Total scans: ${analytics.analytics.totalScans}`) console.log(`Admin scans: ${analytics.analytics.adminScans}`) console.log(`Created at: ${analytics.analytics.estimatedCreatedAt}`) console.log(`Unique locations: ${analytics.analytics.uniqueLocations}`) analytics.analytics.tagSummaries.forEach(tag => { console.log(`Tag ${tag.tagId}: ${tag.totalScans} scans`) }) } ```
15314
15316
 
15315
- **getTimeline**(collectionId: string,
15316
- orderId: string,
15317
+ **getTimeline**(collectionId: string,
15318
+ orderId: string,
15317
15319
  params?: TimelineRequest) → `Promise<ListResult<TagScanEvent> &`
15318
- Get chronological timeline of all scan events for an order's tags. Supports filtering by date range and admin/customer scans. pages: `limit` says how many, default 1000), with the order they belong to ```typescript // Get all scan events const timeline = await order.getTimeline('coll_123', 'order_abc123') timeline.items.forEach(event => { console.log(`${event.timestamp}: ${event.eventType} by ${event.isAdmin ? 'admin' : 'customer'}`) }) // Get admin scans only from last week const adminScans = await order.getTimeline('coll_123', 'order_abc123', { isAdmin: true, from: '2026-02-01T00:00:00Z', limit: 500 }) ```
15320
+ Get chronological timeline of all scan events for an order's tags. Supports filtering by date range and admin/customer scans. time (`limit` says how many, default 1000), with the order they belong to ```typescript // The first page of scan events let timeline = await order.getTimeline('coll_123', 'order_abc123') timeline.items.forEach(event => { console.log(`${event.timestamp}: ${event.eventType} by ${event.isAdmin ? 'admin' : 'customer'}`) }) // The next page if (timeline.nextCursor) timeline = await order.getTimeline('coll_123', 'order_abc123', { cursor: timeline.nextCursor }) // Get admin scans only from last week const adminScans = await order.getTimeline('coll_123', 'order_abc123', { isAdmin: true, from: '2026-02-01T00:00:00Z', limit: 500 }) ```
15319
15321
 
15320
- **getLocationHistory**(collectionId: string,
15321
- orderId: string,
15322
+ **getLocationHistory**(collectionId: string,
15323
+ orderId: string,
15322
15324
  params?: LocationRequest) → `Promise<ListResult<LocationScan> &`
15323
- Get location-based scan history for an order's tags. Shows where the order's tags have been scanned. (one list, no pages: `limit` says how many, default 1000), with the order they belong to ```typescript const locations = await order.getLocationHistory('coll_123', 'order_abc123', { limit: 100 }) console.log(`Order has ${locations.items.length} scans with a location`) locations.items.forEach(scan => { console.log(`${scan.location} at ${scan.timestamp}`) }) ```
15325
+ Get location-based scan history for an order's tags. Shows where the order's tags have been scanned. a page at a time (`limit` says how many, default 1000), with the order they belong to ```typescript let locations = await order.getLocationHistory('coll_123', 'order_abc123', { limit: 100 }) locations.items.forEach(scan => { console.log(`${scan.location} at ${scan.timestamp}`) }) // The next page if (locations.nextCursor) { locations = await order.getLocationHistory('coll_123', 'order_abc123', { limit: 100, cursor: locations.nextCursor }) } ```
15324
15326
 
15325
- **getBulkAnalytics**(collectionId: string,
15327
+ **getBulkAnalytics**(collectionId: string,
15326
15328
  data: BulkAnalyticsRequest) → `Promise<BulkAnalyticsResponse>`
15327
15329
  Get analytics summary for multiple orders at once. Efficient way to retrieve scan data for many orders. ```typescript const bulk = await order.getBulkAnalytics('coll_123', { orderIds: ['order_1', 'order_2', 'order_3'], from: '2026-01-01T00:00:00Z' }) bulk.results.forEach(result => { if (result.analytics) { console.log(`${result.orderRef}: ${result.analytics.totalScans} scans`) } }) ```
15328
15330
 
15329
- **getCollectionSummary**(collectionId: string,
15331
+ **getCollectionSummary**(collectionId: string,
15330
15332
  params?: SummaryRequest) → `Promise<CollectionSummaryResponse>`
15331
15333
  Get collection-wide analytics summary across all orders. Returns daily scan counts and admin activity overview. ```typescript // Get all-time collection summary const summary = await order.getCollectionSummary('coll_123') console.log(`Admin activity count: ${summary.adminActivity.count}`) console.log('Scans by day:') summary.scansByDay.forEach(day => { console.log(` ${day.date}: ${day.scanCount} scans`) }) // Get summary for last 30 days const recentSummary = await order.getCollectionSummary('coll_123', { from: '2026-01-08T00:00:00Z', to: '2026-02-08T00:00:00Z' }) ```
15332
15334
 
15333
15335
  ### partner
15334
15336
 
15335
- **list**() → `Promise<ListResult<Partner>>`
15336
- The partners you belong to, with your role in each. Returns `{ items, nextCursor }`: the partners are in `items` (empty for everyone else). The list is not paged, so `nextCursor` is always `null`. ```typescript const { items: partners } = await partner.list() ```
15337
+ **list**(options: ListOptions = {}) → `Promise<ListResult<Partner>>`
15338
+ The partners you belong to, with your role in each. Returns `{ items, nextCursor }`: the partners are in `items` (empty for everyone else). A page at a time (`limit` and `cursor`; 50 unless you say otherwise). ```typescript let page = await partner.list() while (page.nextCursor) page = await partner.list({ cursor: page.nextCursor }) ```
15337
15339
 
15338
15340
  **get**(partnerId: string) → `Promise<Partner>`
15339
15341
  One partner (owners also see its members).
15340
15342
 
15341
- **claimSets**(partnerId: string) → `Promise<ListResult<PartnerClaimSet>>`
15342
- The partner's claim sets. Returns `{ items, nextCursor }`: the sets are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items: sets } = await partner.claimSets(partnerId) ```
15343
+ **claimSets**(partnerId: string, options: ListOptions = {}) → `Promise<ListResult<PartnerClaimSet>>`
15344
+ The partner's claim sets. Returns `{ items, nextCursor }`: the sets are in `items`. A page at a time (`limit` and `cursor`; 50 unless you say otherwise). ```typescript let page = await partner.claimSets(partnerId) while (page.nextCursor) page = await partner.claimSets(partnerId, { cursor: page.nextCursor }) ```
15343
15345
 
15344
15346
  **getClaimSet**(partnerId: string, claimSetId: string) → `Promise<PartnerClaimSet>`
15345
15347
  One of the partner's claim sets.
@@ -15348,10 +15350,35 @@ One of the partner's claim sets.
15348
15350
  A new claim set for the partner, on one of its tap domains (owners and admins).
15349
15351
 
15350
15352
  **lookupTags**(partnerId: string, query: { uid?: string; code?: string }) → `Promise<ListResult<PartnerTagHit>>`
15351
- Find a tag across the partner's sets by its chip UID (8 or 14 hex) or its code (printed or bare). Returns `{ items, nextCursor }`: `items` has one hit for each of the partner's sets the tag is in (usually one; none if the tag isn't the partner's). Never returns keys. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items: hits } = await partner.lookupTags(partnerId, { uid: '04A1B2C3D4E5F6' }) ```
15353
+ Find a tag across the partner's sets by its chip UID (8 or 14 hex) or its code (printed or bare). Returns `{ items, nextCursor }`: `items` has one hit for each of the partner's sets the tag is in (usually one; none if the tag isn't the partner's). Never returns keys. A look-up is never paged: every hit comes back in the one answer. ```typescript const { items: hits } = await partner.lookupTags(partnerId, { uid: '04A1B2C3D4E5F6' }) ```
15352
15354
 
15353
- **tagAttempts**(partnerId: string, uid: string) → `Promise<ListResult<ClientErrorEvent>>`
15354
- What phones reported about one chip (errors.report with entityType 'tag'), newest first: a tag that failed to program or register, with the host's NFC log in context. For a chip in the partner's sets, or attempts that named one of them. Returns `{ items, nextCursor }`: the ten latest reports are in `items`. The list is not paged, so `nextCursor` is always `null`. ```typescript const { items: attempts } = await partner.tagAttempts(partnerId, '04A1B2C3D4E5F6') ```
15355
+ **tagAttempts**(partnerId: string, uid: string, options: ListOptions = {}) → `Promise<ListResult<ClientErrorEvent>>`
15356
+ What phones reported about one chip (errors.report with entityType 'tag'), newest first: a tag that failed to program or register, with the host's NFC log in context. For a chip in the partner's sets, or attempts that named one of them. Returns `{ items, nextCursor }`: the latest reports are in `items` (ten unless `limit` says otherwise); `cursor` is the previous page's `nextCursor`. ```typescript const { items: attempts } = await partner.tagAttempts(partnerId, '04A1B2C3D4E5F6', { limit: 20 }) ```
15357
+
15358
+ ### payments
15359
+
15360
+ **config**(collectionId: string) → `Promise<PaymentsPublicConfig>`
15361
+ Can this business take payments, and what Stripe.js needs. `ready` is false until the business has connected Stripe in Studio → Payments. ```typescript const cfg = await payments.config(collectionId) if (cfg.ready) stripePromise = loadStripe(cfg.publishableKey!, { stripeAccount: cfg.accountId! }) ```
15362
+
15363
+ **createIntent**(collectionId: string, input: PaymentIntentInput) → `Promise<PaymentIntentResult>`
15364
+ Start an in-page payment on the business's account. Confirm it in the page with Stripe.js, using the returned publishable key AND account id (`loadStripe(publishableKey, { stripeAccount: accountId })`). `amount` is in minor units (500 = £5.00). The app must be installed in the collection. The browser decides the amount, so use this for pay-what-you-want (donations, tips). For a fixed price use a hosted checkout (`shop.checkout`), where the server prices it. ```typescript const pi = await payments.createIntent(collectionId, { appId: 'tap-to-donate', amount: 500, currency: 'GBP', email }) const stripe = await loadStripe(pi.publishableKey, { stripeAccount: pi.accountId }) // <Elements stripe={stripe} options={{ clientSecret: pi.clientSecret }}> … stripe.confirmPayment(…) ```
15365
+
15366
+ ### payments.admin
15367
+
15368
+ **status**(collectionId: string, params?: { appIds?: string[] }) → `Promise<PaymentsStatus>`
15369
+ The business's payments account: connected, can take payments, can pay out. Pass `appIds` to see what SmartLinks takes from each.
15370
+
15371
+ **connect**(collectionId: string, input: PaymentsConnectInput) → `Promise<`
15372
+ Stripe's page to connect (or finish connecting) the business's Stripe account. Send the person to `url`. The account is made the first time; every app shares it.
15373
+
15374
+ **disconnect**(collectionId: string) → `Promise<`
15375
+ Stop using the business's Stripe account. SmartLinks forgets it (apps can no longer take payments until one is connected again); the Stripe account itself stays the business's own, with the payments already in it. Connecting again makes a new account.
15376
+
15377
+ **intents**(collectionId: string, params?: PaymentListParams) → `Promise<PaymentList>`
15378
+ An app's in-page payments on the business's account, newest first (for reconciling).
15379
+
15380
+ **registerDomain**(collectionId: string, domain: string) → `Promise<PaymentDomainResult>`
15381
+ Let Apple Pay and Google Pay run on a site's own domain (smartlinks.app needs nothing).
15355
15382
 
15356
15383
  ### places
15357
15384
 
@@ -15360,7 +15387,7 @@ Move items (by membership), chips without an item (by membership) or containers
15360
15387
 
15361
15388
  ### podcast
15362
15389
 
15363
- **generate**(collectionId: string,
15390
+ **generate**(collectionId: string,
15364
15391
  request: GeneratePodcastRequest) → `Promise<GeneratePodcastResponse>`
15365
15392
  Generate a NotebookLM-style conversational podcast from product documents
15366
15393
 
@@ -15369,213 +15396,219 @@ Get podcast generation status
15369
15396
 
15370
15397
  ### products
15371
15398
 
15372
- **get**(collectionId: string,
15373
- productId: string,
15399
+ **get**(collectionId: string,
15400
+ productId: string,
15374
15401
  admin?: boolean) → `Promise<ProductResponse>`
15375
15402
 
15376
- **list**(collectionId: string,
15377
- admin?: boolean) → `Promise<ListResult<ProductResponse>>`
15378
- Every product in a collection, in one list (no pages). For filtering, sorting and paging use `products.query`. ```typescript const { items } = await products.list(collectionId) ```
15403
+ **list**(collectionId: string,
15404
+ admin?: boolean,
15405
+ options: ListOptions & { expand?: Array<'facets'> } = {}) → `Promise<ListResult<ProductResponse>>`
15406
+ The products in a collection, a page at a time. For searching, filtering and sorting use `products.query`. as full values instead of their keys ```typescript let page = await products.list(collectionId, false, { limit: 50 }) while (page.nextCursor) { page = await products.list(collectionId, false, { limit: 50, cursor: page.nextCursor }) } // Admin, with full facet values const { items } = await products.list(collectionId, true, { expand: ['facets'] }) ```
15379
15407
 
15380
- **create**(collectionId: string,
15408
+ **create**(collectionId: string,
15381
15409
  data: ProductCreateRequest) → `Promise<ProductResponse>`
15382
- Every product in a collection, in one list (no pages). For filtering, sorting and paging use `products.query`. ```typescript const { items } = await products.list(collectionId) ```
15410
+ The products in a collection, a page at a time. For searching, filtering and sorting use `products.query`. as full values instead of their keys ```typescript let page = await products.list(collectionId, false, { limit: 50 }) while (page.nextCursor) { page = await products.list(collectionId, false, { limit: 50, cursor: page.nextCursor }) } // Admin, with full facet values const { items } = await products.list(collectionId, true, { expand: ['facets'] }) ```
15383
15411
 
15384
- **update**(collectionId: string,
15385
- productId: string,
15412
+ **update**(collectionId: string,
15413
+ productId: string,
15386
15414
  data: ProductUpdateRequest) → `Promise<ProductResponse>`
15387
- Every product in a collection, in one list (no pages). For filtering, sorting and paging use `products.query`. ```typescript const { items } = await products.list(collectionId) ```
15415
+ The products in a collection, a page at a time. For searching, filtering and sorting use `products.query`. as full values instead of their keys ```typescript let page = await products.list(collectionId, false, { limit: 50 }) while (page.nextCursor) { page = await products.list(collectionId, false, { limit: 50, cursor: page.nextCursor }) } // Admin, with full facet values const { items } = await products.list(collectionId, true, { expand: ['facets'] }) ```
15388
15416
 
15389
- **remove**(collectionId: string,
15417
+ **remove**(collectionId: string,
15390
15418
  productId: string) → `Promise<void>`
15391
- Every product in a collection, in one list (no pages). For filtering, sorting and paging use `products.query`. ```typescript const { items } = await products.list(collectionId) ```
15419
+ The products in a collection, a page at a time. For searching, filtering and sorting use `products.query`. as full values instead of their keys ```typescript let page = await products.list(collectionId, false, { limit: 50 }) while (page.nextCursor) { page = await products.list(collectionId, false, { limit: 50, cursor: page.nextCursor }) } // Admin, with full facet values const { items } = await products.list(collectionId, true, { expand: ['facets'] }) ```
15392
15420
 
15393
- **query**(collectionId: string,
15394
- body: ProductQueryRequest,
15421
+ **query**(collectionId: string,
15422
+ body: ProductQueryRequest,
15395
15423
  admin?: boolean) → `Promise<ListResult<ProductResponse> &`
15396
- Query products in a collection with filtering, sorting, and paging. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. for the next page (null on the last), how many match in all where the server counted, and `meta` (how the query was run) ```typescript // Public query (default) const { items, nextCursor, count } = await products.query(collectionId, { query: { search: 'cabernet' }, limit: 20 }) // The next page: the same query with the cursor if (nextCursor) { await products.query(collectionId, { query: { search: 'cabernet' }, limit: 20, cursor: nextCursor }) } // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
15424
+ Query products in a collection with search, filtering, sorting, and paging. and the other filters in `query`, plus `limit` (default 50) and `cursor` for paging authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. for the next page (null on the last), how many match in all where the server counted, and `meta` (how the query was run) ```typescript // Public query (default) const { items, nextCursor, count } = await products.query(collectionId, { q: 'cabernet', limit: 20 }) // The next page: the same query with the cursor if (nextCursor) { await products.query(collectionId, { q: 'cabernet', limit: 20, cursor: nextCursor }) } // Newest first, created this month, active only, with full facet values await products.query(collectionId, { orderBy: [{ createdAt: 'desc' }], createdAt: { gte: '2026-11-01T00:00:00Z', lte: '2026-11-30T23:59:59Z' }, query: { status: ['active'] }, expand: ['facets'], }) // Admin query (authenticated) await products.query(collectionId, { q: 'cabernet' }, true) ```
15397
15425
 
15398
- **standardQuery**(collectionId: string,
15426
+ **standardQuery**(collectionId: string,
15399
15427
  body: StandardQuery = {}) → `Promise<QueryResult>`
15400
15428
  The standard query on products (admin only): the one query shape every resource is moving to, with counts, totals and filtering by facet. It sits beside `products.query`, whose own body is unchanged. POST /admin/collection/:collectionId/products/standard/query Fields: id, name, description, sku, gtin, schemaType, status, sortOrder, createdAt, updatedAt, facets. Facets are filtered by key: the facet by its key or name, the value by its key or name. ```typescript await products.standardQuery(collectionId, { where: { facets: { brand: 'Breville', category: { in: ['Toasters', 'Kettles'] } }, status: 'active' }, select: ['id', 'name', 'sku'], count: true, }) ```
15401
15429
 
15402
15430
  **standardQueryFields**(collectionId: string) → `Promise<QueryDescription>`
15403
15431
  What a products standard query can use: its fields and what each can filter, sort, group or total. GET /admin/collection/:collectionId/products/standard/query
15404
15432
 
15405
- **clone**(collectionId: string,
15406
- productId: string,
15433
+ **clone**(collectionId: string,
15434
+ productId: string,
15407
15435
  body: Record<string, JsonValue> = {}) → `Promise<ProductResponse>`
15408
15436
  What a products standard query can use: its fields and what each can filter, sort, group or total. GET /admin/collection/:collectionId/products/standard/query
15409
15437
 
15410
- **listAssets**(collectionId: string,
15411
- productId: string,
15412
- admin?: boolean) → `Promise<ListResult<AssetResponse>>`
15413
- A product's assets (images, documents), in one list (no pages). ```typescript const { items } = await products.listAssets(collectionId, productId) ```
15438
+ **listAssets**(collectionId: string,
15439
+ productId: string,
15440
+ admin?: boolean,
15441
+ options: ListOptions = {}) → `Promise<ListResult<AssetResponse>>`
15442
+ A product's assets (images, documents), a page at a time. ```typescript let page = await products.listAssets(collectionId, productId, false, { limit: 50 }) while (page.nextCursor) { page = await products.listAssets(collectionId, productId, false, { limit: 50, cursor: page.nextCursor }) } ```
15414
15443
 
15415
- **createClaimWindow**(collectionId: string,
15416
- productId: string,
15444
+ **createClaimWindow**(collectionId: string,
15445
+ productId: string,
15417
15446
  body: Record<string, JsonValue>) → `Promise<unknown>`
15418
- A product's assets (images, documents), in one list (no pages). ```typescript const { items } = await products.listAssets(collectionId, productId) ```
15447
+ A product's assets (images, documents), a page at a time. ```typescript let page = await products.listAssets(collectionId, productId, false, { limit: 50 }) while (page.nextCursor) { page = await products.listAssets(collectionId, productId, false, { limit: 50, cursor: page.nextCursor }) } ```
15419
15448
 
15420
- **updateClaimWindow**(collectionId: string,
15421
- productId: string,
15422
- claimId: string,
15449
+ **updateClaimWindow**(collectionId: string,
15450
+ productId: string,
15451
+ claimId: string,
15423
15452
  body: Record<string, JsonValue>) → `Promise<unknown>`
15424
- A product's assets (images, documents), in one list (no pages). ```typescript const { items } = await products.listAssets(collectionId, productId) ```
15453
+ A product's assets (images, documents), a page at a time. ```typescript let page = await products.listAssets(collectionId, productId, false, { limit: 50 }) while (page.nextCursor) { page = await products.listAssets(collectionId, productId, false, { limit: 50, cursor: page.nextCursor }) } ```
15425
15454
 
15426
- **refresh**(collectionId: string,
15455
+ **refresh**(collectionId: string,
15427
15456
  productId: string) → `Promise<ProductResponse>`
15428
- A product's assets (images, documents), in one list (no pages). ```typescript const { items } = await products.listAssets(collectionId, productId) ```
15457
+ A product's assets (images, documents), a page at a time. ```typescript let page = await products.listAssets(collectionId, productId, false, { limit: 50 }) while (page.nextCursor) { page = await products.listAssets(collectionId, productId, false, { limit: 50, cursor: page.nextCursor }) } ```
15429
15458
 
15430
- **getSN**(collectionId: string,
15431
- productId: string,
15432
- startIndex: number = 0,
15459
+ **getSN**(collectionId: string,
15460
+ productId: string,
15461
+ startIndex: number = 0,
15433
15462
  count: number = 10) → `Promise<unknown>`
15434
- A product's assets (images, documents), in one list (no pages). ```typescript const { items } = await products.listAssets(collectionId, productId) ```
15463
+ A product's assets (images, documents), a page at a time. ```typescript let page = await products.listAssets(collectionId, productId, false, { limit: 50 }) while (page.nextCursor) { page = await products.listAssets(collectionId, productId, false, { limit: 50, cursor: page.nextCursor }) } ```
15435
15464
 
15436
- **lookupSN**(collectionId: string,
15437
- productId: string,
15465
+ **lookupSN**(collectionId: string,
15466
+ productId: string,
15438
15467
  codeId: string) → `Promise<unknown>`
15439
- A product's assets (images, documents), in one list (no pages). ```typescript const { items } = await products.listAssets(collectionId, productId) ```
15468
+ A product's assets (images, documents), a page at a time. ```typescript let page = await products.listAssets(collectionId, productId, false, { limit: 50 }) while (page.nextCursor) { page = await products.listAssets(collectionId, productId, false, { limit: 50, cursor: page.nextCursor }) } ```
15440
15469
 
15441
- **publicLookupClaim**(collectionId: string,
15442
- productId: string,
15470
+ **publicLookupClaim**(collectionId: string,
15471
+ productId: string,
15443
15472
  claimId: string) → `Promise<unknown>`
15444
- A product's assets (images, documents), in one list (no pages). ```typescript const { items } = await products.listAssets(collectionId, productId) ```
15473
+ A product's assets (images, documents), a page at a time. ```typescript let page = await products.listAssets(collectionId, productId, false, { limit: 50 }) while (page.nextCursor) { page = await products.listAssets(collectionId, productId, false, { limit: 50, cursor: page.nextCursor }) } ```
15445
15474
 
15446
- **publicCreateClaim**(collectionId: string,
15447
- productId: string,
15475
+ **publicCreateClaim**(collectionId: string,
15476
+ productId: string,
15448
15477
  body: ProductClaimCreateRequestBody) → `Promise<unknown>`
15449
- A product's assets (images, documents), in one list (no pages). ```typescript const { items } = await products.listAssets(collectionId, productId) ```
15478
+ A product's assets (images, documents), a page at a time. ```typescript let page = await products.listAssets(collectionId, productId, false, { limit: 50 }) while (page.nextCursor) { page = await products.listAssets(collectionId, productId, false, { limit: 50, cursor: page.nextCursor }) } ```
15450
15479
 
15451
15480
  ### proof
15452
15481
 
15453
- **query**(collectionId: string,
15482
+ **query**(collectionId: string,
15454
15483
  body: StandardQuery = {}) → `Promise<QueryResult>`
15455
15484
  The standard query on proofs (admin only): filter, sort, page, count and total a collection's proofs in one call, and follow a proof to its `product` and its `owner` (the owner's contact). POST /admin/collection/:collectionId/proof/query Fields: id, productId, userId (the owner's login id), batchId, variantId, lotId, status, claimable, createdAt, updatedAt. A proof's own values are not returned by this call. ```typescript // How many people own each product await proof.query(collectionId, { where: { userId: { isNull: false } }, groupBy: ['productId'], aggregates: { owners: { countDistinct: 'userId' } }, }) // The most recent owner of a product, with their name await proof.query(collectionId, { where: { productId: 'toaster', userId: { isNull: false } }, orderBy: [{ createdAt: 'desc' }], limit: 1, expand: { owner: ['firstName', 'lastName', 'email'] }, }) ```
15456
15485
 
15457
15486
  **queryFields**(collectionId: string) → `Promise<QueryDescription>`
15458
15487
  What a proofs query can use: its fields, what each can filter, sort, group or total, and its links. GET /admin/collection/:collectionId/proof/query
15459
15488
 
15460
- **get**(collectionId: string,
15461
- productId: string,
15462
- proofId: string,
15463
- admin?: boolean,
15489
+ **get**(collectionId: string,
15490
+ productId: string,
15491
+ proofId: string,
15492
+ admin?: boolean,
15464
15493
  include?: string[]) → `Promise<ProofResponse>`
15465
15494
  Retrieves a single Proof by Collection ID, Product ID, and Proof ID. Both public and admin endpoints now include productId in the path.
15466
15495
 
15467
- **list**(collectionId: string,
15468
- include?: string[]) → `Promise<ListResult<ProofResponse>>`
15469
- List all Proofs for a Collection, in one list (no pages). GET /public/collection/:collectionId/proof ```typescript const { items } = await proof.list(collectionId) ```
15496
+ **list**(collectionId: string,
15497
+ options: ListOptions & { expand?: Array<'product'> } = {}) → `Promise<ListResult<ProofResponse>>`
15498
+ List all Proofs for a Collection, a page at a time. GET /public/collection/:collectionId/proof ```typescript let page = await proof.list(collectionId, { limit: 50, expand: ['product'] }) while (page.nextCursor) { page = await proof.list(collectionId, { limit: 50, expand: ['product'], cursor: page.nextCursor }) } ```
15470
15499
 
15471
- **create**(collectionId: string,
15472
- productId: string,
15500
+ **create**(collectionId: string,
15501
+ productId: string,
15473
15502
  request: ProofCreateRequest) → `Promise<ProofResponse>`
15474
15503
  Create a proof for a product (admin only). POST /admin/collection/:collectionId/product/:productId/proof Pass the proof's content in a `proof` block, keyed by zone (see {@link ProofWrite}): ```ts proof.create(collectionId, productId, { proof: { values: { colour: 'red' }, // public + owner readable, owner + admin writable data: { serialNo: 1001 }, // public + owner readable, ADMIN-only writable admin: { costPrice: 4.20 }, // admin-only }, claimable: true, }) ``` Note: a top-level `data`/`admin` on the request body is legacy — top-level `data` gets folded into the values bag, so use `proof.data` for `proof.data`.
15475
15504
 
15476
- **update**(collectionId: string,
15477
- productId: string,
15478
- proofId: string,
15505
+ **update**(collectionId: string,
15506
+ productId: string,
15507
+ proofId: string,
15479
15508
  values: ProofUpdateRequest) → `Promise<ProofResponse>`
15480
15509
  Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId Pass the fields to change **at the root**, keyed by zone (see {@link ProofWrite}): ```ts proof.update(collectionId, productId, proofId, { data: { serialNo: 1002 }, // → proof.data (admin-only writable) values: { colour: 'blue' }, // → proof.values }) ``` Object zones deep-merge, so you can change one field without wiping the rest.
15481
15510
 
15482
- **updateValues**(collectionId: string,
15483
- productId: string,
15484
- proofId: string,
15511
+ **updateValues**(collectionId: string,
15512
+ productId: string,
15513
+ proofId: string,
15485
15514
  values: ProofValuesUpdateRequest) → `Promise<ProofResponse>`
15486
15515
  Owner self-service update of a proof's owner-writable data. PUT /public/collection/:collectionId/product/:productId/proof/:proofId/values The public counterpart to admin `update` — the current OWNER (or a collection admin) editing their own proof, no admin credentials required. Only owner-writable zones are honoured (see {@link ProofValuesUpdateRequest}): ```ts proof.updateValues(collectionId, productId, proofId, { colour: 'blue', // → proof.values.colour (public) owner: { warranty: '2y' }, // → proof.values.owner (owner-scoped) personal: { nickname: 'Bo' }, // → proof.values.personal[callerUid] (private, own slot only) }) ``` `personal` always targets the caller's OWN slot — you cannot write another user's personal data, even as an admin. Object zones deep-merge (owner/personal merge field-by-field), so you can change one field without wiping the rest. Business-only zones (`data`/`admin`/`private`) are not writable here — use the admin `update` for those.
15487
15516
 
15488
- **claim**(collectionId: string,
15489
- productId: string,
15490
- proofId: string,
15517
+ **claim**(collectionId: string,
15518
+ productId: string,
15519
+ proofId: string,
15491
15520
  values: ProofClaimRequest) → `Promise<ProofResponse>`
15492
15521
  Claim a proof for a product using a proof ID (serial number, NFC tag, etc.). PUT /public/collection/:collectionId/product/:productId/proof/:proofId/claim
15493
15522
 
15494
- **claimProduct**(collectionId: string,
15495
- productId: string,
15523
+ **claimProduct**(collectionId: string,
15524
+ productId: string,
15496
15525
  values?: ProofClaimRequest) → `Promise<ProofResponse>`
15497
15526
  Claim a product without providing a proof ID. System auto-generates a unique serial number on-demand. Requires allowAutoGenerateClaims to be enabled on the collection or product. PUT /public/collection/:collectionId/product/:productId/proof/claim ```typescript const proof = await proof.claimProduct( 'beauty-brand', 'moisturizer-pro', { purchaseDate: '2026-02-17', store: 'Target' } ); console.log('Auto-generated ID:', proof.id); ```
15498
15527
 
15499
- **remove**(collectionId: string,
15500
- productId: string,
15528
+ **remove**(collectionId: string,
15529
+ productId: string,
15501
15530
  proofId: string) → `Promise<void>`
15502
15531
  Delete a proof for a product (admin only). DELETE /admin/collection/:collectionId/product/:productId/proof/:proofId
15503
15532
 
15504
- **getByUser**(collectionId: string,
15505
- userId: string) → `Promise<ListResult<ProofResponse>>`
15506
- Get proofs for a user in a collection (admin only), in one list (no pages). GET /admin/collection/:collectionId/proof/findByUser/:userId ```typescript const { items } = await proof.getByUser(collectionId, userId) ```
15533
+ **getByUser**(collectionId: string,
15534
+ userId: string,
15535
+ options: ListOptions = {}) → `Promise<ListResult<ProofResponse>>`
15536
+ Get proofs for a user in a collection (admin only), a page at a time. GET /admin/collection/:collectionId/proof/findByUser/:userId ```typescript let page = await proof.getByUser(collectionId, userId, { limit: 50 }) while (page.nextCursor) page = await proof.getByUser(collectionId, userId, { limit: 50, cursor: page.nextCursor }) ```
15507
15537
 
15508
- **getByProduct**(collectionId: string,
15509
- productId: string) → `Promise<ListResult<ProofResponse>>`
15510
- Get proofs for a product (admin only), in one list (no pages). GET /admin/collection/:collectionId/product/:productId/proof ```typescript const { items } = await proof.getByProduct(collectionId, productId) ```
15538
+ **getByProduct**(collectionId: string,
15539
+ productId: string,
15540
+ options: ListOptions = {}) → `Promise<ListResult<ProofResponse>>`
15541
+ Get proofs for a product (admin only), a page at a time. GET /admin/collection/:collectionId/product/:productId/proof ```typescript let page = await proof.getByProduct(collectionId, productId, { limit: 50 }) while (page.nextCursor) page = await proof.getByProduct(collectionId, productId, { limit: 50, cursor: page.nextCursor }) ```
15511
15542
 
15512
- **findByProduct**(collectionId: string,
15513
- productId: string,
15543
+ **findByProduct**(collectionId: string,
15544
+ productId: string,
15514
15545
  query: ProofFindQuery = {}) → `Promise<ListResult<ProofResponse>>`
15515
- Find proofs for a product (admin only): the newest `limit` (default 100), or every proof matching `filterBy`. For counting, sorting and paging through a collection's proofs use `proof.query`. POST /admin/collection/:collectionId/product/:productId/proof/find ```typescript const { items } = await proof.findByProduct(collectionId, productId, { limit: 50, includes: ['assets'] }) const red = await proof.findByProduct(collectionId, productId, { filterBy: [{ field: 'values.colour', value: 'red' }] }) ```
15546
+ Find proofs for a product (admin only): the newest ones, `limit` at a time (default 100), or the proofs matching `filterBy`. `expand: ['assets']` attaches each proof's assets. Pass `nextCursor` back as `cursor` for the next page. For counting and sorting a collection's proofs use `proof.query`. POST /admin/collection/:collectionId/product/:productId/proof/find ```typescript const { items, nextCursor } = await proof.findByProduct(collectionId, productId, { limit: 50, expand: ['assets'] }) const red = await proof.findByProduct(collectionId, productId, { filterBy: [{ field: 'values.colour', value: 'red' }] }) ```
15516
15547
 
15517
- **getByBatch**(collectionId: string,
15518
- productId: string,
15519
- batchId: string) → `Promise<ListResult<ProofResponse>>`
15520
- Get proofs for a batch (admin only), in one list (no pages). GET /admin/collection/:collectionId/product/:productId/batch/:batchId/proof ```typescript const { items } = await proof.getByBatch(collectionId, productId, batchId) ```
15548
+ **getByBatch**(collectionId: string,
15549
+ productId: string,
15550
+ batchId: string,
15551
+ options: ListOptions = {}) → `Promise<ListResult<ProofResponse>>`
15552
+ Get proofs for a batch (admin only), a page at a time. GET /admin/collection/:collectionId/product/:productId/batch/:batchId/proof ```typescript let page = await proof.getByBatch(collectionId, productId, batchId, { limit: 50 }) while (page.nextCursor) { page = await proof.getByBatch(collectionId, productId, batchId, { limit: 50, cursor: page.nextCursor }) } ```
15521
15553
 
15522
- **migrate**(collectionId: string,
15523
- productId: string,
15524
- proofId: string,
15525
- /** The destination product ID */
15554
+ **migrate**(collectionId: string,
15555
+ productId: string,
15556
+ proofId: string,
15557
+ /** The destination product ID */
15526
15558
  data: { targetProductId: string }) → `Promise<ProofResponse>`
15527
15559
  Migrate a proof to a different product within the same collection (admin only). Because the Firestore ledger document ID is `{productId}-{proofId}`, a proof cannot simply be re-assigned to another product by updating a field — the document must be re-keyed. This endpoint handles that atomically: 1. Reads the source ledger document (`{sourceProductId}-{proofId}`). 2. Writes a new document (`{targetProductId}-{proofId}`) with `productId` and `proofGroup` updated. The short `proofId` (nanoid) is unchanged. 3. Writes a migration history entry to the new document's `history` subcollection (snapshot of the original proof + migration metadata). 4. Copies all subcollections — `assets`, `attestations`, `history` — from the old document to the new one. 5. Deletes the old subcollections and then the old document. Repeated migrations are safe — each one appends a history record; no migration metadata is stored on the proof document itself. ```typescript const migrated = await proof.migrate('coll_123', 'prod_old', 'proof_abc', { targetProductId: 'prod_new', }) console.log(migrated.productId) // 'prod_new' ```
15528
15560
 
15529
- **createGrant**(collectionId: string,
15530
- productId: string,
15531
- proofId: string,
15561
+ **createGrant**(collectionId: string,
15562
+ productId: string,
15563
+ proofId: string,
15532
15564
  options: CreateGrantOptions) → `Promise<ProofGrant>`
15533
15565
  Create a share grant on a proof (owner / collection admin only). The returned grant includes `token` — the opaque bearer secret, available ONLY on this response. Embed it in a share link and hand recipients {@link redeemGrant} / {@link setGrantToken}.
15534
15566
 
15535
- **listGrants**(collectionId: string,
15536
- productId: string,
15537
- proofId: string) → `Promise<ListResult<ProofGrant>>`
15538
- List the active + past grants on a proof (owner / collection admin only), in one list (no pages). Tokens are never returned here. ```typescript const { items } = await proof.listGrants(collectionId, productId, proofId) ```
15567
+ **listGrants**(collectionId: string,
15568
+ productId: string,
15569
+ proofId: string,
15570
+ options: ListOptions = {}) → `Promise<ListResult<ProofGrant>>`
15571
+ List the active + past grants on a proof (owner / collection admin only), a page at a time. Tokens are never returned here. ```typescript const { items, nextCursor } = await proof.listGrants(collectionId, productId, proofId, { limit: 50 }) ```
15539
15572
 
15540
- **revokeGrant**(collectionId: string,
15541
- productId: string,
15542
- proofId: string,
15573
+ **revokeGrant**(collectionId: string,
15574
+ productId: string,
15575
+ proofId: string,
15543
15576
  grantId: string) → `Promise<void>`
15544
15577
  Revoke a grant by id (owner / collection admin only). Takes effect immediately.
15545
15578
 
15546
- **redeemGrant**(collectionId: string,
15547
- productId: string,
15548
- proofId: string,
15549
- token: string,
15579
+ **redeemGrant**(collectionId: string,
15580
+ productId: string,
15581
+ proofId: string,
15582
+ token: string,
15550
15583
  options?: RedeemGrantOptions) → `Promise<RedeemGrantResult>`
15551
15584
  Redeem a grant token (anonymous or signed-in). Records the redemption and returns the granted scope, or — for a `verify_owner` grant — an ownership assertion (never the account). After redeeming, call {@link setGrantToken} so subsequent data requests carry the token.
15552
15585
 
15553
- **transfer**(collectionId: string,
15554
- productId: string,
15555
- proofId: string,
15586
+ **transfer**(collectionId: string,
15587
+ productId: string,
15588
+ proofId: string,
15556
15589
  options: TransferProofOptions) → `Promise<TransferProofResult>`
15557
15590
  Start a push transfer of a proof (current owner / collection admin only). Directed — hand it to a named recipient who then calls {@link acceptTransfer}: ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com' }) ``` Open release — make the proof claimable by anyone: ```ts await proof.transfer(collectionId, productId, proofId, { release: true }) ``` Send comms by naming templates per role (server decides who receives each): ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com', comms: { recipient: { templateId: 'transfer-incoming', props: { note: 'Enjoy!' } }, sender: { templateId: 'transfer-sent' }, }, }) ``` Direct to an SMS recipient by phone (E.164) and notify them by text: ```ts await proof.transfer(collectionId, productId, proofId, { toPhone: '+14155551234', comms: { recipient: { templateId: 'transfer-incoming', channel: 'sms' } }, }) ```
15558
15591
 
15559
- **acceptTransfer**(collectionId: string,
15560
- productId: string,
15561
- proofId: string,
15592
+ **acceptTransfer**(collectionId: string,
15593
+ productId: string,
15594
+ proofId: string,
15562
15595
  options: AcceptTransferOptions = {}) → `Promise<`
15563
15596
  Accept a directed transfer (the named recipient only). Completes the ownership move — the proof's `userId` becomes the caller and the previous owner's private data and share grants are cleared/voided.
15564
15597
 
15565
- **cancelTransfer**(collectionId: string,
15566
- productId: string,
15567
- proofId: string,
15598
+ **cancelTransfer**(collectionId: string,
15599
+ productId: string,
15600
+ proofId: string,
15568
15601
  options: CancelTransferOptions = {}) → `Promise<`
15569
15602
  Cancel a pending push transfer (current owner / collection admin only).
15570
15603
 
15571
- **getTransfer**(collectionId: string,
15572
- productId: string,
15604
+ **getTransfer**(collectionId: string,
15605
+ productId: string,
15573
15606
  proofId: string) → `Promise<`
15574
15607
  Get the active transfer/status for a proof (owner, collection admin, or the named recipient). Returns `{ transfer: null }` when nothing is in flight.
15575
15608
 
15576
15609
  ### publicClient
15577
15610
 
15578
- **agentRun**(collectionId: string,
15611
+ **agentRun**(collectionId: string,
15579
15612
  body: PublicAgentRunRequest) → `Promise<AgentRunResult>`
15580
15613
  Public agent loop — run the orchestration-neutral tool loop on the consumer surface. Exposes an app's PUBLIC server functions (`agent.tool:true`, `visibility:'public'`) to a consumer assistant; built-in tools are opt-in by explicit `server_tools[]` allowlist only. The caller runs as the signed-in consumer ('owner', send the authKit bearer) or anonymous ('public'). POST /public/collection/:collectionId/ai/agent/run
15581
15614
 
@@ -15590,19 +15623,19 @@ Check rate limit status
15590
15623
 
15591
15624
  ### publicClient.sessions
15592
15625
 
15593
- **create**(collectionId: string,
15626
+ **create**(collectionId: string,
15594
15627
  body: AiSessionCreate & { scope?: 'owner' | 'public' } = {}) → `Promise<AiSession>`
15595
15628
 
15596
- **list**(collectionId: string,
15629
+ **list**(collectionId: string,
15597
15630
  params?: { appId?: string; limit?: number }) → `Promise<`
15598
15631
  List the signed-in consumer's own ('owner') sessions — requires an authKit bearer.
15599
15632
 
15600
15633
  **get**(collectionId: string, id: string) → `Promise<AiSession>`
15601
15634
  List the signed-in consumer's own ('owner') sessions — requires an authKit bearer.
15602
15635
 
15603
- **append**(collectionId: string,
15604
- id: string,
15605
- items: ResponseInputItem[],
15636
+ **append**(collectionId: string,
15637
+ id: string,
15638
+ items: ResponseInputItem[],
15606
15639
  opts?: { usage?: Record<string, any> }) → `Promise<AiSession>`
15607
15640
  List the signed-in consumer's own ('owner') sessions — requires an authKit bearer.
15608
15641
 
@@ -15625,7 +15658,7 @@ Reset rate limit for a user
15625
15658
  One of your app's declared channels (manifest `realtime.channels`). ```ts const draw = realtime.channel({ collectionId, appId }, "draw") const off = draw.subscribe("status", (m) => setStatus(m.data)) await draw.publish("status", { phase: "spinning" }) // if the channel lets this viewer publish ```
15626
15659
 
15627
15660
  **onChange**(scope: RealtimeScope, filter: RealtimeChangeFilter, onChangeFn: (change: RealtimeChangeEvent) → `void`
15628
- Something changed: refetch it. IDs only — never data. Admins of the collection see every change; everyone else sees changes to public things (public app records, products). Filter by `type` ('product' | 'proof' | 'asset' | 'record' | 'collection' | 'collection.apps' | 'settings'), `id`, `appId`, `recordType`, `productId`, `proofId`. ```ts const off = realtime.onChange({ collectionId }, { type: "record", appId, recordType: "entry" }, () => refetch()) ```
15661
+ Something changed: refetch it. IDs only — never data. Admins of the collection see every change; everyone else sees changes to public things (public app records, products). Filter by `type` ('product' | 'proof' | 'asset' | 'record' | 'collection' | 'collection.apps' | 'settings'), `id`, `appId`, `recordType`, `productId`, `proofId`. A change with no `id` means many things of that type changed (an import): a `{ type, id }` filter hears it too, so check `change.id` before assuming it is yours. ```ts const off = realtime.onChange({ collectionId }, { type: "record", appId, recordType: "entry" }, () => refetch()) ```
15629
15662
 
15630
15663
  **onStaffChange**(scope: RealtimeScope & { appId: string }, filter: RealtimeChangeFilter, onChangeFn: (change: RealtimeChangeEvent) → `void`
15631
15664
  Something this APP works on changed: one of its work orders, a container or stock it moved, or one of its own records. For the people who use the app, admins or not: someone hears these when they are in one of the app's user groups (the ones its server functions are limited to, or `realtime.staff` in its manifest), and so does a collection admin. IDs only — refetch through your own API. Types: 'workOrder' (`id`, `appId`), 'container' (`id`, `kind` = its container type), 'stock' (`id` = the container, `productId`), 'record' (`id`, `recordType`). Filter as with `onChange`; an empty filter hears them all. ```ts // A production app's screens refetch when anything on the floor changes. useEffect(() => realtime.onStaffChange({ collectionId, appId }, {}, () => queryClient.invalidateQueries()), [collectionId, appId]) ```
@@ -15666,39 +15699,39 @@ Soft-delete a secret. DELETE /secrets/:ref
15666
15699
 
15667
15700
  ### segments
15668
15701
 
15669
- **create**(collectionId: string,
15702
+ **create**(collectionId: string,
15670
15703
  body: Omit<SegmentRecord, 'id' | 'collectionId' | 'createdAt'>) → `Promise<SegmentRecord>`
15671
15704
 
15672
- **list**(collectionId: string,
15705
+ **list**(collectionId: string,
15673
15706
  query: ListSegmentsQuery = {}) → `Promise<ListResult<SegmentRecord>>`
15674
15707
  The collection's segments, a page at a time. Filter by the app that owns them (`appId`) or by `filterType`. ```typescript let page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50 }) page.items // SegmentRecord[] while (page.nextCursor) page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50, cursor: page.nextCursor }) ```
15675
15708
 
15676
- **get**(collectionId: string,
15709
+ **get**(collectionId: string,
15677
15710
  id: string) → `Promise<SegmentRecord>`
15678
15711
  The collection's segments, a page at a time. Filter by the app that owns them (`appId`) or by `filterType`. ```typescript let page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50 }) page.items // SegmentRecord[] while (page.nextCursor) page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50, cursor: page.nextCursor }) ```
15679
15712
 
15680
- **update**(collectionId: string,
15681
- id: string,
15713
+ **update**(collectionId: string,
15714
+ id: string,
15682
15715
  body: Partial<Omit<SegmentRecord, 'id' | 'collectionId' | 'createdAt'>>) → `Promise<SegmentRecord>`
15683
15716
  The collection's segments, a page at a time. Filter by the app that owns them (`appId`) or by `filterType`. ```typescript let page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50 }) page.items // SegmentRecord[] while (page.nextCursor) page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50, cursor: page.nextCursor }) ```
15684
15717
 
15685
- **remove**(collectionId: string,
15718
+ **remove**(collectionId: string,
15686
15719
  id: string) → `Promise<void>`
15687
15720
  The collection's segments, a page at a time. Filter by the app that owns them (`appId`) or by `filterType`. ```typescript let page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50 }) page.items // SegmentRecord[] while (page.nextCursor) page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50, cursor: page.nextCursor }) ```
15688
15721
 
15689
- **calculate**(collectionId: string,
15722
+ **calculate**(collectionId: string,
15690
15723
  id: string) → `Promise<SegmentCalculateResult>`
15691
15724
  The collection's segments, a page at a time. Filter by the app that owns them (`appId`) or by `filterType`. ```typescript let page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50 }) page.items // SegmentRecord[] while (page.nextCursor) page = await segments.list('coll_123', { filterType: 'dynamic', limit: 50, cursor: page.nextCursor }) ```
15692
15725
 
15693
- **recipients**(collectionId: string,
15694
- id: string,
15726
+ **recipients**(collectionId: string,
15727
+ id: string,
15695
15728
  query: ListOptions = {}) → `Promise<SegmentRecipientsResponse>`
15696
15729
  The contacts in a segment, a page at a time. `count` is how many there are in all. ```typescript const page = await segments.recipients('coll_123', 'seg_1', { limit: 100 }) page.items // Recipient[] page.count // total in the segment page.nextCursor // pass back as `cursor` for the next page; null on the last ```
15697
15730
 
15698
15731
  ### serviceAccounts
15699
15732
 
15700
- **list**(collectionId: string) → `Promise<ServiceAccountList>`
15701
- The service accounts that work on this collection — its own (`home: true`, with `alsoOn`) and other collections' (`home: false`, with `homeCollection`) — never their keys, and the access levels that can be given (`access`). All of them in one answer: `nextCursor` is always null. GET /service-accounts ```typescript const { items, access } = await serviceAccounts.list('coll_123') items // ServiceAccount[] access // ["User", "Reporter", "Assigner", "Admin"] ```
15733
+ **list**(collectionId: string, options: ListOptions = {}) → `Promise<ServiceAccountList>`
15734
+ The service accounts that work on this collection — its own (`home: true`, with `alsoOn`) and other collections' (`home: false`, with `homeCollection`) — never their keys, and the access levels that can be given (`access`). A page at a time (`limit` and `cursor`; 50 unless you say otherwise). GET /service-accounts ```typescript let page = await serviceAccounts.list('coll_123') page.items // ServiceAccount[] page.access // ["User", "Reporter", "Assigner", "Admin"] while (page.nextCursor) page = await serviceAccounts.list('coll_123', { cursor: page.nextCursor }) ```
15702
15735
 
15703
15736
  **create**(collectionId: string, input: CreateServiceAccountInput) → `Promise<CreateServiceAccountResult>`
15704
15737
  Make a service account → `{ serviceAccount, key }`. Show the key once — it can't be read again. You can't give it more access than you have. POST /service-accounts
@@ -15732,9 +15765,9 @@ List sessions, most-recently-active first (optionally filtered by app).
15732
15765
  **get**(collectionId: string, id: string) → `Promise<AiSession>`
15733
15766
  Get one session, including its full transcript.
15734
15767
 
15735
- **append**(collectionId: string,
15736
- id: string,
15737
- items: ResponseInputItem[],
15768
+ **append**(collectionId: string,
15769
+ id: string,
15770
+ items: ResponseInputItem[],
15738
15771
  opts?: { usage?: Record<string, any> }) → `Promise<AiSession>`
15739
15772
  Append Responses items (input/output/tool) to a session — the manual-persistence path.
15740
15773
 
@@ -15746,8 +15779,8 @@ Archive (soft-delete) a session.
15746
15779
  **config**(collectionId: string) → `Promise<ShopPublicConfig>`
15747
15780
  What a shop front shows: currency, the seller's details (UK law: shown before paying), shipping rates, policies, and `ready` (false until the shop can take payments).
15748
15781
 
15749
- **products**(collectionId: string, params?: { productIds?: string[] }) → `Promise<ListResult<ShopProduct> &`
15750
- What is for sale, in the shop's currency, with stock (`inStock`, `available`) and whether the buyer must sign in first (`needsSignIn`: a proof or access goes to an account). Everything for sale comes in one answer (`nextCursor` is always null), with the shop's `currency` beside the list. ```typescript const { items, currency } = await shop.products(collectionId) items.map((p) => `${p.name}: ${formatMoney(p.amount, p.currency)}${p.inStock ? '' : ' (sold out)'}`) ```
15782
+ **products**(collectionId: string, params?: ListOptions & { productIds?: string[] }) → `Promise<ListResult<ShopProduct> &`
15783
+ What is for sale, in the shop's currency, with stock (`inStock`, `available`) and whether the buyer must sign in first (`needsSignIn`: a proof or access goes to an account). A page at a time: page with `limit` (50 unless you say) and `cursor`. The shop's `currency` comes beside the list. Pass `productIds` for just those products. ```typescript let page = await shop.products(collectionId, { limit: 50 }) page.items.map((p) => `${p.name}: ${formatMoney(p.amount, p.currency)}${p.inStock ? '' : ' (sold out)'}`) while (page.nextCursor) page = await shop.products(collectionId, { limit: 50, cursor: page.nextCursor }) ```
15751
15784
 
15752
15785
  **checkout**(collectionId: string, input: ShopCheckoutInput) → `Promise<ShopCheckoutResult>`
15753
15786
  Start paying: the server prices the basket, holds the stock and returns Stripe's checkout page. Send the buyer to `checkoutUrl`. Signed-in buyers' orders are theirs (`shop.myOrders`). ```typescript const { checkoutUrl } = await shop.checkout(collectionId, { lines: [{ productId: 'soap', quantity: 2 }], shippingRateId: 'std', successUrl: `${location.origin}/thanks`, // ?session_id= is added cancelUrl: `${location.origin}/basket`, }) location.href = checkoutUrl ``` `DIGITAL_CONSENT_REQUIRED`, `INVALID_INPUT` (e.g. a return page on another site), `PAYMENT_UNAVAILABLE` (nothing was charged)
@@ -15815,14 +15848,14 @@ Invoke a skill by name with structured input — the app-facing verb; no prompt-
15815
15848
 
15816
15849
  ### subscriptions
15817
15850
 
15818
- **plans**(collectionId: string) → `Promise<ListResult<PublicPlan>>`
15819
- Plans open to new members, each with its prices (monthly, yearly, one-off). All of them in one answer: `nextCursor` is always null. ```typescript const { items: plans } = await subscriptions.plans(collectionId) plans.map((p) => p.prices.map((price) => subscriptions.describePrice(price))) ```
15851
+ **plans**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<PublicPlan>>`
15852
+ Plans open to new members, each with its prices (monthly, yearly, one-off), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await subscriptions.plans(collectionId, { limit: 50 }) page.items.map((p) => p.prices.map((price) => subscriptions.describePrice(price))) while (page.nextCursor) page = await subscriptions.plans(collectionId, { limit: 50, cursor: page.nextCursor }) ```
15820
15853
 
15821
15854
  **start**(collectionId: string, input: SubscriptionStartInput) → `Promise<SubscriptionStartResult>`
15822
15855
  Join a plan: Stripe's checkout page for the chosen price. Send them to `checkoutUrl`. Signed in only (a membership belongs to an account). The membership exists once Stripe confirms the payment. ```typescript const { items: plans } = await subscriptions.plans(collectionId) const yearly = plans[0].prices.find((p) => p.interval === 'year') const { checkoutUrl } = await subscriptions.start(collectionId, { priceId: yearly.id, successUrl: `${location.origin}/welcome`, cancelUrl: `${location.origin}/join`, }) location.href = checkoutUrl ```
15823
15856
 
15824
- **mine**(collectionId: string) → `Promise<ListResult<MySubscription>>`
15825
- The signed-in member's memberships, newest first (ended ones too: check `live`). All of them in one answer: `nextCursor` is always null. ```typescript const { items } = await subscriptions.mine(collectionId) const current = items.find((s) => s.live) ```
15857
+ **mine**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<MySubscription>>`
15858
+ The signed-in member's memberships, newest first (ended ones too: check `live`), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await subscriptions.mine(collectionId) const current = page.items.find((s) => s.live) while (page.nextCursor) page = await subscriptions.mine(collectionId, { cursor: page.nextCursor }) ```
15826
15859
 
15827
15860
  **cancel**(collectionId: string, subscriptionId: string) → `Promise<MySubscription>`
15828
15861
  Cancel: it ends at the end of the paid period, and access stays until then. A one-off plan or a staff grant ends now. Undo with `resume` before the period ends.
@@ -15928,7 +15961,7 @@ List tags with optional filters, a page at a time (admin). ```typescript // Tags
15928
15961
 
15929
15962
  **byRef**(collectionId: string,
15930
15963
  params: ReverseTagLookupParams) → `Promise<ListResult<Tag>>`
15931
- Reverse lookup — find all tags linked to a given object (admin). Uses a compound index on `(orgId, refType, refId)` on the per-org shard. No embed support on the admin side. ```typescript const { items: linked } = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', }) ```
15964
+ Reverse lookup — find all tags linked to a given object (admin). Uses a compound index on `(orgId, refType, refId)` on the per-org shard. No embed support on the admin side. ```typescript let page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50 }) while (page.nextCursor) { page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50, cursor: page.nextCursor }) } ```
15932
15965
 
15933
15966
  **resolveTag**(tagId: string) → `Promise<TagIndexEntry>`
15934
15967
  Global tag resolve — returns `{ tagId, collectionId }` only. Use this **only** when you have a raw `tagId` and do not yet know which collection it belongs to. Queries the shared `tag_index` shard. Once `collectionId` is resolved, call `publicGetByCollection` for full data. > The global `/public/tags/by-ref` endpoint has been removed. > Use the collection-scoped `publicByRef` instead. ```typescript // Step 1: resolve collection const { collectionId } = await tags.resolveTag('NFC-001') // Step 2: full lookup with embedded data const { tag, embedded } = await tags.publicGetByCollection( collectionId, 'NFC-001', 'product,proof' ) ```
@@ -15940,78 +15973,78 @@ Single tag lookup with optional embedded data (public). `GET /public/collection/
15940
15973
 
15941
15974
  **lookupTags**(collectionId: string,
15942
15975
  data: LookupTagsRequest) → `Promise<TagLookupResponse>`
15943
- Batch tag lookup via POST (public). `POST /public/collection/:collectionId/tags/lookup` Tags not belonging to this collection are filtered out silently. Returns deduplicated embedded objects alongside the tag array. ```typescript const { items, count, embedded } = await tags.lookupTags('coll_123', { tagIds: ['NFC-001', 'NFC-002', 'NFC-003'], embed: 'product,proof', }) ```
15976
+ Batch tag lookup via POST (public). `POST /public/collection/:collectionId/tags/lookup` Tags not belonging to this collection are filtered out silently. Returns deduplicated embedded objects alongside the tag array. the tags found, a page at a time ```typescript const tagIds = ['NFC-001', 'NFC-002', 'NFC-003'] // Every tag found comes back in the one answer: a look-up is never paged. const { items, embedded } = await tags.lookupTags('coll_123', { tagIds, embed: 'product,proof' }) ```
15944
15977
 
15945
15978
  **lookupTagsQuery**(collectionId: string,
15946
15979
  params: LookupTagsQueryRequest) → `Promise<TagLookupResponse>`
15947
- Batch tag lookup via GET (public). `GET /public/collection/:collectionId/tags/lookup?tagIds=NFC-001,NFC-002&embed=product` ```typescript const { items, embedded } = await tags.lookupTagsQuery('coll_123', { tagIds: 'NFC-001,NFC-002', embed: 'product', }) ```
15980
+ Batch tag lookup via GET (public). `GET /public/collection/:collectionId/tags/lookup?tagIds=NFC-001,NFC-002&embed=product` the tags found, a page at a time ```typescript const { items, embedded } = await tags.lookupTagsQuery('coll_123', { tagIds: 'NFC-001,NFC-002', embed: 'product', }) ```
15948
15981
 
15949
15982
  **publicByRef**(collectionId: string,
15950
15983
  params: ReverseTagLookupParams) → `Promise<ByRefResponse>`
15951
- Reverse lookup by ref via GET (public). `GET /public/collection/:collectionId/tags/by-ref?refType=container&refId=<uuid>&embed=ref` ```typescript const { items: linked, embedded } = await tags.publicByRef('coll_123', { refType: 'container', refId: 'container-uuid', embed: 'container', }) const container = embedded.containers?.[containerId] ```
15984
+ Reverse lookup by ref via GET (public). `GET /public/collection/:collectionId/tags/by-ref?refType=container&refId=<uuid>&embed=ref` ```typescript const { items: linked, embedded, nextCursor } = await tags.publicByRef('coll_123', { refType: 'container', refId: 'container-uuid', embed: 'container', limit: 50, }) const container = embedded.containers?.[containerId] ```
15952
15985
 
15953
15986
  **publicByRefPost**(collectionId: string,
15954
15987
  data: ByRefRequest) → `Promise<ByRefResponse>`
15955
- Reverse lookup by ref via POST (public). `POST /public/collection/:collectionId/tags/by-ref` ```typescript const { items: linked, embedded } = await tags.publicByRefPost('coll_123', { refType: 'container', refId: 'container-uuid', embed: 'container', }) ```
15988
+ Reverse lookup by ref via POST (public). `POST /public/collection/:collectionId/tags/by-ref` ```typescript const { items: linked, embedded, nextCursor } = await tags.publicByRefPost('coll_123', { refType: 'container', refId: 'container-uuid', embed: 'container', limit: 50, }) ```
15956
15989
 
15957
15990
  ### template
15958
15991
 
15959
- **getAll**(collectionId: string) → `Promise<ListResult<Template>>`
15960
- Every template in the collection (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAll('coll_123') items // Template[] ```
15992
+ **getAll**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<Template>>`
15993
+ The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await template.getAll('coll_123', { limit: 100 }) page.items // Template[] while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor }) ```
15961
15994
 
15962
15995
  **get**(collectionId: string, templateId: string) → `Promise<Template>`
15963
- Every template in the collection (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAll('coll_123') items // Template[] ```
15996
+ The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await template.getAll('coll_123', { limit: 100 }) page.items // Template[] while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor }) ```
15964
15997
 
15965
15998
  **create**(collectionId: string, data: TemplateInput) → `Promise<Template>`
15966
- Every template in the collection (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAll('coll_123') items // Template[] ```
15999
+ The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await template.getAll('coll_123', { limit: 100 }) page.items // Template[] while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor }) ```
15967
16000
 
15968
16001
  **update**(collectionId: string,
15969
16002
  templateId: string,
15970
16003
  data: TemplateUpdate) → `Promise<Template>`
15971
- Every template in the collection (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAll('coll_123') items // Template[] ```
16004
+ The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await template.getAll('coll_123', { limit: 100 }) page.items // Template[] while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor }) ```
15972
16005
 
15973
16006
  **del**(collectionId: string, templateId: string) → `Promise<Template>`
15974
- Every template in the collection (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAll('coll_123') items // Template[] ```
16007
+ The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await template.getAll('coll_123', { limit: 100 }) page.items // Template[] while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor }) ```
15975
16008
 
15976
16009
  **uploadAsset**(collectionId: string,
15977
16010
  templateId: string,
15978
16011
  file: File | Blob) → `Promise<`
15979
- Every template in the collection (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAll('coll_123') items // Template[] ```
16012
+ The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await template.getAll('coll_123', { limit: 100 }) page.items // Template[] while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor }) ```
15980
16013
 
15981
- **getAllowed**(collectionId: string) → `Promise<ListResult<TemplatePublic>>`
15982
- The collection's templates that may be used publicly, in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAllowed('coll_123') items // TemplatePublic[] ```
16014
+ **getAllowed**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<TemplatePublic>>`
16015
+ The collection's templates that may be used publicly, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await template.getAllowed('coll_123', { limit: 100 }) items // TemplatePublic[] ```
15983
16016
 
15984
16017
  **getPublic**(collectionId: string, templateId: string) → `Promise<TemplatePublic>`
15985
- The collection's templates that may be used publicly, in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAllowed('coll_123') items // TemplatePublic[] ```
16018
+ The collection's templates that may be used publicly, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await template.getAllowed('coll_123', { limit: 100 }) items // TemplatePublic[] ```
15986
16019
 
15987
16020
  **getGlobal**(templateId: string) → `Promise<TemplatePublic>`
15988
- The collection's templates that may be used publicly, in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAllowed('coll_123') items // TemplatePublic[] ```
16021
+ The collection's templates that may be used publicly, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await template.getAllowed('coll_123', { limit: 100 }) items // TemplatePublic[] ```
15989
16022
 
15990
- **getAllowedGlobal**(collectionId: string) → `Promise<ListResult<TemplatePublic>>`
15991
- The global templates this collection may use, in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAllowedGlobal('coll_123') items // TemplatePublic[] ```
16023
+ **getAllowedGlobal**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<TemplatePublic>>`
16024
+ The global templates this collection may use, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await template.getAllowedGlobal('coll_123', { limit: 100 }) items // TemplatePublic[] ```
15992
16025
 
15993
16026
  **render**(collectionId: string,
15994
16027
  templateId: string,
15995
16028
  body: TemplateRenderRequest) → `Promise<TemplateRenderResponse>`
15996
- The global templates this collection may use, in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAllowedGlobal('coll_123') items // TemplatePublic[] ```
16029
+ The global templates this collection may use, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await template.getAllowedGlobal('coll_123', { limit: 100 }) items // TemplatePublic[] ```
15997
16030
 
15998
16031
  **renderSource**(collectionId: string,
15999
16032
  body: TemplateRenderSourceRequest) → `Promise<TemplateRenderSourceResponse>`
16000
- The global templates this collection may use, in one answer: `nextCursor` is always null. ```typescript const { items } = await template.getAllowedGlobal('coll_123') items // TemplatePublic[] ```
16033
+ The global templates this collection may use, 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript const { items, nextCursor } = await template.getAllowedGlobal('coll_123', { limit: 100 }) items // TemplatePublic[] ```
16001
16034
 
16002
16035
  ### tools
16003
16036
 
16004
- **run**(collectionId: string,
16005
- name: K,
16006
- args: AiToolArgsMap[K],) → `Promise<ToolRunResult>
16007
- export async function run<T = any>(
16008
- collectionId: string,
16009
- name: string,
16010
- args?: Record<string, any>,
16011
- ): Promise<ToolRunResult<T>>
16012
- export async function run(
16013
- collectionId: string,
16014
- name: string,
16037
+ **run**(collectionId: string,
16038
+ name: K,
16039
+ args: AiToolArgsMap[K],) → `Promise<ToolRunResult>
16040
+ export async function run<T = any>(
16041
+ collectionId: string,
16042
+ name: string,
16043
+ args?: Record<string, any>,
16044
+ ): Promise<ToolRunResult<T>>
16045
+ export async function run(
16046
+ collectionId: string,
16047
+ name: string,
16015
16048
  args: Record<string, any> =`
16016
16049
  Invoke ONE built-in server tool directly — no model in the loop. This is the "direct code" caller of the orchestration-neutral tool registry: the SAME tools the agent loop and the Responses `server_tools` path run, but called as a plain, typed, deterministic API. A front end can use it two ways: (1) call a tool straight as an API (e.g. `pdf.render` / `pdf.extract` behind a PDF UX), or (2) drive its OWN agent loop and execute each model tool-call here. Capability-gated server-side to the caller's grants (same blast-radius rules as the agent loop). POST /admin/collection/:collectionId/ai/tools/:name/run
16017
16050
 
@@ -16075,7 +16108,7 @@ Admin: replace the site's translation rules. They apply to new translations from
16075
16108
 
16076
16109
  ### tts
16077
16110
 
16078
- **generate**(collectionId: string,
16111
+ **generate**(collectionId: string,
16079
16112
  request: TTSRequest) → `Promise<Blob>`
16080
16113
  Generate text-to-speech audio
16081
16114
 
@@ -16092,8 +16125,8 @@ Set user's config blob for an app. ```typescript await userAppData.setConfig('al
16092
16125
  **deleteConfig**(appId: string) → `Promise<void>`
16093
16126
  Delete user's config blob for an app. ```typescript await userAppData.deleteConfig('allergy-tracker'); ```
16094
16127
 
16095
- **list**(appId: string) → `Promise<ListResult<any>>`
16096
- List all user's data items for an app. is not paged, so `nextCursor` is always `null`. ```typescript const { items: beds } = await userAppData.list('garden-planner'); // beds: [{ id: 'bed-1', name: 'Vegetables', ... }, { id: 'bed-2', ... }] ```
16128
+ **list**(appId: string, options: ListOptions = {}) → `Promise<ListResult<any>>`
16129
+ List the user's data items for an app, a page at a time. `nextCursor` back as `cursor` for the next page (null on the last). ```typescript let page = await userAppData.list('garden-planner', { limit: 50 }); // page.items: [{ id: 'bed-1', name: 'Vegetables', ... }, { id: 'bed-2', ... }] while (page.nextCursor) page = await userAppData.list('garden-planner', { limit: 50, cursor: page.nextCursor }); ```
16097
16130
 
16098
16131
  **get**(appId: string, itemId: string) → `Promise<any>`
16099
16132
  Get a specific user data item by ID. ```typescript const bed = await userAppData.get('garden-planner', 'bed-1'); // Returns: { id: 'bed-1', name: 'Vegetable Bed', plants: [...] } ```
@@ -16109,8 +16142,8 @@ Delete a user data item by ID. ```typescript await userAppData.remove('garden-pl
16109
16142
  **mine**(collectionId: string) → `Promise<MyUserGroups>`
16110
16143
  The signed-in person's own user groups in this collection. Not signed in → both lists empty. Nobody can ask about anyone else with this. ```typescript const { userGroups: mine } = await userGroups.mine('coll_123') const canRelease = mine.includes('qc-controller') ```
16111
16144
 
16112
- **list**(collectionId: string) → `Promise<ListResult<UserGroup>>`
16113
- Every user group in the collection (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await userGroups.list('coll_123') items.map((g) => g.name) ```
16145
+ **list**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<UserGroup>>`
16146
+ The collection's user groups (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await userGroups.list('coll_123', { limit: 50 }) page.items.map((g) => g.name) while (page.nextCursor) page = await userGroups.list('coll_123', { limit: 50, cursor: page.nextCursor }) ```
16114
16147
 
16115
16148
  **get**(collectionId: string, userGroupId: string) → `Promise<UserGroup>`
16116
16149
  One user group (admin).
@@ -16124,8 +16157,8 @@ Change a user group (admin): its name, description, or anything else you keep on
16124
16157
  **remove**(collectionId: string, userGroupId: string) → `Promise<UserGroup>`
16125
16158
  Delete a user group (admin). Its members lose whatever it allowed.
16126
16159
 
16127
- **members**(collectionId: string, userGroupId: string) → `Promise<ListResult<UserGroupMember>>`
16128
- The people in a user group, with name and email (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await userGroups.members('coll_123', qc.id) items // [{ uid, name, email }] ```
16160
+ **members**(collectionId: string, userGroupId: string, options: ListOptions = {}) → `Promise<ListResult<UserGroupMember>>`
16161
+ The people in a user group, with name and email (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await userGroups.members('coll_123', qc.id, { limit: 50 }) page.items // [{ uid, name, email }] while (page.nextCursor) page = await userGroups.members('coll_123', qc.id, { limit: 50, cursor: page.nextCursor }) ```
16129
16162
 
16130
16163
  **addMember**(collectionId: string, userGroupId: string, who: AddUserGroupMemberRequest) → `Promise<UserGroup>`
16131
16164
  Add one person (admin), by user id or by email. By email, the person is found in the collection's logins or added to them (no welcome email is sent). Adding someone who is already in changes nothing. ```typescript await userGroups.addMember('coll_123', qc.id, { email: 'sam@example.com', name: 'Sam' }) ```
@@ -16134,10 +16167,10 @@ Add one person (admin), by user id or by email. By email, the person is found in
16134
16167
  Remove one person (admin).
16135
16168
 
16136
16169
  **history**(collectionId: string, params: UserGroupHistoryParams = {}) → `Promise<ListResult<UserGroupChange>>`
16137
- What changed, newest first (admin): user groups created, renamed and deleted, and every person added or removed, each with the admin who did it (`actorId`) and when (`at`). Give `userGroupId` for one user group, `userId` for everything about one person, or neither for the whole collection. Covers the last 30 days unless you give `from` / `to` (at most 400 days). Takes about a second. It has no further pages (`nextCursor` is always null): ask for more with `limit`, or narrow the dates. ```typescript const { items } = await userGroups.history('coll_123', { userId: 'uid_1' }) // items: [{ at, type: 'usergroup.member-added', actorId: 'uid_admin', data: { key: 'qc-controllers', userId: 'uid_1', … } }] ```
16170
+ What changed, newest first (admin): user groups created, renamed and deleted, and every person added or removed, each with the admin who did it (`actorId`) and when (`at`). Give `userGroupId` for one user group, `userId` for everything about one person, or neither for the whole collection. Covers the last 30 days unless you give `from` / `to` (at most 400 days). Takes about a second. A page at a time: `limit` says how many (default 100, at most 1000); pass `nextCursor` back as `cursor` for the next page. ```typescript let page = await userGroups.history('coll_123', { userId: 'uid_1', from: '2026-11-01T00:00:00Z' }) // page.items: [{ at, type: 'usergroup.member-added', actorId: 'uid_admin', data: { key: 'qc-controllers', userId: 'uid_1', … } }] while (page.nextCursor) { page = await userGroups.history('coll_123', { userId: 'uid_1', from: '2026-11-01T00:00:00Z', cursor: page.nextCursor }) } ```
16138
16171
 
16139
- **ofUser**(collectionId: string, userId: string) → `Promise<ListResult<UserGroupRef>>`
16140
- The user groups one person is in (admin), in one answer: `nextCursor` is always null. ```typescript const { items } = await userGroups.ofUser('coll_123', 'uid_1') items // [{ id, key, name }] ```
16172
+ **ofUser**(collectionId: string, userId: string, options: ListOptions = {}) → `Promise<ListResult<UserGroupRef>>`
16173
+ The user groups one person is in (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await userGroups.ofUser('coll_123', 'uid_1') page.items // [{ id, key, name }] while (page.nextCursor) page = await userGroups.ofUser('coll_123', 'uid_1', { cursor: page.nextCursor }) ```
16141
16174
 
16142
16175
  ### variant
16143
16176
 
@@ -16147,8 +16180,9 @@ The user groups one person is in (admin), in one answer: `nextCursor` is always
16147
16180
  Get a single variant by ID for a collection and product (admin only).
16148
16181
 
16149
16182
  **list**(collectionId: string,
16150
- productId: string) → `Promise<ListResult<VariantResponse>>`
16151
- List all variants for a collection and product (admin only). All of them come in one answer: `nextCursor` is always null. ```typescript const { items } = await variant.list('coll_123', 'prod_456') items.map((v) => v.name) ```
16183
+ productId: string,
16184
+ options: ListOptions = {}) → `Promise<ListResult<VariantResponse>>`
16185
+ List the variants for a collection and product (admin only), 50 at a time unless you give a `limit` (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one. ```typescript let page = await variant.list('coll_123', 'prod_456', { limit: 100 }) page.items.map((v) => v.name) while (page.nextCursor) page = await variant.list('coll_123', 'prod_456', { limit: 100, cursor: page.nextCursor }) ```
16152
16186
 
16153
16187
  **create**(collectionId: string,
16154
16188
  productId: string,
@@ -16200,14 +16234,14 @@ Speak text
16200
16234
  **addLinks**(collectionId: string, ref: WalletPassRef) → `Promise<`
16201
16235
  "Add to Wallet" links for the signed-in person's pass about `ref` (made on first ask for a booking or a membership card). ```typescript const { pass } = await wallet.addLinks('coll_123', { type: 'booking', id: booking.id }) if (pass.links.apple) appleButton.href = pass.links.apple if (pass.links.google) googleButton.href = pass.links.google ```
16202
16236
 
16203
- **mine**(collectionId: string) → `Promise<ListResult<WalletPassSummary>>`
16204
- The signed-in person's active passes on this site, with their links. All of them in one answer: `nextCursor` is always null. ```typescript const { items } = await wallet.mine('coll_123') items.map((pass) => pass.links.google) ```
16237
+ **mine**(collectionId: string, options: ListOptions = {}) → `Promise<ListResult<WalletPassSummary>>`
16238
+ The signed-in person's active passes on this site, with their links, a page at a time. Page with `limit` (50 unless you say) and `cursor`. ```typescript let page = await wallet.mine('coll_123') page.items.map((pass) => pass.links.google) while (page.nextCursor) page = await wallet.mine('coll_123', { cursor: page.nextCursor }) ```
16205
16239
 
16206
16240
  **status**(collectionId: string) → `Promise<`
16207
16241
  Which wallets are switched on (admin).
16208
16242
 
16209
- **list**(collectionId: string, query: { refType?: string; refId?: string; contactId?: string; includeVoided?: boolean }) → `Promise<ListResult<WalletPass>>`
16210
- Passes for one thing (`refType` + `refId`) or one person (`contactId`) (admin). All of them in one answer: `nextCursor` is always null. Voided passes are left out unless `includeVoided` is true. ```typescript const { items } = await wallet.list('coll_123', { refType: 'event', refId: eventId }) items // WalletPass[] ```
16243
+ **list**(collectionId: string, query: ListOptions & { refType?: string; refId?: string; contactId?: string; includeVoided?: boolean }) → `Promise<ListResult<WalletPass>>`
16244
+ Passes for one thing (`refType` + `refId`) or one person (`contactId`) (admin), a page at a time. Page with `limit` (50 unless you say) and `cursor`. Voided passes are left out unless `includeVoided` is true. ```typescript let page = await wallet.list('coll_123', { refType: 'event', refId: eventId, limit: 50 }) page.items // WalletPass[] while (page.nextCursor) page = await wallet.list('coll_123', { refType: 'event', refId: eventId, limit: 50, cursor: page.nextCursor }) ```
16211
16245
 
16212
16246
  **get**(collectionId: string, passId: string) → `Promise<`
16213
16247
  One pass, with its links (admin).