@proveanything/smartlinks 1.0.64 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API_SUMMARY.md +671 -21
- package/README.md +43 -0
- package/dist/api/actions.d.ts +32 -0
- package/dist/api/actions.js +99 -0
- package/dist/api/broadcasts.d.ts +44 -0
- package/dist/api/broadcasts.js +105 -0
- package/dist/api/collection.d.ts +9 -1
- package/dist/api/collection.js +15 -2
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +4 -0
- package/dist/api/journeys.d.ts +8 -0
- package/dist/api/journeys.js +48 -0
- package/dist/api/segments.d.ts +13 -0
- package/dist/api/segments.js +60 -0
- package/dist/types/actions.d.ts +120 -0
- package/dist/types/actions.js +2 -0
- package/dist/types/analytics.d.ts +0 -0
- package/dist/types/analytics.js +3 -0
- package/dist/types/broadcasts.d.ts +111 -0
- package/dist/types/broadcasts.js +2 -0
- package/dist/types/common.d.ts +1 -0
- package/dist/types/common.js +2 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -0
- package/dist/types/journeys.d.ts +57 -0
- package/dist/types/journeys.js +2 -0
- package/dist/types/segments.d.ts +40 -0
- package/dist/types/segments.js +2 -0
- package/package.json +1 -1
package/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0 | Generated: 2025-12-18T21:46:20.895Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -8,25 +8,44 @@ This is a concise summary of all available API functions and types.
|
|
|
8
8
|
|
|
9
9
|
The Smartlinks SDK is organized into the following namespaces:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
11
|
+
— Core Data & Configuration —
|
|
12
|
+
- **collection** - Manage collections, settings, and identifiers for your workspace.
|
|
13
|
+
- **product** - Create and manage products within a collection; metadata, tags, media.
|
|
14
|
+
- **variant** - Manage product variants per product; includes serial number helpers.
|
|
15
|
+
- **asset** - Upload and manage media assets for collections, products, and proofs.
|
|
16
|
+
- **batch** - Group products into batches; manage serial number ranges and lookups.
|
|
17
|
+
- **crate** - Organize products in containers/crates for logistics and grouping.
|
|
18
|
+
- **form** - Build and manage dynamic forms used by apps and workflows.
|
|
19
|
+
- **appRecord** - Store and retrieve application-level records tied to a collection.
|
|
20
|
+
- **appConfiguration** - Read/write app configuration and scoped data (collection/product/proof).
|
|
21
|
+
|
|
22
|
+
— Identity & Access —
|
|
23
|
+
- **auth** - Admin authentication and account ops: login/logout, tokens, account info.
|
|
24
|
+
- **authKit** - End‑user auth flows (email/password, OAuth, phone); profiles and verification.
|
|
25
|
+
- **contact** - Manage customer contacts; CRUD, lookup, upsert, erase.
|
|
26
|
+
|
|
27
|
+
— Messaging & Audience —
|
|
28
|
+
- **comms** - Send notifications (push, email, wallet); templating, severity, delivery status.
|
|
29
|
+
- **broadcasts** - Define broadcast campaigns; append recipients/events; analytics and CRUD.
|
|
30
|
+
- **segments** - Define dynamic/static audience segments; estimate and list recipients; schedule calculations.
|
|
31
|
+
|
|
32
|
+
— Analytics & Events —
|
|
33
|
+
- **actions** - Log and analyze actions/outcomes; aggregates and actor lists; action definition CRUD.
|
|
34
|
+
|
|
35
|
+
— Automation —
|
|
36
|
+
- **journeys** - Configure automated flows triggered by events or schedules; steps, rules; full CRUD.
|
|
37
|
+
|
|
38
|
+
— NFC, Proofs & Claims —
|
|
39
|
+
- **nfc** - Claim and validate NFC tags; perform tag lookups.
|
|
40
|
+
- **proof** - Create, update, claim, and list product proofs (digital certificates).
|
|
41
|
+
- **claimSet** - Manage claim sets and tag assignments; queries, reports, and updates.
|
|
42
|
+
|
|
43
|
+
— AI & Utilities —
|
|
44
|
+
- **ai** - Generate content and images, search photos, chat, upload files, and cache.
|
|
45
|
+
- **serialNumber** - Assign, lookup, and manage serial numbers across scopes.
|
|
46
|
+
|
|
47
|
+
— Other —
|
|
48
|
+
- **attestation** - Functions for attestation operations
|
|
30
49
|
|
|
31
50
|
## HTTP Utilities
|
|
32
51
|
|
|
@@ -87,6 +106,189 @@ Sends a custom proxy message to the parent Smartlinks application when running i
|
|
|
87
106
|
|
|
88
107
|
## Types
|
|
89
108
|
|
|
109
|
+
### actions
|
|
110
|
+
|
|
111
|
+
**AdminByUserRequest** (interface)
|
|
112
|
+
```typescript
|
|
113
|
+
interface AdminByUserRequest {
|
|
114
|
+
userId?: string
|
|
115
|
+
contactId?: string
|
|
116
|
+
appId?: string
|
|
117
|
+
actionId?: string
|
|
118
|
+
broadcastId?: string
|
|
119
|
+
outcome?: string | null
|
|
120
|
+
from?: string
|
|
121
|
+
to?: string
|
|
122
|
+
limit?: number
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**AdminCountsByOutcomeRequest** (interface)
|
|
127
|
+
```typescript
|
|
128
|
+
interface AdminCountsByOutcomeRequest {
|
|
129
|
+
appId?: string
|
|
130
|
+
actionId?: string
|
|
131
|
+
from?: string
|
|
132
|
+
to?: string
|
|
133
|
+
limit?: number
|
|
134
|
+
dedupeLatest?: boolean
|
|
135
|
+
idField?: IdField
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**AdminActorIdsByActionRequest** (interface)
|
|
140
|
+
```typescript
|
|
141
|
+
interface AdminActorIdsByActionRequest {
|
|
142
|
+
actionId: string
|
|
143
|
+
idField?: IdField
|
|
144
|
+
outcome?: string | null
|
|
145
|
+
includeOutcome?: boolean
|
|
146
|
+
from?: string
|
|
147
|
+
to?: string
|
|
148
|
+
limit?: number
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**PublicCountsByOutcomeRequest** (interface)
|
|
153
|
+
```typescript
|
|
154
|
+
interface PublicCountsByOutcomeRequest {
|
|
155
|
+
appId: string
|
|
156
|
+
actionId: string
|
|
157
|
+
from?: string
|
|
158
|
+
to?: string
|
|
159
|
+
limit?: number
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**PublicByUserRequest** (interface)
|
|
164
|
+
```typescript
|
|
165
|
+
interface PublicByUserRequest {
|
|
166
|
+
appId: string
|
|
167
|
+
actionId: string
|
|
168
|
+
from?: string
|
|
169
|
+
to?: string
|
|
170
|
+
limit?: number
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**ActionEventRow** (interface)
|
|
175
|
+
```typescript
|
|
176
|
+
interface ActionEventRow {
|
|
177
|
+
orgId: string
|
|
178
|
+
timestamp: string
|
|
179
|
+
appId?: string
|
|
180
|
+
actionId?: string
|
|
181
|
+
broadcastId?: string
|
|
182
|
+
userId?: string
|
|
183
|
+
contactId?: string
|
|
184
|
+
outcome?: string | null
|
|
185
|
+
[k: string]: unknown
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**OutcomeCount** (interface)
|
|
190
|
+
```typescript
|
|
191
|
+
interface OutcomeCount {
|
|
192
|
+
outcome: string | null; count: number
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**ActorWithOutcome** (interface)
|
|
197
|
+
```typescript
|
|
198
|
+
interface ActorWithOutcome {
|
|
199
|
+
id: string; outcome: string | null
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**AppendActionBody** (interface)
|
|
204
|
+
```typescript
|
|
205
|
+
interface AppendActionBody {
|
|
206
|
+
userId?: string
|
|
207
|
+
contactId?: string
|
|
208
|
+
actionId: string
|
|
209
|
+
appId?: string
|
|
210
|
+
broadcastId?: string
|
|
211
|
+
outcome?: string
|
|
212
|
+
timestamp?: string
|
|
213
|
+
[k: string]: any
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**ActionPermissions** (interface)
|
|
218
|
+
```typescript
|
|
219
|
+
interface ActionPermissions {
|
|
220
|
+
allowOwnRead?: boolean
|
|
221
|
+
allowPublicSummary?: boolean
|
|
222
|
+
allowAuthenticatedSummary?: boolean
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**ActionRecord** (interface)
|
|
227
|
+
```typescript
|
|
228
|
+
interface ActionRecord {
|
|
229
|
+
id: string
|
|
230
|
+
collectionId: string
|
|
231
|
+
appId: string
|
|
232
|
+
permissions?: ActionPermissions
|
|
233
|
+
data?: {
|
|
234
|
+
display?: {
|
|
235
|
+
title?: string
|
|
236
|
+
description?: string
|
|
237
|
+
icon?: string
|
|
238
|
+
color?: string
|
|
239
|
+
}
|
|
240
|
+
actionType?: string
|
|
241
|
+
[key: string]: unknown
|
|
242
|
+
}
|
|
243
|
+
createdAt: string
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**ActionList** (interface)
|
|
248
|
+
```typescript
|
|
249
|
+
interface ActionList {
|
|
250
|
+
items: ActionRecord[]
|
|
251
|
+
limit: number
|
|
252
|
+
offset: number
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**CreateActionBody** (interface)
|
|
257
|
+
```typescript
|
|
258
|
+
interface CreateActionBody {
|
|
259
|
+
id: string
|
|
260
|
+
appId: string
|
|
261
|
+
permissions?: ActionPermissions
|
|
262
|
+
data?: Record<string, unknown>
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**UpdateActionBody** (interface)
|
|
267
|
+
```typescript
|
|
268
|
+
interface UpdateActionBody {
|
|
269
|
+
appId?: string
|
|
270
|
+
permissions?: ActionPermissions
|
|
271
|
+
data?: Record<string, unknown>
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**ListActionsQuery** (interface)
|
|
276
|
+
```typescript
|
|
277
|
+
interface ListActionsQuery {
|
|
278
|
+
appId?: string
|
|
279
|
+
limit?: number
|
|
280
|
+
offset?: number
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**ActorId** = `string`
|
|
285
|
+
|
|
286
|
+
**ActionQueryByUser** = `AdminByUserRequest`
|
|
287
|
+
|
|
288
|
+
**ActionCountsQuery** = `AdminCountsByOutcomeRequest`
|
|
289
|
+
|
|
290
|
+
**ActorIdsByActionQuery** = `AdminActorIdsByActionRequest`
|
|
291
|
+
|
|
90
292
|
### appConfiguration
|
|
91
293
|
|
|
92
294
|
**AppConfigurationResponse** (interface)
|
|
@@ -328,6 +530,174 @@ interface AuthKitConfig {
|
|
|
328
530
|
|
|
329
531
|
**BatchUpdateRequest** = `any`
|
|
330
532
|
|
|
533
|
+
### broadcasts
|
|
534
|
+
|
|
535
|
+
**BroadcastEvent** (interface)
|
|
536
|
+
```typescript
|
|
537
|
+
interface BroadcastEvent {
|
|
538
|
+
orgId: string
|
|
539
|
+
broadcastId: string
|
|
540
|
+
userId?: string
|
|
541
|
+
contactId?: string
|
|
542
|
+
channel?: string
|
|
543
|
+
timestamp: string
|
|
544
|
+
[k: string]: any
|
|
545
|
+
}
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
**BroadcastQueryByUser** (interface)
|
|
549
|
+
```typescript
|
|
550
|
+
interface BroadcastQueryByUser {
|
|
551
|
+
userId?: string
|
|
552
|
+
contactId?: string
|
|
553
|
+
from?: string
|
|
554
|
+
to?: string
|
|
555
|
+
limit?: number
|
|
556
|
+
}
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
**RecipientIdsQuery** (interface)
|
|
560
|
+
```typescript
|
|
561
|
+
interface RecipientIdsQuery {
|
|
562
|
+
broadcastId: string
|
|
563
|
+
idField?: IdField
|
|
564
|
+
from?: string
|
|
565
|
+
to?: string
|
|
566
|
+
limit?: number
|
|
567
|
+
}
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
**RecipientsWithoutActionQuery** (interface)
|
|
571
|
+
```typescript
|
|
572
|
+
interface RecipientsWithoutActionQuery {
|
|
573
|
+
broadcastId: string
|
|
574
|
+
actionId?: string
|
|
575
|
+
appId?: string
|
|
576
|
+
idField?: IdField
|
|
577
|
+
from?: string
|
|
578
|
+
to?: string
|
|
579
|
+
limit?: number
|
|
580
|
+
}
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
**RecipientsWithActionQuery** (interface)
|
|
584
|
+
```typescript
|
|
585
|
+
interface RecipientsWithActionQuery {
|
|
586
|
+
broadcastId: string
|
|
587
|
+
actionId?: string
|
|
588
|
+
appId?: string
|
|
589
|
+
outcome?: string
|
|
590
|
+
idField?: IdField
|
|
591
|
+
includeOutcome?: boolean
|
|
592
|
+
from?: string
|
|
593
|
+
to?: string
|
|
594
|
+
limit?: number
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
**RecipientWithOutcome** (interface)
|
|
599
|
+
```typescript
|
|
600
|
+
interface RecipientWithOutcome {
|
|
601
|
+
id: string; outcome: string
|
|
602
|
+
}
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
**AppendBroadcastBody** (interface)
|
|
606
|
+
```typescript
|
|
607
|
+
interface AppendBroadcastBody {
|
|
608
|
+
broadcastId: string
|
|
609
|
+
userId?: string
|
|
610
|
+
contactId?: string
|
|
611
|
+
channel?: string
|
|
612
|
+
timestamp?: string
|
|
613
|
+
[k: string]: any
|
|
614
|
+
}
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
**AppendBroadcastBulkBody** (interface)
|
|
618
|
+
```typescript
|
|
619
|
+
interface AppendBroadcastBulkBody {
|
|
620
|
+
params: { broadcastId: string; [k: string]: any }
|
|
621
|
+
ids: string[]
|
|
622
|
+
idField?: IdField
|
|
623
|
+
}
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
**AppendResult** (interface)
|
|
627
|
+
```typescript
|
|
628
|
+
interface AppendResult {
|
|
629
|
+
success: true
|
|
630
|
+
}
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
**AppendBulkResult** (interface)
|
|
634
|
+
```typescript
|
|
635
|
+
interface AppendBulkResult {
|
|
636
|
+
success: true; count: number
|
|
637
|
+
}
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
**CreateBroadcastBody** (interface)
|
|
641
|
+
```typescript
|
|
642
|
+
interface CreateBroadcastBody {
|
|
643
|
+
appId: string
|
|
644
|
+
data?: Record<string, any>
|
|
645
|
+
}
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
**UpdateBroadcastBody** (interface)
|
|
649
|
+
```typescript
|
|
650
|
+
interface UpdateBroadcastBody {
|
|
651
|
+
appId?: string
|
|
652
|
+
data?: Record<string, any>
|
|
653
|
+
}
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
**ListBroadcastsQuery** (interface)
|
|
657
|
+
```typescript
|
|
658
|
+
interface ListBroadcastsQuery {
|
|
659
|
+
limit?: number
|
|
660
|
+
offset?: number
|
|
661
|
+
appId?: string
|
|
662
|
+
}
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
**BroadcastRecord** (interface)
|
|
666
|
+
```typescript
|
|
667
|
+
interface BroadcastRecord {
|
|
668
|
+
id: string
|
|
669
|
+
collectionId: string
|
|
670
|
+
appId: string
|
|
671
|
+
templateId?: string
|
|
672
|
+
segmentId?: string
|
|
673
|
+
status?: 'draft' | 'scheduled' | 'sending' | 'sent' | string
|
|
674
|
+
scheduledAt?: string
|
|
675
|
+
sentAt?: string
|
|
676
|
+
data?: {
|
|
677
|
+
display?: {
|
|
678
|
+
title?: string
|
|
679
|
+
description?: string
|
|
680
|
+
icon?: string
|
|
681
|
+
color?: string
|
|
682
|
+
}
|
|
683
|
+
broadcastType?: string
|
|
684
|
+
[key: string]: unknown
|
|
685
|
+
}
|
|
686
|
+
createdAt: string
|
|
687
|
+
}
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
**BroadcastList** (interface)
|
|
691
|
+
```typescript
|
|
692
|
+
interface BroadcastList {
|
|
693
|
+
items: BroadcastRecord[]
|
|
694
|
+
limit: number
|
|
695
|
+
offset: number
|
|
696
|
+
}
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
**RecipientId** = `string`
|
|
700
|
+
|
|
331
701
|
### claimSet
|
|
332
702
|
|
|
333
703
|
**ClaimCodeRef** (interface)
|
|
@@ -405,6 +775,10 @@ interface CollectionResponse {
|
|
|
405
775
|
}
|
|
406
776
|
```
|
|
407
777
|
|
|
778
|
+
### common
|
|
779
|
+
|
|
780
|
+
**IdField** = `'userId' | 'contactId'`
|
|
781
|
+
|
|
408
782
|
### comms
|
|
409
783
|
|
|
410
784
|
**NotificationSubjectTarget** (interface)
|
|
@@ -561,6 +935,78 @@ interface ErrorResponse {
|
|
|
561
935
|
}
|
|
562
936
|
```
|
|
563
937
|
|
|
938
|
+
### journeys
|
|
939
|
+
|
|
940
|
+
**JourneyRecord** (interface)
|
|
941
|
+
```typescript
|
|
942
|
+
interface JourneyRecord {
|
|
943
|
+
id: string
|
|
944
|
+
collectionId: string
|
|
945
|
+
appId?: string
|
|
946
|
+
name: string
|
|
947
|
+
active: boolean
|
|
948
|
+
journeyType: 'event_triggered' | 'scheduled'
|
|
949
|
+
data?: {
|
|
950
|
+
display?: {
|
|
951
|
+
title?: string
|
|
952
|
+
description?: string
|
|
953
|
+
icon?: string
|
|
954
|
+
color?: string
|
|
955
|
+
}
|
|
956
|
+
steps?: Array<{ id: string; type: string; config?: Record<string, unknown> }>
|
|
957
|
+
triggers?: Array<{ type: string; config?: Record<string, unknown> }>
|
|
958
|
+
entryRules?: any[]
|
|
959
|
+
exitRules?: any[]
|
|
960
|
+
metadata?: Record<string, unknown>
|
|
961
|
+
[key: string]: unknown
|
|
962
|
+
}
|
|
963
|
+
createdAt: string
|
|
964
|
+
updatedAt: string
|
|
965
|
+
}
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
**JourneyList** (interface)
|
|
969
|
+
```typescript
|
|
970
|
+
interface JourneyList {
|
|
971
|
+
items: JourneyRecord[]
|
|
972
|
+
limit: number
|
|
973
|
+
offset: number
|
|
974
|
+
}
|
|
975
|
+
```
|
|
976
|
+
|
|
977
|
+
**ListJourneysQuery** (interface)
|
|
978
|
+
```typescript
|
|
979
|
+
interface ListJourneysQuery {
|
|
980
|
+
appId?: string
|
|
981
|
+
active?: boolean
|
|
982
|
+
journeyType?: 'event_triggered' | 'scheduled'
|
|
983
|
+
limit?: number
|
|
984
|
+
offset?: number
|
|
985
|
+
}
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
**CreateJourneyBody** (interface)
|
|
989
|
+
```typescript
|
|
990
|
+
interface CreateJourneyBody {
|
|
991
|
+
appId?: string
|
|
992
|
+
name: string
|
|
993
|
+
active?: boolean
|
|
994
|
+
journeyType: 'event_triggered' | 'scheduled'
|
|
995
|
+
data?: Record<string, unknown>
|
|
996
|
+
}
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
**UpdateJourneyBody** (interface)
|
|
1000
|
+
```typescript
|
|
1001
|
+
interface UpdateJourneyBody {
|
|
1002
|
+
appId?: string
|
|
1003
|
+
name?: string
|
|
1004
|
+
active?: boolean
|
|
1005
|
+
journeyType?: 'event_triggered' | 'scheduled'
|
|
1006
|
+
data?: Record<string, unknown>
|
|
1007
|
+
}
|
|
1008
|
+
```
|
|
1009
|
+
|
|
564
1010
|
### nfc
|
|
565
1011
|
|
|
566
1012
|
**NfcTagInfo** (interface)
|
|
@@ -669,6 +1115,68 @@ interface ProofResponse {
|
|
|
669
1115
|
}
|
|
670
1116
|
```
|
|
671
1117
|
|
|
1118
|
+
### segments
|
|
1119
|
+
|
|
1120
|
+
**SegmentRecord** (interface)
|
|
1121
|
+
```typescript
|
|
1122
|
+
interface SegmentRecord {
|
|
1123
|
+
id: string
|
|
1124
|
+
collectionId: string
|
|
1125
|
+
appId?: string
|
|
1126
|
+
name: string
|
|
1127
|
+
filterType: 'dynamic' | 'static'
|
|
1128
|
+
estimatedCount?: number
|
|
1129
|
+
lastCalculatedAt?: string
|
|
1130
|
+
createdAt: string
|
|
1131
|
+
data?: {
|
|
1132
|
+
filterRules: any[]
|
|
1133
|
+
description?: string
|
|
1134
|
+
staticContactIds?: string[]
|
|
1135
|
+
[key: string]: unknown
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
```
|
|
1139
|
+
|
|
1140
|
+
**ListSegmentsQuery** (interface)
|
|
1141
|
+
```typescript
|
|
1142
|
+
interface ListSegmentsQuery {
|
|
1143
|
+
appId?: string
|
|
1144
|
+
filterType?: 'dynamic' | 'static'
|
|
1145
|
+
limit?: number
|
|
1146
|
+
offset?: number
|
|
1147
|
+
}
|
|
1148
|
+
```
|
|
1149
|
+
|
|
1150
|
+
**SegmentList** (interface)
|
|
1151
|
+
```typescript
|
|
1152
|
+
interface SegmentList {
|
|
1153
|
+
items: SegmentRecord[]
|
|
1154
|
+
limit: number
|
|
1155
|
+
offset: number
|
|
1156
|
+
}
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
**SegmentCalculateResult** (interface)
|
|
1160
|
+
```typescript
|
|
1161
|
+
interface SegmentCalculateResult {
|
|
1162
|
+
scheduled: true
|
|
1163
|
+
lastCalculatedAt?: string
|
|
1164
|
+
estimatedCount?: number | null
|
|
1165
|
+
note?: string
|
|
1166
|
+
}
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
**SegmentRecipientsResponse** (interface)
|
|
1170
|
+
```typescript
|
|
1171
|
+
interface SegmentRecipientsResponse {
|
|
1172
|
+
items: string[]
|
|
1173
|
+
limit: number
|
|
1174
|
+
offset: number
|
|
1175
|
+
total: number
|
|
1176
|
+
note?: string
|
|
1177
|
+
}
|
|
1178
|
+
```
|
|
1179
|
+
|
|
672
1180
|
### variant
|
|
673
1181
|
|
|
674
1182
|
**VariantResponse** = `any`
|
|
@@ -805,6 +1313,55 @@ type AccountInfoResponse = {
|
|
|
805
1313
|
|
|
806
1314
|
## API Functions
|
|
807
1315
|
|
|
1316
|
+
### actions
|
|
1317
|
+
|
|
1318
|
+
**byUser**(collectionId: string,
|
|
1319
|
+
query: AdminByUserRequest | ActionQueryByUser = {}) → `Promise<ActionEventRow[]>`
|
|
1320
|
+
POST /admin/collection/:collectionId/actions/by-user Returns BigQuery action rows, newest first.
|
|
1321
|
+
|
|
1322
|
+
**countsByOutcome**(collectionId: string,
|
|
1323
|
+
query: AdminCountsByOutcomeRequest | ActionCountsQuery = {}) → `Promise<OutcomeCount[]>`
|
|
1324
|
+
POST /admin/collection/:collectionId/actions/counts-by-outcome Returns array of { outcome, count }.
|
|
1325
|
+
|
|
1326
|
+
**actorIdsByAction**(collectionId: string,
|
|
1327
|
+
query: AdminActorIdsByActionRequest | ActorIdsByActionQuery) → `Promise<ActorId[] | ActorWithOutcome[]>`
|
|
1328
|
+
POST /admin/collection/:collectionId/actions/actor-ids/by-action Returns list of IDs, optionally with outcome when includeOutcome=true.
|
|
1329
|
+
|
|
1330
|
+
**append**(collectionId: string,
|
|
1331
|
+
body: AppendActionBody) → `Promise<`
|
|
1332
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1333
|
+
|
|
1334
|
+
**create**(collectionId: string,
|
|
1335
|
+
body: CreateActionBody) → `Promise<ActionRecord>`
|
|
1336
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1337
|
+
|
|
1338
|
+
**list**(collectionId: string,
|
|
1339
|
+
query: ListActionsQuery = {}) → `Promise<ActionList>`
|
|
1340
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1341
|
+
|
|
1342
|
+
**get**(collectionId: string,
|
|
1343
|
+
id: string) → `Promise<ActionRecord>`
|
|
1344
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1345
|
+
|
|
1346
|
+
**update**(collectionId: string,
|
|
1347
|
+
id: string,
|
|
1348
|
+
patchBody: UpdateActionBody) → `Promise<ActionRecord>`
|
|
1349
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1350
|
+
|
|
1351
|
+
**remove**(collectionId: string,
|
|
1352
|
+
id: string) → `Promise<void>`
|
|
1353
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1354
|
+
|
|
1355
|
+
**publicCountsByOutcome**(collectionId: string,
|
|
1356
|
+
body: PublicCountsByOutcomeRequest,
|
|
1357
|
+
authToken?: string) → `Promise<OutcomeCount[]>`
|
|
1358
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1359
|
+
|
|
1360
|
+
**publicMyActions**(collectionId: string,
|
|
1361
|
+
body: PublicByUserRequest,
|
|
1362
|
+
authToken?: string) → `Promise<ActionEventRow[]>`
|
|
1363
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1364
|
+
|
|
808
1365
|
### ai
|
|
809
1366
|
|
|
810
1367
|
**generateContent**(collectionId: string,
|
|
@@ -1074,6 +1631,53 @@ Get serial numbers for a batch (admin only).
|
|
|
1074
1631
|
codeId: string) → `Promise<any>`
|
|
1075
1632
|
Look up a serial number by code for a batch (admin only).
|
|
1076
1633
|
|
|
1634
|
+
### broadcasts
|
|
1635
|
+
|
|
1636
|
+
**byUser**(collectionId: string,
|
|
1637
|
+
query: BroadcastQueryByUser = {}) → `Promise<BroadcastEvent[]>`
|
|
1638
|
+
POST /admin/collection/:collectionId/broadcasts/by-user Returns broadcast events array, newest first.
|
|
1639
|
+
|
|
1640
|
+
**recipientIds**(collectionId: string,
|
|
1641
|
+
query: RecipientIdsQuery) → `Promise<RecipientId[]>`
|
|
1642
|
+
POST /admin/collection/:collectionId/broadcasts/recipient-ids Returns recipient IDs for a broadcast.
|
|
1643
|
+
|
|
1644
|
+
**recipientsWithoutAction**(collectionId: string,
|
|
1645
|
+
query: RecipientsWithoutActionQuery) → `Promise<RecipientId[]>`
|
|
1646
|
+
POST /admin/collection/:collectionId/broadcasts/recipients/without-action Returns IDs who received the broadcast but did not perform an action.
|
|
1647
|
+
|
|
1648
|
+
**recipientsWithAction**(collectionId: string,
|
|
1649
|
+
query: RecipientsWithActionQuery) → `Promise<RecipientId[] | RecipientWithOutcome[]>`
|
|
1650
|
+
POST /admin/collection/:collectionId/broadcasts/recipients/with-action Returns IDs who received the broadcast and performed an action; optionally includes outcome.
|
|
1651
|
+
|
|
1652
|
+
**append**(collectionId: string,
|
|
1653
|
+
body: AppendBroadcastBody) → `Promise<AppendResult>`
|
|
1654
|
+
POST /admin/collection/:collectionId/broadcasts/append Appends one broadcast event.
|
|
1655
|
+
|
|
1656
|
+
**appendBulk**(collectionId: string,
|
|
1657
|
+
body: AppendBroadcastBulkBody | ({ broadcastId: string; ids: string[]; idField?: 'userId'|'contactId'; [k: string]: any }) → `void`
|
|
1658
|
+
POST /admin/collection/:collectionId/broadcasts/append/bulk Appends many broadcast recipients. Accepts preferred body shape with params + ids, and legacy flat shape.
|
|
1659
|
+
|
|
1660
|
+
**create**(collectionId: string,
|
|
1661
|
+
body: CreateBroadcastBody) → `Promise<BroadcastRecord>`
|
|
1662
|
+
POST /admin/collection/:collectionId/broadcasts/append/bulk Appends many broadcast recipients. Accepts preferred body shape with params + ids, and legacy flat shape.
|
|
1663
|
+
|
|
1664
|
+
**list**(collectionId: string,
|
|
1665
|
+
query: ListBroadcastsQuery = {}) → `Promise<BroadcastList>`
|
|
1666
|
+
POST /admin/collection/:collectionId/broadcasts/append/bulk Appends many broadcast recipients. Accepts preferred body shape with params + ids, and legacy flat shape.
|
|
1667
|
+
|
|
1668
|
+
**get**(collectionId: string,
|
|
1669
|
+
id: string) → `Promise<BroadcastRecord>`
|
|
1670
|
+
POST /admin/collection/:collectionId/broadcasts/append/bulk Appends many broadcast recipients. Accepts preferred body shape with params + ids, and legacy flat shape.
|
|
1671
|
+
|
|
1672
|
+
**update**(collectionId: string,
|
|
1673
|
+
id: string,
|
|
1674
|
+
body: UpdateBroadcastBody) → `Promise<BroadcastRecord>`
|
|
1675
|
+
POST /admin/collection/:collectionId/broadcasts/append/bulk Appends many broadcast recipients. Accepts preferred body shape with params + ids, and legacy flat shape.
|
|
1676
|
+
|
|
1677
|
+
**remove**(collectionId: string,
|
|
1678
|
+
id: string) → `Promise<void>`
|
|
1679
|
+
POST /admin/collection/:collectionId/broadcasts/append/bulk Appends many broadcast recipients. Accepts preferred body shape with params + ids, and legacy flat shape.
|
|
1680
|
+
|
|
1077
1681
|
### claimSet
|
|
1078
1682
|
|
|
1079
1683
|
**getAllForCollection**(collectionId: string) → `Promise<any[]>`
|
|
@@ -1123,9 +1727,12 @@ Retrieves all Collections.
|
|
|
1123
1727
|
**getShortId**(shortId: string) → `Promise<CollectionResponse>`
|
|
1124
1728
|
Retrieve a collection by its shortId (public endpoint).
|
|
1125
1729
|
|
|
1126
|
-
**getSettings**(collectionId: string, settingGroup: string) → `Promise<any>`
|
|
1730
|
+
**getSettings**(collectionId: string, settingGroup: string, admin?: boolean) → `Promise<any>`
|
|
1127
1731
|
Retrieve a specific settings group for a collection (public endpoint).
|
|
1128
1732
|
|
|
1733
|
+
**updateSettings**(collectionId: string, settingGroup: string, settings: any) → `Promise<any>`
|
|
1734
|
+
Update a specific settings group for a collection (admin endpoint).
|
|
1735
|
+
|
|
1129
1736
|
**create**(data: any) → `Promise<CollectionResponse>`
|
|
1130
1737
|
Create a new collection (admin only).
|
|
1131
1738
|
|
|
@@ -1214,6 +1821,24 @@ Update a form for a collection (admin only).
|
|
|
1214
1821
|
**remove**(collectionId: string, formId: string) → `Promise<void>`
|
|
1215
1822
|
Delete a form for a collection (admin only).
|
|
1216
1823
|
|
|
1824
|
+
### journeys
|
|
1825
|
+
|
|
1826
|
+
**create**(collectionId: string,
|
|
1827
|
+
body: CreateJourneyBody) → `Promise<JourneyRecord>`
|
|
1828
|
+
|
|
1829
|
+
**list**(collectionId: string,
|
|
1830
|
+
query: ListJourneysQuery = {}) → `Promise<JourneyList>`
|
|
1831
|
+
|
|
1832
|
+
**get**(collectionId: string,
|
|
1833
|
+
id: string) → `Promise<JourneyRecord>`
|
|
1834
|
+
|
|
1835
|
+
**update**(collectionId: string,
|
|
1836
|
+
id: string,
|
|
1837
|
+
body: UpdateJourneyBody) → `Promise<JourneyRecord>`
|
|
1838
|
+
|
|
1839
|
+
**remove**(collectionId: string,
|
|
1840
|
+
id: string) → `Promise<void>`
|
|
1841
|
+
|
|
1217
1842
|
### nfc
|
|
1218
1843
|
|
|
1219
1844
|
**claimTag**(data: NfcClaimTagRequest) → `Promise<NfcTagInfo>`
|
|
@@ -1313,6 +1938,31 @@ Find proofs for a product (admin only). POST /admin/collection/:collectionId/pro
|
|
|
1313
1938
|
batchId: string) → `Promise<ProofResponse[]>`
|
|
1314
1939
|
Get proofs for a batch (admin only). GET /admin/collection/:collectionId/product/:productId/batch/:batchId/proof
|
|
1315
1940
|
|
|
1941
|
+
### segments
|
|
1942
|
+
|
|
1943
|
+
**create**(collectionId: string,
|
|
1944
|
+
body: Omit<SegmentRecord, 'id' | 'collectionId' | 'createdAt'>) → `Promise<SegmentRecord>`
|
|
1945
|
+
|
|
1946
|
+
**list**(collectionId: string,
|
|
1947
|
+
query: ListSegmentsQuery = {}) → `Promise<SegmentList>`
|
|
1948
|
+
|
|
1949
|
+
**get**(collectionId: string,
|
|
1950
|
+
id: string) → `Promise<SegmentRecord>`
|
|
1951
|
+
|
|
1952
|
+
**update**(collectionId: string,
|
|
1953
|
+
id: string,
|
|
1954
|
+
body: Partial<Omit<SegmentRecord, 'id' | 'collectionId' | 'createdAt'>>) → `Promise<SegmentRecord>`
|
|
1955
|
+
|
|
1956
|
+
**remove**(collectionId: string,
|
|
1957
|
+
id: string) → `Promise<void>`
|
|
1958
|
+
|
|
1959
|
+
**calculate**(collectionId: string,
|
|
1960
|
+
id: string) → `Promise<SegmentCalculateResult>`
|
|
1961
|
+
|
|
1962
|
+
**recipients**(collectionId: string,
|
|
1963
|
+
id: string,
|
|
1964
|
+
query: { limit?: number; offset?: number } = {}) → `Promise<SegmentRecipientsResponse>`
|
|
1965
|
+
|
|
1316
1966
|
### variant
|
|
1317
1967
|
|
|
1318
1968
|
**get**(collectionId: string,
|