@sentdm/sentdm 0.36.0 → 0.38.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 (137) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +31 -0
  3. package/client.d.mts +28 -14
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +28 -14
  6. package/client.d.ts.map +1 -1
  7. package/client.js +10 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +10 -0
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +164 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +164 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +212 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +202 -0
  18. package/core/pagination.mjs.map +1 -0
  19. package/index.d.mts +1 -0
  20. package/index.d.mts.map +1 -1
  21. package/index.d.ts +1 -0
  22. package/index.d.ts.map +1 -1
  23. package/index.js +3 -1
  24. package/index.js.map +1 -1
  25. package/index.mjs +1 -0
  26. package/index.mjs.map +1 -1
  27. package/internal/tslib.js +17 -17
  28. package/package.json +11 -1
  29. package/pagination.d.mts +3 -0
  30. package/pagination.d.mts.map +1 -0
  31. package/pagination.d.ts +3 -0
  32. package/pagination.d.ts.map +1 -0
  33. package/pagination.js +6 -0
  34. package/pagination.js.map +1 -0
  35. package/pagination.mjs +3 -0
  36. package/pagination.mjs.map +1 -0
  37. package/resources/contacts.d.mts +79 -626
  38. package/resources/contacts.d.mts.map +1 -1
  39. package/resources/contacts.d.ts +79 -626
  40. package/resources/contacts.d.ts.map +1 -1
  41. package/resources/contacts.js +12 -11
  42. package/resources/contacts.js.map +1 -1
  43. package/resources/contacts.mjs +12 -11
  44. package/resources/contacts.mjs.map +1 -1
  45. package/resources/conversations.d.mts +72 -346
  46. package/resources/conversations.d.mts.map +1 -1
  47. package/resources/conversations.d.ts +72 -346
  48. package/resources/conversations.d.ts.map +1 -1
  49. package/resources/conversations.js +16 -13
  50. package/resources/conversations.js.map +1 -1
  51. package/resources/conversations.mjs +16 -13
  52. package/resources/conversations.mjs.map +1 -1
  53. package/resources/index.d.mts +7 -7
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +7 -7
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js.map +1 -1
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/me.d.mts +48 -129
  60. package/resources/me.d.mts.map +1 -1
  61. package/resources/me.d.ts +48 -129
  62. package/resources/me.d.ts.map +1 -1
  63. package/resources/me.js.map +1 -1
  64. package/resources/me.mjs.map +1 -1
  65. package/resources/messages.d.mts +8 -171
  66. package/resources/messages.d.mts.map +1 -1
  67. package/resources/messages.d.ts +8 -171
  68. package/resources/messages.d.ts.map +1 -1
  69. package/resources/messages.js.map +1 -1
  70. package/resources/messages.mjs.map +1 -1
  71. package/resources/numbers.d.mts +3 -42
  72. package/resources/numbers.d.mts.map +1 -1
  73. package/resources/numbers.d.ts +3 -42
  74. package/resources/numbers.d.ts.map +1 -1
  75. package/resources/numbers.js.map +1 -1
  76. package/resources/numbers.mjs.map +1 -1
  77. package/resources/profiles/campaigns.d.mts +149 -544
  78. package/resources/profiles/campaigns.d.mts.map +1 -1
  79. package/resources/profiles/campaigns.d.ts +149 -544
  80. package/resources/profiles/campaigns.d.ts.map +1 -1
  81. package/resources/profiles/index.d.mts +2 -2
  82. package/resources/profiles/index.d.mts.map +1 -1
  83. package/resources/profiles/index.d.ts +2 -2
  84. package/resources/profiles/index.d.ts.map +1 -1
  85. package/resources/profiles/index.js.map +1 -1
  86. package/resources/profiles/index.mjs.map +1 -1
  87. package/resources/profiles/profiles.d.mts +411 -1821
  88. package/resources/profiles/profiles.d.mts.map +1 -1
  89. package/resources/profiles/profiles.d.ts +411 -1821
  90. package/resources/profiles/profiles.d.ts.map +1 -1
  91. package/resources/profiles/profiles.js.map +1 -1
  92. package/resources/profiles/profiles.mjs.map +1 -1
  93. package/resources/templates.d.mts +87 -532
  94. package/resources/templates.d.mts.map +1 -1
  95. package/resources/templates.d.ts +87 -532
  96. package/resources/templates.d.ts.map +1 -1
  97. package/resources/templates.js +11 -10
  98. package/resources/templates.js.map +1 -1
  99. package/resources/templates.mjs +11 -10
  100. package/resources/templates.mjs.map +1 -1
  101. package/resources/users.d.mts +47 -437
  102. package/resources/users.d.mts.map +1 -1
  103. package/resources/users.d.ts +47 -437
  104. package/resources/users.d.ts.map +1 -1
  105. package/resources/users.js +3 -3
  106. package/resources/users.js.map +1 -1
  107. package/resources/users.mjs +3 -3
  108. package/resources/users.mjs.map +1 -1
  109. package/resources/webhooks.d.mts +192 -856
  110. package/resources/webhooks.d.mts.map +1 -1
  111. package/resources/webhooks.d.ts +192 -856
  112. package/resources/webhooks.d.ts.map +1 -1
  113. package/resources/webhooks.js +23 -19
  114. package/resources/webhooks.js.map +1 -1
  115. package/resources/webhooks.mjs +23 -19
  116. package/resources/webhooks.mjs.map +1 -1
  117. package/src/client.ts +124 -45
  118. package/src/core/pagination.ts +428 -0
  119. package/src/index.ts +1 -0
  120. package/src/pagination.ts +2 -0
  121. package/src/resources/contacts.ts +89 -726
  122. package/src/resources/conversations.ts +99 -427
  123. package/src/resources/index.ts +31 -23
  124. package/src/resources/me.ts +59 -148
  125. package/src/resources/messages.ts +8 -194
  126. package/src/resources/numbers.ts +3 -47
  127. package/src/resources/profiles/campaigns.ts +174 -673
  128. package/src/resources/profiles/index.ts +14 -6
  129. package/src/resources/profiles/profiles.ts +529 -2216
  130. package/src/resources/templates.ts +110 -629
  131. package/src/resources/users.ts +48 -505
  132. package/src/resources/webhooks.ts +307 -1091
  133. package/src/version.ts +1 -1
  134. package/version.d.mts +1 -1
  135. package/version.d.ts +1 -1
  136. package/version.js +1 -1
  137. package/version.mjs +1 -1
@@ -1,5 +1,7 @@
1
1
  import { APIResource } from "../core/resource.js";
2
+ import * as WebhooksAPI from "./webhooks.js";
2
3
  import { APIPromise } from "../core/api-promise.js";
4
+ import { ContactsPage, type ContactsPageParams, PagePromise } from "../core/pagination.js";
3
5
  import { RequestOptions } from "../internal/request-options.js";
4
6
  /**
5
7
  * The people you message, and their channel identities.
@@ -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,36 +30,36 @@ 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.
51
53
  *
52
54
  * @example
53
55
  * ```ts
54
- * const contacts = await client.contacts.list({
55
- * page: 0,
56
- * page_size: 0,
57
- * });
56
+ * // Automatically fetches more pages as needed.
57
+ * for await (const contactResponse of client.contacts.list()) {
58
+ * // ...
59
+ * }
58
60
  * ```
59
61
  */
60
- list(params: ContactListParams, options?: RequestOptions): APIPromise<ContactListResponse>;
62
+ list(params?: ContactListParams | null | undefined, options?: RequestOptions): PagePromise<ContactResponsesContactsPage, ContactResponse>;
61
63
  /**
62
64
  * **Deprecated.** Use `PATCH /v3/contacts/{id}` with `{"opt_out": true}` instead,
63
65
  * and expect this to be removed in a future release. It still behaves exactly as
@@ -81,688 +83,147 @@ 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
  }
94
+ export type ContactResponsesContactsPage = ContactsPage<ContactResponse>;
92
95
  /**
93
96
  * Standard API response envelope for all v3 endpoints
94
97
  */
95
- export interface ContactCreateResponse {
98
+ export interface APIResponseOfContact {
96
99
  /**
97
100
  * Contact response for v3 API Uses snake_case for JSON property names
98
101
  */
99
- data?: ContactCreateResponse.Data | null;
102
+ data?: ContactResponse | null;
100
103
  /**
101
104
  * Error information
102
105
  */
103
- error?: ContactCreateResponse.Error | null;
106
+ error?: WebhooksAPI.ErrorDetail | null;
104
107
  /**
105
108
  * Request and response metadata
106
109
  */
107
- meta?: ContactCreateResponse.Meta;
110
+ meta?: WebhooksAPI.APIMeta;
108
111
  /**
109
112
  * Indicates whether the request was successful
110
113
  */
111
114
  success?: boolean;
112
115
  }
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
116
  /**
225
117
  * Standard API response envelope for all v3 endpoints
226
118
  */
227
- export interface ContactRetrieveResponse {
119
+ export interface APIResponseOfContactMessageSummary {
228
120
  /**
229
- * Contact response for v3 API Uses snake_case for JSON property names
121
+ * The response data (null if error)
230
122
  */
231
- data?: ContactRetrieveResponse.Data | null;
123
+ data?: ContactMessageSummary | null;
232
124
  /**
233
125
  * Error information
234
126
  */
235
- error?: ContactRetrieveResponse.Error | null;
127
+ error?: WebhooksAPI.ErrorDetail | null;
236
128
  /**
237
129
  * Request and response metadata
238
130
  */
239
- meta?: ContactRetrieveResponse.Meta;
131
+ meta?: WebhooksAPI.APIMeta;
240
132
  /**
241
133
  * Indicates whether the request was successful
242
134
  */
243
135
  success?: boolean;
244
136
  }
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;
137
+ export interface ContactMessageSummary {
138
+ channel_scores?: Array<ContactMessageSummary.ChannelScore>;
139
+ channels_used?: Array<string>;
140
+ contact_id?: string;
141
+ first_message_at?: string | null;
142
+ last_message_at?: string | null;
143
+ message_count?: number;
144
+ }
145
+ export declare namespace ContactMessageSummary {
146
+ interface ChannelScore {
147
+ channel?: string;
346
148
  /**
347
- * Server timestamp when the response was generated
149
+ * Percentage (0-100) of messages on this channel that ended in FAILED.
348
150
  */
349
- timestamp?: string;
151
+ fail_score?: number;
350
152
  /**
351
- * API version used for this request
153
+ * Percentage (0-100) of messages on this channel that reached a successful
154
+ * terminal state: SENT/DELIVERED/READ for outbound, RECEIVED for inbound.
352
155
  */
353
- version?: string;
156
+ success_score?: number;
354
157
  }
355
158
  }
356
159
  /**
357
- * Standard API response envelope for all v3 endpoints
160
+ * Contact response for v3 API Uses snake_case for JSON property names
358
161
  */
359
- export interface ContactUpdateResponse {
162
+ export interface ContactResponse {
360
163
  /**
361
- * Contact response for v3 API Uses snake_case for JSON property names
164
+ * Unique identifier for the contact
362
165
  */
363
- data?: ContactUpdateResponse.Data | null;
166
+ id?: string;
364
167
  /**
365
- * Error information
168
+ * Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
366
169
  */
367
- error?: ContactUpdateResponse.Error | null;
170
+ available_channels?: string;
368
171
  /**
369
- * Request and response metadata
172
+ * Country calling code (e.g., 1 for US/Canada)
370
173
  */
371
- meta?: ContactUpdateResponse.Meta;
174
+ country_code?: string;
372
175
  /**
373
- * Indicates whether the request was successful
176
+ * When the contact was created
374
177
  */
375
- success?: boolean;
376
- }
377
- export declare namespace ContactUpdateResponse {
178
+ created_at?: string;
378
179
  /**
379
- * Contact response for v3 API Uses snake_case for JSON property names
180
+ * Which customer owns this — the key's own, or the profile named in x-profile-id.
181
+ * Says whose resource this is, which the resource's own id does not.
380
182
  */
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
- }
447
- /**
448
- * Error information
449
- */
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
- }
470
- /**
471
- * Request and response metadata
472
- */
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 {
492
- /**
493
- * A paginated list of contacts.
494
- */
495
- data?: ContactListResponse.Data | null;
496
- /**
497
- * Error information
498
- */
499
- error?: ContactListResponse.Error | null;
500
- /**
501
- * Request and response metadata
502
- */
503
- meta?: ContactListResponse.Meta;
504
- /**
505
- * Indicates whether the request was successful
506
- */
507
- success?: boolean;
508
- }
509
- export declare namespace ContactListResponse {
183
+ customer_id?: string;
510
184
  /**
511
- * A paginated list of contacts.
185
+ * Default messaging channel to use (e.g., "sms" or "whatsapp")
512
186
  */
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
- }
187
+ default_channel?: string;
638
188
  /**
639
- * Error information
189
+ * Phone number in E.164 format (e.g., +1234567890)
640
190
  */
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
- }
191
+ format_e164?: string;
661
192
  /**
662
- * Request and response metadata
193
+ * Phone number in international format (e.g., +1 234-567-890)
663
194
  */
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
- }
678
- }
679
- /**
680
- * Standard API response envelope for all v3 endpoints
681
- */
682
- export interface ContactRetrieveMessageSummaryResponse {
195
+ format_international?: string;
683
196
  /**
684
- * The response data (null if error)
197
+ * Phone number in national format (e.g., (234) 567-890)
685
198
  */
686
- data?: ContactRetrieveMessageSummaryResponse.Data | null;
199
+ format_national?: string;
687
200
  /**
688
- * Error information
201
+ * Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
689
202
  */
690
- error?: ContactRetrieveMessageSummaryResponse.Error | null;
203
+ format_rfc?: string;
691
204
  /**
692
- * Request and response metadata
205
+ * @deprecated Always false. Contacts are no longer shared or inherited between
206
+ * sender profiles — a profile sees only the contacts it owns. Retained so existing
207
+ * v3 clients reading is_inherited keep deserializing; it carries no information.
693
208
  */
694
- meta?: ContactRetrieveMessageSummaryResponse.Meta;
209
+ is_inherited?: boolean;
695
210
  /**
696
- * Indicates whether the request was successful
211
+ * Whether the contact has opted out of messaging. Single source of truth — opt-out
212
+ * is per-contact, not per-channel.
697
213
  */
698
- success?: boolean;
699
- }
700
- export declare namespace ContactRetrieveMessageSummaryResponse {
214
+ opt_out?: boolean;
701
215
  /**
702
- * The response data (null if error)
216
+ * Phone number in original format
703
217
  */
704
- 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
- }
218
+ phone_number?: string;
726
219
  /**
727
- * Error information
220
+ * ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
728
221
  */
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
- /**
745
- * Human-readable error message
746
- */
747
- message?: string;
748
- }
222
+ region_code?: string;
749
223
  /**
750
- * Request and response metadata
224
+ * When the contact was last updated
751
225
  */
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
759
- */
760
- timestamp?: string;
761
- /**
762
- * API version used for this request
763
- */
764
- version?: string;
765
- }
226
+ updated_at?: string | null;
766
227
  }
767
228
  export interface ContactCreateParams {
768
229
  /**
@@ -822,15 +283,7 @@ export interface ContactUpdateParams {
822
283
  */
823
284
  'x-profile-id'?: string;
824
285
  }
825
- export interface ContactListParams {
826
- /**
827
- * Query param: Page number (1-indexed)
828
- */
829
- page: number;
830
- /**
831
- * Query param: Number of items per page
832
- */
833
- page_size: number;
286
+ export interface ContactListParams extends ContactsPageParams {
834
287
  /**
835
288
  * Query param: Optional channel filter (sms, whatsapp)
836
289
  */
@@ -871,6 +324,6 @@ export interface ContactRetrieveMessageSummaryParams {
871
324
  'x-profile-id'?: string;
872
325
  }
873
326
  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, };
327
+ export { type APIResponseOfContact as APIResponseOfContact, type APIResponseOfContactMessageSummary as APIResponseOfContactMessageSummary, type ContactMessageSummary as ContactMessageSummary, type ContactResponse as ContactResponse, type ContactResponsesContactsPage as ContactResponsesContactsPage, 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
328
  }
876
329
  //# sourceMappingURL=contacts.d.ts.map