@sentdm/sentdm 0.34.0 → 0.35.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 (120) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +53 -22
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +53 -22
  5. package/client.d.ts.map +1 -1
  6. package/client.js +39 -8
  7. package/client.js.map +1 -1
  8. package/client.mjs +39 -8
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/contacts.d.mts +606 -89
  12. package/resources/contacts.d.mts.map +1 -1
  13. package/resources/contacts.d.ts +606 -89
  14. package/resources/contacts.d.ts.map +1 -1
  15. package/resources/contacts.js +21 -15
  16. package/resources/contacts.js.map +1 -1
  17. package/resources/contacts.mjs +21 -15
  18. package/resources/contacts.mjs.map +1 -1
  19. package/resources/conversations.d.mts +335 -69
  20. package/resources/conversations.d.mts.map +1 -1
  21. package/resources/conversations.d.ts +335 -69
  22. package/resources/conversations.d.ts.map +1 -1
  23. package/resources/conversations.js +15 -10
  24. package/resources/conversations.js.map +1 -1
  25. package/resources/conversations.mjs +15 -10
  26. package/resources/conversations.mjs.map +1 -1
  27. package/resources/index.d.mts +7 -7
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +7 -7
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js.map +1 -1
  32. package/resources/index.mjs.map +1 -1
  33. package/resources/me.d.mts +132 -41
  34. package/resources/me.d.mts.map +1 -1
  35. package/resources/me.d.ts +132 -41
  36. package/resources/me.d.ts.map +1 -1
  37. package/resources/me.js +3 -1
  38. package/resources/me.js.map +1 -1
  39. package/resources/me.mjs +3 -1
  40. package/resources/me.mjs.map +1 -1
  41. package/resources/messages.d.mts +206 -27
  42. package/resources/messages.d.mts.map +1 -1
  43. package/resources/messages.d.ts +206 -27
  44. package/resources/messages.d.ts.map +1 -1
  45. package/resources/messages.js +5 -1
  46. package/resources/messages.js.map +1 -1
  47. package/resources/messages.mjs +5 -1
  48. package/resources/messages.mjs.map +1 -1
  49. package/resources/numbers.d.mts +45 -4
  50. package/resources/numbers.d.mts.map +1 -1
  51. package/resources/numbers.d.ts +45 -4
  52. package/resources/numbers.d.ts.map +1 -1
  53. package/resources/numbers.js +3 -1
  54. package/resources/numbers.js.map +1 -1
  55. package/resources/numbers.mjs +3 -1
  56. package/resources/numbers.mjs.map +1 -1
  57. package/resources/profiles/campaigns.d.mts +579 -209
  58. package/resources/profiles/campaigns.d.mts.map +1 -1
  59. package/resources/profiles/campaigns.d.ts +579 -209
  60. package/resources/profiles/campaigns.d.ts.map +1 -1
  61. package/resources/profiles/campaigns.js +33 -64
  62. package/resources/profiles/campaigns.js.map +1 -1
  63. package/resources/profiles/campaigns.mjs +33 -64
  64. package/resources/profiles/campaigns.mjs.map +1 -1
  65. package/resources/profiles/index.d.mts +2 -2
  66. package/resources/profiles/index.d.mts.map +1 -1
  67. package/resources/profiles/index.d.ts +2 -2
  68. package/resources/profiles/index.d.ts.map +1 -1
  69. package/resources/profiles/index.js.map +1 -1
  70. package/resources/profiles/index.mjs.map +1 -1
  71. package/resources/profiles/profiles.d.mts +2006 -508
  72. package/resources/profiles/profiles.d.mts.map +1 -1
  73. package/resources/profiles/profiles.d.ts +2006 -508
  74. package/resources/profiles/profiles.d.ts.map +1 -1
  75. package/resources/profiles/profiles.js +98 -75
  76. package/resources/profiles/profiles.js.map +1 -1
  77. package/resources/profiles/profiles.mjs +98 -75
  78. package/resources/profiles/profiles.mjs.map +1 -1
  79. package/resources/templates.d.mts +497 -84
  80. package/resources/templates.d.mts.map +1 -1
  81. package/resources/templates.d.ts +497 -84
  82. package/resources/templates.d.ts.map +1 -1
  83. package/resources/templates.js +6 -4
  84. package/resources/templates.js.map +1 -1
  85. package/resources/templates.mjs +6 -4
  86. package/resources/templates.mjs.map +1 -1
  87. package/resources/users.d.mts +444 -43
  88. package/resources/users.d.mts.map +1 -1
  89. package/resources/users.d.ts +444 -43
  90. package/resources/users.d.ts.map +1 -1
  91. package/resources/users.js +6 -4
  92. package/resources/users.js.map +1 -1
  93. package/resources/users.mjs +6 -4
  94. package/resources/users.mjs.map +1 -1
  95. package/resources/webhooks.d.mts +770 -169
  96. package/resources/webhooks.d.mts.map +1 -1
  97. package/resources/webhooks.d.ts +770 -169
  98. package/resources/webhooks.d.ts.map +1 -1
  99. package/resources/webhooks.js +11 -8
  100. package/resources/webhooks.js.map +1 -1
  101. package/resources/webhooks.mjs +11 -8
  102. package/resources/webhooks.mjs.map +1 -1
  103. package/src/client.ts +78 -60
  104. package/src/resources/contacts.ts +696 -92
  105. package/src/resources/conversations.ts +400 -77
  106. package/src/resources/index.ts +20 -26
  107. package/src/resources/me.ts +151 -52
  108. package/src/resources/messages.ts +230 -27
  109. package/src/resources/numbers.ts +50 -4
  110. package/src/resources/profiles/campaigns.ts +706 -232
  111. package/src/resources/profiles/index.ts +6 -14
  112. package/src/resources/profiles/profiles.ts +2421 -646
  113. package/src/resources/templates.ts +583 -99
  114. package/src/resources/users.ts +514 -44
  115. package/src/resources/webhooks.ts +1006 -283
  116. package/src/version.ts +1 -1
  117. package/version.d.mts +1 -1
  118. package/version.d.ts +1 -1
  119. package/version.js +1 -1
  120. package/version.mjs +1 -1
@@ -1,14 +1,14 @@
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 MeAPI from './me';
5
- import * as WebhooksAPI from './webhooks';
6
4
  import { APIPromise } from '../core/api-promise';
7
5
  import { buildHeaders } from '../internal/headers';
8
6
  import { RequestOptions } from '../internal/request-options';
9
7
 
10
8
  /**
11
- * Retrieve account details
9
+ * Who the current key is.
10
+ *
11
+ * `GET /v3/me` answers with the account the key authenticates as, which is the quickest way to tell a live key from a test one, an organization key from a sender profile's, and to confirm `x-profile-id` resolved to the profile you meant.
12
12
  */
13
13
  export class Me extends APIResource {
14
14
  /**
@@ -43,46 +43,6 @@ export class Me extends APIResource {
43
43
  }
44
44
  }
45
45
 
46
- /**
47
- * Profile configuration settings
48
- */
49
- export interface ProfileSettings {
50
- /**
51
- * Whether contacts are shared across profiles in the organization
52
- */
53
- allow_contact_sharing?: boolean | null;
54
-
55
- /**
56
- * Whether templates are shared across profiles in the organization
57
- */
58
- allow_template_sharing?: boolean | null;
59
-
60
- /**
61
- * Billing model: profile, organization, or profile_and_organization
62
- */
63
- billing_model?: string | null;
64
-
65
- /**
66
- * Whether this profile inherits contacts from the organization
67
- */
68
- inherit_contacts?: boolean | null;
69
-
70
- /**
71
- * Whether this profile inherits TCR brand from the organization
72
- */
73
- inherit_tcr_brand?: boolean | null;
74
-
75
- /**
76
- * Whether this profile inherits TCR campaign from the organization
77
- */
78
- inherit_tcr_campaign?: boolean | null;
79
-
80
- /**
81
- * Whether this profile inherits templates from the organization
82
- */
83
- inherit_templates?: boolean | null;
84
- }
85
-
86
46
  /**
87
47
  * Standard API response envelope for all v3 endpoints
88
48
  */
@@ -97,12 +57,12 @@ export interface MeRetrieveResponse {
97
57
  /**
98
58
  * Error information
99
59
  */
100
- error?: WebhooksAPI.ErrorDetail | null;
60
+ error?: MeRetrieveResponse.Error | null;
101
61
 
102
62
  /**
103
63
  * Request and response metadata
104
64
  */
105
- meta?: WebhooksAPI.APIMeta;
65
+ meta?: MeRetrieveResponse.Meta;
106
66
 
107
67
  /**
108
68
  * Indicates whether the request was successful
@@ -167,7 +127,7 @@ export namespace MeRetrieveResponse {
167
127
  /**
168
128
  * Profile configuration settings
169
129
  */
170
- settings?: MeAPI.ProfileSettings | null;
130
+ settings?: Data.Settings | null;
171
131
 
172
132
  /**
173
133
  * Short name / abbreviation (only for profile type)
@@ -301,7 +261,7 @@ export namespace MeRetrieveResponse {
301
261
  /**
302
262
  * Profile configuration settings
303
263
  */
304
- settings?: MeAPI.ProfileSettings;
264
+ settings?: Profile.Settings;
305
265
 
306
266
  /**
307
267
  * Profile short name (abbreviation)
@@ -313,6 +273,149 @@ export namespace MeRetrieveResponse {
313
273
  */
314
274
  status?: string | null;
315
275
  }
276
+
277
+ export namespace Profile {
278
+ /**
279
+ * Profile configuration settings
280
+ */
281
+ export interface Settings {
282
+ /**
283
+ * @deprecated Always false. A profile no longer shares contacts with sibling
284
+ * profiles — it sees only what it owns. Retained so existing v3 clients reading
285
+ * allow_contact_sharing keep deserializing; it carries no information.
286
+ */
287
+ allow_contact_sharing?: boolean | null;
288
+
289
+ /**
290
+ * @deprecated Always false. A profile no longer shares templates with sibling
291
+ * profiles. Retained so existing v3 clients reading allow_template_sharing keep
292
+ * deserializing; it carries no information.
293
+ */
294
+ allow_template_sharing?: boolean | null;
295
+
296
+ /**
297
+ * Billing model: profile, organization, or profile_and_organization
298
+ */
299
+ billing_model?: string | null;
300
+
301
+ /**
302
+ * @deprecated Always false. A profile no longer inherits its organization's
303
+ * contacts. Retained so existing v3 clients reading inherit_contacts keep
304
+ * deserializing; it carries no information.
305
+ */
306
+ inherit_contacts?: boolean | null;
307
+
308
+ /**
309
+ * Whether this profile inherits TCR brand from the organization
310
+ */
311
+ inherit_tcr_brand?: boolean | null;
312
+
313
+ /**
314
+ * Whether this profile inherits TCR campaign from the organization
315
+ */
316
+ inherit_tcr_campaign?: boolean | null;
317
+
318
+ /**
319
+ * @deprecated Always false. A profile no longer inherits its organization's
320
+ * templates. Retained so existing v3 clients reading inherit_templates keep
321
+ * deserializing; it carries no information.
322
+ */
323
+ inherit_templates?: boolean | null;
324
+ }
325
+ }
326
+
327
+ /**
328
+ * Profile configuration settings
329
+ */
330
+ export interface Settings {
331
+ /**
332
+ * @deprecated Always false. A profile no longer shares contacts with sibling
333
+ * profiles — it sees only what it owns. Retained so existing v3 clients reading
334
+ * allow_contact_sharing keep deserializing; it carries no information.
335
+ */
336
+ allow_contact_sharing?: boolean | null;
337
+
338
+ /**
339
+ * @deprecated Always false. A profile no longer shares templates with sibling
340
+ * profiles. Retained so existing v3 clients reading allow_template_sharing keep
341
+ * deserializing; it carries no information.
342
+ */
343
+ allow_template_sharing?: boolean | null;
344
+
345
+ /**
346
+ * Billing model: profile, organization, or profile_and_organization
347
+ */
348
+ billing_model?: string | null;
349
+
350
+ /**
351
+ * @deprecated Always false. A profile no longer inherits its organization's
352
+ * contacts. Retained so existing v3 clients reading inherit_contacts keep
353
+ * deserializing; it carries no information.
354
+ */
355
+ inherit_contacts?: boolean | null;
356
+
357
+ /**
358
+ * Whether this profile inherits TCR brand from the organization
359
+ */
360
+ inherit_tcr_brand?: boolean | null;
361
+
362
+ /**
363
+ * Whether this profile inherits TCR campaign from the organization
364
+ */
365
+ inherit_tcr_campaign?: boolean | null;
366
+
367
+ /**
368
+ * @deprecated Always false. A profile no longer inherits its organization's
369
+ * templates. Retained so existing v3 clients reading inherit_templates keep
370
+ * deserializing; it carries no information.
371
+ */
372
+ inherit_templates?: boolean | null;
373
+ }
374
+ }
375
+
376
+ /**
377
+ * Error information
378
+ */
379
+ export interface Error {
380
+ /**
381
+ * Machine-readable error code (e.g., "RESOURCE_001")
382
+ */
383
+ code?: string;
384
+
385
+ /**
386
+ * Additional validation error details (field-level errors)
387
+ */
388
+ details?: { [key: string]: Array<string> } | null;
389
+
390
+ /**
391
+ * URL to documentation about this error
392
+ */
393
+ doc_url?: string | null;
394
+
395
+ /**
396
+ * Human-readable error message
397
+ */
398
+ message?: string;
399
+ }
400
+
401
+ /**
402
+ * Request and response metadata
403
+ */
404
+ export interface Meta {
405
+ /**
406
+ * Unique identifier for this request (for tracing and support)
407
+ */
408
+ request_id?: string;
409
+
410
+ /**
411
+ * Server timestamp when the response was generated
412
+ */
413
+ timestamp?: string;
414
+
415
+ /**
416
+ * API version used for this request
417
+ */
418
+ version?: string;
316
419
  }
317
420
  }
318
421
 
@@ -325,9 +428,5 @@ export interface MeRetrieveParams {
325
428
  }
326
429
 
327
430
  export declare namespace Me {
328
- export {
329
- type ProfileSettings as ProfileSettings,
330
- type MeRetrieveResponse as MeRetrieveResponse,
331
- type MeRetrieveParams as MeRetrieveParams,
332
- };
431
+ export { type MeRetrieveResponse as MeRetrieveResponse, type MeRetrieveParams as MeRetrieveParams };
333
432
  }
@@ -1,14 +1,17 @@
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 WebhooksAPI from './webhooks';
5
4
  import { APIPromise } from '../core/api-promise';
6
5
  import { buildHeaders } from '../internal/headers';
7
6
  import { RequestOptions } from '../internal/request-options';
8
7
  import { path } from '../internal/utils/path';
9
8
 
10
9
  /**
11
- * Send and track SMS and WhatsApp messages
10
+ * Send a message and follow what happened to it.
11
+ *
12
+ * One endpoint sends on any channel: pass `channel: "sent"` and we pick between SMS, WhatsApp and RCS per recipient using your routing rules, or name a channel to pin it. A send is accepted asynchronously — `POST /v3/messages` returns an id, and delivery is reported through `GET /v3/messages/{id}`, its activities, or a webhook.
13
+ *
14
+ * **A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
12
15
  */
13
16
  export class Messages extends APIResource {
14
17
  /**
@@ -108,12 +111,12 @@ export interface MessageRetrieveActivitiesResponse {
108
111
  /**
109
112
  * Error information
110
113
  */
111
- error?: WebhooksAPI.ErrorDetail | null;
114
+ error?: MessageRetrieveActivitiesResponse.Error | null;
112
115
 
113
116
  /**
114
117
  * Request and response metadata
115
118
  */
116
- meta?: WebhooksAPI.APIMeta;
119
+ meta?: MessageRetrieveActivitiesResponse.Meta;
117
120
 
118
121
  /**
119
122
  * Indicates whether the request was successful
@@ -135,6 +138,11 @@ export namespace MessageRetrieveActivitiesResponse {
135
138
  * The message ID these activities belong to
136
139
  */
137
140
  message_id?: string;
141
+
142
+ /**
143
+ * Pagination metadata for list responses
144
+ */
145
+ pagination?: Data.Pagination;
138
146
  }
139
147
 
140
148
  export namespace Data {
@@ -177,6 +185,103 @@ export namespace MessageRetrieveActivitiesResponse {
177
185
  */
178
186
  timestamp?: string;
179
187
  }
188
+
189
+ /**
190
+ * Pagination metadata for list responses
191
+ */
192
+ export interface Pagination {
193
+ /**
194
+ * @deprecated Cursor-based pagination. Never populated — see Cursors.
195
+ */
196
+ cursors?: Pagination.Cursors | null;
197
+
198
+ /**
199
+ * Whether there are more pages after this one
200
+ */
201
+ has_more?: boolean;
202
+
203
+ /**
204
+ * Current page number (1-indexed)
205
+ */
206
+ page?: number;
207
+
208
+ /**
209
+ * Number of items per page
210
+ */
211
+ page_size?: number;
212
+
213
+ /**
214
+ * Total number of items across all pages
215
+ */
216
+ total_count?: number;
217
+
218
+ /**
219
+ * Total number of pages
220
+ */
221
+ total_pages?: number;
222
+ }
223
+
224
+ export namespace Pagination {
225
+ /**
226
+ * @deprecated Cursor-based pagination. Never populated — see Cursors.
227
+ */
228
+ export interface Cursors {
229
+ /**
230
+ * Cursor to fetch the next page.
231
+ */
232
+ after?: string | null;
233
+
234
+ /**
235
+ * Cursor to fetch the previous page.
236
+ */
237
+ before?: string | null;
238
+ }
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Error information
244
+ */
245
+ export interface Error {
246
+ /**
247
+ * Machine-readable error code (e.g., "RESOURCE_001")
248
+ */
249
+ code?: string;
250
+
251
+ /**
252
+ * Additional validation error details (field-level errors)
253
+ */
254
+ details?: { [key: string]: Array<string> } | null;
255
+
256
+ /**
257
+ * URL to documentation about this error
258
+ */
259
+ doc_url?: string | null;
260
+
261
+ /**
262
+ * Human-readable error message
263
+ */
264
+ message?: string;
265
+ }
266
+
267
+ /**
268
+ * Request and response metadata
269
+ */
270
+ export interface Meta {
271
+ /**
272
+ * Unique identifier for this request (for tracing and support)
273
+ */
274
+ request_id?: string;
275
+
276
+ /**
277
+ * Server timestamp when the response was generated
278
+ */
279
+ timestamp?: string;
280
+
281
+ /**
282
+ * API version used for this request
283
+ */
284
+ version?: string;
180
285
  }
181
286
  }
182
287
 
@@ -192,12 +297,12 @@ export interface MessageRetrieveStatusResponse {
192
297
  /**
193
298
  * Error information
194
299
  */
195
- error?: WebhooksAPI.ErrorDetail | null;
300
+ error?: MessageRetrieveStatusResponse.Error | null;
196
301
 
197
302
  /**
198
303
  * Request and response metadata
199
304
  */
200
- meta?: WebhooksAPI.APIMeta;
305
+ meta?: MessageRetrieveStatusResponse.Meta;
201
306
 
202
307
  /**
203
308
  * Indicates whether the request was successful
@@ -287,6 +392,51 @@ export namespace MessageRetrieveStatusResponse {
287
392
  }
288
393
  }
289
394
  }
395
+
396
+ /**
397
+ * Error information
398
+ */
399
+ export interface Error {
400
+ /**
401
+ * Machine-readable error code (e.g., "RESOURCE_001")
402
+ */
403
+ code?: string;
404
+
405
+ /**
406
+ * Additional validation error details (field-level errors)
407
+ */
408
+ details?: { [key: string]: Array<string> } | null;
409
+
410
+ /**
411
+ * URL to documentation about this error
412
+ */
413
+ doc_url?: string | null;
414
+
415
+ /**
416
+ * Human-readable error message
417
+ */
418
+ message?: string;
419
+ }
420
+
421
+ /**
422
+ * Request and response metadata
423
+ */
424
+ export interface Meta {
425
+ /**
426
+ * Unique identifier for this request (for tracing and support)
427
+ */
428
+ request_id?: string;
429
+
430
+ /**
431
+ * Server timestamp when the response was generated
432
+ */
433
+ timestamp?: string;
434
+
435
+ /**
436
+ * API version used for this request
437
+ */
438
+ version?: string;
439
+ }
290
440
  }
291
441
 
292
442
  /**
@@ -294,19 +444,28 @@ export namespace MessageRetrieveStatusResponse {
294
444
  */
295
445
  export interface MessageSendResponse {
296
446
  /**
297
- * Response for the multi-recipient send message endpoint
447
+ * The result of a multi-recipient send.
448
+ *
449
+ * Declared here rather than in the service layer. POST /v3/messages used to
450
+ * publish MessageSendResult — a type in Common.Services.Messaging.Contracts — so
451
+ * the public contract was whatever the send service happened to return, and
452
+ * changing that service for an internal reason changed the API. The service keeps
453
+ * its result; this is what a caller sees, and the mapping between them is a
454
+ * decision the endpoint makes.
455
+ *
456
+ * The wire is unchanged by the move: same names, same values.
298
457
  */
299
458
  data?: MessageSendResponse.Data | null;
300
459
 
301
460
  /**
302
461
  * Error information
303
462
  */
304
- error?: WebhooksAPI.ErrorDetail | null;
463
+ error?: MessageSendResponse.Error | null;
305
464
 
306
465
  /**
307
466
  * Request and response metadata
308
467
  */
309
- meta?: WebhooksAPI.APIMeta;
468
+ meta?: MessageSendResponse.Meta;
310
469
 
311
470
  /**
312
471
  * Indicates whether the request was successful
@@ -316,58 +475,102 @@ export interface MessageSendResponse {
316
475
 
317
476
  export namespace MessageSendResponse {
318
477
  /**
319
- * Response for the multi-recipient send message endpoint
478
+ * The result of a multi-recipient send.
479
+ *
480
+ * Declared here rather than in the service layer. POST /v3/messages used to
481
+ * publish MessageSendResult — a type in Common.Services.Messaging.Contracts — so
482
+ * the public contract was whatever the send service happened to return, and
483
+ * changing that service for an internal reason changed the API. The service keeps
484
+ * its result; this is what a caller sees, and the mapping between them is a
485
+ * decision the endpoint makes.
486
+ *
487
+ * The wire is unchanged by the move: same names, same values.
320
488
  */
321
489
  export interface Data {
322
- /**
323
- * Per-recipient message results
324
- */
325
490
  recipients?: Array<Data.Recipient>;
326
491
 
327
492
  /**
328
- * Overall request status: "QUEUED" when the batch has been accepted for delivery.
493
+ * Overall status — QUEUED once the batch is accepted for delivery.
329
494
  */
330
495
  status?: string;
331
496
 
332
- /**
333
- * Template ID that was used
334
- */
335
497
  template_id?: string;
336
498
 
337
- /**
338
- * Template display name
339
- */
340
499
  template_name?: string;
341
500
  }
342
501
 
343
502
  export namespace Data {
344
503
  /**
345
- * Per-recipient result in the send message response
504
+ * What one recipient of a send got, as the API reports it.
346
505
  */
347
506
  export interface Recipient {
348
507
  /**
349
- * Resolved template body text for this recipient's channel, or null for
350
- * auto-detect
508
+ * Resolved template body for this recipient's channel, or null when the channel is
509
+ * auto-detected.
351
510
  */
352
511
  body?: string | null;
353
512
 
354
513
  /**
355
- * Channel this message will be sent on (e.g. "sms", "whatsapp"), or null for
356
- * auto-detect
514
+ * Channel this message will be sent on — sms, whatsapp — or null to auto-detect.
357
515
  */
358
516
  channel?: string | null;
359
517
 
360
518
  /**
361
- * Unique message identifier for tracking this recipient's message
519
+ * Identifier for tracking this recipient's message.
362
520
  */
363
521
  message_id?: string;
364
522
 
365
523
  /**
366
- * Phone number in E.164 format
524
+ * Phone number in E.164 format.
367
525
  */
368
526
  to?: string;
369
527
  }
370
528
  }
529
+
530
+ /**
531
+ * Error information
532
+ */
533
+ export interface Error {
534
+ /**
535
+ * Machine-readable error code (e.g., "RESOURCE_001")
536
+ */
537
+ code?: string;
538
+
539
+ /**
540
+ * Additional validation error details (field-level errors)
541
+ */
542
+ details?: { [key: string]: Array<string> } | null;
543
+
544
+ /**
545
+ * URL to documentation about this error
546
+ */
547
+ doc_url?: string | null;
548
+
549
+ /**
550
+ * Human-readable error message
551
+ */
552
+ message?: string;
553
+ }
554
+
555
+ /**
556
+ * Request and response metadata
557
+ */
558
+ export interface Meta {
559
+ /**
560
+ * Unique identifier for this request (for tracing and support)
561
+ */
562
+ request_id?: string;
563
+
564
+ /**
565
+ * Server timestamp when the response was generated
566
+ */
567
+ timestamp?: string;
568
+
569
+ /**
570
+ * API version used for this request
571
+ */
572
+ version?: string;
573
+ }
371
574
  }
372
575
 
373
576
  export interface MessageRetrieveActivitiesParams {
@@ -1,14 +1,15 @@
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 WebhooksAPI from './webhooks';
5
4
  import { APIPromise } from '../core/api-promise';
6
5
  import { buildHeaders } from '../internal/headers';
7
6
  import { RequestOptions } from '../internal/request-options';
8
7
  import { path } from '../internal/utils/path';
9
8
 
10
9
  /**
11
- * Manage and lookup phone numbers
10
+ * What a phone number actually is, before you send to it.
11
+ *
12
+ * A lookup returns the number's country, line type and carrier, which is what decides whether it is reachable on a channel and what it costs. Worth doing on import rather than on send: a landline in a contact list is a message that can never be delivered.
12
13
  */
13
14
  export class Numbers extends APIResource {
14
15
  /**
@@ -51,12 +52,12 @@ export interface NumberLookupResponse {
51
52
  /**
52
53
  * Error information
53
54
  */
54
- error?: WebhooksAPI.ErrorDetail | null;
55
+ error?: NumberLookupResponse.Error | null;
55
56
 
56
57
  /**
57
58
  * Request and response metadata
58
59
  */
59
- meta?: WebhooksAPI.APIMeta;
60
+ meta?: NumberLookupResponse.Meta;
60
61
 
61
62
  /**
62
63
  * Indicates whether the request was successful
@@ -87,6 +88,51 @@ export namespace NumberLookupResponse {
87
88
 
88
89
  phone_number?: string;
89
90
  }
91
+
92
+ /**
93
+ * Error information
94
+ */
95
+ export interface Error {
96
+ /**
97
+ * Machine-readable error code (e.g., "RESOURCE_001")
98
+ */
99
+ code?: string;
100
+
101
+ /**
102
+ * Additional validation error details (field-level errors)
103
+ */
104
+ details?: { [key: string]: Array<string> } | null;
105
+
106
+ /**
107
+ * URL to documentation about this error
108
+ */
109
+ doc_url?: string | null;
110
+
111
+ /**
112
+ * Human-readable error message
113
+ */
114
+ message?: string;
115
+ }
116
+
117
+ /**
118
+ * Request and response metadata
119
+ */
120
+ export interface Meta {
121
+ /**
122
+ * Unique identifier for this request (for tracing and support)
123
+ */
124
+ request_id?: string;
125
+
126
+ /**
127
+ * Server timestamp when the response was generated
128
+ */
129
+ timestamp?: string;
130
+
131
+ /**
132
+ * API version used for this request
133
+ */
134
+ version?: string;
135
+ }
90
136
  }
91
137
 
92
138
  export interface NumberLookupParams {