@sentdm/sentdm 0.26.0 → 0.27.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +12 -12
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +12 -12
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/contacts.d.mts +48 -486
  10. package/resources/contacts.d.mts.map +1 -1
  11. package/resources/contacts.d.ts +48 -486
  12. package/resources/contacts.d.ts.map +1 -1
  13. package/resources/contacts.js +3 -3
  14. package/resources/contacts.js.map +1 -1
  15. package/resources/contacts.mjs +3 -3
  16. package/resources/contacts.mjs.map +1 -1
  17. package/resources/index.d.mts +6 -6
  18. package/resources/index.d.mts.map +1 -1
  19. package/resources/index.d.ts +6 -6
  20. package/resources/index.d.ts.map +1 -1
  21. package/resources/index.js.map +1 -1
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/me.d.mts +40 -113
  24. package/resources/me.d.mts.map +1 -1
  25. package/resources/me.d.ts +40 -113
  26. package/resources/me.d.ts.map +1 -1
  27. package/resources/me.js.map +1 -1
  28. package/resources/me.mjs.map +1 -1
  29. package/resources/messages.d.mts +7 -126
  30. package/resources/messages.d.mts.map +1 -1
  31. package/resources/messages.d.ts +7 -126
  32. package/resources/messages.d.ts.map +1 -1
  33. package/resources/messages.js.map +1 -1
  34. package/resources/messages.mjs.map +1 -1
  35. package/resources/numbers.d.mts +3 -42
  36. package/resources/numbers.d.mts.map +1 -1
  37. package/resources/numbers.d.ts +3 -42
  38. package/resources/numbers.d.ts.map +1 -1
  39. package/resources/numbers.js.map +1 -1
  40. package/resources/numbers.mjs.map +1 -1
  41. package/resources/profiles/campaigns.d.mts +149 -480
  42. package/resources/profiles/campaigns.d.mts.map +1 -1
  43. package/resources/profiles/campaigns.d.ts +149 -480
  44. package/resources/profiles/campaigns.d.ts.map +1 -1
  45. package/resources/profiles/campaigns.js +41 -39
  46. package/resources/profiles/campaigns.js.map +1 -1
  47. package/resources/profiles/campaigns.mjs +41 -39
  48. package/resources/profiles/campaigns.mjs.map +1 -1
  49. package/resources/profiles/index.d.mts +2 -2
  50. package/resources/profiles/index.d.mts.map +1 -1
  51. package/resources/profiles/index.d.ts +2 -2
  52. package/resources/profiles/index.d.ts.map +1 -1
  53. package/resources/profiles/index.js.map +1 -1
  54. package/resources/profiles/index.mjs.map +1 -1
  55. package/resources/profiles/profiles.d.mts +391 -1699
  56. package/resources/profiles/profiles.d.mts.map +1 -1
  57. package/resources/profiles/profiles.d.ts +391 -1699
  58. package/resources/profiles/profiles.d.ts.map +1 -1
  59. package/resources/profiles/profiles.js +6 -3
  60. package/resources/profiles/profiles.js.map +1 -1
  61. package/resources/profiles/profiles.mjs +6 -3
  62. package/resources/profiles/profiles.mjs.map +1 -1
  63. package/resources/templates.d.mts +176 -993
  64. package/resources/templates.d.mts.map +1 -1
  65. package/resources/templates.d.ts +176 -993
  66. package/resources/templates.d.ts.map +1 -1
  67. package/resources/templates.js +3 -3
  68. package/resources/templates.js.map +1 -1
  69. package/resources/templates.mjs +3 -3
  70. package/resources/templates.mjs.map +1 -1
  71. package/resources/users.d.mts +46 -373
  72. package/resources/users.d.mts.map +1 -1
  73. package/resources/users.d.ts +46 -373
  74. package/resources/users.d.ts.map +1 -1
  75. package/resources/users.js +7 -3
  76. package/resources/users.js.map +1 -1
  77. package/resources/users.mjs +7 -3
  78. package/resources/users.mjs.map +1 -1
  79. package/resources/webhooks.d.mts +110 -624
  80. package/resources/webhooks.d.mts.map +1 -1
  81. package/resources/webhooks.d.ts +110 -624
  82. package/resources/webhooks.d.ts.map +1 -1
  83. package/resources/webhooks.js +7 -6
  84. package/resources/webhooks.js.map +1 -1
  85. package/resources/webhooks.mjs +7 -6
  86. package/resources/webhooks.mjs.map +1 -1
  87. package/src/client.ts +68 -33
  88. package/src/resources/contacts.ts +49 -566
  89. package/src/resources/index.ts +34 -17
  90. package/src/resources/me.ts +51 -132
  91. package/src/resources/messages.ts +7 -141
  92. package/src/resources/numbers.ts +3 -47
  93. package/src/resources/profiles/campaigns.ts +172 -667
  94. package/src/resources/profiles/index.ts +17 -5
  95. package/src/resources/profiles/profiles.ts +549 -2282
  96. package/src/resources/templates.ts +206 -1256
  97. package/src/resources/users.ts +47 -430
  98. package/src/resources/webhooks.ts +120 -742
  99. package/src/version.ts +1 -1
  100. package/version.d.mts +1 -1
  101. package/version.d.ts +1 -1
  102. package/version.js +1 -1
  103. package/version.mjs +1 -1
@@ -1,6 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
+ import * as CampaignsAPI from './campaigns';
5
+ import * as WebhooksAPI from '../webhooks';
4
6
  import { APIPromise } from '../../core/api-promise';
5
7
  import { buildHeaders } from '../../internal/headers';
6
8
  import { RequestOptions } from '../../internal/request-options';
@@ -16,33 +18,34 @@ export class Campaigns extends APIResource {
16
18
  *
17
19
  * @example
18
20
  * ```ts
19
- * const campaign = await client.profiles.campaigns.create(
20
- * '770e8400-e29b-41d4-a716-446655440002',
21
- * {
22
- * campaign: {
23
- * description:
24
- * 'Appointment reminders and account notifications',
25
- * name: 'Customer Notifications',
26
- * type: 'App',
27
- * useCases: [
28
- * {
29
- * messagingUseCaseUs: 'ACCOUNT_NOTIFICATION',
30
- * sampleMessages: [
31
- * 'Hi {name}, your appointment is confirmed for {date} at {time}.',
32
- * 'Your order #{order_id} has been shipped. Track at {url}',
33
- * ],
34
- * },
35
- * ],
21
+ * const apiResponseOfTcrCampaignWithUseCases =
22
+ * await client.profiles.campaigns.create(
23
+ * '770e8400-e29b-41d4-a716-446655440002',
24
+ * {
25
+ * campaign: {
26
+ * description:
27
+ * 'Appointment reminders and account notifications',
28
+ * name: 'Customer Notifications',
29
+ * type: 'App',
30
+ * useCases: [
31
+ * {
32
+ * messagingUseCaseUs: 'ACCOUNT_NOTIFICATION',
33
+ * sampleMessages: [
34
+ * 'Hi {name}, your appointment is confirmed for {date} at {time}.',
35
+ * 'Your order #{order_id} has been shipped. Track at {url}',
36
+ * ],
37
+ * },
38
+ * ],
39
+ * },
36
40
  * },
37
- * },
38
- * );
41
+ * );
39
42
  * ```
40
43
  */
41
44
  create(
42
45
  profileID: string,
43
46
  params: CampaignCreateParams,
44
47
  options?: RequestOptions,
45
- ): APIPromise<CampaignCreateResponse> {
48
+ ): APIPromise<APIResponseOfTcrCampaignWithUseCases> {
46
49
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
47
50
  return this._client.post(path`/v3/profiles/${profileID}/campaigns`, {
48
51
  body,
@@ -63,34 +66,35 @@ export class Campaigns extends APIResource {
63
66
  *
64
67
  * @example
65
68
  * ```ts
66
- * const campaign = await client.profiles.campaigns.update(
67
- * 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
68
- * {
69
- * profileId: '770e8400-e29b-41d4-a716-446655440002',
70
- * campaign: {
71
- * description:
72
- * 'Updated appointment reminders and account notifications',
73
- * name: 'Customer Notifications Updated',
74
- * type: 'App',
75
- * useCases: [
76
- * {
77
- * messagingUseCaseUs: 'ACCOUNT_NOTIFICATION',
78
- * sampleMessages: [
79
- * 'Hi {name}, your appointment is confirmed for {date} at {time}.',
80
- * 'Your order #{order_id} has been shipped. Track at {url}',
81
- * ],
82
- * },
83
- * ],
69
+ * const apiResponseOfTcrCampaignWithUseCases =
70
+ * await client.profiles.campaigns.update(
71
+ * 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
72
+ * {
73
+ * profileId: '770e8400-e29b-41d4-a716-446655440002',
74
+ * campaign: {
75
+ * description:
76
+ * 'Updated appointment reminders and account notifications',
77
+ * name: 'Customer Notifications Updated',
78
+ * type: 'App',
79
+ * useCases: [
80
+ * {
81
+ * messagingUseCaseUs: 'ACCOUNT_NOTIFICATION',
82
+ * sampleMessages: [
83
+ * 'Hi {name}, your appointment is confirmed for {date} at {time}.',
84
+ * 'Your order #{order_id} has been shipped. Track at {url}',
85
+ * ],
86
+ * },
87
+ * ],
88
+ * },
84
89
  * },
85
- * },
86
- * );
90
+ * );
87
91
  * ```
88
92
  */
89
93
  update(
90
94
  campaignID: string,
91
95
  params: CampaignUpdateParams,
92
96
  options?: RequestOptions,
93
- ): APIPromise<CampaignUpdateResponse> {
97
+ ): APIPromise<APIResponseOfTcrCampaignWithUseCases> {
94
98
  const { profileId, 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
95
99
  return this._client.put(path`/v3/profiles/${profileId}/campaigns/${campaignID}`, {
96
100
  body,
@@ -159,21 +163,21 @@ export class Campaigns extends APIResource {
159
163
  /**
160
164
  * Standard API response envelope for all v3 endpoints
161
165
  */
162
- export interface CampaignCreateResponse {
166
+ export interface APIResponseOfTcrCampaignWithUseCases {
163
167
  /**
164
168
  * The response data (null if error)
165
169
  */
166
- data?: CampaignCreateResponse.Data | null;
170
+ data?: TcrCampaignWithUseCases | null;
167
171
 
168
172
  /**
169
173
  * Error information
170
174
  */
171
- error?: CampaignCreateResponse.Error | null;
175
+ error?: WebhooksAPI.ErrorDetail | null;
172
176
 
173
177
  /**
174
178
  * Request and response metadata
175
179
  */
176
- meta?: CampaignCreateResponse.Meta;
180
+ meta?: WebhooksAPI.APIMeta;
177
181
 
178
182
  /**
179
183
  * Indicates whether the request was successful
@@ -181,338 +185,185 @@ export interface CampaignCreateResponse {
181
185
  success?: boolean;
182
186
  }
183
187
 
184
- export namespace CampaignCreateResponse {
188
+ export interface BaseDto {
185
189
  /**
186
- * The response data (null if error)
190
+ * Unique identifier
187
191
  */
188
- export interface Data {
189
- /**
190
- * Unique identifier
191
- */
192
- id?: string;
193
-
194
- billedDate?: string | null;
195
-
196
- brandId?: string | null;
197
-
198
- cost?: number | null;
199
-
200
- createdAt?: string;
201
-
202
- cspId?: string | null;
203
-
204
- customerId?: string;
205
-
206
- dcaElectionsComplete?: boolean;
207
-
208
- dcaElectionsCompletedAt?: string | null;
209
-
210
- description?: string;
211
-
212
- helpKeywords?: string | null;
213
-
214
- helpMessage?: string | null;
215
-
216
- kycSubmissionFormId?: string | null;
192
+ id?: string;
217
193
 
218
- messageFlow?: string | null;
194
+ createdAt?: string;
219
195
 
220
- name?: string;
221
-
222
- optinKeywords?: string | null;
223
-
224
- optinMessage?: string | null;
225
-
226
- optoutKeywords?: string | null;
227
-
228
- optoutMessage?: string | null;
229
-
230
- privacyPolicyLink?: string | null;
231
-
232
- resellerId?: string | null;
233
-
234
- sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
235
-
236
- status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
237
-
238
- submittedAt?: string | null;
239
-
240
- submittedToTCR?: boolean;
241
-
242
- tcrCampaignId?: string | null;
243
-
244
- tcrSyncError?: string | null;
196
+ updatedAt?: string | null;
197
+ }
245
198
 
246
- telnyxCampaignId?: string | null;
199
+ /**
200
+ * Campaign data for create or update operation
201
+ */
202
+ export interface CampaignData {
203
+ /**
204
+ * Campaign description
205
+ */
206
+ description: string;
247
207
 
248
- termsAndConditionsLink?: string | null;
208
+ /**
209
+ * Campaign name
210
+ */
211
+ name: string;
249
212
 
250
- type?: string;
213
+ /**
214
+ * Campaign type (e.g., "KYC", "App")
215
+ */
216
+ type: string;
251
217
 
252
- updatedAt?: string | null;
218
+ /**
219
+ * List of use cases with sample messages
220
+ */
221
+ useCases: Array<SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData>;
253
222
 
254
- upstreamCnpId?: string | null;
223
+ /**
224
+ * Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
225
+ */
226
+ helpKeywords?: string | null;
255
227
 
256
- useCases?: Array<Data.UseCase>;
257
- }
228
+ /**
229
+ * Message sent when user requests help
230
+ */
231
+ helpMessage?: string | null;
258
232
 
259
- export namespace Data {
260
- export interface UseCase {
261
- /**
262
- * Unique identifier
263
- */
264
- id?: string;
265
-
266
- campaignId?: string;
267
-
268
- createdAt?: string;
269
-
270
- customerId?: string;
271
-
272
- messagingUseCaseUs?:
273
- | 'MARKETING'
274
- | 'ACCOUNT_NOTIFICATION'
275
- | 'CUSTOMER_CARE'
276
- | 'FRAUD_ALERT'
277
- | 'TWO_FA'
278
- | 'DELIVERY_NOTIFICATION'
279
- | 'SECURITY_ALERT'
280
- | 'M2M'
281
- | 'MIXED'
282
- | 'HIGHER_EDUCATION'
283
- | 'POLLING_VOTING'
284
- | 'PUBLIC_SERVICE_ANNOUNCEMENT'
285
- | 'LOW_VOLUME';
286
-
287
- sampleMessages?: Array<string>;
288
-
289
- updatedAt?: string | null;
290
- }
291
- }
233
+ /**
234
+ * Description of how messages flow in the campaign
235
+ */
236
+ messageFlow?: string | null;
292
237
 
293
238
  /**
294
- * Error information
239
+ * Comma-separated keywords that trigger opt-in (e.g., "YES, START, SUBSCRIBE")
295
240
  */
296
- export interface Error {
297
- /**
298
- * Machine-readable error code (e.g., "RESOURCE_001")
299
- */
300
- code?: string;
301
-
302
- /**
303
- * Additional validation error details (field-level errors)
304
- */
305
- details?: { [key: string]: Array<string> } | null;
306
-
307
- /**
308
- * URL to documentation about this error
309
- */
310
- doc_url?: string | null;
311
-
312
- /**
313
- * Human-readable error message
314
- */
315
- message?: string;
316
- }
241
+ optinKeywords?: string | null;
317
242
 
318
243
  /**
319
- * Request and response metadata
244
+ * Message sent when user opts in
320
245
  */
321
- export interface Meta {
322
- /**
323
- * Unique identifier for this request (for tracing and support)
324
- */
325
- request_id?: string;
326
-
327
- /**
328
- * Server timestamp when the response was generated
329
- */
330
- timestamp?: string;
331
-
332
- /**
333
- * API version used for this request
334
- */
335
- version?: string;
336
- }
337
- }
246
+ optinMessage?: string | null;
338
247
 
339
- /**
340
- * Standard API response envelope for all v3 endpoints
341
- */
342
- export interface CampaignUpdateResponse {
343
248
  /**
344
- * The response data (null if error)
249
+ * Comma-separated keywords that trigger opt-out (e.g., "STOP, UNSUBSCRIBE, END")
345
250
  */
346
- data?: CampaignUpdateResponse.Data | null;
251
+ optoutKeywords?: string | null;
347
252
 
348
253
  /**
349
- * Error information
254
+ * Message sent when user opts out
350
255
  */
351
- error?: CampaignUpdateResponse.Error | null;
256
+ optoutMessage?: string | null;
352
257
 
353
258
  /**
354
- * Request and response metadata
259
+ * URL to privacy policy
355
260
  */
356
- meta?: CampaignUpdateResponse.Meta;
261
+ privacyPolicyLink?: string | null;
357
262
 
358
263
  /**
359
- * Indicates whether the request was successful
264
+ * URL to terms and conditions
360
265
  */
361
- success?: boolean;
266
+ termsAndConditionsLink?: string | null;
362
267
  }
363
268
 
364
- export namespace CampaignUpdateResponse {
269
+ export type MessagingUseCaseUs =
270
+ | 'MARKETING'
271
+ | 'ACCOUNT_NOTIFICATION'
272
+ | 'CUSTOMER_CARE'
273
+ | 'FRAUD_ALERT'
274
+ | 'TWO_FA'
275
+ | 'DELIVERY_NOTIFICATION'
276
+ | 'SECURITY_ALERT'
277
+ | 'M2M'
278
+ | 'MIXED'
279
+ | 'HIGHER_EDUCATION'
280
+ | 'POLLING_VOTING'
281
+ | 'PUBLIC_SERVICE_ANNOUNCEMENT'
282
+ | 'LOW_VOLUME';
283
+
284
+ /**
285
+ * Campaign use case with sample messages
286
+ */
287
+ export interface SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData {
288
+ messagingUseCaseUs: MessagingUseCaseUs;
289
+
365
290
  /**
366
- * The response data (null if error)
291
+ * Sample messages for this use case (1-5 messages, max 1024 characters each)
367
292
  */
368
- export interface Data {
369
- /**
370
- * Unique identifier
371
- */
372
- id?: string;
373
-
374
- billedDate?: string | null;
293
+ sampleMessages: Array<string>;
294
+ }
375
295
 
376
- brandId?: string | null;
296
+ export interface TcrCampaignWithUseCases extends BaseDto {
297
+ billedDate?: string | null;
377
298
 
378
- cost?: number | null;
299
+ brandId?: string | null;
379
300
 
380
- createdAt?: string;
301
+ cost?: number | null;
381
302
 
382
- cspId?: string | null;
303
+ cspId?: string | null;
383
304
 
384
- customerId?: string;
305
+ customerId?: string;
385
306
 
386
- dcaElectionsComplete?: boolean;
307
+ dcaElectionsComplete?: boolean;
387
308
 
388
- dcaElectionsCompletedAt?: string | null;
309
+ dcaElectionsCompletedAt?: string | null;
389
310
 
390
- description?: string;
311
+ description?: string;
391
312
 
392
- helpKeywords?: string | null;
313
+ helpKeywords?: string | null;
393
314
 
394
- helpMessage?: string | null;
315
+ helpMessage?: string | null;
395
316
 
396
- kycSubmissionFormId?: string | null;
317
+ kycSubmissionFormId?: string | null;
397
318
 
398
- messageFlow?: string | null;
319
+ messageFlow?: string | null;
399
320
 
400
- name?: string;
321
+ name?: string;
401
322
 
402
- optinKeywords?: string | null;
323
+ optinKeywords?: string | null;
403
324
 
404
- optinMessage?: string | null;
325
+ optinMessage?: string | null;
405
326
 
406
- optoutKeywords?: string | null;
327
+ optoutKeywords?: string | null;
407
328
 
408
- optoutMessage?: string | null;
329
+ optoutMessage?: string | null;
409
330
 
410
- privacyPolicyLink?: string | null;
331
+ privacyPolicyLink?: string | null;
411
332
 
412
- resellerId?: string | null;
333
+ resellerId?: string | null;
413
334
 
414
- sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
335
+ sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
415
336
 
416
- status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
337
+ status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
417
338
 
418
- submittedAt?: string | null;
339
+ submittedAt?: string | null;
419
340
 
420
- submittedToTCR?: boolean;
341
+ submittedToTCR?: boolean;
421
342
 
422
- tcrCampaignId?: string | null;
343
+ tcrCampaignId?: string | null;
423
344
 
424
- tcrSyncError?: string | null;
345
+ tcrSyncError?: string | null;
425
346
 
426
- telnyxCampaignId?: string | null;
347
+ telnyxCampaignId?: string | null;
427
348
 
428
- termsAndConditionsLink?: string | null;
349
+ termsAndConditionsLink?: string | null;
429
350
 
430
- type?: string;
351
+ type?: string;
431
352
 
432
- updatedAt?: string | null;
353
+ upstreamCnpId?: string | null;
433
354
 
434
- upstreamCnpId?: string | null;
355
+ useCases?: Array<TcrCampaignWithUseCases.UseCase>;
356
+ }
435
357
 
436
- useCases?: Array<Data.UseCase>;
437
- }
358
+ export namespace TcrCampaignWithUseCases {
359
+ export interface UseCase extends CampaignsAPI.BaseDto {
360
+ campaignId?: string;
438
361
 
439
- export namespace Data {
440
- export interface UseCase {
441
- /**
442
- * Unique identifier
443
- */
444
- id?: string;
445
-
446
- campaignId?: string;
447
-
448
- createdAt?: string;
449
-
450
- customerId?: string;
451
-
452
- messagingUseCaseUs?:
453
- | 'MARKETING'
454
- | 'ACCOUNT_NOTIFICATION'
455
- | 'CUSTOMER_CARE'
456
- | 'FRAUD_ALERT'
457
- | 'TWO_FA'
458
- | 'DELIVERY_NOTIFICATION'
459
- | 'SECURITY_ALERT'
460
- | 'M2M'
461
- | 'MIXED'
462
- | 'HIGHER_EDUCATION'
463
- | 'POLLING_VOTING'
464
- | 'PUBLIC_SERVICE_ANNOUNCEMENT'
465
- | 'LOW_VOLUME';
466
-
467
- sampleMessages?: Array<string>;
468
-
469
- updatedAt?: string | null;
470
- }
471
- }
362
+ customerId?: string;
472
363
 
473
- /**
474
- * Error information
475
- */
476
- export interface Error {
477
- /**
478
- * Machine-readable error code (e.g., "RESOURCE_001")
479
- */
480
- code?: string;
481
-
482
- /**
483
- * Additional validation error details (field-level errors)
484
- */
485
- details?: { [key: string]: Array<string> } | null;
486
-
487
- /**
488
- * URL to documentation about this error
489
- */
490
- doc_url?: string | null;
491
-
492
- /**
493
- * Human-readable error message
494
- */
495
- message?: string;
496
- }
364
+ messagingUseCaseUs?: CampaignsAPI.MessagingUseCaseUs;
497
365
 
498
- /**
499
- * Request and response metadata
500
- */
501
- export interface Meta {
502
- /**
503
- * Unique identifier for this request (for tracing and support)
504
- */
505
- request_id?: string;
506
-
507
- /**
508
- * Server timestamp when the response was generated
509
- */
510
- timestamp?: string;
511
-
512
- /**
513
- * API version used for this request
514
- */
515
- version?: string;
366
+ sampleMessages?: Array<string>;
516
367
  }
517
368
  }
518
369
 
@@ -523,17 +374,17 @@ export interface CampaignListResponse {
523
374
  /**
524
375
  * The response data (null if error)
525
376
  */
526
- data?: Array<CampaignListResponse.Data> | null;
377
+ data?: Array<TcrCampaignWithUseCases> | null;
527
378
 
528
379
  /**
529
380
  * Error information
530
381
  */
531
- error?: CampaignListResponse.Error | null;
382
+ error?: WebhooksAPI.ErrorDetail | null;
532
383
 
533
384
  /**
534
385
  * Request and response metadata
535
386
  */
536
- meta?: CampaignListResponse.Meta;
387
+ meta?: WebhooksAPI.APIMeta;
537
388
 
538
389
  /**
539
390
  * Indicates whether the request was successful
@@ -541,163 +392,11 @@ export interface CampaignListResponse {
541
392
  success?: boolean;
542
393
  }
543
394
 
544
- export namespace CampaignListResponse {
545
- export interface Data {
546
- /**
547
- * Unique identifier
548
- */
549
- id?: string;
550
-
551
- billedDate?: string | null;
552
-
553
- brandId?: string | null;
554
-
555
- cost?: number | null;
556
-
557
- createdAt?: string;
558
-
559
- cspId?: string | null;
560
-
561
- customerId?: string;
562
-
563
- dcaElectionsComplete?: boolean;
564
-
565
- dcaElectionsCompletedAt?: string | null;
566
-
567
- description?: string;
568
-
569
- helpKeywords?: string | null;
570
-
571
- helpMessage?: string | null;
572
-
573
- kycSubmissionFormId?: string | null;
574
-
575
- messageFlow?: string | null;
576
-
577
- name?: string;
578
-
579
- optinKeywords?: string | null;
580
-
581
- optinMessage?: string | null;
582
-
583
- optoutKeywords?: string | null;
584
-
585
- optoutMessage?: string | null;
586
-
587
- privacyPolicyLink?: string | null;
588
-
589
- resellerId?: string | null;
590
-
591
- sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
592
-
593
- status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
594
-
595
- submittedAt?: string | null;
596
-
597
- submittedToTCR?: boolean;
598
-
599
- tcrCampaignId?: string | null;
600
-
601
- tcrSyncError?: string | null;
602
-
603
- telnyxCampaignId?: string | null;
604
-
605
- termsAndConditionsLink?: string | null;
606
-
607
- type?: string;
608
-
609
- updatedAt?: string | null;
610
-
611
- upstreamCnpId?: string | null;
612
-
613
- useCases?: Array<Data.UseCase>;
614
- }
615
-
616
- export namespace Data {
617
- export interface UseCase {
618
- /**
619
- * Unique identifier
620
- */
621
- id?: string;
622
-
623
- campaignId?: string;
624
-
625
- createdAt?: string;
626
-
627
- customerId?: string;
628
-
629
- messagingUseCaseUs?:
630
- | 'MARKETING'
631
- | 'ACCOUNT_NOTIFICATION'
632
- | 'CUSTOMER_CARE'
633
- | 'FRAUD_ALERT'
634
- | 'TWO_FA'
635
- | 'DELIVERY_NOTIFICATION'
636
- | 'SECURITY_ALERT'
637
- | 'M2M'
638
- | 'MIXED'
639
- | 'HIGHER_EDUCATION'
640
- | 'POLLING_VOTING'
641
- | 'PUBLIC_SERVICE_ANNOUNCEMENT'
642
- | 'LOW_VOLUME';
643
-
644
- sampleMessages?: Array<string>;
645
-
646
- updatedAt?: string | null;
647
- }
648
- }
649
-
650
- /**
651
- * Error information
652
- */
653
- export interface Error {
654
- /**
655
- * Machine-readable error code (e.g., "RESOURCE_001")
656
- */
657
- code?: string;
658
-
659
- /**
660
- * Additional validation error details (field-level errors)
661
- */
662
- details?: { [key: string]: Array<string> } | null;
663
-
664
- /**
665
- * URL to documentation about this error
666
- */
667
- doc_url?: string | null;
668
-
669
- /**
670
- * Human-readable error message
671
- */
672
- message?: string;
673
- }
674
-
675
- /**
676
- * Request and response metadata
677
- */
678
- export interface Meta {
679
- /**
680
- * Unique identifier for this request (for tracing and support)
681
- */
682
- request_id?: string;
683
-
684
- /**
685
- * Server timestamp when the response was generated
686
- */
687
- timestamp?: string;
688
-
689
- /**
690
- * API version used for this request
691
- */
692
- version?: string;
693
- }
694
- }
695
-
696
395
  export interface CampaignCreateParams {
697
396
  /**
698
397
  * Body param: Campaign data for create or update operation
699
398
  */
700
- campaign: CampaignCreateParams.Campaign;
399
+ campaign: CampaignData;
701
400
 
702
401
  /**
703
402
  * Body param: Sandbox flag - when true, the operation is simulated without side
@@ -720,105 +419,6 @@ export interface CampaignCreateParams {
720
419
  'x-profile-id'?: string;
721
420
  }
722
421
 
723
- export namespace CampaignCreateParams {
724
- /**
725
- * Campaign data for create or update operation
726
- */
727
- export interface Campaign {
728
- /**
729
- * Campaign description
730
- */
731
- description: string;
732
-
733
- /**
734
- * Campaign name
735
- */
736
- name: string;
737
-
738
- /**
739
- * Campaign type (e.g., "KYC", "App")
740
- */
741
- type: string;
742
-
743
- /**
744
- * List of use cases with sample messages
745
- */
746
- useCases: Array<Campaign.UseCase>;
747
-
748
- /**
749
- * Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
750
- */
751
- helpKeywords?: string | null;
752
-
753
- /**
754
- * Message sent when user requests help
755
- */
756
- helpMessage?: string | null;
757
-
758
- /**
759
- * Description of how messages flow in the campaign
760
- */
761
- messageFlow?: string | null;
762
-
763
- /**
764
- * Comma-separated keywords that trigger opt-in (e.g., "YES, START, SUBSCRIBE")
765
- */
766
- optinKeywords?: string | null;
767
-
768
- /**
769
- * Message sent when user opts in
770
- */
771
- optinMessage?: string | null;
772
-
773
- /**
774
- * Comma-separated keywords that trigger opt-out (e.g., "STOP, UNSUBSCRIBE, END")
775
- */
776
- optoutKeywords?: string | null;
777
-
778
- /**
779
- * Message sent when user opts out
780
- */
781
- optoutMessage?: string | null;
782
-
783
- /**
784
- * URL to privacy policy
785
- */
786
- privacyPolicyLink?: string | null;
787
-
788
- /**
789
- * URL to terms and conditions
790
- */
791
- termsAndConditionsLink?: string | null;
792
- }
793
-
794
- export namespace Campaign {
795
- /**
796
- * Campaign use case with sample messages
797
- */
798
- export interface UseCase {
799
- messagingUseCaseUs:
800
- | 'MARKETING'
801
- | 'ACCOUNT_NOTIFICATION'
802
- | 'CUSTOMER_CARE'
803
- | 'FRAUD_ALERT'
804
- | 'TWO_FA'
805
- | 'DELIVERY_NOTIFICATION'
806
- | 'SECURITY_ALERT'
807
- | 'M2M'
808
- | 'MIXED'
809
- | 'HIGHER_EDUCATION'
810
- | 'POLLING_VOTING'
811
- | 'PUBLIC_SERVICE_ANNOUNCEMENT'
812
- | 'LOW_VOLUME';
813
-
814
- /**
815
- * Sample messages for this use case (1-5 messages, max 1024 characters each)
816
- */
817
- sampleMessages: Array<string>;
818
- }
819
- }
820
- }
821
-
822
422
  export interface CampaignUpdateParams {
823
423
  /**
824
424
  * Path param: Profile ID from route
@@ -828,7 +428,7 @@ export interface CampaignUpdateParams {
828
428
  /**
829
429
  * Body param: Campaign data for create or update operation
830
430
  */
831
- campaign: CampaignUpdateParams.Campaign;
431
+ campaign: CampaignData;
832
432
 
833
433
  /**
834
434
  * Body param: Sandbox flag - when true, the operation is simulated without side
@@ -851,105 +451,6 @@ export interface CampaignUpdateParams {
851
451
  'x-profile-id'?: string;
852
452
  }
853
453
 
854
- export namespace CampaignUpdateParams {
855
- /**
856
- * Campaign data for create or update operation
857
- */
858
- export interface Campaign {
859
- /**
860
- * Campaign description
861
- */
862
- description: string;
863
-
864
- /**
865
- * Campaign name
866
- */
867
- name: string;
868
-
869
- /**
870
- * Campaign type (e.g., "KYC", "App")
871
- */
872
- type: string;
873
-
874
- /**
875
- * List of use cases with sample messages
876
- */
877
- useCases: Array<Campaign.UseCase>;
878
-
879
- /**
880
- * Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
881
- */
882
- helpKeywords?: string | null;
883
-
884
- /**
885
- * Message sent when user requests help
886
- */
887
- helpMessage?: string | null;
888
-
889
- /**
890
- * Description of how messages flow in the campaign
891
- */
892
- messageFlow?: string | null;
893
-
894
- /**
895
- * Comma-separated keywords that trigger opt-in (e.g., "YES, START, SUBSCRIBE")
896
- */
897
- optinKeywords?: string | null;
898
-
899
- /**
900
- * Message sent when user opts in
901
- */
902
- optinMessage?: string | null;
903
-
904
- /**
905
- * Comma-separated keywords that trigger opt-out (e.g., "STOP, UNSUBSCRIBE, END")
906
- */
907
- optoutKeywords?: string | null;
908
-
909
- /**
910
- * Message sent when user opts out
911
- */
912
- optoutMessage?: string | null;
913
-
914
- /**
915
- * URL to privacy policy
916
- */
917
- privacyPolicyLink?: string | null;
918
-
919
- /**
920
- * URL to terms and conditions
921
- */
922
- termsAndConditionsLink?: string | null;
923
- }
924
-
925
- export namespace Campaign {
926
- /**
927
- * Campaign use case with sample messages
928
- */
929
- export interface UseCase {
930
- messagingUseCaseUs:
931
- | 'MARKETING'
932
- | 'ACCOUNT_NOTIFICATION'
933
- | 'CUSTOMER_CARE'
934
- | 'FRAUD_ALERT'
935
- | 'TWO_FA'
936
- | 'DELIVERY_NOTIFICATION'
937
- | 'SECURITY_ALERT'
938
- | 'M2M'
939
- | 'MIXED'
940
- | 'HIGHER_EDUCATION'
941
- | 'POLLING_VOTING'
942
- | 'PUBLIC_SERVICE_ANNOUNCEMENT'
943
- | 'LOW_VOLUME';
944
-
945
- /**
946
- * Sample messages for this use case (1-5 messages, max 1024 characters each)
947
- */
948
- sampleMessages: Array<string>;
949
- }
950
- }
951
- }
952
-
953
454
  export interface CampaignListParams {
954
455
  /**
955
456
  * Profile UUID to scope the request to a child profile. Only organization API keys
@@ -980,8 +481,12 @@ export interface CampaignDeleteParams {
980
481
 
981
482
  export declare namespace Campaigns {
982
483
  export {
983
- type CampaignCreateResponse as CampaignCreateResponse,
984
- type CampaignUpdateResponse as CampaignUpdateResponse,
484
+ type APIResponseOfTcrCampaignWithUseCases as APIResponseOfTcrCampaignWithUseCases,
485
+ type BaseDto as BaseDto,
486
+ type CampaignData as CampaignData,
487
+ type MessagingUseCaseUs as MessagingUseCaseUs,
488
+ type SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData as SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData,
489
+ type TcrCampaignWithUseCases as TcrCampaignWithUseCases,
985
490
  type CampaignListResponse as CampaignListResponse,
986
491
  type CampaignCreateParams as CampaignCreateParams,
987
492
  type CampaignUpdateParams as CampaignUpdateParams,