@sentdm/sentdm 0.40.0 → 0.42.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 (139) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +18 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +18 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +13 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +13 -0
  9. package/client.mjs.map +1 -1
  10. package/core/pagination.d.mts +25 -0
  11. package/core/pagination.d.mts.map +1 -1
  12. package/core/pagination.d.ts +25 -0
  13. package/core/pagination.d.ts.map +1 -1
  14. package/core/pagination.js +28 -1
  15. package/core/pagination.js.map +1 -1
  16. package/core/pagination.mjs +26 -0
  17. package/core/pagination.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/calls/calls.d.mts +386 -0
  20. package/resources/calls/calls.d.mts.map +1 -0
  21. package/resources/calls/calls.d.ts +386 -0
  22. package/resources/calls/calls.d.ts.map +1 -0
  23. package/resources/calls/calls.js +158 -0
  24. package/resources/calls/calls.js.map +1 -0
  25. package/resources/calls/calls.mjs +153 -0
  26. package/resources/calls/calls.mjs.map +1 -0
  27. package/resources/calls/index.d.mts +3 -0
  28. package/resources/calls/index.d.mts.map +1 -0
  29. package/resources/calls/index.d.ts +3 -0
  30. package/resources/calls/index.d.ts.map +1 -0
  31. package/resources/calls/index.js +9 -0
  32. package/resources/calls/index.js.map +1 -0
  33. package/resources/calls/index.mjs +4 -0
  34. package/resources/calls/index.mjs.map +1 -0
  35. package/resources/calls/participants.d.mts +258 -0
  36. package/resources/calls/participants.d.mts.map +1 -0
  37. package/resources/calls/participants.d.ts +258 -0
  38. package/resources/calls/participants.d.ts.map +1 -0
  39. package/resources/calls/participants.js +158 -0
  40. package/resources/calls/participants.js.map +1 -0
  41. package/resources/calls/participants.mjs +154 -0
  42. package/resources/calls/participants.mjs.map +1 -0
  43. package/resources/calls.d.mts +2 -0
  44. package/resources/calls.d.mts.map +1 -0
  45. package/resources/calls.d.ts +2 -0
  46. package/resources/calls.d.ts.map +1 -0
  47. package/resources/calls.js +6 -0
  48. package/resources/calls.js.map +1 -0
  49. package/resources/calls.mjs +3 -0
  50. package/resources/calls.mjs.map +1 -0
  51. package/resources/channels/channels.d.mts +10 -0
  52. package/resources/channels/channels.d.mts.map +1 -0
  53. package/resources/channels/channels.d.ts +10 -0
  54. package/resources/channels/channels.d.ts.map +1 -0
  55. package/resources/channels/channels.js +17 -0
  56. package/resources/channels/channels.js.map +1 -0
  57. package/resources/channels/channels.mjs +12 -0
  58. package/resources/channels/channels.mjs.map +1 -0
  59. package/resources/channels/index.d.mts +3 -0
  60. package/resources/channels/index.d.mts.map +1 -0
  61. package/resources/channels/index.d.ts +3 -0
  62. package/resources/channels/index.d.ts.map +1 -0
  63. package/resources/channels/index.js +9 -0
  64. package/resources/channels/index.js.map +1 -0
  65. package/resources/channels/index.mjs +4 -0
  66. package/resources/channels/index.mjs.map +1 -0
  67. package/resources/channels/voice.d.mts +654 -0
  68. package/resources/channels/voice.d.mts.map +1 -0
  69. package/resources/channels/voice.d.ts +654 -0
  70. package/resources/channels/voice.d.ts.map +1 -0
  71. package/resources/channels/voice.js +285 -0
  72. package/resources/channels/voice.js.map +1 -0
  73. package/resources/channels/voice.mjs +281 -0
  74. package/resources/channels/voice.mjs.map +1 -0
  75. package/resources/channels.d.mts +2 -0
  76. package/resources/channels.d.mts.map +1 -0
  77. package/resources/channels.d.ts +2 -0
  78. package/resources/channels.d.ts.map +1 -0
  79. package/resources/channels.js +6 -0
  80. package/resources/channels.js.map +1 -0
  81. package/resources/channels.mjs +3 -0
  82. package/resources/channels.mjs.map +1 -0
  83. package/resources/conversations.d.mts +63 -8
  84. package/resources/conversations.d.mts.map +1 -1
  85. package/resources/conversations.d.ts +63 -8
  86. package/resources/conversations.d.ts.map +1 -1
  87. package/resources/index.d.mts +3 -1
  88. package/resources/index.d.mts.map +1 -1
  89. package/resources/index.d.ts +3 -1
  90. package/resources/index.d.ts.map +1 -1
  91. package/resources/index.js +5 -1
  92. package/resources/index.js.map +1 -1
  93. package/resources/index.mjs +2 -0
  94. package/resources/index.mjs.map +1 -1
  95. package/resources/me.d.mts +21 -0
  96. package/resources/me.d.mts.map +1 -1
  97. package/resources/me.d.ts +21 -0
  98. package/resources/me.d.ts.map +1 -1
  99. package/resources/me.js +5 -0
  100. package/resources/me.js.map +1 -1
  101. package/resources/me.mjs +5 -0
  102. package/resources/me.mjs.map +1 -1
  103. package/resources/messages.d.mts +76 -8
  104. package/resources/messages.d.mts.map +1 -1
  105. package/resources/messages.d.ts +76 -8
  106. package/resources/messages.d.ts.map +1 -1
  107. package/resources/templates.d.mts +7 -0
  108. package/resources/templates.d.mts.map +1 -1
  109. package/resources/templates.d.ts +7 -0
  110. package/resources/templates.d.ts.map +1 -1
  111. package/resources/webhooks.d.mts +212 -8
  112. package/resources/webhooks.d.mts.map +1 -1
  113. package/resources/webhooks.d.ts +212 -8
  114. package/resources/webhooks.d.ts.map +1 -1
  115. package/resources/webhooks.js +3 -1
  116. package/resources/webhooks.js.map +1 -1
  117. package/resources/webhooks.mjs +3 -1
  118. package/resources/webhooks.mjs.map +1 -1
  119. package/src/client.ts +60 -0
  120. package/src/core/pagination.ts +59 -0
  121. package/src/resources/calls/calls.ts +554 -0
  122. package/src/resources/calls/index.ts +31 -0
  123. package/src/resources/calls/participants.ts +367 -0
  124. package/src/resources/calls.ts +3 -0
  125. package/src/resources/channels/channels.ts +61 -0
  126. package/src/resources/channels/index.ts +27 -0
  127. package/src/resources/channels/voice.ts +864 -0
  128. package/src/resources/channels.ts +3 -0
  129. package/src/resources/conversations.ts +70 -8
  130. package/src/resources/index.ts +21 -0
  131. package/src/resources/me.ts +22 -0
  132. package/src/resources/messages.ts +85 -8
  133. package/src/resources/templates.ts +8 -0
  134. package/src/resources/webhooks.ts +238 -7
  135. package/src/version.ts +1 -1
  136. package/version.d.mts +1 -1
  137. package/version.d.ts +1 -1
  138. package/version.js +1 -1
  139. package/version.mjs +1 -1
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './channels/index';
@@ -165,6 +165,22 @@ export namespace ConversationMessagesList {
165
165
 
166
166
  price?: number | null;
167
167
 
168
+ /**
169
+ * A human-readable sentence for reason_code, for example "Insufficient balance".
170
+ * Omitted whenever reason_code is.
171
+ */
172
+ reason?: string | null;
173
+
174
+ /**
175
+ * Why the message is at its current status, as a stable platform code such as
176
+ * DELIVERY_007, BUSINESS_003 or DELIVERY_003. Present when the current status is
177
+ * FAILED, FILTERED or BLOCKED and the lifecycle was loaded; omitted otherwise.
178
+ * Switch on this rather than on reason: the code is stable, the wording may be
179
+ * improved. It is the platform's classification of the outcome, never a carrier or
180
+ * vendor code.
181
+ */
182
+ reason_code?: string | null;
183
+
168
184
  region_code?: string;
169
185
 
170
186
  status?: string;
@@ -186,6 +202,19 @@ export namespace ConversationMessagesList {
186
202
  timestamp: string;
187
203
 
188
204
  description?: string | null;
205
+
206
+ /**
207
+ * A human-readable sentence for reason_code. Omitted whenever reason_code is.
208
+ */
209
+ reason?: string | null;
210
+
211
+ /**
212
+ * Why the message reached this status, as a stable platform code such as
213
+ * DELIVERY_007. Present on FAILED, FILTERED and BLOCKED events; omitted on every
214
+ * status that needs no explanation. Same wire name and vocabulary as on the
215
+ * activities list and the webhook.
216
+ */
217
+ reason_code?: string | null;
189
218
  }
190
219
 
191
220
  /**
@@ -259,21 +288,54 @@ export namespace ConversationMessagesList {
259
288
  }
260
289
 
261
290
  /**
262
- * One attachment on a message: a customer-supplied public URL handed to the
263
- * carrier as-is.
291
+ * One attachment on a message, in either direction — and in both, a URL somebody
292
+ * else hosts.
293
+ *
294
+ * Outbound: the customer supplied a public URL and we handed it to the carrier.
295
+ * Inbound: the carrier hosts the file and we record where. sent.dm never holds the
296
+ * bytes, so there is no key, no expiry bookkeeping and nothing minted per read —
297
+ * what is stored is what is served.
264
298
  *
265
- * A URL and nothing else. sent.dm never takes custody of MMS media — the customer hosts it and we
266
- * pass the link through at send time — so there is no storage key, size or expiry to record. If we ever
267
- * do host attachments, that belongs with the change that introduces the hosting, not here.
299
+ * An inbound link expires on the carrier's own schedule and is unauthenticated.
300
+ * That is the customer's to manage, and it is documented where they will see it
301
+ * rather than only here — a recipient who needs an attachment to outlive that
302
+ * window copies it on receipt.
303
+ *
304
+ * Storing a presigned URL is the specific mistake this shape still avoids:
305
+ * M260826130000 and M260826140000 exist because RCS assets were stored as signed
306
+ * URLs and went stale. Nothing here is signed.
268
307
  */
269
308
  export interface Media {
270
309
  /**
271
- * One of Constants.MmsMediaTypes when known. Advisory — the carrier reads the
272
- * fetched object's Content-Type, not this.
310
+ * One of MmsMediaTypes when the content type is known. Advisory — a reader should
311
+ * trust the fetched object's own Content-Type.
273
312
  */
274
313
  mediaType?: string | null;
275
314
 
276
- url?: string;
315
+ /**
316
+ * Content type as the provider declared it. Null when it declared none.
317
+ */
318
+ mimeType?: string | null;
319
+
320
+ /**
321
+ * Size as the provider declared it. Never measured here — nothing downloads the
322
+ * file.
323
+ */
324
+ sizeBytes?: number | null;
325
+
326
+ /**
327
+ * Inbound only: the SHA-256 the provider declared alongside the attachment, when
328
+ * it declared one. Relayed to the customer so they can verify what they fetch
329
+ * matches what the carrier said it sent. It is the only integrity signal available
330
+ * on an attachment nobody here has read.
331
+ */
332
+ sourceHashSha256?: string | null;
333
+
334
+ /**
335
+ * Where the file lives. Outbound: the URL the customer gave us and the carrier
336
+ * fetched. Inbound: the URL the carrier hosts it at, relayed unchanged.
337
+ */
338
+ url?: string | null;
277
339
  }
278
340
  }
279
341
  }
@@ -1,5 +1,24 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ export {
4
+ Calls,
5
+ type APIResponseOfCall,
6
+ type APIResponseOfCallRecordings,
7
+ type APIResponseOfCallsList,
8
+ type Call,
9
+ type CallParty,
10
+ type CallRecording,
11
+ type CallRecordings,
12
+ type CallTimelineEntry,
13
+ type CallsList,
14
+ type CallRetrieveParams,
15
+ type CallListParams,
16
+ type CallHangupParams,
17
+ type CallListRecordingsParams,
18
+ type CallRecordParams,
19
+ type CallsCallsPage,
20
+ } from './calls/calls';
21
+ export { Channels } from './channels/channels';
3
22
  export {
4
23
  Contacts,
5
24
  type APIResponseOfContact,
@@ -90,6 +109,8 @@ export {
90
109
  Webhooks,
91
110
  type APIMeta,
92
111
  type APIResponseWebhook,
112
+ type CallEvent,
113
+ type CallEventPayload,
93
114
  type ChannelEvent,
94
115
  type ChannelEventPayload,
95
116
  type ContactEvent,
@@ -40,6 +40,11 @@ export class Me extends APIResource {
40
40
  * `sending_phone_number_profile_id` names the account that holds that number in
41
41
  * inventory — normally this account, and a different one where a number is shared.
42
42
  * Both are `null` when the account has no US SMS sender.
43
+ *
44
+ * **Template auto-creation:** `enable_template_auto_creation_for_sp` reports
45
+ * whether this account may mark a template for automatic creation on its sender
46
+ * profiles. It is granted by Sent and off by default. A `profile` reports `false`,
47
+ * having no sender profiles of its own to create anything on.
43
48
  */
44
49
  retrieve(
45
50
  params: MeRetrieveParams | null | undefined = {},
@@ -164,6 +169,23 @@ export namespace MeRetrieveResponse {
164
169
  */
165
170
  email?: string | null;
166
171
 
172
+ /**
173
+ * Whether this account may mark a template for automatic creation on its sender
174
+ * profiles. Granted by Sent per account and off by default, so it is what a
175
+ * template-create form reads to decide whether to offer the option at all —
176
+ * marking a template without it does nothing.
177
+ *
178
+ * Top-level rather than inside settings, which is written for type: "profile" only
179
+ * and so would never carry it to the account type that can act on it.
180
+ *
181
+ * This is the capability, not the stored flag: a profile reports false whatever
182
+ * its own row holds. A sender profile owns no sender profiles, so a template it
183
+ * marked would have nothing to be created on and the fan-out would never read the
184
+ * flag. The admin GET /customers/{id} reports the stored value instead, because
185
+ * that is the one an operator granted.
186
+ */
187
+ enable_template_auto_creation_for_sp?: boolean;
188
+
167
189
  /**
168
190
  * Account icon URL
169
191
  */
@@ -197,6 +197,21 @@ export namespace MessageRetrieveActivitiesResponse {
197
197
  */
198
198
  price?: string | null;
199
199
 
200
+ /**
201
+ * A human-readable sentence for reason_code, for example "The recipient is not
202
+ * registered on this channel" Omitted whenever reason_code is.
203
+ */
204
+ reason?: string | null;
205
+
206
+ /**
207
+ * Why the message reached this status, as a stable platform code such as
208
+ * DELIVERY_007 or BUSINESS_003. Present on FAILED, FILTERED and BLOCKED
209
+ * activities; omitted on every status that needs no explanation. Switch on this
210
+ * rather than on reason: the code is stable, the wording may be improved. Same
211
+ * wire name and vocabulary as on the message and the webhook.
212
+ */
213
+ reason_code?: string | null;
214
+
200
215
  /**
201
216
  * SCHEDULED activities only: when the held message will be released for delivery,
202
217
  * in UTC. Same wire name as on the send response, the message and the webhook.
@@ -294,6 +309,22 @@ export namespace MessageRetrieveStatusResponse {
294
309
 
295
310
  price?: number | null;
296
311
 
312
+ /**
313
+ * A human-readable sentence for reason_code, for example "Insufficient balance".
314
+ * Omitted whenever reason_code is.
315
+ */
316
+ reason?: string | null;
317
+
318
+ /**
319
+ * Why the message is at its current status, as a stable platform code such as
320
+ * DELIVERY_007, BUSINESS_003 or DELIVERY_003. Present when the current status is
321
+ * FAILED, FILTERED or BLOCKED and the lifecycle was loaded; omitted otherwise.
322
+ * Switch on this rather than on reason: the code is stable, the wording may be
323
+ * improved. It is the platform's classification of the outcome, never a carrier or
324
+ * vendor code.
325
+ */
326
+ reason_code?: string | null;
327
+
297
328
  region_code?: string;
298
329
 
299
330
  status?: string;
@@ -315,6 +346,19 @@ export namespace MessageRetrieveStatusResponse {
315
346
  timestamp: string;
316
347
 
317
348
  description?: string | null;
349
+
350
+ /**
351
+ * A human-readable sentence for reason_code. Omitted whenever reason_code is.
352
+ */
353
+ reason?: string | null;
354
+
355
+ /**
356
+ * Why the message reached this status, as a stable platform code such as
357
+ * DELIVERY_007. Present on FAILED, FILTERED and BLOCKED events; omitted on every
358
+ * status that needs no explanation. Same wire name and vocabulary as on the
359
+ * activities list and the webhook.
360
+ */
361
+ reason_code?: string | null;
318
362
  }
319
363
 
320
364
  /**
@@ -388,21 +432,54 @@ export namespace MessageRetrieveStatusResponse {
388
432
  }
389
433
 
390
434
  /**
391
- * One attachment on a message: a customer-supplied public URL handed to the
392
- * carrier as-is.
435
+ * One attachment on a message, in either direction — and in both, a URL somebody
436
+ * else hosts.
437
+ *
438
+ * Outbound: the customer supplied a public URL and we handed it to the carrier.
439
+ * Inbound: the carrier hosts the file and we record where. sent.dm never holds the
440
+ * bytes, so there is no key, no expiry bookkeeping and nothing minted per read —
441
+ * what is stored is what is served.
442
+ *
443
+ * An inbound link expires on the carrier's own schedule and is unauthenticated.
444
+ * That is the customer's to manage, and it is documented where they will see it
445
+ * rather than only here — a recipient who needs an attachment to outlive that
446
+ * window copies it on receipt.
393
447
  *
394
- * A URL and nothing else. sent.dm never takes custody of MMS media — the customer hosts it and we
395
- * pass the link through at send time — so there is no storage key, size or expiry to record. If we ever
396
- * do host attachments, that belongs with the change that introduces the hosting, not here.
448
+ * Storing a presigned URL is the specific mistake this shape still avoids:
449
+ * M260826130000 and M260826140000 exist because RCS assets were stored as signed
450
+ * URLs and went stale. Nothing here is signed.
397
451
  */
398
452
  export interface Media {
399
453
  /**
400
- * One of Constants.MmsMediaTypes when known. Advisory — the carrier reads the
401
- * fetched object's Content-Type, not this.
454
+ * One of MmsMediaTypes when the content type is known. Advisory — a reader should
455
+ * trust the fetched object's own Content-Type.
402
456
  */
403
457
  mediaType?: string | null;
404
458
 
405
- url?: string;
459
+ /**
460
+ * Content type as the provider declared it. Null when it declared none.
461
+ */
462
+ mimeType?: string | null;
463
+
464
+ /**
465
+ * Size as the provider declared it. Never measured here — nothing downloads the
466
+ * file.
467
+ */
468
+ sizeBytes?: number | null;
469
+
470
+ /**
471
+ * Inbound only: the SHA-256 the provider declared alongside the attachment, when
472
+ * it declared one. Relayed to the customer so they can verify what they fetch
473
+ * matches what the carrier said it sent. It is the only integrity signal available
474
+ * on an attachment nobody here has read.
475
+ */
476
+ sourceHashSha256?: string | null;
477
+
478
+ /**
479
+ * Where the file lives. Outbound: the URL the customer gave us and the carrier
480
+ * fetched. Inbound: the URL the carrier hosts it at, relayed unchanged.
481
+ */
482
+ url?: string | null;
406
483
  }
407
484
  }
408
485
  }
@@ -720,6 +720,14 @@ export namespace TemplateVariable {
720
720
  }
721
721
 
722
722
  export interface TemplateCreateParams {
723
+ /**
724
+ * Body param: Create this template automatically on every sender profile of the
725
+ * organization, now and in future (default: false). Accepted only from an
726
+ * organization that has been enabled for it, and only at creation — it cannot be
727
+ * changed afterwards.
728
+ */
729
+ auto_create_for_sp?: boolean;
730
+
723
731
  /**
724
732
  * Body param: Template category: MARKETING, UTILITY, AUTHENTICATION (optional,
725
733
  * auto-detected if not provided)
@@ -169,7 +169,9 @@ export class Webhooks extends APIResource {
169
169
  }
170
170
 
171
171
  /**
172
- * Retrieves a paginated list of delivery events for the specified webhook.
172
+ * Retrieves a paginated list of delivery events for the specified webhook. If the
173
+ * webhook is cloned onto your sender profiles, the list includes what those clones
174
+ * received; read payload.account_id to tell whose event it is.
173
175
  *
174
176
  * @example
175
177
  * ```ts
@@ -336,6 +338,122 @@ export interface APIResponseWebhook {
336
338
  success?: boolean;
337
339
  }
338
340
 
341
+ /**
342
+ * The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
343
+ * this shape and varies only in Payload.
344
+ */
345
+ export interface CallEvent {
346
+ /**
347
+ * The specific event within the family, for example message.delivered,
348
+ * message.received or contact.opt_out. Absent on events that have no subtype, so
349
+ * treat it as optional.
350
+ */
351
+ event?: string | null;
352
+
353
+ /**
354
+ * The event family, for example message, templates or contact. Route on this
355
+ * first, then on event for the specific change.
356
+ */
357
+ field?: string;
358
+
359
+ /**
360
+ * Body of a call.initiated, call.answered, call.completed, call.failed or
361
+ * call.recording_ready event. Which of them occurred is the envelope's event.
362
+ *
363
+ * Shaped like the message, inbound, template and channel payloads: account_id
364
+ * names the account the event is about, channel names the channel, and updated_at
365
+ * is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
366
+ * duration_seconds and price are added on call.completed, reason on call.failed
367
+ * and recording_id on call.recording_ready; each is omitted rather than sent as
368
+ * null when it does not apply.
369
+ *
370
+ * Casing is snake_case because these ride the same webhook stream customers
371
+ * already parse message_id from; the question/answer contract is a separate
372
+ * surface and stays camelCase. Nothing here is provider-shaped: no provider call
373
+ * id, no namespaced identity.
374
+ */
375
+ payload?: CallEventPayload | null;
376
+
377
+ /**
378
+ * The event-specific body.
379
+ */
380
+ request_id?: string | null;
381
+
382
+ /**
383
+ * When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
384
+ * time, not the time the underlying change happened. Use the timestamp inside the
385
+ * payload for the latter.
386
+ */
387
+ timestamp?: string;
388
+ }
389
+
390
+ /**
391
+ * Body of a call.initiated, call.answered, call.completed, call.failed or
392
+ * call.recording_ready event. Which of them occurred is the envelope's event.
393
+ *
394
+ * Shaped like the message, inbound, template and channel payloads: account_id
395
+ * names the account the event is about, channel names the channel, and updated_at
396
+ * is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
397
+ * duration_seconds and price are added on call.completed, reason on call.failed
398
+ * and recording_id on call.recording_ready; each is omitted rather than sent as
399
+ * null when it does not apply.
400
+ *
401
+ * Casing is snake_case because these ride the same webhook stream customers
402
+ * already parse message_id from; the question/answer contract is a separate
403
+ * surface and stays camelCase. Nothing here is provider-shaped: no provider call
404
+ * id, no namespaced identity.
405
+ */
406
+ export interface CallEventPayload {
407
+ /**
408
+ * Sent's call id, the same one the customer saw on the first question.
409
+ */
410
+ call_id: string;
411
+
412
+ /**
413
+ * The account the call belongs to: the key's own customer, or the sender profile
414
+ * it acted as.
415
+ */
416
+ account_id?: string;
417
+
418
+ /**
419
+ * Always voice.
420
+ */
421
+ channel?: string;
422
+
423
+ /**
424
+ * How long the call lasted. Only on call.completed.
425
+ */
426
+ duration_seconds?: number | null;
427
+
428
+ /**
429
+ * The customer number that owns the call, in E.164 format.
430
+ */
431
+ number?: string;
432
+
433
+ /**
434
+ * What the call was charged. Only on call.completed, and omitted there until
435
+ * billing has recorded the charge.
436
+ */
437
+ price?: number | null;
438
+
439
+ /**
440
+ * The machine-readable reason the call did not complete. Only on call.failed, and
441
+ * omitted when no reason was recorded.
442
+ */
443
+ reason?: string | null;
444
+
445
+ /**
446
+ * The recording that became available, the same id GET /v3/calls/{id}/recordings
447
+ * lists it under. Only on call.recording_ready, which is sent once per recording.
448
+ */
449
+ recording_id?: string | null;
450
+
451
+ /**
452
+ * When the change happened on the call, as opposed to when the event was emitted.
453
+ */
454
+ updated_at?: string;
455
+ }
456
+
339
457
  /**
340
458
  * The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
341
459
  * this shape and varies only in Payload.
@@ -467,13 +585,20 @@ export interface ChannelEventPayload {
467
585
  number_type?: string | null;
468
586
 
469
587
  /**
470
- * Why the market reached this state, when a reason was given — a correction
471
- * explained, or a campaign lapse. Free text, passed through from the registry or
472
- * carrier that wrote it, so treat it as a message to show a human rather than a
473
- * value to branch on.
588
+ * Why the market reached this state, as a sentence to show a person: the specific
589
+ * explanation when one was given (a correction explained, a campaign lapse),
590
+ * otherwise what reason_code means for this market. Not a value to branch on.
474
591
  */
475
592
  reason?: string | null;
476
593
 
594
+ /**
595
+ * Why the market is not ACTIVE, as a stable code: an ErrorCodes CHANNEL_xxx value
596
+ * such as CHANNEL_001 (something you owe) or CHANNEL_002 (a correction was
597
+ * requested). The same code the channels resource reports for the market. Switch
598
+ * on this rather than on reason. Omitted while ACTIVE.
599
+ */
600
+ reason_code?: string | null;
601
+
477
602
  /**
478
603
  * The sender itself — a number in E.164, or an alphanumeric sender ID.
479
604
  *
@@ -867,10 +992,24 @@ export interface InboundMessageEventPayload {
867
992
  account_id?: string;
868
993
 
869
994
  /**
870
- * The channel the message arrived on, for example sms or whatsapp.
995
+ * The channel the message arrived on, for example sms or mms.
871
996
  */
872
997
  channel?: string;
873
998
 
999
+ /**
1000
+ * Attachments the contact sent, present only on channels that carry them (mms
1001
+ * today) and omitted entirely otherwise.
1002
+ *
1003
+ * Each url points at the carrier's own copy of the file — sent.dm records where
1004
+ * the attachment is, not the attachment itself. The link is unauthenticated and
1005
+ * expires on the carrier's schedule, which differs between them: assume days, not
1006
+ * months. Download what you need on receipt; re-reading the message through GET
1007
+ * /v3/messages/{id} returns the same stored link, not a fresh one, so once it
1008
+ * lapses the entry remains with whatever the carrier declared about the file but
1009
+ * the file is no longer reachable.
1010
+ */
1011
+ media?: Array<InboundMessageEventPayload.Media> | null;
1012
+
874
1013
  /**
875
1014
  * The inbound message.
876
1015
  */
@@ -895,6 +1034,41 @@ export interface InboundMessageEventPayload {
895
1034
  updated_at?: string;
896
1035
  }
897
1036
 
1037
+ export namespace InboundMessageEventPayload {
1038
+ /**
1039
+ * One attachment on an inbound message.
1040
+ */
1041
+ export interface Media {
1042
+ /**
1043
+ * SHA-256 of the file as the carrier declared it, when it declares one. Verify
1044
+ * what you download against this — sent.dm never reads the bytes, so it is the
1045
+ * only integrity signal available.
1046
+ */
1047
+ hash_sha256?: string | null;
1048
+
1049
+ /**
1050
+ * Content type as the carrier reported it, for example image/jpeg.
1051
+ */
1052
+ mime_type?: string | null;
1053
+
1054
+ /**
1055
+ * Size in bytes as the carrier declared it. Absent when it declared none.
1056
+ */
1057
+ size_bytes?: number | null;
1058
+
1059
+ /**
1060
+ * Where the carrier hosts the attachment.
1061
+ *
1062
+ * This link expires and is not authenticated. sent.dm relays it rather than
1063
+ * copying the file, so how long it stays fetchable is the carrier's decision and
1064
+ * differs between them — assume days, not months. Anyone holding the URL can fetch
1065
+ * it until it lapses. Copy the file on receipt if you need it to outlive that
1066
+ * window; do not store this URL as a permanent reference.
1067
+ */
1068
+ url?: string | null;
1069
+ }
1070
+ }
1071
+
898
1072
  /**
899
1073
  * The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
900
1074
  * this shape and varies only in Payload.
@@ -980,6 +1154,22 @@ export interface MessageEventPayload {
980
1154
  */
981
1155
  outbound_number?: string;
982
1156
 
1157
+ /**
1158
+ * A human-readable sentence for ReasonCode, for example "The recipient is not
1159
+ * registered on this channel". Omitted whenever reason_code is.
1160
+ */
1161
+ reason?: string | null;
1162
+
1163
+ /**
1164
+ * Why the message reached this status, as a stable platform code such as
1165
+ * DELIVERY_007 or BUSINESS_003. Present on message.failed, message.filtered and
1166
+ * message.blocked; omitted on every status that needs no explanation. Switch on
1167
+ * this rather than on Reason: the code is stable, the wording may be improved. It
1168
+ * is the platform's classification of the outcome and never a carrier or vendor
1169
+ * code.
1170
+ */
1171
+ reason_code?: string | null;
1172
+
983
1173
  /**
984
1174
  * message.scheduled only: why the message is held, either because you scheduled it
985
1175
  * or because the recipient is inside a protected quiet-hours window. Omitted on
@@ -1312,7 +1502,8 @@ export interface WebhookListEventsResponse {
1312
1502
  | TemplateEvent
1313
1503
  | ChannelEvent
1314
1504
  | ContactEvent
1315
- | WebhookListEventsResponse.SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload;
1505
+ | WebhookListEventsResponse.SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload
1506
+ | CallEvent;
1316
1507
 
1317
1508
  event_type?: string;
1318
1509
 
@@ -1639,6 +1830,13 @@ export interface WebhookCreateParams {
1639
1830
  */
1640
1831
  sandbox?: boolean;
1641
1832
 
1833
+ /**
1834
+ * Body param: Request-only: the events an organization webhook's sender profile
1835
+ * clones receive, one clone per existing and future profile. Responses never
1836
+ * return it.
1837
+ */
1838
+ sender_profile?: WebhookCreateParams.SenderProfile | null;
1839
+
1642
1840
  /**
1643
1841
  * Body param
1644
1842
  */
@@ -1659,6 +1857,18 @@ export interface WebhookCreateParams {
1659
1857
  'x-profile-id'?: string;
1660
1858
  }
1661
1859
 
1860
+ export namespace WebhookCreateParams {
1861
+ /**
1862
+ * Request-only: the events an organization webhook's sender profile clones
1863
+ * receive, one clone per existing and future profile. Responses never return it.
1864
+ */
1865
+ export interface SenderProfile {
1866
+ event_filters?: { [key: string]: Array<string> } | null;
1867
+
1868
+ event_types?: Array<string>;
1869
+ }
1870
+ }
1871
+
1662
1872
  export interface WebhookRetrieveParams {
1663
1873
  /**
1664
1874
  * Profile UUID to scope the request to a child profile. Only organization API keys
@@ -1699,6 +1909,13 @@ export interface WebhookUpdateParams {
1699
1909
  */
1700
1910
  sandbox?: boolean;
1701
1911
 
1912
+ /**
1913
+ * Body param: Request-only: the events an organization webhook's sender profile
1914
+ * clones receive, one clone per existing and future profile. Responses never
1915
+ * return it.
1916
+ */
1917
+ sender_profile?: WebhookUpdateParams.SenderProfile | null;
1918
+
1702
1919
  /**
1703
1920
  * Body param
1704
1921
  */
@@ -1719,6 +1936,18 @@ export interface WebhookUpdateParams {
1719
1936
  'x-profile-id'?: string;
1720
1937
  }
1721
1938
 
1939
+ export namespace WebhookUpdateParams {
1940
+ /**
1941
+ * Request-only: the events an organization webhook's sender profile clones
1942
+ * receive, one clone per existing and future profile. Responses never return it.
1943
+ */
1944
+ export interface SenderProfile {
1945
+ event_filters?: { [key: string]: Array<string> } | null;
1946
+
1947
+ event_types?: Array<string>;
1948
+ }
1949
+ }
1950
+
1722
1951
  export interface WebhookListParams extends WebhooksPageParams {
1723
1952
  /**
1724
1953
  * Query param
@@ -1848,6 +2077,8 @@ export declare namespace Webhooks {
1848
2077
  export {
1849
2078
  type APIMeta as APIMeta,
1850
2079
  type APIResponseWebhook as APIResponseWebhook,
2080
+ type CallEvent as CallEvent,
2081
+ type CallEventPayload as CallEventPayload,
1851
2082
  type ChannelEvent as ChannelEvent,
1852
2083
  type ChannelEventPayload as ChannelEventPayload,
1853
2084
  type ContactEvent as ContactEvent,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.40.0'; // x-release-please-version
1
+ export const VERSION = '0.42.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.40.0";
1
+ export declare const VERSION = "0.42.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.40.0";
1
+ export declare const VERSION = "0.42.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.40.0'; // x-release-please-version
4
+ exports.VERSION = '0.42.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.40.0'; // x-release-please-version
1
+ export const VERSION = '0.42.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map