@sentdm/sentdm 0.25.3 → 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 (110) hide show
  1. package/CHANGELOG.md +22 -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/internal/utils/log.d.mts.map +1 -1
  9. package/internal/utils/log.d.ts.map +1 -1
  10. package/internal/utils/log.js +3 -2
  11. package/internal/utils/log.js.map +1 -1
  12. package/internal/utils/log.mjs +3 -2
  13. package/internal/utils/log.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/contacts.d.mts +488 -68
  16. package/resources/contacts.d.mts.map +1 -1
  17. package/resources/contacts.d.ts +488 -68
  18. package/resources/contacts.d.ts.map +1 -1
  19. package/resources/contacts.js +3 -3
  20. package/resources/contacts.js.map +1 -1
  21. package/resources/contacts.mjs +3 -3
  22. package/resources/contacts.mjs.map +1 -1
  23. package/resources/index.d.mts +6 -6
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +6 -6
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs.map +1 -1
  29. package/resources/me.d.mts +113 -40
  30. package/resources/me.d.mts.map +1 -1
  31. package/resources/me.d.ts +113 -40
  32. package/resources/me.d.ts.map +1 -1
  33. package/resources/me.js.map +1 -1
  34. package/resources/me.mjs.map +1 -1
  35. package/resources/messages.d.mts +130 -9
  36. package/resources/messages.d.mts.map +1 -1
  37. package/resources/messages.d.ts +130 -9
  38. package/resources/messages.d.ts.map +1 -1
  39. package/resources/messages.js.map +1 -1
  40. package/resources/messages.mjs.map +1 -1
  41. package/resources/numbers.d.mts +42 -3
  42. package/resources/numbers.d.mts.map +1 -1
  43. package/resources/numbers.d.ts +42 -3
  44. package/resources/numbers.d.ts.map +1 -1
  45. package/resources/numbers.js.map +1 -1
  46. package/resources/numbers.mjs.map +1 -1
  47. package/resources/profiles/campaigns.d.mts +480 -147
  48. package/resources/profiles/campaigns.d.mts.map +1 -1
  49. package/resources/profiles/campaigns.d.ts +480 -147
  50. package/resources/profiles/campaigns.d.ts.map +1 -1
  51. package/resources/profiles/campaigns.js +39 -41
  52. package/resources/profiles/campaigns.js.map +1 -1
  53. package/resources/profiles/campaigns.mjs +39 -41
  54. package/resources/profiles/campaigns.mjs.map +1 -1
  55. package/resources/profiles/index.d.mts +2 -2
  56. package/resources/profiles/index.d.mts.map +1 -1
  57. package/resources/profiles/index.d.ts +2 -2
  58. package/resources/profiles/index.d.ts.map +1 -1
  59. package/resources/profiles/index.js.map +1 -1
  60. package/resources/profiles/index.mjs.map +1 -1
  61. package/resources/profiles/profiles.d.mts +1699 -391
  62. package/resources/profiles/profiles.d.mts.map +1 -1
  63. package/resources/profiles/profiles.d.ts +1699 -391
  64. package/resources/profiles/profiles.d.ts.map +1 -1
  65. package/resources/profiles/profiles.js +3 -6
  66. package/resources/profiles/profiles.js.map +1 -1
  67. package/resources/profiles/profiles.mjs +3 -6
  68. package/resources/profiles/profiles.mjs.map +1 -1
  69. package/resources/templates.d.mts +993 -172
  70. package/resources/templates.d.mts.map +1 -1
  71. package/resources/templates.d.ts +993 -172
  72. package/resources/templates.d.ts.map +1 -1
  73. package/resources/templates.js +3 -3
  74. package/resources/templates.js.map +1 -1
  75. package/resources/templates.mjs +3 -3
  76. package/resources/templates.mjs.map +1 -1
  77. package/resources/users.d.mts +373 -46
  78. package/resources/users.d.mts.map +1 -1
  79. package/resources/users.d.ts +373 -46
  80. package/resources/users.d.ts.map +1 -1
  81. package/resources/users.js +3 -7
  82. package/resources/users.js.map +1 -1
  83. package/resources/users.mjs +3 -7
  84. package/resources/users.mjs.map +1 -1
  85. package/resources/webhooks.d.mts +624 -110
  86. package/resources/webhooks.d.mts.map +1 -1
  87. package/resources/webhooks.d.ts +624 -110
  88. package/resources/webhooks.d.ts.map +1 -1
  89. package/resources/webhooks.js +6 -7
  90. package/resources/webhooks.js.map +1 -1
  91. package/resources/webhooks.mjs +6 -7
  92. package/resources/webhooks.mjs.map +1 -1
  93. package/src/client.ts +33 -68
  94. package/src/internal/utils/log.ts +2 -1
  95. package/src/resources/contacts.ts +567 -66
  96. package/src/resources/index.ts +17 -34
  97. package/src/resources/me.ts +132 -51
  98. package/src/resources/messages.ts +147 -9
  99. package/src/resources/numbers.ts +47 -3
  100. package/src/resources/profiles/campaigns.ts +668 -169
  101. package/src/resources/profiles/index.ts +5 -17
  102. package/src/resources/profiles/profiles.ts +2278 -545
  103. package/src/resources/templates.ts +1261 -206
  104. package/src/resources/users.ts +430 -47
  105. package/src/resources/webhooks.ts +742 -120
  106. package/src/version.ts +1 -1
  107. package/version.d.mts +1 -1
  108. package/version.d.ts +1 -1
  109. package/version.js +1 -1
  110. 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 ContactsAPI from './contacts';
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,10 +16,10 @@ export class Contacts extends APIResource {
18
16
  *
19
17
  * @example
20
18
  * ```ts
21
- * const apiResponseOfContact = await client.contacts.create();
19
+ * const contact = await client.contacts.create();
22
20
  * ```
23
21
  */
24
- create(params: ContactCreateParams, options?: RequestOptions): APIPromise<APIResponseOfContact> {
22
+ create(params: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse> {
25
23
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
26
24
  return this._client.post('/v3/contacts', {
27
25
  body,
@@ -43,7 +41,7 @@ export class Contacts extends APIResource {
43
41
  *
44
42
  * @example
45
43
  * ```ts
46
- * const apiResponseOfContact = await client.contacts.retrieve(
44
+ * const contact = await client.contacts.retrieve(
47
45
  * '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
48
46
  * );
49
47
  * ```
@@ -52,7 +50,7 @@ export class Contacts extends APIResource {
52
50
  id: string,
53
51
  params: ContactRetrieveParams | null | undefined = {},
54
52
  options?: RequestOptions,
55
- ): APIPromise<APIResponseOfContact> {
53
+ ): APIPromise<ContactRetrieveResponse> {
56
54
  const { 'x-profile-id': xProfileID } = params ?? {};
57
55
  return this._client.get(path`/v3/contacts/${id}`, {
58
56
  ...options,
@@ -69,7 +67,7 @@ export class Contacts extends APIResource {
69
67
  *
70
68
  * @example
71
69
  * ```ts
72
- * const apiResponseOfContact = await client.contacts.update(
70
+ * const contact = await client.contacts.update(
73
71
  * '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
74
72
  * );
75
73
  * ```
@@ -78,7 +76,7 @@ export class Contacts extends APIResource {
78
76
  id: string,
79
77
  params: ContactUpdateParams,
80
78
  options?: RequestOptions,
81
- ): APIPromise<APIResponseOfContact> {
79
+ ): APIPromise<ContactUpdateResponse> {
82
80
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
83
81
  return this._client.patch(path`/v3/contacts/${id}`, {
84
82
  body,
@@ -144,21 +142,21 @@ export class Contacts extends APIResource {
144
142
  /**
145
143
  * Standard API response envelope for all v3 endpoints
146
144
  */
147
- export interface APIResponseOfContact {
145
+ export interface ContactCreateResponse {
148
146
  /**
149
147
  * Contact response for v3 API Uses snake_case for JSON property names
150
148
  */
151
- data?: ContactResponse | null;
149
+ data?: ContactCreateResponse.Data | null;
152
150
 
153
151
  /**
154
152
  * Error information
155
153
  */
156
- error?: WebhooksAPI.ErrorDetail | null;
154
+ error?: ContactCreateResponse.Error | null;
157
155
 
158
156
  /**
159
157
  * Request and response metadata
160
158
  */
161
- meta?: WebhooksAPI.APIMeta;
159
+ meta?: ContactCreateResponse.Meta;
162
160
 
163
161
  /**
164
162
  * Indicates whether the request was successful
@@ -166,87 +164,423 @@ export interface APIResponseOfContact {
166
164
  success?: boolean;
167
165
  }
168
166
 
169
- /**
170
- * Contact response for v3 API Uses snake_case for JSON property names
171
- */
172
- export interface ContactResponse {
167
+ export namespace ContactCreateResponse {
173
168
  /**
174
- * Unique identifier for the contact
169
+ * Contact response for v3 API Uses snake_case for JSON property names
175
170
  */
176
- id?: string;
171
+ export interface Data {
172
+ /**
173
+ * Unique identifier for the contact
174
+ */
175
+ id?: string;
176
+
177
+ /**
178
+ * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
179
+ */
180
+ available_channels?: string;
181
+
182
+ /**
183
+ * Country calling code (e.g., 1 for US/Canada)
184
+ */
185
+ country_code?: string;
186
+
187
+ /**
188
+ * When the contact was created
189
+ */
190
+ created_at?: string;
191
+
192
+ /**
193
+ * Default messaging channel to use (e.g., "sms" or "whatsapp")
194
+ */
195
+ default_channel?: string;
196
+
197
+ /**
198
+ * Phone number in E.164 format (e.g., +1234567890)
199
+ */
200
+ format_e164?: string;
201
+
202
+ /**
203
+ * Phone number in international format (e.g., +1 234-567-890)
204
+ */
205
+ format_international?: string;
206
+
207
+ /**
208
+ * Phone number in national format (e.g., (234) 567-890)
209
+ */
210
+ format_national?: string;
211
+
212
+ /**
213
+ * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
214
+ */
215
+ format_rfc?: string;
216
+
217
+ /**
218
+ * Whether this is an inherited contact (read-only)
219
+ */
220
+ is_inherited?: boolean;
221
+
222
+ /**
223
+ * Whether the contact has opted out of messaging. Single source of truth — opt-out
224
+ * is per-contact, not per-channel.
225
+ */
226
+ opt_out?: boolean;
227
+
228
+ /**
229
+ * Phone number in original format
230
+ */
231
+ phone_number?: string;
232
+
233
+ /**
234
+ * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
235
+ */
236
+ region_code?: string;
237
+
238
+ /**
239
+ * When the contact was last updated
240
+ */
241
+ updated_at?: string | null;
242
+ }
177
243
 
178
244
  /**
179
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
245
+ * Error information
180
246
  */
181
- available_channels?: string;
247
+ export interface Error {
248
+ /**
249
+ * Machine-readable error code (e.g., "RESOURCE_001")
250
+ */
251
+ code?: string;
252
+
253
+ /**
254
+ * Additional validation error details (field-level errors)
255
+ */
256
+ details?: { [key: string]: Array<string> } | null;
257
+
258
+ /**
259
+ * URL to documentation about this error
260
+ */
261
+ doc_url?: string | null;
262
+
263
+ /**
264
+ * Human-readable error message
265
+ */
266
+ message?: string;
267
+ }
182
268
 
183
269
  /**
184
- * Consent status by channel. Keys: "sms", "whatsapp". Values: "opted_in",
185
- * "opted_out". All channels will have the same status because consent is global
186
- * across channels. A STOP on any channel opts out of all channels; a START opts in
187
- * to all.
270
+ * Request and response metadata
188
271
  */
189
- channel_consent?: { [key: string]: string } | null;
272
+ export interface Meta {
273
+ /**
274
+ * Unique identifier for this request (for tracing and support)
275
+ */
276
+ request_id?: string;
277
+
278
+ /**
279
+ * Server timestamp when the response was generated
280
+ */
281
+ timestamp?: string;
190
282
 
283
+ /**
284
+ * API version used for this request
285
+ */
286
+ version?: string;
287
+ }
288
+ }
289
+
290
+ /**
291
+ * Standard API response envelope for all v3 endpoints
292
+ */
293
+ export interface ContactRetrieveResponse {
191
294
  /**
192
- * Country calling code (e.g., 1 for US/Canada)
295
+ * Contact response for v3 API Uses snake_case for JSON property names
193
296
  */
194
- country_code?: string;
297
+ data?: ContactRetrieveResponse.Data | null;
195
298
 
196
299
  /**
197
- * When the contact was created
300
+ * Error information
198
301
  */
199
- created_at?: string;
302
+ error?: ContactRetrieveResponse.Error | null;
200
303
 
201
304
  /**
202
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
305
+ * Request and response metadata
203
306
  */
204
- default_channel?: string;
307
+ meta?: ContactRetrieveResponse.Meta;
205
308
 
206
309
  /**
207
- * Phone number in E.164 format (e.g., +1234567890)
310
+ * Indicates whether the request was successful
208
311
  */
209
- format_e164?: string;
312
+ success?: boolean;
313
+ }
314
+
315
+ export namespace ContactRetrieveResponse {
316
+ /**
317
+ * Contact response for v3 API Uses snake_case for JSON property names
318
+ */
319
+ export interface Data {
320
+ /**
321
+ * Unique identifier for the contact
322
+ */
323
+ id?: string;
324
+
325
+ /**
326
+ * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
327
+ */
328
+ available_channels?: string;
329
+
330
+ /**
331
+ * Country calling code (e.g., 1 for US/Canada)
332
+ */
333
+ country_code?: string;
334
+
335
+ /**
336
+ * When the contact was created
337
+ */
338
+ created_at?: string;
339
+
340
+ /**
341
+ * Default messaging channel to use (e.g., "sms" or "whatsapp")
342
+ */
343
+ default_channel?: string;
344
+
345
+ /**
346
+ * Phone number in E.164 format (e.g., +1234567890)
347
+ */
348
+ format_e164?: string;
349
+
350
+ /**
351
+ * Phone number in international format (e.g., +1 234-567-890)
352
+ */
353
+ format_international?: string;
354
+
355
+ /**
356
+ * Phone number in national format (e.g., (234) 567-890)
357
+ */
358
+ format_national?: string;
359
+
360
+ /**
361
+ * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
362
+ */
363
+ format_rfc?: string;
364
+
365
+ /**
366
+ * Whether this is an inherited contact (read-only)
367
+ */
368
+ is_inherited?: boolean;
369
+
370
+ /**
371
+ * Whether the contact has opted out of messaging. Single source of truth — opt-out
372
+ * is per-contact, not per-channel.
373
+ */
374
+ opt_out?: boolean;
375
+
376
+ /**
377
+ * Phone number in original format
378
+ */
379
+ phone_number?: string;
380
+
381
+ /**
382
+ * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
383
+ */
384
+ region_code?: string;
385
+
386
+ /**
387
+ * When the contact was last updated
388
+ */
389
+ updated_at?: string | null;
390
+ }
391
+
392
+ /**
393
+ * Error information
394
+ */
395
+ export interface Error {
396
+ /**
397
+ * Machine-readable error code (e.g., "RESOURCE_001")
398
+ */
399
+ code?: string;
400
+
401
+ /**
402
+ * Additional validation error details (field-level errors)
403
+ */
404
+ details?: { [key: string]: Array<string> } | null;
405
+
406
+ /**
407
+ * URL to documentation about this error
408
+ */
409
+ doc_url?: string | null;
410
+
411
+ /**
412
+ * Human-readable error message
413
+ */
414
+ message?: string;
415
+ }
210
416
 
211
417
  /**
212
- * Phone number in international format (e.g., +1 234-567-890)
418
+ * Request and response metadata
213
419
  */
214
- format_international?: string;
420
+ export interface Meta {
421
+ /**
422
+ * Unique identifier for this request (for tracing and support)
423
+ */
424
+ request_id?: string;
425
+
426
+ /**
427
+ * Server timestamp when the response was generated
428
+ */
429
+ timestamp?: string;
430
+
431
+ /**
432
+ * API version used for this request
433
+ */
434
+ version?: string;
435
+ }
436
+ }
215
437
 
438
+ /**
439
+ * Standard API response envelope for all v3 endpoints
440
+ */
441
+ export interface ContactUpdateResponse {
216
442
  /**
217
- * Phone number in national format (e.g., (234) 567-890)
443
+ * Contact response for v3 API Uses snake_case for JSON property names
218
444
  */
219
- format_national?: string;
445
+ data?: ContactUpdateResponse.Data | null;
220
446
 
221
447
  /**
222
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
448
+ * Error information
223
449
  */
224
- format_rfc?: string;
450
+ error?: ContactUpdateResponse.Error | null;
225
451
 
226
452
  /**
227
- * Whether this is an inherited contact (read-only)
453
+ * Request and response metadata
228
454
  */
229
- is_inherited?: boolean;
455
+ meta?: ContactUpdateResponse.Meta;
230
456
 
231
457
  /**
232
- * Whether the contact has opted out of messaging
458
+ * Indicates whether the request was successful
233
459
  */
234
- opt_out?: boolean;
460
+ success?: boolean;
461
+ }
235
462
 
463
+ export namespace ContactUpdateResponse {
236
464
  /**
237
- * Phone number in original format
465
+ * Contact response for v3 API Uses snake_case for JSON property names
238
466
  */
239
- phone_number?: string;
467
+ export interface Data {
468
+ /**
469
+ * Unique identifier for the contact
470
+ */
471
+ id?: string;
472
+
473
+ /**
474
+ * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
475
+ */
476
+ available_channels?: string;
477
+
478
+ /**
479
+ * Country calling code (e.g., 1 for US/Canada)
480
+ */
481
+ country_code?: string;
482
+
483
+ /**
484
+ * When the contact was created
485
+ */
486
+ created_at?: string;
487
+
488
+ /**
489
+ * Default messaging channel to use (e.g., "sms" or "whatsapp")
490
+ */
491
+ default_channel?: string;
492
+
493
+ /**
494
+ * Phone number in E.164 format (e.g., +1234567890)
495
+ */
496
+ format_e164?: string;
497
+
498
+ /**
499
+ * Phone number in international format (e.g., +1 234-567-890)
500
+ */
501
+ format_international?: string;
502
+
503
+ /**
504
+ * Phone number in national format (e.g., (234) 567-890)
505
+ */
506
+ format_national?: string;
507
+
508
+ /**
509
+ * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
510
+ */
511
+ format_rfc?: string;
512
+
513
+ /**
514
+ * Whether this is an inherited contact (read-only)
515
+ */
516
+ is_inherited?: boolean;
517
+
518
+ /**
519
+ * Whether the contact has opted out of messaging. Single source of truth — opt-out
520
+ * is per-contact, not per-channel.
521
+ */
522
+ opt_out?: boolean;
523
+
524
+ /**
525
+ * Phone number in original format
526
+ */
527
+ phone_number?: string;
528
+
529
+ /**
530
+ * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
531
+ */
532
+ region_code?: string;
533
+
534
+ /**
535
+ * When the contact was last updated
536
+ */
537
+ updated_at?: string | null;
538
+ }
240
539
 
241
540
  /**
242
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
541
+ * Error information
243
542
  */
244
- region_code?: string;
543
+ export interface Error {
544
+ /**
545
+ * Machine-readable error code (e.g., "RESOURCE_001")
546
+ */
547
+ code?: string;
548
+
549
+ /**
550
+ * Additional validation error details (field-level errors)
551
+ */
552
+ details?: { [key: string]: Array<string> } | null;
553
+
554
+ /**
555
+ * URL to documentation about this error
556
+ */
557
+ doc_url?: string | null;
558
+
559
+ /**
560
+ * Human-readable error message
561
+ */
562
+ message?: string;
563
+ }
245
564
 
246
565
  /**
247
- * When the contact was last updated
566
+ * Request and response metadata
248
567
  */
249
- updated_at?: string | null;
568
+ export interface Meta {
569
+ /**
570
+ * Unique identifier for this request (for tracing and support)
571
+ */
572
+ request_id?: string;
573
+
574
+ /**
575
+ * Server timestamp when the response was generated
576
+ */
577
+ timestamp?: string;
578
+
579
+ /**
580
+ * API version used for this request
581
+ */
582
+ version?: string;
583
+ }
250
584
  }
251
585
 
252
586
  /**
@@ -261,12 +595,12 @@ export interface ContactListResponse {
261
595
  /**
262
596
  * Error information
263
597
  */
264
- error?: WebhooksAPI.ErrorDetail | null;
598
+ error?: ContactListResponse.Error | null;
265
599
 
266
600
  /**
267
601
  * Request and response metadata
268
602
  */
269
- meta?: WebhooksAPI.APIMeta;
603
+ meta?: ContactListResponse.Meta;
270
604
 
271
605
  /**
272
606
  * Indicates whether the request was successful
@@ -282,12 +616,187 @@ export namespace ContactListResponse {
282
616
  /**
283
617
  * List of contacts
284
618
  */
285
- contacts?: Array<ContactsAPI.ContactResponse>;
619
+ contacts?: Array<Data.Contact>;
286
620
 
287
621
  /**
288
622
  * Pagination metadata for list responses
289
623
  */
290
- pagination?: WebhooksAPI.PaginationMeta;
624
+ pagination?: Data.Pagination;
625
+ }
626
+
627
+ export namespace Data {
628
+ /**
629
+ * Contact response for v3 API Uses snake_case for JSON property names
630
+ */
631
+ export interface Contact {
632
+ /**
633
+ * Unique identifier for the contact
634
+ */
635
+ id?: string;
636
+
637
+ /**
638
+ * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
639
+ */
640
+ available_channels?: string;
641
+
642
+ /**
643
+ * Country calling code (e.g., 1 for US/Canada)
644
+ */
645
+ country_code?: string;
646
+
647
+ /**
648
+ * When the contact was created
649
+ */
650
+ created_at?: string;
651
+
652
+ /**
653
+ * Default messaging channel to use (e.g., "sms" or "whatsapp")
654
+ */
655
+ default_channel?: string;
656
+
657
+ /**
658
+ * Phone number in E.164 format (e.g., +1234567890)
659
+ */
660
+ format_e164?: string;
661
+
662
+ /**
663
+ * Phone number in international format (e.g., +1 234-567-890)
664
+ */
665
+ format_international?: string;
666
+
667
+ /**
668
+ * Phone number in national format (e.g., (234) 567-890)
669
+ */
670
+ format_national?: string;
671
+
672
+ /**
673
+ * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
674
+ */
675
+ format_rfc?: string;
676
+
677
+ /**
678
+ * Whether this is an inherited contact (read-only)
679
+ */
680
+ is_inherited?: boolean;
681
+
682
+ /**
683
+ * Whether the contact has opted out of messaging. Single source of truth — opt-out
684
+ * is per-contact, not per-channel.
685
+ */
686
+ opt_out?: boolean;
687
+
688
+ /**
689
+ * Phone number in original format
690
+ */
691
+ phone_number?: string;
692
+
693
+ /**
694
+ * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
695
+ */
696
+ region_code?: string;
697
+
698
+ /**
699
+ * When the contact was last updated
700
+ */
701
+ updated_at?: string | null;
702
+ }
703
+
704
+ /**
705
+ * Pagination metadata for list responses
706
+ */
707
+ export interface Pagination {
708
+ /**
709
+ * Cursor-based pagination pointers
710
+ */
711
+ cursors?: Pagination.Cursors | null;
712
+
713
+ /**
714
+ * Whether there are more pages after this one
715
+ */
716
+ has_more?: boolean;
717
+
718
+ /**
719
+ * Current page number (1-indexed)
720
+ */
721
+ page?: number;
722
+
723
+ /**
724
+ * Number of items per page
725
+ */
726
+ page_size?: number;
727
+
728
+ /**
729
+ * Total number of items across all pages
730
+ */
731
+ total_count?: number;
732
+
733
+ /**
734
+ * Total number of pages
735
+ */
736
+ total_pages?: number;
737
+ }
738
+
739
+ export namespace Pagination {
740
+ /**
741
+ * Cursor-based pagination pointers
742
+ */
743
+ export interface Cursors {
744
+ /**
745
+ * Cursor to fetch the next page
746
+ */
747
+ after?: string | null;
748
+
749
+ /**
750
+ * Cursor to fetch the previous page
751
+ */
752
+ before?: string | null;
753
+ }
754
+ }
755
+ }
756
+
757
+ /**
758
+ * Error information
759
+ */
760
+ export interface Error {
761
+ /**
762
+ * Machine-readable error code (e.g., "RESOURCE_001")
763
+ */
764
+ code?: string;
765
+
766
+ /**
767
+ * Additional validation error details (field-level errors)
768
+ */
769
+ details?: { [key: string]: Array<string> } | null;
770
+
771
+ /**
772
+ * URL to documentation about this error
773
+ */
774
+ doc_url?: string | null;
775
+
776
+ /**
777
+ * Human-readable error message
778
+ */
779
+ message?: string;
780
+ }
781
+
782
+ /**
783
+ * Request and response metadata
784
+ */
785
+ export interface Meta {
786
+ /**
787
+ * Unique identifier for this request (for tracing and support)
788
+ */
789
+ request_id?: string;
790
+
791
+ /**
792
+ * Server timestamp when the response was generated
793
+ */
794
+ timestamp?: string;
795
+
796
+ /**
797
+ * API version used for this request
798
+ */
799
+ version?: string;
291
800
  }
292
801
  }
293
802
 
@@ -327,23 +836,14 @@ export interface ContactRetrieveParams {
327
836
  }
328
837
 
329
838
  export interface ContactUpdateParams {
330
- /**
331
- * Body param: Consent status by channel. Keys: "sms", "whatsapp". Values:
332
- * "opted_in", "opted_out". All entries must have the same status — mixed values
333
- * (e.g., sms: opted_out + whatsapp: opted_in) are rejected with 400. The provided
334
- * status is applied to ALL channels regardless of which keys are specified,
335
- * because consent is global across channels. When provided, takes precedence over
336
- * the opt_out field.
337
- */
338
- channel_consent?: { [key: string]: string } | null;
339
-
340
839
  /**
341
840
  * Body param: Default messaging channel: "sms" or "whatsapp"
342
841
  */
343
842
  default_channel?: string | null;
344
843
 
345
844
  /**
346
- * Body param: Whether the contact has opted out of messaging
845
+ * Body param: Whether the contact has opted out of messaging. Single source of
846
+ * truth — opt-out is per-contact, not per-channel.
347
847
  */
348
848
  opt_out?: boolean | null;
349
849
 
@@ -419,8 +919,9 @@ export interface ContactDeleteParams {
419
919
 
420
920
  export declare namespace Contacts {
421
921
  export {
422
- type APIResponseOfContact as APIResponseOfContact,
423
- type ContactResponse as ContactResponse,
922
+ type ContactCreateResponse as ContactCreateResponse,
923
+ type ContactRetrieveResponse as ContactRetrieveResponse,
924
+ type ContactUpdateResponse as ContactUpdateResponse,
424
925
  type ContactListResponse as ContactListResponse,
425
926
  type ContactCreateParams as ContactCreateParams,
426
927
  type ContactRetrieveParams as ContactRetrieveParams,