@sentdm/sentdm 0.35.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 (108) hide show
  1. package/CHANGELOG.md +18 -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 +81 -129
  32. package/resources/me.d.mts.map +1 -1
  33. package/resources/me.d.ts +81 -129
  34. package/resources/me.d.ts.map +1 -1
  35. package/resources/me.js +11 -0
  36. package/resources/me.js.map +1 -1
  37. package/resources/me.mjs +11 -0
  38. package/resources/me.mjs.map +1 -1
  39. package/resources/messages.d.mts +8 -171
  40. package/resources/messages.d.mts.map +1 -1
  41. package/resources/messages.d.ts +8 -171
  42. package/resources/messages.d.ts.map +1 -1
  43. package/resources/messages.js.map +1 -1
  44. package/resources/messages.mjs.map +1 -1
  45. package/resources/numbers.d.mts +3 -42
  46. package/resources/numbers.d.mts.map +1 -1
  47. package/resources/numbers.d.ts +3 -42
  48. package/resources/numbers.d.ts.map +1 -1
  49. package/resources/numbers.js.map +1 -1
  50. package/resources/numbers.mjs.map +1 -1
  51. package/resources/profiles/campaigns.d.mts +149 -544
  52. package/resources/profiles/campaigns.d.mts.map +1 -1
  53. package/resources/profiles/campaigns.d.ts +149 -544
  54. package/resources/profiles/campaigns.d.ts.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 +411 -1821
  62. package/resources/profiles/profiles.d.mts.map +1 -1
  63. package/resources/profiles/profiles.d.ts +411 -1821
  64. package/resources/profiles/profiles.d.ts.map +1 -1
  65. package/resources/profiles/profiles.js.map +1 -1
  66. package/resources/profiles/profiles.mjs.map +1 -1
  67. package/resources/templates.d.mts +84 -486
  68. package/resources/templates.d.mts.map +1 -1
  69. package/resources/templates.d.ts +84 -486
  70. package/resources/templates.d.ts.map +1 -1
  71. package/resources/templates.js +3 -3
  72. package/resources/templates.js.map +1 -1
  73. package/resources/templates.mjs +3 -3
  74. package/resources/templates.mjs.map +1 -1
  75. package/resources/users.d.mts +47 -437
  76. package/resources/users.d.mts.map +1 -1
  77. package/resources/users.d.ts +47 -437
  78. package/resources/users.d.ts.map +1 -1
  79. package/resources/users.js +3 -3
  80. package/resources/users.js.map +1 -1
  81. package/resources/users.mjs +3 -3
  82. package/resources/users.mjs.map +1 -1
  83. package/resources/webhooks.d.mts +189 -768
  84. package/resources/webhooks.d.mts.map +1 -1
  85. package/resources/webhooks.d.ts +189 -768
  86. package/resources/webhooks.d.ts.map +1 -1
  87. package/resources/webhooks.js +7 -6
  88. package/resources/webhooks.js.map +1 -1
  89. package/resources/webhooks.mjs +7 -6
  90. package/resources/webhooks.mjs.map +1 -1
  91. package/src/client.ts +52 -39
  92. package/src/resources/contacts.ts +88 -678
  93. package/src/resources/conversations.ts +77 -393
  94. package/src/resources/index.ts +26 -20
  95. package/src/resources/me.ts +94 -148
  96. package/src/resources/messages.ts +8 -194
  97. package/src/resources/numbers.ts +3 -47
  98. package/src/resources/profiles/campaigns.ts +174 -673
  99. package/src/resources/profiles/index.ts +14 -6
  100. package/src/resources/profiles/profiles.ts +529 -2216
  101. package/src/resources/templates.ts +100 -572
  102. package/src/resources/users.ts +48 -505
  103. package/src/resources/webhooks.ts +297 -996
  104. package/src/version.ts +1 -1
  105. package/version.d.mts +1 -1
  106. package/version.d.ts +1 -1
  107. package/version.js +1 -1
  108. package/version.mjs +1 -1
@@ -1,4 +1,6 @@
1
1
  import { APIResource } from "../core/resource.js";
2
+ import * as ContactsAPI from "./contacts.js";
3
+ import * as WebhooksAPI from "./webhooks.js";
2
4
  import { APIPromise } from "../core/api-promise.js";
3
5
  import { RequestOptions } from "../internal/request-options.js";
4
6
  /**
@@ -15,12 +17,12 @@ export declare class Contacts extends APIResource {
15
17
  *
16
18
  * @example
17
19
  * ```ts
18
- * const contact = await client.contacts.create({
20
+ * const apiResponseOfContact = await client.contacts.create({
19
21
  * phone_number: '+1234567890',
20
22
  * });
21
23
  * ```
22
24
  */
23
- create(params: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse>;
25
+ create(params: ContactCreateParams, options?: RequestOptions): APIPromise<APIResponseOfContact>;
24
26
  /**
25
27
  * Retrieves a specific contact by their unique identifier. Returns detailed
26
28
  * contact information including phone formats, available channels, and opt-out
@@ -28,23 +30,23 @@ export declare class Contacts extends APIResource {
28
30
  *
29
31
  * @example
30
32
  * ```ts
31
- * const contact = await client.contacts.retrieve(
33
+ * const apiResponseOfContact = await client.contacts.retrieve(
32
34
  * '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
33
35
  * );
34
36
  * ```
35
37
  */
36
- retrieve(id: string, params?: ContactRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<ContactRetrieveResponse>;
38
+ retrieve(id: string, params?: ContactRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseOfContact>;
37
39
  /**
38
40
  * Updates a contact's default channel and/or opt-out status.
39
41
  *
40
42
  * @example
41
43
  * ```ts
42
- * const contact = await client.contacts.update(
44
+ * const apiResponseOfContact = await client.contacts.update(
43
45
  * '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
44
46
  * );
45
47
  * ```
46
48
  */
47
- update(id: string, params: ContactUpdateParams, options?: RequestOptions): APIPromise<ContactUpdateResponse>;
49
+ update(id: string, params: ContactUpdateParams, options?: RequestOptions): APIPromise<APIResponseOfContact>;
48
50
  /**
49
51
  * Retrieves a paginated list of contacts for the authenticated customer. Supports
50
52
  * filtering by search term, channel, or phone number.
@@ -81,687 +83,181 @@ export declare class Contacts extends APIResource {
81
83
  *
82
84
  * @example
83
85
  * ```ts
84
- * const response =
86
+ * const apiResponseOfContactMessageSummary =
85
87
  * await client.contacts.retrieveMessageSummary(
86
88
  * '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
87
89
  * );
88
90
  * ```
89
91
  */
90
- retrieveMessageSummary(contactID: string, params?: ContactRetrieveMessageSummaryParams | null | undefined, options?: RequestOptions): APIPromise<ContactRetrieveMessageSummaryResponse>;
92
+ retrieveMessageSummary(contactID: string, params?: ContactRetrieveMessageSummaryParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseOfContactMessageSummary>;
91
93
  }
92
94
  /**
93
95
  * Standard API response envelope for all v3 endpoints
94
96
  */
95
- export interface ContactCreateResponse {
97
+ export interface APIResponseOfContact {
96
98
  /**
97
99
  * Contact response for v3 API Uses snake_case for JSON property names
98
100
  */
99
- data?: ContactCreateResponse.Data | null;
101
+ data?: ContactResponse | null;
100
102
  /**
101
103
  * Error information
102
104
  */
103
- error?: ContactCreateResponse.Error | null;
105
+ error?: WebhooksAPI.ErrorDetail | null;
104
106
  /**
105
107
  * Request and response metadata
106
108
  */
107
- meta?: ContactCreateResponse.Meta;
109
+ meta?: WebhooksAPI.APIMeta;
108
110
  /**
109
111
  * Indicates whether the request was successful
110
112
  */
111
113
  success?: boolean;
112
114
  }
113
- export declare namespace ContactCreateResponse {
114
- /**
115
- * Contact response for v3 API Uses snake_case for JSON property names
116
- */
117
- interface Data {
118
- /**
119
- * Unique identifier for the contact
120
- */
121
- id?: string;
122
- /**
123
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
124
- */
125
- available_channels?: string;
126
- /**
127
- * Country calling code (e.g., 1 for US/Canada)
128
- */
129
- country_code?: string;
130
- /**
131
- * When the contact was created
132
- */
133
- created_at?: string;
134
- /**
135
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
136
- * Says whose resource this is, which the resource's own id does not.
137
- */
138
- customer_id?: string;
139
- /**
140
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
141
- */
142
- default_channel?: string;
143
- /**
144
- * Phone number in E.164 format (e.g., +1234567890)
145
- */
146
- format_e164?: string;
147
- /**
148
- * Phone number in international format (e.g., +1 234-567-890)
149
- */
150
- format_international?: string;
151
- /**
152
- * Phone number in national format (e.g., (234) 567-890)
153
- */
154
- format_national?: string;
155
- /**
156
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
157
- */
158
- format_rfc?: string;
159
- /**
160
- * @deprecated Always false. Contacts are no longer shared or inherited between
161
- * sender profiles — a profile sees only the contacts it owns. Retained so existing
162
- * v3 clients reading is_inherited keep deserializing; it carries no information.
163
- */
164
- is_inherited?: boolean;
165
- /**
166
- * Whether the contact has opted out of messaging. Single source of truth — opt-out
167
- * is per-contact, not per-channel.
168
- */
169
- opt_out?: boolean;
170
- /**
171
- * Phone number in original format
172
- */
173
- phone_number?: string;
174
- /**
175
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
176
- */
177
- region_code?: string;
178
- /**
179
- * When the contact was last updated
180
- */
181
- updated_at?: string | null;
182
- }
183
- /**
184
- * Error information
185
- */
186
- interface Error {
187
- /**
188
- * Machine-readable error code (e.g., "RESOURCE_001")
189
- */
190
- code?: string;
191
- /**
192
- * Additional validation error details (field-level errors)
193
- */
194
- details?: {
195
- [key: string]: Array<string>;
196
- } | null;
197
- /**
198
- * URL to documentation about this error
199
- */
200
- doc_url?: string | null;
201
- /**
202
- * Human-readable error message
203
- */
204
- message?: string;
205
- }
206
- /**
207
- * Request and response metadata
208
- */
209
- interface Meta {
210
- /**
211
- * Unique identifier for this request (for tracing and support)
212
- */
213
- request_id?: string;
214
- /**
215
- * Server timestamp when the response was generated
216
- */
217
- timestamp?: string;
218
- /**
219
- * API version used for this request
220
- */
221
- version?: string;
222
- }
223
- }
224
115
  /**
225
116
  * Standard API response envelope for all v3 endpoints
226
117
  */
227
- export interface ContactRetrieveResponse {
118
+ export interface APIResponseOfContactMessageSummary {
228
119
  /**
229
- * Contact response for v3 API Uses snake_case for JSON property names
120
+ * The response data (null if error)
230
121
  */
231
- data?: ContactRetrieveResponse.Data | null;
122
+ data?: ContactMessageSummary | null;
232
123
  /**
233
124
  * Error information
234
125
  */
235
- error?: ContactRetrieveResponse.Error | null;
126
+ error?: WebhooksAPI.ErrorDetail | null;
236
127
  /**
237
128
  * Request and response metadata
238
129
  */
239
- meta?: ContactRetrieveResponse.Meta;
130
+ meta?: WebhooksAPI.APIMeta;
240
131
  /**
241
132
  * Indicates whether the request was successful
242
133
  */
243
134
  success?: boolean;
244
135
  }
245
- export declare namespace ContactRetrieveResponse {
246
- /**
247
- * Contact response for v3 API Uses snake_case for JSON property names
248
- */
249
- interface Data {
250
- /**
251
- * Unique identifier for the contact
252
- */
253
- id?: string;
254
- /**
255
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
256
- */
257
- available_channels?: string;
258
- /**
259
- * Country calling code (e.g., 1 for US/Canada)
260
- */
261
- country_code?: string;
262
- /**
263
- * When the contact was created
264
- */
265
- created_at?: string;
266
- /**
267
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
268
- * Says whose resource this is, which the resource's own id does not.
269
- */
270
- customer_id?: string;
271
- /**
272
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
273
- */
274
- default_channel?: string;
275
- /**
276
- * Phone number in E.164 format (e.g., +1234567890)
277
- */
278
- format_e164?: string;
279
- /**
280
- * Phone number in international format (e.g., +1 234-567-890)
281
- */
282
- format_international?: string;
283
- /**
284
- * Phone number in national format (e.g., (234) 567-890)
285
- */
286
- format_national?: string;
287
- /**
288
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
289
- */
290
- format_rfc?: string;
291
- /**
292
- * @deprecated Always false. Contacts are no longer shared or inherited between
293
- * sender profiles — a profile sees only the contacts it owns. Retained so existing
294
- * v3 clients reading is_inherited keep deserializing; it carries no information.
295
- */
296
- is_inherited?: boolean;
297
- /**
298
- * Whether the contact has opted out of messaging. Single source of truth — opt-out
299
- * is per-contact, not per-channel.
300
- */
301
- opt_out?: boolean;
302
- /**
303
- * Phone number in original format
304
- */
305
- phone_number?: string;
306
- /**
307
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
308
- */
309
- region_code?: string;
310
- /**
311
- * When the contact was last updated
312
- */
313
- updated_at?: string | null;
314
- }
315
- /**
316
- * Error information
317
- */
318
- interface Error {
319
- /**
320
- * Machine-readable error code (e.g., "RESOURCE_001")
321
- */
322
- code?: string;
323
- /**
324
- * Additional validation error details (field-level errors)
325
- */
326
- details?: {
327
- [key: string]: Array<string>;
328
- } | null;
329
- /**
330
- * URL to documentation about this error
331
- */
332
- doc_url?: string | null;
333
- /**
334
- * Human-readable error message
335
- */
336
- message?: string;
337
- }
338
- /**
339
- * Request and response metadata
340
- */
341
- interface Meta {
342
- /**
343
- * Unique identifier for this request (for tracing and support)
344
- */
345
- request_id?: string;
136
+ export interface ContactMessageSummary {
137
+ channel_scores?: Array<ContactMessageSummary.ChannelScore>;
138
+ channels_used?: Array<string>;
139
+ contact_id?: string;
140
+ first_message_at?: string | null;
141
+ last_message_at?: string | null;
142
+ message_count?: number;
143
+ }
144
+ export declare namespace ContactMessageSummary {
145
+ interface ChannelScore {
146
+ channel?: string;
346
147
  /**
347
- * Server timestamp when the response was generated
148
+ * Percentage (0-100) of messages on this channel that ended in FAILED.
348
149
  */
349
- timestamp?: string;
150
+ fail_score?: number;
350
151
  /**
351
- * API version used for this request
152
+ * Percentage (0-100) of messages on this channel that reached a successful
153
+ * terminal state: SENT/DELIVERED/READ for outbound, RECEIVED for inbound.
352
154
  */
353
- version?: string;
155
+ success_score?: number;
354
156
  }
355
157
  }
356
158
  /**
357
- * Standard API response envelope for all v3 endpoints
159
+ * Contact response for v3 API Uses snake_case for JSON property names
358
160
  */
359
- export interface ContactUpdateResponse {
161
+ export interface ContactResponse {
360
162
  /**
361
- * Contact response for v3 API Uses snake_case for JSON property names
163
+ * Unique identifier for the contact
362
164
  */
363
- data?: ContactUpdateResponse.Data | null;
165
+ id?: string;
364
166
  /**
365
- * Error information
167
+ * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
366
168
  */
367
- error?: ContactUpdateResponse.Error | null;
169
+ available_channels?: string;
368
170
  /**
369
- * Request and response metadata
171
+ * Country calling code (e.g., 1 for US/Canada)
370
172
  */
371
- meta?: ContactUpdateResponse.Meta;
173
+ country_code?: string;
372
174
  /**
373
- * Indicates whether the request was successful
175
+ * When the contact was created
374
176
  */
375
- success?: boolean;
376
- }
377
- export declare namespace ContactUpdateResponse {
177
+ created_at?: string;
378
178
  /**
379
- * Contact response for v3 API Uses snake_case for JSON property names
179
+ * Which customer owns this — the key's own, or the profile named in x-profile-id.
180
+ * Says whose resource this is, which the resource's own id does not.
380
181
  */
381
- interface Data {
382
- /**
383
- * Unique identifier for the contact
384
- */
385
- id?: string;
386
- /**
387
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
388
- */
389
- available_channels?: string;
390
- /**
391
- * Country calling code (e.g., 1 for US/Canada)
392
- */
393
- country_code?: string;
394
- /**
395
- * When the contact was created
396
- */
397
- created_at?: string;
398
- /**
399
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
400
- * Says whose resource this is, which the resource's own id does not.
401
- */
402
- customer_id?: string;
403
- /**
404
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
405
- */
406
- default_channel?: string;
407
- /**
408
- * Phone number in E.164 format (e.g., +1234567890)
409
- */
410
- format_e164?: string;
411
- /**
412
- * Phone number in international format (e.g., +1 234-567-890)
413
- */
414
- format_international?: string;
415
- /**
416
- * Phone number in national format (e.g., (234) 567-890)
417
- */
418
- format_national?: string;
419
- /**
420
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
421
- */
422
- format_rfc?: string;
423
- /**
424
- * @deprecated Always false. Contacts are no longer shared or inherited between
425
- * sender profiles — a profile sees only the contacts it owns. Retained so existing
426
- * v3 clients reading is_inherited keep deserializing; it carries no information.
427
- */
428
- is_inherited?: boolean;
429
- /**
430
- * Whether the contact has opted out of messaging. Single source of truth — opt-out
431
- * is per-contact, not per-channel.
432
- */
433
- opt_out?: boolean;
434
- /**
435
- * Phone number in original format
436
- */
437
- phone_number?: string;
438
- /**
439
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
440
- */
441
- region_code?: string;
442
- /**
443
- * When the contact was last updated
444
- */
445
- updated_at?: string | null;
446
- }
182
+ customer_id?: string;
447
183
  /**
448
- * Error information
184
+ * Default messaging channel to use (e.g., "sms" or "whatsapp")
449
185
  */
450
- interface Error {
451
- /**
452
- * Machine-readable error code (e.g., "RESOURCE_001")
453
- */
454
- code?: string;
455
- /**
456
- * Additional validation error details (field-level errors)
457
- */
458
- details?: {
459
- [key: string]: Array<string>;
460
- } | null;
461
- /**
462
- * URL to documentation about this error
463
- */
464
- doc_url?: string | null;
465
- /**
466
- * Human-readable error message
467
- */
468
- message?: string;
469
- }
186
+ default_channel?: string;
470
187
  /**
471
- * Request and response metadata
188
+ * Phone number in E.164 format (e.g., +1234567890)
472
189
  */
473
- interface Meta {
474
- /**
475
- * Unique identifier for this request (for tracing and support)
476
- */
477
- request_id?: string;
478
- /**
479
- * Server timestamp when the response was generated
480
- */
481
- timestamp?: string;
482
- /**
483
- * API version used for this request
484
- */
485
- version?: string;
486
- }
487
- }
488
- /**
489
- * Standard API response envelope for all v3 endpoints
490
- */
491
- export interface ContactListResponse {
190
+ format_e164?: string;
492
191
  /**
493
- * A paginated list of contacts.
192
+ * Phone number in international format (e.g., +1 234-567-890)
494
193
  */
495
- data?: ContactListResponse.Data | null;
194
+ format_international?: string;
496
195
  /**
497
- * Error information
196
+ * Phone number in national format (e.g., (234) 567-890)
498
197
  */
499
- error?: ContactListResponse.Error | null;
198
+ format_national?: string;
500
199
  /**
501
- * Request and response metadata
200
+ * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
502
201
  */
503
- meta?: ContactListResponse.Meta;
202
+ format_rfc?: string;
504
203
  /**
505
- * Indicates whether the request was successful
204
+ * @deprecated Always false. Contacts are no longer shared or inherited between
205
+ * sender profiles — a profile sees only the contacts it owns. Retained so existing
206
+ * v3 clients reading is_inherited keep deserializing; it carries no information.
506
207
  */
507
- success?: boolean;
508
- }
509
- export declare namespace ContactListResponse {
208
+ is_inherited?: boolean;
510
209
  /**
511
- * A paginated list of contacts.
210
+ * Whether the contact has opted out of messaging. Single source of truth — opt-out
211
+ * is per-contact, not per-channel.
512
212
  */
513
- interface Data {
514
- /**
515
- * The contacts on this page.
516
- */
517
- contacts?: Array<Data.Contact>;
518
- /**
519
- * Pagination metadata for list responses
520
- */
521
- pagination?: Data.Pagination;
522
- }
523
- namespace Data {
524
- /**
525
- * Contact response for v3 API Uses snake_case for JSON property names
526
- */
527
- interface Contact {
528
- /**
529
- * Unique identifier for the contact
530
- */
531
- id?: string;
532
- /**
533
- * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
534
- */
535
- available_channels?: string;
536
- /**
537
- * Country calling code (e.g., 1 for US/Canada)
538
- */
539
- country_code?: string;
540
- /**
541
- * When the contact was created
542
- */
543
- created_at?: string;
544
- /**
545
- * Which customer owns this — the key's own, or the profile named in x-profile-id.
546
- * Says whose resource this is, which the resource's own id does not.
547
- */
548
- customer_id?: string;
549
- /**
550
- * Default messaging channel to use (e.g., "sms" or "whatsapp")
551
- */
552
- default_channel?: string;
553
- /**
554
- * Phone number in E.164 format (e.g., +1234567890)
555
- */
556
- format_e164?: string;
557
- /**
558
- * Phone number in international format (e.g., +1 234-567-890)
559
- */
560
- format_international?: string;
561
- /**
562
- * Phone number in national format (e.g., (234) 567-890)
563
- */
564
- format_national?: string;
565
- /**
566
- * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
567
- */
568
- format_rfc?: string;
569
- /**
570
- * @deprecated Always false. Contacts are no longer shared or inherited between
571
- * sender profiles — a profile sees only the contacts it owns. Retained so existing
572
- * v3 clients reading is_inherited keep deserializing; it carries no information.
573
- */
574
- is_inherited?: boolean;
575
- /**
576
- * Whether the contact has opted out of messaging. Single source of truth — opt-out
577
- * is per-contact, not per-channel.
578
- */
579
- opt_out?: boolean;
580
- /**
581
- * Phone number in original format
582
- */
583
- phone_number?: string;
584
- /**
585
- * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
586
- */
587
- region_code?: string;
588
- /**
589
- * When the contact was last updated
590
- */
591
- updated_at?: string | null;
592
- }
593
- /**
594
- * Pagination metadata for list responses
595
- */
596
- interface Pagination {
597
- /**
598
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
599
- */
600
- cursors?: Pagination.Cursors | null;
601
- /**
602
- * Whether there are more pages after this one
603
- */
604
- has_more?: boolean;
605
- /**
606
- * Current page number (1-indexed)
607
- */
608
- page?: number;
609
- /**
610
- * Number of items per page
611
- */
612
- page_size?: number;
613
- /**
614
- * Total number of items across all pages
615
- */
616
- total_count?: number;
617
- /**
618
- * Total number of pages
619
- */
620
- total_pages?: number;
621
- }
622
- namespace Pagination {
623
- /**
624
- * @deprecated Cursor-based pagination. Never populated — see Cursors.
625
- */
626
- interface Cursors {
627
- /**
628
- * Cursor to fetch the next page.
629
- */
630
- after?: string | null;
631
- /**
632
- * Cursor to fetch the previous page.
633
- */
634
- before?: string | null;
635
- }
636
- }
637
- }
213
+ opt_out?: boolean;
638
214
  /**
639
- * Error information
215
+ * Phone number in original format
640
216
  */
641
- interface Error {
642
- /**
643
- * Machine-readable error code (e.g., "RESOURCE_001")
644
- */
645
- code?: string;
646
- /**
647
- * Additional validation error details (field-level errors)
648
- */
649
- details?: {
650
- [key: string]: Array<string>;
651
- } | null;
652
- /**
653
- * URL to documentation about this error
654
- */
655
- doc_url?: string | null;
656
- /**
657
- * Human-readable error message
658
- */
659
- message?: string;
660
- }
217
+ phone_number?: string;
661
218
  /**
662
- * Request and response metadata
219
+ * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
663
220
  */
664
- interface Meta {
665
- /**
666
- * Unique identifier for this request (for tracing and support)
667
- */
668
- request_id?: string;
669
- /**
670
- * Server timestamp when the response was generated
671
- */
672
- timestamp?: string;
673
- /**
674
- * API version used for this request
675
- */
676
- version?: string;
677
- }
221
+ region_code?: string;
222
+ /**
223
+ * When the contact was last updated
224
+ */
225
+ updated_at?: string | null;
678
226
  }
679
227
  /**
680
228
  * Standard API response envelope for all v3 endpoints
681
229
  */
682
- export interface ContactRetrieveMessageSummaryResponse {
230
+ export interface ContactListResponse {
683
231
  /**
684
- * The response data (null if error)
232
+ * A paginated list of contacts.
685
233
  */
686
- data?: ContactRetrieveMessageSummaryResponse.Data | null;
234
+ data?: ContactListResponse.Data | null;
687
235
  /**
688
236
  * Error information
689
237
  */
690
- error?: ContactRetrieveMessageSummaryResponse.Error | null;
238
+ error?: WebhooksAPI.ErrorDetail | null;
691
239
  /**
692
240
  * Request and response metadata
693
241
  */
694
- meta?: ContactRetrieveMessageSummaryResponse.Meta;
242
+ meta?: WebhooksAPI.APIMeta;
695
243
  /**
696
244
  * Indicates whether the request was successful
697
245
  */
698
246
  success?: boolean;
699
247
  }
700
- export declare namespace ContactRetrieveMessageSummaryResponse {
248
+ export declare namespace ContactListResponse {
701
249
  /**
702
- * The response data (null if error)
250
+ * A paginated list of contacts.
703
251
  */
704
252
  interface Data {
705
- channel_scores?: Array<Data.ChannelScore>;
706
- channels_used?: Array<string>;
707
- contact_id?: string;
708
- first_message_at?: string | null;
709
- last_message_at?: string | null;
710
- message_count?: number;
711
- }
712
- namespace Data {
713
- interface ChannelScore {
714
- channel?: string;
715
- /**
716
- * Percentage (0-100) of messages on this channel that ended in FAILED.
717
- */
718
- fail_score?: number;
719
- /**
720
- * Percentage (0-100) of messages on this channel that reached a successful
721
- * terminal state: SENT/DELIVERED/READ for outbound, RECEIVED for inbound.
722
- */
723
- success_score?: number;
724
- }
725
- }
726
- /**
727
- * Error information
728
- */
729
- interface Error {
730
- /**
731
- * Machine-readable error code (e.g., "RESOURCE_001")
732
- */
733
- code?: string;
734
- /**
735
- * Additional validation error details (field-level errors)
736
- */
737
- details?: {
738
- [key: string]: Array<string>;
739
- } | null;
740
- /**
741
- * URL to documentation about this error
742
- */
743
- doc_url?: string | null;
744
253
  /**
745
- * Human-readable error message
746
- */
747
- message?: string;
748
- }
749
- /**
750
- * Request and response metadata
751
- */
752
- interface Meta {
753
- /**
754
- * Unique identifier for this request (for tracing and support)
755
- */
756
- request_id?: string;
757
- /**
758
- * Server timestamp when the response was generated
254
+ * The contacts on this page.
759
255
  */
760
- timestamp?: string;
256
+ contacts?: Array<ContactsAPI.ContactResponse>;
761
257
  /**
762
- * API version used for this request
258
+ * Pagination metadata for list responses
763
259
  */
764
- version?: string;
260
+ pagination?: WebhooksAPI.PaginationMeta;
765
261
  }
766
262
  }
767
263
  export interface ContactCreateParams {
@@ -871,6 +367,6 @@ export interface ContactRetrieveMessageSummaryParams {
871
367
  'x-profile-id'?: string;
872
368
  }
873
369
  export declare namespace Contacts {
874
- export { type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactRetrieveMessageSummaryResponse as ContactRetrieveMessageSummaryResponse, type ContactCreateParams as ContactCreateParams, type ContactRetrieveParams as ContactRetrieveParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactDeleteParams as ContactDeleteParams, type ContactRetrieveMessageSummaryParams as ContactRetrieveMessageSummaryParams, };
370
+ export { type APIResponseOfContact as APIResponseOfContact, type APIResponseOfContactMessageSummary as APIResponseOfContactMessageSummary, type ContactMessageSummary as ContactMessageSummary, type ContactResponse as ContactResponse, type ContactListResponse as ContactListResponse, type ContactCreateParams as ContactCreateParams, type ContactRetrieveParams as ContactRetrieveParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactDeleteParams as ContactDeleteParams, type ContactRetrieveMessageSummaryParams as ContactRetrieveMessageSummaryParams, };
875
371
  }
876
372
  //# sourceMappingURL=contacts.d.ts.map