@zavudev/sdk 0.51.0 → 0.53.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 (100) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +1 -1
  3. package/resources/functions/functions.d.mts +28 -8
  4. package/resources/functions/functions.d.mts.map +1 -1
  5. package/resources/functions/functions.d.ts +28 -8
  6. package/resources/functions/functions.d.ts.map +1 -1
  7. package/resources/functions/functions.js +6 -4
  8. package/resources/functions/functions.js.map +1 -1
  9. package/resources/functions/functions.mjs +6 -4
  10. package/resources/functions/functions.mjs.map +1 -1
  11. package/resources/invitations.d.mts +85 -15
  12. package/resources/invitations.d.mts.map +1 -1
  13. package/resources/invitations.d.ts +85 -15
  14. package/resources/invitations.d.ts.map +1 -1
  15. package/resources/invitations.js +14 -4
  16. package/resources/invitations.js.map +1 -1
  17. package/resources/invitations.mjs +14 -4
  18. package/resources/invitations.mjs.map +1 -1
  19. package/resources/messages.d.mts +41 -4
  20. package/resources/messages.d.mts.map +1 -1
  21. package/resources/messages.d.ts +41 -4
  22. package/resources/messages.d.ts.map +1 -1
  23. package/resources/messages.js +12 -3
  24. package/resources/messages.js.map +1 -1
  25. package/resources/messages.mjs +12 -3
  26. package/resources/messages.mjs.map +1 -1
  27. package/resources/number-10dlc/brands.d.mts +5 -1
  28. package/resources/number-10dlc/brands.d.mts.map +1 -1
  29. package/resources/number-10dlc/brands.d.ts +5 -1
  30. package/resources/number-10dlc/brands.d.ts.map +1 -1
  31. package/resources/number-10dlc/brands.js +5 -1
  32. package/resources/number-10dlc/brands.js.map +1 -1
  33. package/resources/number-10dlc/brands.mjs +5 -1
  34. package/resources/number-10dlc/brands.mjs.map +1 -1
  35. package/resources/number-10dlc/campaigns/campaigns.d.mts +6 -1
  36. package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -1
  37. package/resources/number-10dlc/campaigns/campaigns.d.ts +6 -1
  38. package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -1
  39. package/resources/number-10dlc/campaigns/campaigns.js +6 -1
  40. package/resources/number-10dlc/campaigns/campaigns.js.map +1 -1
  41. package/resources/number-10dlc/campaigns/campaigns.mjs +6 -1
  42. package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -1
  43. package/resources/phone-numbers.d.mts +10 -3
  44. package/resources/phone-numbers.d.mts.map +1 -1
  45. package/resources/phone-numbers.d.ts +10 -3
  46. package/resources/phone-numbers.d.ts.map +1 -1
  47. package/resources/phone-numbers.js +3 -2
  48. package/resources/phone-numbers.js.map +1 -1
  49. package/resources/phone-numbers.mjs +3 -2
  50. package/resources/phone-numbers.mjs.map +1 -1
  51. package/resources/senders/agent/agent.d.mts +314 -0
  52. package/resources/senders/agent/agent.d.mts.map +1 -1
  53. package/resources/senders/agent/agent.d.ts +314 -0
  54. package/resources/senders/agent/agent.d.ts.map +1 -1
  55. package/resources/senders/agent/agent.js +6 -0
  56. package/resources/senders/agent/agent.js.map +1 -1
  57. package/resources/senders/agent/agent.mjs +6 -0
  58. package/resources/senders/agent/agent.mjs.map +1 -1
  59. package/resources/senders/agent/executions.d.mts +5 -0
  60. package/resources/senders/agent/executions.d.mts.map +1 -1
  61. package/resources/senders/agent/executions.d.ts +5 -0
  62. package/resources/senders/agent/executions.d.ts.map +1 -1
  63. package/resources/senders/agent/executions.js +5 -0
  64. package/resources/senders/agent/executions.js.map +1 -1
  65. package/resources/senders/agent/executions.mjs +5 -0
  66. package/resources/senders/agent/executions.mjs.map +1 -1
  67. package/resources/senders/agent/tools.d.mts +51 -2
  68. package/resources/senders/agent/tools.d.mts.map +1 -1
  69. package/resources/senders/agent/tools.d.ts +51 -2
  70. package/resources/senders/agent/tools.d.ts.map +1 -1
  71. package/resources/senders/agent/tools.js +10 -1
  72. package/resources/senders/agent/tools.js.map +1 -1
  73. package/resources/senders/agent/tools.mjs +10 -1
  74. package/resources/senders/agent/tools.mjs.map +1 -1
  75. package/resources/senders/senders.d.mts +64 -4
  76. package/resources/senders/senders.d.mts.map +1 -1
  77. package/resources/senders/senders.d.ts +64 -4
  78. package/resources/senders/senders.d.ts.map +1 -1
  79. package/resources/senders/senders.js.map +1 -1
  80. package/resources/senders/senders.mjs.map +1 -1
  81. package/resources/templates.d.mts +12 -3
  82. package/resources/templates.d.mts.map +1 -1
  83. package/resources/templates.d.ts +12 -3
  84. package/resources/templates.d.ts.map +1 -1
  85. package/src/resources/functions/functions.ts +29 -8
  86. package/src/resources/invitations.ts +91 -15
  87. package/src/resources/messages.ts +42 -3
  88. package/src/resources/number-10dlc/brands.ts +5 -1
  89. package/src/resources/number-10dlc/campaigns/campaigns.ts +6 -1
  90. package/src/resources/phone-numbers.ts +11 -3
  91. package/src/resources/senders/agent/agent.ts +365 -0
  92. package/src/resources/senders/agent/executions.ts +5 -0
  93. package/src/resources/senders/agent/tools.ts +58 -2
  94. package/src/resources/senders/senders.ts +73 -3
  95. package/src/resources/templates.ts +13 -4
  96. package/src/version.ts +1 -1
  97. package/version.d.mts +1 -1
  98. package/version.d.ts +1 -1
  99. package/version.js +1 -1
  100. package/version.mjs +1 -1
@@ -138,6 +138,12 @@ export class AgentResource extends APIResource {
138
138
  /**
139
139
  * Get statistics for an AI agent including invocations, tokens, and costs.
140
140
  *
141
+ * Covers the messaging channels only. Voice calls are not counted here: a call is
142
+ * a multi-turn conversation rather than one inbound message and one reply, so it
143
+ * is recorded as a call, not an execution. An agent that only answers phone calls
144
+ * reports zeros on every field. Use `GET /v1/calls` for voice activity, duration,
145
+ * and cost.
146
+ *
141
147
  * @example
142
148
  * ```ts
143
149
  * const agentStats = await client.senders.agent.stats(
@@ -201,6 +207,12 @@ export interface Agent {
201
207
  */
202
208
  maxTokens?: number | null;
203
209
 
210
+ /**
211
+ * Senders this agent answers on. An agent can serve several; `senderId` remains
212
+ * the primary one, for compatibility.
213
+ */
214
+ senderIds?: Array<string>;
215
+
204
216
  stats?: Agent.Stats;
205
217
 
206
218
  /**
@@ -217,6 +229,13 @@ export interface Agent {
217
229
  * Message types that trigger the agent.
218
230
  */
219
231
  triggerOnMessageTypes?: Array<string>;
232
+
233
+ /**
234
+ * Voice Agent configuration. When present and enabled, the agent can answer
235
+ * inbound phone calls and place outbound calls with Zavu's managed voice pipeline.
236
+ * Requires the Voice Agents feature to be enabled for your team.
237
+ */
238
+ voice?: Agent.Voice;
220
239
  }
221
240
 
222
241
  export namespace Agent {
@@ -230,6 +249,110 @@ export namespace Agent {
230
249
 
231
250
  totalTokensUsed?: number;
232
251
  }
252
+
253
+ /**
254
+ * Voice Agent configuration. When present and enabled, the agent can answer
255
+ * inbound phone calls and place outbound calls with Zavu's managed voice pipeline.
256
+ * Requires the Voice Agents feature to be enabled for your team.
257
+ */
258
+ export interface Voice {
259
+ /**
260
+ * Whether the agent handles voice calls. When false, the sender's number is not
261
+ * answered by the voice agent and outbound calls are rejected.
262
+ */
263
+ enabled: boolean;
264
+
265
+ /**
266
+ * Opening line the agent speaks when the call connects. If omitted, the agent
267
+ * waits for the caller to speak first.
268
+ */
269
+ greeting?: string;
270
+
271
+ /**
272
+ * Greeting per language, keyed by language code. Used when the caller's language
273
+ * differs from the one `greeting` is written in.
274
+ */
275
+ greetings?: { [key: string]: string };
276
+
277
+ /**
278
+ * Whether the caller can interrupt the agent while it is speaking (barge-in). When
279
+ * true, the agent stops talking as soon as the caller starts.
280
+ */
281
+ interruptible?: boolean;
282
+
283
+ /**
284
+ * BCP-47 language code used for both speech recognition and speech synthesis (e.g.
285
+ * `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
286
+ */
287
+ language?: string;
288
+
289
+ /**
290
+ * Hard limit on call length in minutes. The call ends automatically when reached.
291
+ */
292
+ maxCallDurationMinutes?: number;
293
+
294
+ /**
295
+ * How long the agent waits during silence before ending the call.
296
+ */
297
+ maxIdleSeconds?: number;
298
+
299
+ /**
300
+ * Model that runs the conversation, co-located in the voice network for lowest
301
+ * latency. Independent of the model used for text messaging. Derived from the
302
+ * agent's text model when omitted.
303
+ */
304
+ model?: string;
305
+
306
+ /**
307
+ * Whether the call audio is recorded.
308
+ */
309
+ recordCalls?: boolean;
310
+
311
+ /**
312
+ * Speech-recognition model. Uses the default when omitted.
313
+ */
314
+ sttModel?: string;
315
+
316
+ /**
317
+ * Speech-recognition provider. Uses the default when omitted.
318
+ */
319
+ sttProvider?: string;
320
+
321
+ /**
322
+ * E.164 phone number the agent can transfer the call to. When set, the agent is
323
+ * given a transfer tool it can use to hand the call to a human.
324
+ */
325
+ transferPhoneNumber?: string;
326
+
327
+ /**
328
+ * Speech-synthesis provider. Uses the default when omitted.
329
+ */
330
+ ttsProvider?: string;
331
+
332
+ /**
333
+ * Identifier of the synthesized voice that speaks. Choose from the voices
334
+ * available in the dashboard. Uses a neutral default when omitted.
335
+ */
336
+ ttsVoiceId?: string;
337
+
338
+ /**
339
+ * What the agent does when an answering machine or voicemail is detected on an
340
+ * outbound call.
341
+ */
342
+ voicemailAction?: 'hangup' | 'leave_message';
343
+
344
+ /**
345
+ * Message spoken when `voicemailAction` is `leave_message`. Falls back to
346
+ * `greeting` when omitted.
347
+ */
348
+ voicemailMessage?: string;
349
+
350
+ /**
351
+ * Speech rate. 1.0 is natural. Only honoured by voices that support rate control;
352
+ * ignored by the others.
353
+ */
354
+ voiceSpeed?: number;
355
+ }
233
356
  }
234
357
 
235
358
  export interface AgentExecution {
@@ -259,9 +382,25 @@ export interface AgentExecution {
259
382
 
260
383
  inboundMessageId?: string;
261
384
 
385
+ /**
386
+ * Knowledge-base chunks retrieved for this answer. Zero on an agent that has
387
+ * documents attached means the reply was not grounded in them, which is otherwise
388
+ * indistinguishable from a correct answer in this record. Absent on executions
389
+ * recorded before this field existed, which is not the same as zero.
390
+ */
391
+ knowledgeChunksUsed?: number | null;
392
+
262
393
  responseMessageId?: string | null;
263
394
 
264
395
  responseText?: string | null;
396
+
397
+ /**
398
+ * Tools the agent called while producing this reply. Zero on an agent that has
399
+ * tools configured means it answered without calling any — the case where a reply
400
+ * says it will look something up and nothing ever reaches your endpoint. Absent on
401
+ * executions recorded before this field existed, which is not the same as zero.
402
+ */
403
+ toolCalls?: number | null;
265
404
  }
266
405
 
267
406
  /**
@@ -326,6 +465,119 @@ export interface AgentCreateParams {
326
465
  triggerOnChannels?: Array<string>;
327
466
 
328
467
  triggerOnMessageTypes?: Array<string>;
468
+
469
+ /**
470
+ * Voice Agent configuration. Enable this to let the agent answer and place phone
471
+ * calls with Zavu's managed voice pipeline. Requires the Voice Agents feature to
472
+ * be enabled for your team.
473
+ */
474
+ voice?: AgentCreateParams.Voice;
475
+ }
476
+
477
+ export namespace AgentCreateParams {
478
+ /**
479
+ * Voice Agent configuration. Enable this to let the agent answer and place phone
480
+ * calls with Zavu's managed voice pipeline. Requires the Voice Agents feature to
481
+ * be enabled for your team.
482
+ */
483
+ export interface Voice {
484
+ /**
485
+ * Whether the agent handles voice calls. When false, the sender's number is not
486
+ * answered by the voice agent and outbound calls are rejected.
487
+ */
488
+ enabled: boolean;
489
+
490
+ /**
491
+ * Opening line the agent speaks when the call connects. If omitted, the agent
492
+ * waits for the caller to speak first.
493
+ */
494
+ greeting?: string;
495
+
496
+ /**
497
+ * Greeting per language, keyed by language code. Used when the caller's language
498
+ * differs from the one `greeting` is written in.
499
+ */
500
+ greetings?: { [key: string]: string };
501
+
502
+ /**
503
+ * Whether the caller can interrupt the agent while it is speaking (barge-in). When
504
+ * true, the agent stops talking as soon as the caller starts.
505
+ */
506
+ interruptible?: boolean;
507
+
508
+ /**
509
+ * BCP-47 language code used for both speech recognition and speech synthesis (e.g.
510
+ * `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
511
+ */
512
+ language?: string;
513
+
514
+ /**
515
+ * Hard limit on call length in minutes. The call ends automatically when reached.
516
+ */
517
+ maxCallDurationMinutes?: number;
518
+
519
+ /**
520
+ * How long the agent waits during silence before ending the call.
521
+ */
522
+ maxIdleSeconds?: number;
523
+
524
+ /**
525
+ * Model that runs the conversation, co-located in the voice network for lowest
526
+ * latency. Independent of the model used for text messaging. Derived from the
527
+ * agent's text model when omitted.
528
+ */
529
+ model?: string;
530
+
531
+ /**
532
+ * Whether the call audio is recorded.
533
+ */
534
+ recordCalls?: boolean;
535
+
536
+ /**
537
+ * Speech-recognition model. Uses the default when omitted.
538
+ */
539
+ sttModel?: string;
540
+
541
+ /**
542
+ * Speech-recognition provider. Uses the default when omitted.
543
+ */
544
+ sttProvider?: string;
545
+
546
+ /**
547
+ * E.164 phone number the agent can transfer the call to. When set, the agent is
548
+ * given a transfer tool it can use to hand the call to a human.
549
+ */
550
+ transferPhoneNumber?: string;
551
+
552
+ /**
553
+ * Speech-synthesis provider. Uses the default when omitted.
554
+ */
555
+ ttsProvider?: string;
556
+
557
+ /**
558
+ * Identifier of the synthesized voice that speaks. Choose from the voices
559
+ * available in the dashboard. Uses a neutral default when omitted.
560
+ */
561
+ ttsVoiceId?: string;
562
+
563
+ /**
564
+ * What the agent does when an answering machine or voicemail is detected on an
565
+ * outbound call.
566
+ */
567
+ voicemailAction?: 'hangup' | 'leave_message';
568
+
569
+ /**
570
+ * Message spoken when `voicemailAction` is `leave_message`. Falls back to
571
+ * `greeting` when omitted.
572
+ */
573
+ voicemailMessage?: string;
574
+
575
+ /**
576
+ * Speech rate. 1.0 is natural. Only honoured by voices that support rate control;
577
+ * ignored by the others.
578
+ */
579
+ voiceSpeed?: number;
580
+ }
329
581
  }
330
582
 
331
583
  export interface AgentUpdateParams {
@@ -355,6 +607,119 @@ export interface AgentUpdateParams {
355
607
  triggerOnChannels?: Array<string>;
356
608
 
357
609
  triggerOnMessageTypes?: Array<string>;
610
+
611
+ /**
612
+ * Voice Agent configuration. Patch this object to enable voice, change the
613
+ * greeting, or adjust call limits. Requires the Voice Agents feature to be enabled
614
+ * for your team.
615
+ */
616
+ voice?: AgentUpdateParams.Voice;
617
+ }
618
+
619
+ export namespace AgentUpdateParams {
620
+ /**
621
+ * Voice Agent configuration. Patch this object to enable voice, change the
622
+ * greeting, or adjust call limits. Requires the Voice Agents feature to be enabled
623
+ * for your team.
624
+ */
625
+ export interface Voice {
626
+ /**
627
+ * Whether the agent handles voice calls. When false, the sender's number is not
628
+ * answered by the voice agent and outbound calls are rejected.
629
+ */
630
+ enabled: boolean;
631
+
632
+ /**
633
+ * Opening line the agent speaks when the call connects. If omitted, the agent
634
+ * waits for the caller to speak first.
635
+ */
636
+ greeting?: string;
637
+
638
+ /**
639
+ * Greeting per language, keyed by language code. Used when the caller's language
640
+ * differs from the one `greeting` is written in.
641
+ */
642
+ greetings?: { [key: string]: string };
643
+
644
+ /**
645
+ * Whether the caller can interrupt the agent while it is speaking (barge-in). When
646
+ * true, the agent stops talking as soon as the caller starts.
647
+ */
648
+ interruptible?: boolean;
649
+
650
+ /**
651
+ * BCP-47 language code used for both speech recognition and speech synthesis (e.g.
652
+ * `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
653
+ */
654
+ language?: string;
655
+
656
+ /**
657
+ * Hard limit on call length in minutes. The call ends automatically when reached.
658
+ */
659
+ maxCallDurationMinutes?: number;
660
+
661
+ /**
662
+ * How long the agent waits during silence before ending the call.
663
+ */
664
+ maxIdleSeconds?: number;
665
+
666
+ /**
667
+ * Model that runs the conversation, co-located in the voice network for lowest
668
+ * latency. Independent of the model used for text messaging. Derived from the
669
+ * agent's text model when omitted.
670
+ */
671
+ model?: string;
672
+
673
+ /**
674
+ * Whether the call audio is recorded.
675
+ */
676
+ recordCalls?: boolean;
677
+
678
+ /**
679
+ * Speech-recognition model. Uses the default when omitted.
680
+ */
681
+ sttModel?: string;
682
+
683
+ /**
684
+ * Speech-recognition provider. Uses the default when omitted.
685
+ */
686
+ sttProvider?: string;
687
+
688
+ /**
689
+ * E.164 phone number the agent can transfer the call to. When set, the agent is
690
+ * given a transfer tool it can use to hand the call to a human.
691
+ */
692
+ transferPhoneNumber?: string;
693
+
694
+ /**
695
+ * Speech-synthesis provider. Uses the default when omitted.
696
+ */
697
+ ttsProvider?: string;
698
+
699
+ /**
700
+ * Identifier of the synthesized voice that speaks. Choose from the voices
701
+ * available in the dashboard. Uses a neutral default when omitted.
702
+ */
703
+ ttsVoiceId?: string;
704
+
705
+ /**
706
+ * What the agent does when an answering machine or voicemail is detected on an
707
+ * outbound call.
708
+ */
709
+ voicemailAction?: 'hangup' | 'leave_message';
710
+
711
+ /**
712
+ * Message spoken when `voicemailAction` is `leave_message`. Falls back to
713
+ * `greeting` when omitted.
714
+ */
715
+ voicemailMessage?: string;
716
+
717
+ /**
718
+ * Speech rate. 1.0 is natural. Only honoured by voices that support rate control;
719
+ * ignored by the others.
720
+ */
721
+ voiceSpeed?: number;
722
+ }
358
723
  }
359
724
 
360
725
  AgentResource.Executions = Executions;
@@ -34,6 +34,11 @@ export class Executions extends APIResource {
34
34
  /**
35
35
  * List recent agent executions with pagination.
36
36
  *
37
+ * An execution is one inbound message answered by the agent, so this covers the
38
+ * messaging channels only. Voice calls are never listed here regardless of how
39
+ * many the agent handled. Use `GET /v1/calls` (and `GET /v1/calls/{callId}` for
40
+ * the transcript) for voice.
41
+ *
37
42
  * @example
38
43
  * ```ts
39
44
  * // Automatically fetches more pages as needed.
@@ -118,7 +118,16 @@ export class Tools extends APIResource {
118
118
  }
119
119
 
120
120
  /**
121
- * Test a tool by triggering its webhook with test parameters.
121
+ * Run a tool with the parameters you supply and return what it answered.
122
+ *
123
+ * The call is synchronous: the response carries the tool's status, body, and
124
+ * duration, so a green result is evidence the tool ran rather than evidence it was
125
+ * accepted. Each run is also recorded and readable afterwards via
126
+ * `GET /v1/senders/{senderId}/agent/tools/{toolId}/test-runs`.
127
+ *
128
+ * A tool that answers with an error is reported as a run with `success: false` —
129
+ * the endpoint itself still returns 200. This fires the tool's real webhook, so a
130
+ * test has whatever side effects the tool has.
122
131
  *
123
132
  * @example
124
133
  * ```ts
@@ -194,7 +203,54 @@ export interface ToolUpdateResponse {
194
203
  }
195
204
 
196
205
  export interface ToolTestResponse {
197
- scheduled: boolean;
206
+ /**
207
+ * One run of a tool triggered from the test endpoint. Recorded so a test is
208
+ * verifiable after the fact rather than only visible in the response.
209
+ */
210
+ run: ToolTestResponse.Run;
211
+ }
212
+
213
+ export namespace ToolTestResponse {
214
+ /**
215
+ * One run of a tool triggered from the test endpoint. Recorded so a test is
216
+ * verifiable after the fact rather than only visible in the response.
217
+ */
218
+ export interface Run {
219
+ id: string;
220
+
221
+ createdAt: string;
222
+
223
+ durationMs: number;
224
+
225
+ /**
226
+ * Whether the tool returned without error. A tool that answered with a non-2xx
227
+ * status is a failed run, not an error of this endpoint.
228
+ */
229
+ success: boolean;
230
+
231
+ toolId: string;
232
+
233
+ /**
234
+ * Why the run failed, when it did.
235
+ */
236
+ error?: string | null;
237
+
238
+ /**
239
+ * The parameters the tool was called with.
240
+ */
241
+ params?: { [key: string]: unknown };
242
+
243
+ /**
244
+ * The tool's response body, truncated.
245
+ */
246
+ response?: string | null;
247
+
248
+ /**
249
+ * HTTP status the tool's webhook returned. Absent for tools that do not go over
250
+ * HTTP.
251
+ */
252
+ statusCode?: number | null;
253
+ }
198
254
  }
199
255
 
200
256
  export interface ToolCreateParams {
@@ -195,6 +195,14 @@ export interface Sender {
195
195
  */
196
196
  phoneNumber: string;
197
197
 
198
+ /**
199
+ * Channels this sender can actually send on right now, computed from its
200
+ * configuration. Empty means the sender cannot send or receive anything yet: a
201
+ * phoneNumber alone does not enable SMS or voice. Check this rather than inferring
202
+ * capability from phoneNumber or emailAddress.
203
+ */
204
+ channels?: Array<string>;
205
+
198
206
  createdAt?: string;
199
207
 
200
208
  /**
@@ -354,7 +362,32 @@ export interface SenderWebhook {
354
362
  * **Partner events:**
355
363
  *
356
364
  * - `invitation.status_changed`: A partner invitation status changed (pending,
357
- * in_progress, completed, cancelled)
365
+ * in_progress, completed, cancelled, failed). `data` carries `invitationId`,
366
+ * `clientName`, `clientEmail`, `connectionType` (`whatsapp_waba` or
367
+ * `messenger`), `previousStatus`, and `currentStatus`. On `completed` it also
368
+ * carries `senderId` and `connectedAccount` (`channel`, `id`, `name`) — the
369
+ * WhatsApp number or Facebook Page that was linked. On `failed` it carries
370
+ * `failureReason`; the invitation link stays usable, so a client can retry it.
371
+ *
372
+ * **Voice Agent events:** For every voice event, `data` carries `callId`,
373
+ * `direction`, `from`, `to`, `status`, `durationSeconds`, `endReason`, and
374
+ * `transcriptAvailable`. The terminal events (`call.completed`, `call.failed`)
375
+ * additionally carry `cost` — what the call was billed, in USD, combining
376
+ * telephony and the managed voice pipeline — and `currency`. They are dispatched
377
+ * after the call is charged, so `cost` is populated rather than zero; telephony
378
+ * can still be settling on an outbound call, in which case
379
+ * `GET /v1/calls/{callId}` holds the reconciled figure.
380
+ *
381
+ * - `call.initiated`: An outbound call was created and is dialing, or an inbound
382
+ * call was received. `data.status` = `ringing`
383
+ * - `call.answered`: The call was answered and the voice agent is connected.
384
+ * `data.status` = `in_progress`
385
+ * - `call.completed`: The call ended after a conversation. `data.status` =
386
+ * `completed`; `durationSeconds` and `endReason` describe how it ended, and
387
+ * `transcriptAvailable` indicates whether a transcript can be fetched.
388
+ * - `call.failed`: The call could not be completed (busy, no answer, canceled, or
389
+ * an error). `data.status` is the terminal status and `endReason` explains the
390
+ * cause.
358
391
  *
359
392
  * **Custom domain events:**
360
393
  *
@@ -368,6 +401,7 @@ export type WebhookEvent =
368
401
  | 'message.sent'
369
402
  | 'message.delivered'
370
403
  | 'message.read'
404
+ | 'message.status'
371
405
  | 'message.failed'
372
406
  | 'message.inbound'
373
407
  | 'message.unsupported'
@@ -375,6 +409,10 @@ export type WebhookEvent =
375
409
  | 'conversation.new'
376
410
  | 'template.status_changed'
377
411
  | 'invitation.status_changed'
412
+ | 'call.initiated'
413
+ | 'call.answered'
414
+ | 'call.completed'
415
+ | 'call.failed'
378
416
  | 'domain.verified'
379
417
  | 'domain.failed';
380
418
 
@@ -502,8 +540,26 @@ export interface SenderCreateParams {
502
540
  emailReceivingEnabled?: boolean;
503
541
 
504
542
  /**
505
- * Phone number in E.164 format. Required for phone-based channels (SMS, WhatsApp).
506
- * Omit for an email-only sender.
543
+ * Enable the one-way SMS channel (`sms_oneway`). Needs nothing else — no phone
544
+ * number, no credential — so it is the fastest way to get a sender that can send.
545
+ * Recipients cannot reply. Confirm with `sms_oneway` in the `channels` array on
546
+ * the response.
547
+ */
548
+ enableSmsOneway?: boolean;
549
+
550
+ /**
551
+ * Let this sender place and answer phone calls. Requires `phoneNumber`; enabling
552
+ * it without one returns 400. Check the `channels` array on the response to
553
+ * confirm `voice` is on.
554
+ */
555
+ enableVoice?: boolean;
556
+
557
+ /**
558
+ * Phone number in E.164 format, and it must be a number your project already owns
559
+ * (see `GET /v1/phone-numbers`). The number is routed to the sender as part of
560
+ * this call, which is what turns the SMS channel on. Passing a number the project
561
+ * does not own, or one already attached to another sender, returns 400 rather than
562
+ * creating a sender that cannot send. Omit for an email-only sender.
507
563
  */
508
564
  phoneNumber?: string;
509
565
 
@@ -550,6 +606,20 @@ export interface SenderUpdateParams {
550
606
  */
551
607
  emailReceivingEnabled?: boolean;
552
608
 
609
+ /**
610
+ * Turn the one-way SMS channel on or off. Enabling needs nothing else and takes
611
+ * effect immediately; disabling removes the channel from the sender. Confirm with
612
+ * the `channels` array on the response.
613
+ */
614
+ enableSmsOneway?: boolean;
615
+
616
+ /**
617
+ * Turn the voice channel on or off. The sender must already have a phone number
618
+ * provisioned for calls; enabling it otherwise returns 400 instead of storing a
619
+ * flag that changes nothing. Confirm with the `channels` array on the response.
620
+ */
621
+ enableVoice?: boolean;
622
+
553
623
  name?: string;
554
624
 
555
625
  setAsDefault?: boolean;
@@ -210,7 +210,7 @@ export namespace Template {
210
210
 
211
211
  text?: string;
212
212
 
213
- type?: 'quick_reply' | 'url' | 'phone' | 'otp';
213
+ type?: 'quick_reply' | 'url' | 'phone' | 'otp' | 'request_contact_info';
214
214
 
215
215
  url?: string;
216
216
  }
@@ -306,9 +306,12 @@ export interface TemplateCreateParams {
306
306
 
307
307
  export namespace TemplateCreateParams {
308
308
  export interface Button {
309
- text: string;
310
-
311
- type: 'quick_reply' | 'url' | 'phone' | 'otp';
309
+ /**
310
+ * `request_contact_info` renders a fixed **Share Contact Info** button that asks
311
+ * the recipient to share their phone number — useful when a contact adopted a
312
+ * WhatsApp username and you only know their BSUID. It takes no other fields.
313
+ */
314
+ type: 'quick_reply' | 'url' | 'phone' | 'otp' | 'request_contact_info';
312
315
 
313
316
  /**
314
317
  * Sample value Meta uses to review templates with a dynamic URL button.
@@ -335,6 +338,12 @@ export namespace TemplateCreateParams {
335
338
  */
336
339
  signatureHash?: string;
337
340
 
341
+ /**
342
+ * Button label. Required for every type except `request_contact_info`, whose label
343
+ * is fixed by WhatsApp.
344
+ */
345
+ text?: string;
346
+
338
347
  /**
339
348
  * Button destination. Use `{{1}}` exactly once for a dynamic URL (e.g.
340
349
  * `https://example.com/orders/{{1}}`); WhatsApp only accepts the strict `{{1}}`
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.51.0'; // x-release-please-version
1
+ export const VERSION = '0.53.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.51.0";
1
+ export declare const VERSION = "0.53.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.51.0";
1
+ export declare const VERSION = "0.53.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.51.0'; // x-release-please-version
4
+ exports.VERSION = '0.53.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.51.0'; // x-release-please-version
1
+ export const VERSION = '0.53.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map