@sentdm/sentdm 0.36.0 → 0.37.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 (106) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/client.d.mts +14 -14
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +14 -14
  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 +85 -589
  10. package/resources/contacts.d.mts.map +1 -1
  11. package/resources/contacts.d.ts +85 -589
  12. package/resources/contacts.d.ts.map +1 -1
  13. package/resources/contacts.js +4 -4
  14. package/resources/contacts.js.map +1 -1
  15. package/resources/contacts.mjs +4 -4
  16. package/resources/contacts.mjs.map +1 -1
  17. package/resources/conversations.d.mts +69 -328
  18. package/resources/conversations.d.mts.map +1 -1
  19. package/resources/conversations.d.ts +69 -328
  20. package/resources/conversations.d.ts.map +1 -1
  21. package/resources/conversations.js +10 -8
  22. package/resources/conversations.js.map +1 -1
  23. package/resources/conversations.mjs +10 -8
  24. package/resources/conversations.mjs.map +1 -1
  25. package/resources/index.d.mts +7 -7
  26. package/resources/index.d.mts.map +1 -1
  27. package/resources/index.d.ts +7 -7
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js.map +1 -1
  30. package/resources/index.mjs.map +1 -1
  31. package/resources/me.d.mts +48 -129
  32. package/resources/me.d.mts.map +1 -1
  33. package/resources/me.d.ts +48 -129
  34. package/resources/me.d.ts.map +1 -1
  35. package/resources/me.js.map +1 -1
  36. package/resources/me.mjs.map +1 -1
  37. package/resources/messages.d.mts +8 -171
  38. package/resources/messages.d.mts.map +1 -1
  39. package/resources/messages.d.ts +8 -171
  40. package/resources/messages.d.ts.map +1 -1
  41. package/resources/messages.js.map +1 -1
  42. package/resources/messages.mjs.map +1 -1
  43. package/resources/numbers.d.mts +3 -42
  44. package/resources/numbers.d.mts.map +1 -1
  45. package/resources/numbers.d.ts +3 -42
  46. package/resources/numbers.d.ts.map +1 -1
  47. package/resources/numbers.js.map +1 -1
  48. package/resources/numbers.mjs.map +1 -1
  49. package/resources/profiles/campaigns.d.mts +149 -544
  50. package/resources/profiles/campaigns.d.mts.map +1 -1
  51. package/resources/profiles/campaigns.d.ts +149 -544
  52. package/resources/profiles/campaigns.d.ts.map +1 -1
  53. package/resources/profiles/index.d.mts +2 -2
  54. package/resources/profiles/index.d.mts.map +1 -1
  55. package/resources/profiles/index.d.ts +2 -2
  56. package/resources/profiles/index.d.ts.map +1 -1
  57. package/resources/profiles/index.js.map +1 -1
  58. package/resources/profiles/index.mjs.map +1 -1
  59. package/resources/profiles/profiles.d.mts +411 -1821
  60. package/resources/profiles/profiles.d.mts.map +1 -1
  61. package/resources/profiles/profiles.d.ts +411 -1821
  62. package/resources/profiles/profiles.d.ts.map +1 -1
  63. package/resources/profiles/profiles.js.map +1 -1
  64. package/resources/profiles/profiles.mjs.map +1 -1
  65. package/resources/templates.d.mts +84 -486
  66. package/resources/templates.d.mts.map +1 -1
  67. package/resources/templates.d.ts +84 -486
  68. package/resources/templates.d.ts.map +1 -1
  69. package/resources/templates.js +3 -3
  70. package/resources/templates.js.map +1 -1
  71. package/resources/templates.mjs +3 -3
  72. package/resources/templates.mjs.map +1 -1
  73. package/resources/users.d.mts +47 -437
  74. package/resources/users.d.mts.map +1 -1
  75. package/resources/users.d.ts +47 -437
  76. package/resources/users.d.ts.map +1 -1
  77. package/resources/users.js +3 -3
  78. package/resources/users.js.map +1 -1
  79. package/resources/users.mjs +3 -3
  80. package/resources/users.mjs.map +1 -1
  81. package/resources/webhooks.d.mts +166 -745
  82. package/resources/webhooks.d.mts.map +1 -1
  83. package/resources/webhooks.d.ts +166 -745
  84. package/resources/webhooks.d.ts.map +1 -1
  85. package/resources/webhooks.js +7 -6
  86. package/resources/webhooks.js.map +1 -1
  87. package/resources/webhooks.mjs +7 -6
  88. package/resources/webhooks.mjs.map +1 -1
  89. package/src/client.ts +52 -39
  90. package/src/resources/contacts.ts +88 -678
  91. package/src/resources/conversations.ts +77 -393
  92. package/src/resources/index.ts +26 -20
  93. package/src/resources/me.ts +59 -148
  94. package/src/resources/messages.ts +8 -194
  95. package/src/resources/numbers.ts +3 -47
  96. package/src/resources/profiles/campaigns.ts +174 -673
  97. package/src/resources/profiles/index.ts +14 -6
  98. package/src/resources/profiles/profiles.ts +529 -2216
  99. package/src/resources/templates.ts +100 -572
  100. package/src/resources/users.ts +48 -505
  101. package/src/resources/webhooks.ts +282 -981
  102. package/src/version.ts +1 -1
  103. package/version.d.mts +1 -1
  104. package/version.d.ts +1 -1
  105. package/version.js +1 -1
  106. 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 ContactsAPI from './contacts';
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';
@@ -20,12 +22,12 @@ export class Contacts extends APIResource {
20
22
  *
21
23
  * @example
22
24
  * ```ts
23
- * const contact = await client.contacts.create({
25
+ * const apiResponseOfContact = await client.contacts.create({
24
26
  * phone_number: '+1234567890',
25
27
  * });
26
28
  * ```
27
29
  */
28
- create(params: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse> {
30
+ create(params: ContactCreateParams, options?: RequestOptions): APIPromise<APIResponseOfContact> {
29
31
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
30
32
  return this._client.post('/v3/contacts', {
31
33
  body,
@@ -47,7 +49,7 @@ export class Contacts extends APIResource {
47
49
  *
48
50
  * @example
49
51
  * ```ts
50
- * const contact = await client.contacts.retrieve(
52
+ * const apiResponseOfContact = await client.contacts.retrieve(
51
53
  * '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
52
54
  * );
53
55
  * ```
@@ -56,7 +58,7 @@ export class Contacts extends APIResource {
56
58
  id: string,
57
59
  params: ContactRetrieveParams | null | undefined = {},
58
60
  options?: RequestOptions,
59
- ): APIPromise<ContactRetrieveResponse> {
61
+ ): APIPromise<APIResponseOfContact> {
60
62
  const { 'x-profile-id': xProfileID } = params ?? {};
61
63
  return this._client.get(path`/v3/contacts/${id}`, {
62
64
  ...options,
@@ -72,7 +74,7 @@ export class Contacts extends APIResource {
72
74
  *
73
75
  * @example
74
76
  * ```ts
75
- * const contact = await client.contacts.update(
77
+ * const apiResponseOfContact = await client.contacts.update(
76
78
  * '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
77
79
  * );
78
80
  * ```
@@ -81,7 +83,7 @@ export class Contacts extends APIResource {
81
83
  id: string,
82
84
  params: ContactUpdateParams,
83
85
  options?: RequestOptions,
84
- ): APIPromise<ContactUpdateResponse> {
86
+ ): APIPromise<APIResponseOfContact> {
85
87
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
86
88
  return this._client.patch(path`/v3/contacts/${id}`, {
87
89
  body,
@@ -154,7 +156,7 @@ export class Contacts extends APIResource {
154
156
  *
155
157
  * @example
156
158
  * ```ts
157
- * const response =
159
+ * const apiResponseOfContactMessageSummary =
158
160
  * await client.contacts.retrieveMessageSummary(
159
161
  * '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
160
162
  * );
@@ -164,7 +166,7 @@ export class Contacts extends APIResource {
164
166
  contactID: string,
165
167
  params: ContactRetrieveMessageSummaryParams | null | undefined = {},
166
168
  options?: RequestOptions,
167
- ): APIPromise<ContactRetrieveMessageSummaryResponse> {
169
+ ): APIPromise<APIResponseOfContactMessageSummary> {
168
170
  const { 'x-profile-id': xProfileID } = params ?? {};
169
171
  return this._client.get(path`/v3/contacts/${contactID}/message-summary`, {
170
172
  ...options,
@@ -179,21 +181,21 @@ export class Contacts extends APIResource {
179
181
  /**
180
182
  * Standard API response envelope for all v3 endpoints
181
183
  */
182
- export interface ContactCreateResponse {
184
+ export interface APIResponseOfContact {
183
185
  /**
184
186
  * Contact response for v3 API Uses snake_case for JSON property names
185
187
  */
186
- data?: ContactCreateResponse.Data | null;
188
+ data?: ContactResponse | null;
187
189
 
188
190
  /**
189
191
  * Error information
190
192
  */
191
- error?: ContactCreateResponse.Error | null;
193
+ error?: WebhooksAPI.ErrorDetail | null;
192
194
 
193
195
  /**
194
196
  * Request and response metadata
195
197
  */
196
- meta?: ContactCreateResponse.Meta;
198
+ meta?: WebhooksAPI.APIMeta;
197
199
 
198
200
  /**
199
201
  * Indicates whether the request was successful
@@ -201,155 +203,24 @@ export interface ContactCreateResponse {
201
203
  success?: boolean;
202
204
  }
203
205
 
204
- export namespace ContactCreateResponse {
205
- /**
206
- * Contact response for v3 API Uses snake_case for JSON property names
207
- */
208
- export interface Data {
209
- /**
210
- * Unique identifier for the contact
211
- */
212
- id?: string;
213
-
214
- /**
215
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
216
- */
217
- available_channels?: string;
218
-
219
- /**
220
- * Country calling code (e.g., 1 for US/Canada)
221
- */
222
- country_code?: string;
223
-
224
- /**
225
- * When the contact was created
226
- */
227
- created_at?: string;
228
-
229
- /**
230
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
231
- * Says whose resource this is, which the resource's own id does not.
232
- */
233
- customer_id?: string;
234
-
235
- /**
236
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
237
- */
238
- default_channel?: string;
239
-
240
- /**
241
- * Phone number in E.164 format (e.g., +1234567890)
242
- */
243
- format_e164?: string;
244
-
245
- /**
246
- * Phone number in international format (e.g., +1 234-567-890)
247
- */
248
- format_international?: string;
249
-
250
- /**
251
- * Phone number in national format (e.g., (234) 567-890)
252
- */
253
- format_national?: string;
254
-
255
- /**
256
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
257
- */
258
- format_rfc?: string;
259
-
260
- /**
261
- * @deprecated Always false. Contacts are no longer shared or inherited between
262
- * sender profiles — a profile sees only the contacts it owns. Retained so existing
263
- * v3 clients reading is_inherited keep deserializing; it carries no information.
264
- */
265
- is_inherited?: boolean;
266
-
267
- /**
268
- * Whether the contact has opted out of messaging. Single source of truth — opt-out
269
- * is per-contact, not per-channel.
270
- */
271
- opt_out?: boolean;
272
-
273
- /**
274
- * Phone number in original format
275
- */
276
- phone_number?: string;
277
-
278
- /**
279
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
280
- */
281
- region_code?: string;
282
-
283
- /**
284
- * When the contact was last updated
285
- */
286
- updated_at?: string | null;
287
- }
288
-
289
- /**
290
- * Error information
291
- */
292
- export interface Error {
293
- /**
294
- * Machine-readable error code (e.g., "RESOURCE_001")
295
- */
296
- code?: string;
297
-
298
- /**
299
- * Additional validation error details (field-level errors)
300
- */
301
- details?: { [key: string]: Array<string> } | null;
302
-
303
- /**
304
- * URL to documentation about this error
305
- */
306
- doc_url?: string | null;
307
-
308
- /**
309
- * Human-readable error message
310
- */
311
- message?: string;
312
- }
313
-
314
- /**
315
- * Request and response metadata
316
- */
317
- export interface Meta {
318
- /**
319
- * Unique identifier for this request (for tracing and support)
320
- */
321
- request_id?: string;
322
-
323
- /**
324
- * Server timestamp when the response was generated
325
- */
326
- timestamp?: string;
327
-
328
- /**
329
- * API version used for this request
330
- */
331
- version?: string;
332
- }
333
- }
334
-
335
206
  /**
336
207
  * Standard API response envelope for all v3 endpoints
337
208
  */
338
- export interface ContactRetrieveResponse {
209
+ export interface APIResponseOfContactMessageSummary {
339
210
  /**
340
- * Contact response for v3 API Uses snake_case for JSON property names
211
+ * The response data (null if error)
341
212
  */
342
- data?: ContactRetrieveResponse.Data | null;
213
+ data?: ContactMessageSummary | null;
343
214
 
344
215
  /**
345
216
  * Error information
346
217
  */
347
- error?: ContactRetrieveResponse.Error | null;
218
+ error?: WebhooksAPI.ErrorDetail | null;
348
219
 
349
220
  /**
350
221
  * Request and response metadata
351
222
  */
352
- meta?: ContactRetrieveResponse.Meta;
223
+ meta?: WebhooksAPI.APIMeta;
353
224
 
354
225
  /**
355
226
  * Indicates whether the request was successful
@@ -357,536 +228,139 @@ export interface ContactRetrieveResponse {
357
228
  success?: boolean;
358
229
  }
359
230
 
360
- export namespace ContactRetrieveResponse {
361
- /**
362
- * Contact response for v3 API Uses snake_case for JSON property names
363
- */
364
- export interface Data {
365
- /**
366
- * Unique identifier for the contact
367
- */
368
- id?: string;
369
-
370
- /**
371
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
372
- */
373
- available_channels?: string;
374
-
375
- /**
376
- * Country calling code (e.g., 1 for US/Canada)
377
- */
378
- country_code?: string;
379
-
380
- /**
381
- * When the contact was created
382
- */
383
- created_at?: string;
384
-
385
- /**
386
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
387
- * Says whose resource this is, which the resource's own id does not.
388
- */
389
- customer_id?: string;
390
-
391
- /**
392
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
393
- */
394
- default_channel?: string;
395
-
396
- /**
397
- * Phone number in E.164 format (e.g., +1234567890)
398
- */
399
- format_e164?: string;
400
-
401
- /**
402
- * Phone number in international format (e.g., +1 234-567-890)
403
- */
404
- format_international?: string;
405
-
406
- /**
407
- * Phone number in national format (e.g., (234) 567-890)
408
- */
409
- format_national?: string;
410
-
411
- /**
412
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
413
- */
414
- format_rfc?: string;
415
-
416
- /**
417
- * @deprecated Always false. Contacts are no longer shared or inherited between
418
- * sender profiles — a profile sees only the contacts it owns. Retained so existing
419
- * v3 clients reading is_inherited keep deserializing; it carries no information.
420
- */
421
- is_inherited?: boolean;
422
-
423
- /**
424
- * Whether the contact has opted out of messaging. Single source of truth — opt-out
425
- * is per-contact, not per-channel.
426
- */
427
- opt_out?: boolean;
428
-
429
- /**
430
- * Phone number in original format
431
- */
432
- phone_number?: string;
433
-
434
- /**
435
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
436
- */
437
- region_code?: string;
231
+ export interface ContactMessageSummary {
232
+ channel_scores?: Array<ContactMessageSummary.ChannelScore>;
438
233
 
439
- /**
440
- * When the contact was last updated
441
- */
442
- updated_at?: string | null;
443
- }
234
+ channels_used?: Array<string>;
444
235
 
445
- /**
446
- * Error information
447
- */
448
- export interface Error {
449
- /**
450
- * Machine-readable error code (e.g., "RESOURCE_001")
451
- */
452
- code?: string;
236
+ contact_id?: string;
453
237
 
454
- /**
455
- * Additional validation error details (field-level errors)
456
- */
457
- details?: { [key: string]: Array<string> } | null;
238
+ first_message_at?: string | null;
458
239
 
459
- /**
460
- * URL to documentation about this error
461
- */
462
- doc_url?: string | null;
240
+ last_message_at?: string | null;
463
241
 
464
- /**
465
- * Human-readable error message
466
- */
467
- message?: string;
468
- }
242
+ message_count?: number;
243
+ }
469
244
 
470
- /**
471
- * Request and response metadata
472
- */
473
- export interface Meta {
474
- /**
475
- * Unique identifier for this request (for tracing and support)
476
- */
477
- request_id?: string;
245
+ export namespace ContactMessageSummary {
246
+ export interface ChannelScore {
247
+ channel?: string;
478
248
 
479
249
  /**
480
- * Server timestamp when the response was generated
250
+ * Percentage (0-100) of messages on this channel that ended in FAILED.
481
251
  */
482
- timestamp?: string;
252
+ fail_score?: number;
483
253
 
484
254
  /**
485
- * API version used for this request
255
+ * Percentage (0-100) of messages on this channel that reached a successful
256
+ * terminal state: SENT/DELIVERED/READ for outbound, RECEIVED for inbound.
486
257
  */
487
- version?: string;
258
+ success_score?: number;
488
259
  }
489
260
  }
490
261
 
491
262
  /**
492
- * Standard API response envelope for all v3 endpoints
263
+ * Contact response for v3 API Uses snake_case for JSON property names
493
264
  */
494
- export interface ContactUpdateResponse {
265
+ export interface ContactResponse {
495
266
  /**
496
- * Contact response for v3 API Uses snake_case for JSON property names
267
+ * Unique identifier for the contact
497
268
  */
498
- data?: ContactUpdateResponse.Data | null;
269
+ id?: string;
499
270
 
500
271
  /**
501
- * Error information
272
+ * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
502
273
  */
503
- error?: ContactUpdateResponse.Error | null;
274
+ available_channels?: string;
504
275
 
505
276
  /**
506
- * Request and response metadata
277
+ * Country calling code (e.g., 1 for US/Canada)
507
278
  */
508
- meta?: ContactUpdateResponse.Meta;
279
+ country_code?: string;
509
280
 
510
281
  /**
511
- * Indicates whether the request was successful
282
+ * When the contact was created
512
283
  */
513
- success?: boolean;
514
- }
284
+ created_at?: string;
515
285
 
516
- export namespace ContactUpdateResponse {
517
286
  /**
518
- * Contact response for v3 API Uses snake_case for JSON property names
287
+ * Which customer owns this — the key's own, or the profile named in x-profile-id.
288
+ * Says whose resource this is, which the resource's own id does not.
519
289
  */
520
- export interface Data {
521
- /**
522
- * Unique identifier for the contact
523
- */
524
- id?: string;
525
-
526
- /**
527
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
528
- */
529
- available_channels?: string;
530
-
531
- /**
532
- * Country calling code (e.g., 1 for US/Canada)
533
- */
534
- country_code?: string;
535
-
536
- /**
537
- * When the contact was created
538
- */
539
- created_at?: string;
540
-
541
- /**
542
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
543
- * Says whose resource this is, which the resource's own id does not.
544
- */
545
- customer_id?: string;
546
-
547
- /**
548
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
549
- */
550
- default_channel?: string;
551
-
552
- /**
553
- * Phone number in E.164 format (e.g., +1234567890)
554
- */
555
- format_e164?: string;
556
-
557
- /**
558
- * Phone number in international format (e.g., +1 234-567-890)
559
- */
560
- format_international?: string;
561
-
562
- /**
563
- * Phone number in national format (e.g., (234) 567-890)
564
- */
565
- format_national?: string;
566
-
567
- /**
568
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
569
- */
570
- format_rfc?: string;
571
-
572
- /**
573
- * @deprecated Always false. Contacts are no longer shared or inherited between
574
- * sender profiles — a profile sees only the contacts it owns. Retained so existing
575
- * v3 clients reading is_inherited keep deserializing; it carries no information.
576
- */
577
- is_inherited?: boolean;
578
-
579
- /**
580
- * Whether the contact has opted out of messaging. Single source of truth — opt-out
581
- * is per-contact, not per-channel.
582
- */
583
- opt_out?: boolean;
584
-
585
- /**
586
- * Phone number in original format
587
- */
588
- phone_number?: string;
589
-
590
- /**
591
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
592
- */
593
- region_code?: string;
594
-
595
- /**
596
- * When the contact was last updated
597
- */
598
- updated_at?: string | null;
599
- }
290
+ customer_id?: string;
600
291
 
601
292
  /**
602
- * Error information
293
+ * Default messaging channel to use (e.g., "sms" or "whatsapp")
603
294
  */
604
- export interface Error {
605
- /**
606
- * Machine-readable error code (e.g., "RESOURCE_001")
607
- */
608
- code?: string;
609
-
610
- /**
611
- * Additional validation error details (field-level errors)
612
- */
613
- details?: { [key: string]: Array<string> } | null;
614
-
615
- /**
616
- * URL to documentation about this error
617
- */
618
- doc_url?: string | null;
619
-
620
- /**
621
- * Human-readable error message
622
- */
623
- message?: string;
624
- }
295
+ default_channel?: string;
625
296
 
626
297
  /**
627
- * Request and response metadata
298
+ * Phone number in E.164 format (e.g., +1234567890)
628
299
  */
629
- export interface Meta {
630
- /**
631
- * Unique identifier for this request (for tracing and support)
632
- */
633
- request_id?: string;
634
-
635
- /**
636
- * Server timestamp when the response was generated
637
- */
638
- timestamp?: string;
639
-
640
- /**
641
- * API version used for this request
642
- */
643
- version?: string;
644
- }
645
- }
300
+ format_e164?: string;
646
301
 
647
- /**
648
- * Standard API response envelope for all v3 endpoints
649
- */
650
- export interface ContactListResponse {
651
302
  /**
652
- * A paginated list of contacts.
303
+ * Phone number in international format (e.g., +1 234-567-890)
653
304
  */
654
- data?: ContactListResponse.Data | null;
305
+ format_international?: string;
655
306
 
656
307
  /**
657
- * Error information
308
+ * Phone number in national format (e.g., (234) 567-890)
658
309
  */
659
- error?: ContactListResponse.Error | null;
310
+ format_national?: string;
660
311
 
661
312
  /**
662
- * Request and response metadata
313
+ * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
663
314
  */
664
- meta?: ContactListResponse.Meta;
315
+ format_rfc?: string;
665
316
 
666
317
  /**
667
- * Indicates whether the request was successful
318
+ * @deprecated Always false. Contacts are no longer shared or inherited between
319
+ * sender profiles — a profile sees only the contacts it owns. Retained so existing
320
+ * v3 clients reading is_inherited keep deserializing; it carries no information.
668
321
  */
669
- success?: boolean;
670
- }
322
+ is_inherited?: boolean;
671
323
 
672
- export namespace ContactListResponse {
673
324
  /**
674
- * A paginated list of contacts.
325
+ * Whether the contact has opted out of messaging. Single source of truth — opt-out
326
+ * is per-contact, not per-channel.
675
327
  */
676
- export interface Data {
677
- /**
678
- * The contacts on this page.
679
- */
680
- contacts?: Array<Data.Contact>;
681
-
682
- /**
683
- * Pagination metadata for list responses
684
- */
685
- pagination?: Data.Pagination;
686
- }
687
-
688
- export namespace Data {
689
- /**
690
- * Contact response for v3 API Uses snake_case for JSON property names
691
- */
692
- export interface Contact {
693
- /**
694
- * Unique identifier for the contact
695
- */
696
- id?: string;
697
-
698
- /**
699
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
700
- */
701
- available_channels?: string;
702
-
703
- /**
704
- * Country calling code (e.g., 1 for US/Canada)
705
- */
706
- country_code?: string;
707
-
708
- /**
709
- * When the contact was created
710
- */
711
- created_at?: string;
712
-
713
- /**
714
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
715
- * Says whose resource this is, which the resource's own id does not.
716
- */
717
- customer_id?: string;
718
-
719
- /**
720
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
721
- */
722
- default_channel?: string;
723
-
724
- /**
725
- * Phone number in E.164 format (e.g., +1234567890)
726
- */
727
- format_e164?: string;
728
-
729
- /**
730
- * Phone number in international format (e.g., +1 234-567-890)
731
- */
732
- format_international?: string;
733
-
734
- /**
735
- * Phone number in national format (e.g., (234) 567-890)
736
- */
737
- format_national?: string;
738
-
739
- /**
740
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
741
- */
742
- format_rfc?: string;
743
-
744
- /**
745
- * @deprecated Always false. Contacts are no longer shared or inherited between
746
- * sender profiles — a profile sees only the contacts it owns. Retained so existing
747
- * v3 clients reading is_inherited keep deserializing; it carries no information.
748
- */
749
- is_inherited?: boolean;
750
-
751
- /**
752
- * Whether the contact has opted out of messaging. Single source of truth — opt-out
753
- * is per-contact, not per-channel.
754
- */
755
- opt_out?: boolean;
756
-
757
- /**
758
- * Phone number in original format
759
- */
760
- phone_number?: string;
761
-
762
- /**
763
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
764
- */
765
- region_code?: string;
766
-
767
- /**
768
- * When the contact was last updated
769
- */
770
- updated_at?: string | null;
771
- }
772
-
773
- /**
774
- * Pagination metadata for list responses
775
- */
776
- export interface Pagination {
777
- /**
778
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
779
- */
780
- cursors?: Pagination.Cursors | null;
781
-
782
- /**
783
- * Whether there are more pages after this one
784
- */
785
- has_more?: boolean;
786
-
787
- /**
788
- * Current page number (1-indexed)
789
- */
790
- page?: number;
791
-
792
- /**
793
- * Number of items per page
794
- */
795
- page_size?: number;
796
-
797
- /**
798
- * Total number of items across all pages
799
- */
800
- total_count?: number;
801
-
802
- /**
803
- * Total number of pages
804
- */
805
- total_pages?: number;
806
- }
807
-
808
- export namespace Pagination {
809
- /**
810
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
811
- */
812
- export interface Cursors {
813
- /**
814
- * Cursor to fetch the next page.
815
- */
816
- after?: string | null;
817
-
818
- /**
819
- * Cursor to fetch the previous page.
820
- */
821
- before?: string | null;
822
- }
823
- }
824
- }
328
+ opt_out?: boolean;
825
329
 
826
330
  /**
827
- * Error information
331
+ * Phone number in original format
828
332
  */
829
- export interface Error {
830
- /**
831
- * Machine-readable error code (e.g., "RESOURCE_001")
832
- */
833
- code?: string;
834
-
835
- /**
836
- * Additional validation error details (field-level errors)
837
- */
838
- details?: { [key: string]: Array<string> } | null;
839
-
840
- /**
841
- * URL to documentation about this error
842
- */
843
- doc_url?: string | null;
844
-
845
- /**
846
- * Human-readable error message
847
- */
848
- message?: string;
849
- }
333
+ phone_number?: string;
850
334
 
851
335
  /**
852
- * Request and response metadata
336
+ * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
853
337
  */
854
- export interface Meta {
855
- /**
856
- * Unique identifier for this request (for tracing and support)
857
- */
858
- request_id?: string;
859
-
860
- /**
861
- * Server timestamp when the response was generated
862
- */
863
- timestamp?: string;
338
+ region_code?: string;
864
339
 
865
- /**
866
- * API version used for this request
867
- */
868
- version?: string;
869
- }
340
+ /**
341
+ * When the contact was last updated
342
+ */
343
+ updated_at?: string | null;
870
344
  }
871
345
 
872
346
  /**
873
347
  * Standard API response envelope for all v3 endpoints
874
348
  */
875
- export interface ContactRetrieveMessageSummaryResponse {
349
+ export interface ContactListResponse {
876
350
  /**
877
- * The response data (null if error)
351
+ * A paginated list of contacts.
878
352
  */
879
- data?: ContactRetrieveMessageSummaryResponse.Data | null;
353
+ data?: ContactListResponse.Data | null;
880
354
 
881
355
  /**
882
356
  * Error information
883
357
  */
884
- error?: ContactRetrieveMessageSummaryResponse.Error | null;
358
+ error?: WebhooksAPI.ErrorDetail | null;
885
359
 
886
360
  /**
887
361
  * Request and response metadata
888
362
  */
889
- meta?: ContactRetrieveMessageSummaryResponse.Meta;
363
+ meta?: WebhooksAPI.APIMeta;
890
364
 
891
365
  /**
892
366
  * Indicates whether the request was successful
@@ -894,84 +368,20 @@ export interface ContactRetrieveMessageSummaryResponse {
894
368
  success?: boolean;
895
369
  }
896
370
 
897
- export namespace ContactRetrieveMessageSummaryResponse {
371
+ export namespace ContactListResponse {
898
372
  /**
899
- * The response data (null if error)
373
+ * A paginated list of contacts.
900
374
  */
901
375
  export interface Data {
902
- channel_scores?: Array<Data.ChannelScore>;
903
-
904
- channels_used?: Array<string>;
905
-
906
- contact_id?: string;
907
-
908
- first_message_at?: string | null;
909
-
910
- last_message_at?: string | null;
911
-
912
- message_count?: number;
913
- }
914
-
915
- export namespace Data {
916
- export interface ChannelScore {
917
- channel?: string;
918
-
919
- /**
920
- * Percentage (0-100) of messages on this channel that ended in FAILED.
921
- */
922
- fail_score?: number;
923
-
924
- /**
925
- * Percentage (0-100) of messages on this channel that reached a successful
926
- * terminal state: SENT/DELIVERED/READ for outbound, RECEIVED for inbound.
927
- */
928
- success_score?: number;
929
- }
930
- }
931
-
932
- /**
933
- * Error information
934
- */
935
- export interface Error {
936
- /**
937
- * Machine-readable error code (e.g., "RESOURCE_001")
938
- */
939
- code?: string;
940
-
941
- /**
942
- * Additional validation error details (field-level errors)
943
- */
944
- details?: { [key: string]: Array<string> } | null;
945
-
946
- /**
947
- * URL to documentation about this error
948
- */
949
- doc_url?: string | null;
950
-
951
- /**
952
- * Human-readable error message
953
- */
954
- message?: string;
955
- }
956
-
957
- /**
958
- * Request and response metadata
959
- */
960
- export interface Meta {
961
376
  /**
962
- * Unique identifier for this request (for tracing and support)
963
- */
964
- request_id?: string;
965
-
966
- /**
967
- * Server timestamp when the response was generated
377
+ * The contacts on this page.
968
378
  */
969
- timestamp?: string;
379
+ contacts?: Array<ContactsAPI.ContactResponse>;
970
380
 
971
381
  /**
972
- * API version used for this request
382
+ * Pagination metadata for list responses
973
383
  */
974
- version?: string;
384
+ pagination?: WebhooksAPI.PaginationMeta;
975
385
  }
976
386
  }
977
387
 
@@ -1102,11 +512,11 @@ export interface ContactRetrieveMessageSummaryParams {
1102
512
 
1103
513
  export declare namespace Contacts {
1104
514
  export {
1105
- type ContactCreateResponse as ContactCreateResponse,
1106
- type ContactRetrieveResponse as ContactRetrieveResponse,
1107
- type ContactUpdateResponse as ContactUpdateResponse,
515
+ type APIResponseOfContact as APIResponseOfContact,
516
+ type APIResponseOfContactMessageSummary as APIResponseOfContactMessageSummary,
517
+ type ContactMessageSummary as ContactMessageSummary,
518
+ type ContactResponse as ContactResponse,
1108
519
  type ContactListResponse as ContactListResponse,
1109
- type ContactRetrieveMessageSummaryResponse as ContactRetrieveMessageSummaryResponse,
1110
520
  type ContactCreateParams as ContactCreateParams,
1111
521
  type ContactRetrieveParams as ContactRetrieveParams,
1112
522
  type ContactUpdateParams as ContactUpdateParams,