@sentdm/sentdm 0.25.4 → 0.26.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 +488 -68
  10. package/resources/contacts.d.mts.map +1 -1
  11. package/resources/contacts.d.ts +488 -68
  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 +113 -40
  24. package/resources/me.d.mts.map +1 -1
  25. package/resources/me.d.ts +113 -40
  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 +130 -9
  30. package/resources/messages.d.mts.map +1 -1
  31. package/resources/messages.d.ts +130 -9
  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 +42 -3
  36. package/resources/numbers.d.mts.map +1 -1
  37. package/resources/numbers.d.ts +42 -3
  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 +480 -147
  42. package/resources/profiles/campaigns.d.mts.map +1 -1
  43. package/resources/profiles/campaigns.d.ts +480 -147
  44. package/resources/profiles/campaigns.d.ts.map +1 -1
  45. package/resources/profiles/campaigns.js +39 -41
  46. package/resources/profiles/campaigns.js.map +1 -1
  47. package/resources/profiles/campaigns.mjs +39 -41
  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 +1699 -391
  56. package/resources/profiles/profiles.d.mts.map +1 -1
  57. package/resources/profiles/profiles.d.ts +1699 -391
  58. package/resources/profiles/profiles.d.ts.map +1 -1
  59. package/resources/profiles/profiles.js +3 -6
  60. package/resources/profiles/profiles.js.map +1 -1
  61. package/resources/profiles/profiles.mjs +3 -6
  62. package/resources/profiles/profiles.mjs.map +1 -1
  63. package/resources/templates.d.mts +993 -172
  64. package/resources/templates.d.mts.map +1 -1
  65. package/resources/templates.d.ts +993 -172
  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 +373 -46
  72. package/resources/users.d.mts.map +1 -1
  73. package/resources/users.d.ts +373 -46
  74. package/resources/users.d.ts.map +1 -1
  75. package/resources/users.js +3 -7
  76. package/resources/users.js.map +1 -1
  77. package/resources/users.mjs +3 -7
  78. package/resources/users.mjs.map +1 -1
  79. package/resources/webhooks.d.mts +624 -110
  80. package/resources/webhooks.d.mts.map +1 -1
  81. package/resources/webhooks.d.ts +624 -110
  82. package/resources/webhooks.d.ts.map +1 -1
  83. package/resources/webhooks.js +6 -7
  84. package/resources/webhooks.js.map +1 -1
  85. package/resources/webhooks.mjs +6 -7
  86. package/resources/webhooks.mjs.map +1 -1
  87. package/src/client.ts +33 -68
  88. package/src/resources/contacts.ts +567 -66
  89. package/src/resources/index.ts +17 -34
  90. package/src/resources/me.ts +132 -51
  91. package/src/resources/messages.ts +147 -9
  92. package/src/resources/numbers.ts +47 -3
  93. package/src/resources/profiles/campaigns.ts +668 -169
  94. package/src/resources/profiles/index.ts +5 -17
  95. package/src/resources/profiles/profiles.ts +2278 -545
  96. package/src/resources/templates.ts +1261 -206
  97. package/src/resources/users.ts +430 -47
  98. package/src/resources/webhooks.ts +742 -120
  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,8 +1,6 @@
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';
6
4
  import { APIPromise } from '../../core/api-promise';
7
5
  import { buildHeaders } from '../../internal/headers';
8
6
  import { RequestOptions } from '../../internal/request-options';
@@ -18,34 +16,33 @@ export class Campaigns extends APIResource {
18
16
  *
19
17
  * @example
20
18
  * ```ts
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
- * },
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
+ * ],
40
36
  * },
41
- * );
37
+ * },
38
+ * );
42
39
  * ```
43
40
  */
44
41
  create(
45
42
  profileID: string,
46
43
  params: CampaignCreateParams,
47
44
  options?: RequestOptions,
48
- ): APIPromise<APIResponseOfTcrCampaignWithUseCases> {
45
+ ): APIPromise<CampaignCreateResponse> {
49
46
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
50
47
  return this._client.post(path`/v3/profiles/${profileID}/campaigns`, {
51
48
  body,
@@ -66,35 +63,34 @@ export class Campaigns extends APIResource {
66
63
  *
67
64
  * @example
68
65
  * ```ts
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
- * },
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
+ * ],
89
84
  * },
90
- * );
85
+ * },
86
+ * );
91
87
  * ```
92
88
  */
93
89
  update(
94
90
  campaignID: string,
95
91
  params: CampaignUpdateParams,
96
92
  options?: RequestOptions,
97
- ): APIPromise<APIResponseOfTcrCampaignWithUseCases> {
93
+ ): APIPromise<CampaignUpdateResponse> {
98
94
  const { profileId, 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
99
95
  return this._client.put(path`/v3/profiles/${profileId}/campaigns/${campaignID}`, {
100
96
  body,
@@ -163,21 +159,21 @@ export class Campaigns extends APIResource {
163
159
  /**
164
160
  * Standard API response envelope for all v3 endpoints
165
161
  */
166
- export interface APIResponseOfTcrCampaignWithUseCases {
162
+ export interface CampaignCreateResponse {
167
163
  /**
168
164
  * The response data (null if error)
169
165
  */
170
- data?: TcrCampaignWithUseCases | null;
166
+ data?: CampaignCreateResponse.Data | null;
171
167
 
172
168
  /**
173
169
  * Error information
174
170
  */
175
- error?: WebhooksAPI.ErrorDetail | null;
171
+ error?: CampaignCreateResponse.Error | null;
176
172
 
177
173
  /**
178
174
  * Request and response metadata
179
175
  */
180
- meta?: WebhooksAPI.APIMeta;
176
+ meta?: CampaignCreateResponse.Meta;
181
177
 
182
178
  /**
183
179
  * Indicates whether the request was successful
@@ -185,181 +181,338 @@ export interface APIResponseOfTcrCampaignWithUseCases {
185
181
  success?: boolean;
186
182
  }
187
183
 
188
- export interface BaseDto {
184
+ export namespace CampaignCreateResponse {
189
185
  /**
190
- * Unique identifier
186
+ * The response data (null if error)
191
187
  */
192
- id?: string;
188
+ export interface Data {
189
+ /**
190
+ * Unique identifier
191
+ */
192
+ id?: string;
193
193
 
194
- createdAt?: string;
194
+ billedDate?: string | null;
195
195
 
196
- updatedAt?: string | null;
197
- }
196
+ brandId?: string | null;
198
197
 
199
- /**
200
- * Campaign data for create or update operation
201
- */
202
- export interface CampaignData {
203
- /**
204
- * Campaign description
205
- */
206
- description: string;
198
+ cost?: number | null;
207
199
 
208
- /**
209
- * Campaign name
210
- */
211
- name: string;
200
+ createdAt?: string;
212
201
 
213
- /**
214
- * Campaign type (e.g., "KYC", "App")
215
- */
216
- type: string;
202
+ cspId?: string | null;
217
203
 
218
- /**
219
- * List of use cases with sample messages
220
- */
221
- useCases: Array<SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData>;
204
+ customerId?: string;
222
205
 
223
- /**
224
- * Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
225
- */
226
- helpKeywords?: string | null;
206
+ dcaElectionsComplete?: boolean;
227
207
 
228
- /**
229
- * Message sent when user requests help
230
- */
231
- helpMessage?: string | null;
208
+ dcaElectionsCompletedAt?: string | null;
209
+
210
+ description?: string;
211
+
212
+ helpKeywords?: string | null;
213
+
214
+ helpMessage?: string | null;
215
+
216
+ kycSubmissionFormId?: string | null;
217
+
218
+ messageFlow?: string | null;
219
+
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;
245
+
246
+ telnyxCampaignId?: string | null;
247
+
248
+ termsAndConditionsLink?: string | null;
249
+
250
+ type?: string;
251
+
252
+ updatedAt?: string | null;
253
+
254
+ upstreamCnpId?: string | null;
255
+
256
+ useCases?: Array<Data.UseCase>;
257
+ }
258
+
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
+ }
232
292
 
233
293
  /**
234
- * Description of how messages flow in the campaign
294
+ * Error information
235
295
  */
236
- messageFlow?: string | null;
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
+ }
237
317
 
238
318
  /**
239
- * Comma-separated keywords that trigger opt-in (e.g., "YES, START, SUBSCRIBE")
319
+ * Request and response metadata
240
320
  */
241
- optinKeywords?: string | null;
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
+ }
242
338
 
339
+ /**
340
+ * Standard API response envelope for all v3 endpoints
341
+ */
342
+ export interface CampaignUpdateResponse {
243
343
  /**
244
- * Message sent when user opts in
344
+ * The response data (null if error)
245
345
  */
246
- optinMessage?: string | null;
346
+ data?: CampaignUpdateResponse.Data | null;
247
347
 
248
348
  /**
249
- * Comma-separated keywords that trigger opt-out (e.g., "STOP, UNSUBSCRIBE, END")
349
+ * Error information
250
350
  */
251
- optoutKeywords?: string | null;
351
+ error?: CampaignUpdateResponse.Error | null;
252
352
 
253
353
  /**
254
- * Message sent when user opts out
354
+ * Request and response metadata
255
355
  */
256
- optoutMessage?: string | null;
356
+ meta?: CampaignUpdateResponse.Meta;
257
357
 
258
358
  /**
259
- * URL to privacy policy
359
+ * Indicates whether the request was successful
260
360
  */
261
- privacyPolicyLink?: string | null;
361
+ success?: boolean;
362
+ }
262
363
 
364
+ export namespace CampaignUpdateResponse {
263
365
  /**
264
- * URL to terms and conditions
366
+ * The response data (null if error)
265
367
  */
266
- termsAndConditionsLink?: string | null;
267
- }
368
+ export interface Data {
369
+ /**
370
+ * Unique identifier
371
+ */
372
+ id?: string;
268
373
 
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';
374
+ billedDate?: string | null;
283
375
 
284
- /**
285
- * Campaign use case with sample messages
286
- */
287
- export interface SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData {
288
- messagingUseCaseUs: MessagingUseCaseUs;
376
+ brandId?: string | null;
289
377
 
290
- /**
291
- * Sample messages for this use case (1-5 messages, max 1024 characters each)
292
- */
293
- sampleMessages: Array<string>;
294
- }
378
+ cost?: number | null;
295
379
 
296
- export interface TcrCampaignWithUseCases extends BaseDto {
297
- billedDate?: string | null;
380
+ createdAt?: string;
298
381
 
299
- brandId?: string | null;
382
+ cspId?: string | null;
300
383
 
301
- cost?: number | null;
384
+ customerId?: string;
302
385
 
303
- cspId?: string | null;
386
+ dcaElectionsComplete?: boolean;
304
387
 
305
- customerId?: string;
388
+ dcaElectionsCompletedAt?: string | null;
306
389
 
307
- description?: string;
390
+ description?: string;
308
391
 
309
- helpKeywords?: string | null;
392
+ helpKeywords?: string | null;
310
393
 
311
- helpMessage?: string | null;
394
+ helpMessage?: string | null;
312
395
 
313
- kycSubmissionFormId?: string | null;
396
+ kycSubmissionFormId?: string | null;
314
397
 
315
- messageFlow?: string | null;
398
+ messageFlow?: string | null;
316
399
 
317
- name?: string;
400
+ name?: string;
318
401
 
319
- optinKeywords?: string | null;
402
+ optinKeywords?: string | null;
320
403
 
321
- optinMessage?: string | null;
404
+ optinMessage?: string | null;
322
405
 
323
- optoutKeywords?: string | null;
406
+ optoutKeywords?: string | null;
324
407
 
325
- optoutMessage?: string | null;
408
+ optoutMessage?: string | null;
326
409
 
327
- privacyPolicyLink?: string | null;
410
+ privacyPolicyLink?: string | null;
328
411
 
329
- resellerId?: string | null;
412
+ resellerId?: string | null;
330
413
 
331
- sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
414
+ sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
332
415
 
333
- status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
416
+ status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
334
417
 
335
- submittedAt?: string | null;
418
+ submittedAt?: string | null;
336
419
 
337
- submittedToTCR?: boolean;
420
+ submittedToTCR?: boolean;
338
421
 
339
- tcrCampaignId?: string | null;
422
+ tcrCampaignId?: string | null;
340
423
 
341
- tcrSyncError?: string | null;
424
+ tcrSyncError?: string | null;
342
425
 
343
- telnyxCampaignId?: string | null;
426
+ telnyxCampaignId?: string | null;
344
427
 
345
- termsAndConditionsLink?: string | null;
428
+ termsAndConditionsLink?: string | null;
346
429
 
347
- type?: string;
430
+ type?: string;
348
431
 
349
- upstreamCnpId?: string | null;
432
+ updatedAt?: string | null;
350
433
 
351
- useCases?: Array<TcrCampaignWithUseCases.UseCase>;
352
- }
434
+ upstreamCnpId?: string | null;
353
435
 
354
- export namespace TcrCampaignWithUseCases {
355
- export interface UseCase extends CampaignsAPI.BaseDto {
356
- campaignId?: string;
436
+ useCases?: Array<Data.UseCase>;
437
+ }
357
438
 
358
- customerId?: string;
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
+ }
359
472
 
360
- messagingUseCaseUs?: CampaignsAPI.MessagingUseCaseUs;
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
+ }
361
497
 
362
- sampleMessages?: Array<string>;
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;
363
516
  }
364
517
  }
365
518
 
@@ -370,17 +523,17 @@ export interface CampaignListResponse {
370
523
  /**
371
524
  * The response data (null if error)
372
525
  */
373
- data?: Array<TcrCampaignWithUseCases> | null;
526
+ data?: Array<CampaignListResponse.Data> | null;
374
527
 
375
528
  /**
376
529
  * Error information
377
530
  */
378
- error?: WebhooksAPI.ErrorDetail | null;
531
+ error?: CampaignListResponse.Error | null;
379
532
 
380
533
  /**
381
534
  * Request and response metadata
382
535
  */
383
- meta?: WebhooksAPI.APIMeta;
536
+ meta?: CampaignListResponse.Meta;
384
537
 
385
538
  /**
386
539
  * Indicates whether the request was successful
@@ -388,11 +541,163 @@ export interface CampaignListResponse {
388
541
  success?: boolean;
389
542
  }
390
543
 
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
+
391
696
  export interface CampaignCreateParams {
392
697
  /**
393
698
  * Body param: Campaign data for create or update operation
394
699
  */
395
- campaign: CampaignData;
700
+ campaign: CampaignCreateParams.Campaign;
396
701
 
397
702
  /**
398
703
  * Body param: Sandbox flag - when true, the operation is simulated without side
@@ -415,6 +720,105 @@ export interface CampaignCreateParams {
415
720
  'x-profile-id'?: string;
416
721
  }
417
722
 
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
+
418
822
  export interface CampaignUpdateParams {
419
823
  /**
420
824
  * Path param: Profile ID from route
@@ -424,7 +828,7 @@ export interface CampaignUpdateParams {
424
828
  /**
425
829
  * Body param: Campaign data for create or update operation
426
830
  */
427
- campaign: CampaignData;
831
+ campaign: CampaignUpdateParams.Campaign;
428
832
 
429
833
  /**
430
834
  * Body param: Sandbox flag - when true, the operation is simulated without side
@@ -447,6 +851,105 @@ export interface CampaignUpdateParams {
447
851
  'x-profile-id'?: string;
448
852
  }
449
853
 
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
+
450
953
  export interface CampaignListParams {
451
954
  /**
452
955
  * Profile UUID to scope the request to a child profile. Only organization API keys
@@ -477,12 +980,8 @@ export interface CampaignDeleteParams {
477
980
 
478
981
  export declare namespace Campaigns {
479
982
  export {
480
- type APIResponseOfTcrCampaignWithUseCases as APIResponseOfTcrCampaignWithUseCases,
481
- type BaseDto as BaseDto,
482
- type CampaignData as CampaignData,
483
- type MessagingUseCaseUs as MessagingUseCaseUs,
484
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData as SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData,
485
- type TcrCampaignWithUseCases as TcrCampaignWithUseCases,
983
+ type CampaignCreateResponse as CampaignCreateResponse,
984
+ type CampaignUpdateResponse as CampaignUpdateResponse,
486
985
  type CampaignListResponse as CampaignListResponse,
487
986
  type CampaignCreateParams as CampaignCreateParams,
488
987
  type CampaignUpdateParams as CampaignUpdateParams,