@zavudev/sdk 0.55.0 → 0.57.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.
- package/CHANGELOG.md +26 -0
- package/client.d.mts +25 -13
- package/client.d.mts.map +1 -1
- package/client.d.ts +25 -13
- package/client.d.ts.map +1 -1
- package/client.js +15 -3
- package/client.js.map +1 -1
- package/client.mjs +15 -3
- package/client.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +0 -3
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts +0 -3
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +3 -16
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +2 -16
- package/internal/utils/query.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent-templates.d.mts +97 -0
- package/resources/agent-templates.d.mts.map +1 -0
- package/resources/agent-templates.d.ts +97 -0
- package/resources/agent-templates.d.ts.map +1 -0
- package/resources/agent-templates.js +39 -0
- package/resources/agent-templates.js.map +1 -0
- package/resources/agent-templates.mjs +35 -0
- package/resources/agent-templates.mjs.map +1 -0
- package/resources/agents/agents.d.mts +462 -0
- package/resources/agents/agents.d.mts.map +1 -0
- package/resources/agents/agents.d.ts +462 -0
- package/resources/agents/agents.d.ts.map +1 -0
- package/resources/agents/agents.js +129 -0
- package/resources/agents/agents.js.map +1 -0
- package/resources/agents/agents.mjs +124 -0
- package/resources/agents/agents.mjs.map +1 -0
- package/resources/agents/index.d.mts +3 -0
- package/resources/agents/index.d.mts.map +1 -0
- package/resources/agents/index.d.ts +3 -0
- package/resources/agents/index.d.ts.map +1 -0
- package/resources/agents/index.js +9 -0
- package/resources/agents/index.js.map +1 -0
- package/resources/agents/index.mjs +4 -0
- package/resources/agents/index.mjs.map +1 -0
- package/resources/agents/senders.d.mts +54 -0
- package/resources/agents/senders.d.mts.map +1 -0
- package/resources/agents/senders.d.ts +54 -0
- package/resources/agents/senders.d.ts.map +1 -0
- package/resources/agents/senders.js +45 -0
- package/resources/agents/senders.js.map +1 -0
- package/resources/agents/senders.mjs +41 -0
- package/resources/agents/senders.mjs.map +1 -0
- package/resources/agents.d.mts +2 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +2 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/agents.js +6 -0
- package/resources/agents.js.map +1 -0
- package/resources/agents.mjs +3 -0
- package/resources/agents.mjs.map +1 -0
- package/resources/broadcasts/broadcasts.d.mts +16 -9
- package/resources/broadcasts/broadcasts.d.mts.map +1 -1
- package/resources/broadcasts/broadcasts.d.ts +16 -9
- package/resources/broadcasts/broadcasts.d.ts.map +1 -1
- package/resources/broadcasts/broadcasts.js +16 -9
- package/resources/broadcasts/broadcasts.js.map +1 -1
- package/resources/broadcasts/broadcasts.mjs +16 -9
- package/resources/broadcasts/broadcasts.mjs.map +1 -1
- package/resources/calls.d.mts +539 -0
- package/resources/calls.d.mts.map +1 -0
- package/resources/calls.d.ts +539 -0
- package/resources/calls.d.ts.map +1 -0
- package/resources/calls.js +85 -0
- package/resources/calls.js.map +1 -0
- package/resources/calls.mjs +81 -0
- package/resources/calls.mjs.map +1 -0
- package/resources/contacts/contacts.d.mts +32 -13
- package/resources/contacts/contacts.d.mts.map +1 -1
- package/resources/contacts/contacts.d.ts +32 -13
- package/resources/contacts/contacts.d.ts.map +1 -1
- package/resources/contacts/contacts.js +0 -14
- package/resources/contacts/contacts.js.map +1 -1
- package/resources/contacts/contacts.mjs +0 -14
- package/resources/contacts/contacts.mjs.map +1 -1
- package/resources/conversations.d.mts +360 -0
- package/resources/conversations.d.mts.map +1 -0
- package/resources/conversations.d.ts +360 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +47 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +43 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/email-domains.d.mts +260 -0
- package/resources/email-domains.d.mts.map +1 -0
- package/resources/email-domains.d.ts +260 -0
- package/resources/email-domains.d.ts.map +1 -0
- package/resources/email-domains.js +77 -0
- package/resources/email-domains.js.map +1 -0
- package/resources/email-domains.mjs +73 -0
- package/resources/email-domains.mjs.map +1 -0
- package/resources/functions/functions.d.mts +122 -1
- package/resources/functions/functions.d.mts.map +1 -1
- package/resources/functions/functions.d.ts +122 -1
- package/resources/functions/functions.d.ts.map +1 -1
- package/resources/functions/functions.js +53 -0
- package/resources/functions/functions.js.map +1 -1
- package/resources/functions/functions.mjs +53 -0
- package/resources/functions/functions.mjs.map +1 -1
- package/resources/functions/git-link.d.mts +295 -0
- package/resources/functions/git-link.d.mts.map +1 -0
- package/resources/functions/git-link.d.ts +295 -0
- package/resources/functions/git-link.d.ts.map +1 -0
- package/resources/functions/git-link.js +97 -0
- package/resources/functions/git-link.js.map +1 -0
- package/resources/functions/git-link.mjs +93 -0
- package/resources/functions/git-link.mjs.map +1 -0
- package/resources/functions/index.d.mts +3 -1
- package/resources/functions/index.d.mts.map +1 -1
- package/resources/functions/index.d.ts +3 -1
- package/resources/functions/index.d.ts.map +1 -1
- package/resources/functions/index.js +5 -1
- package/resources/functions/index.js.map +1 -1
- package/resources/functions/index.mjs +2 -0
- package/resources/functions/index.mjs.map +1 -1
- package/resources/functions/triggers.d.mts +164 -0
- package/resources/functions/triggers.d.mts.map +1 -0
- package/resources/functions/triggers.d.ts +164 -0
- package/resources/functions/triggers.d.ts.map +1 -0
- package/resources/functions/triggers.js +74 -0
- package/resources/functions/triggers.js.map +1 -0
- package/resources/functions/triggers.mjs +70 -0
- package/resources/functions/triggers.mjs.map +1 -0
- package/resources/index.d.mts +10 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +10 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +11 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -0
- package/resources/index.mjs.map +1 -1
- package/resources/introspect.d.mts +74 -1
- package/resources/introspect.d.mts.map +1 -1
- package/resources/introspect.d.ts +74 -1
- package/resources/introspect.d.ts.map +1 -1
- package/resources/introspect.js +22 -0
- package/resources/introspect.js.map +1 -1
- package/resources/introspect.mjs +22 -0
- package/resources/introspect.mjs.map +1 -1
- package/resources/messages.d.mts +89 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +89 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +48 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +48 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/number-10dlc/brands.d.mts +10 -5
- package/resources/number-10dlc/brands.d.mts.map +1 -1
- package/resources/number-10dlc/brands.d.ts +10 -5
- package/resources/number-10dlc/brands.d.ts.map +1 -1
- package/resources/number-10dlc/brands.js +10 -5
- package/resources/number-10dlc/brands.js.map +1 -1
- package/resources/number-10dlc/brands.mjs +10 -5
- package/resources/number-10dlc/brands.mjs.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.d.mts +8 -7
- package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.d.ts +8 -7
- package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.js +8 -7
- package/resources/number-10dlc/campaigns/campaigns.js.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.mjs +8 -7
- package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +6 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +6 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/senders/agent/agent.d.mts +4 -3
- package/resources/senders/agent/agent.d.mts.map +1 -1
- package/resources/senders/agent/agent.d.ts +4 -3
- package/resources/senders/agent/agent.d.ts.map +1 -1
- package/resources/senders/agent/agent.js +2 -2
- package/resources/senders/agent/agent.js.map +1 -1
- package/resources/senders/agent/agent.mjs +2 -2
- package/resources/senders/agent/agent.mjs.map +1 -1
- package/resources/senders/agent/index.d.mts +2 -2
- package/resources/senders/agent/index.d.mts.map +1 -1
- package/resources/senders/agent/index.d.ts +2 -2
- package/resources/senders/agent/index.d.ts.map +1 -1
- package/resources/senders/agent/index.js +2 -2
- package/resources/senders/agent/index.js.map +1 -1
- package/resources/senders/agent/index.mjs +1 -1
- package/resources/senders/agent/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.mts +56 -1
- package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.ts +56 -1
- package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.js +33 -0
- package/resources/senders/agent/knowledge-bases/documents.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.mjs +33 -0
- package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.mts +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.ts +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +2 -2
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +2 -2
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -1
- package/resources/senders/agent/tools/index.d.mts +3 -0
- package/resources/senders/agent/tools/index.d.mts.map +1 -0
- package/resources/senders/agent/tools/index.d.ts +3 -0
- package/resources/senders/agent/tools/index.d.ts.map +1 -0
- package/resources/senders/agent/tools/index.js +9 -0
- package/resources/senders/agent/tools/index.js.map +1 -0
- package/resources/senders/agent/tools/index.mjs +4 -0
- package/resources/senders/agent/tools/index.mjs.map +1 -0
- package/resources/senders/agent/tools/tools.d.mts +338 -0
- package/resources/senders/agent/tools/tools.d.mts.map +1 -0
- package/resources/senders/agent/tools/tools.d.ts +338 -0
- package/resources/senders/agent/tools/tools.d.ts.map +1 -0
- package/resources/senders/agent/tools/tools.js +163 -0
- package/resources/senders/agent/tools/tools.js.map +1 -0
- package/resources/senders/agent/tools/tools.mjs +158 -0
- package/resources/senders/agent/tools/tools.mjs.map +1 -0
- package/resources/senders/agent/tools/webhook.d.mts +28 -0
- package/resources/senders/agent/tools/webhook.d.mts.map +1 -0
- package/resources/senders/agent/tools/webhook.d.ts +28 -0
- package/resources/senders/agent/tools/webhook.d.ts.map +1 -0
- package/resources/senders/agent/tools/webhook.js +28 -0
- package/resources/senders/agent/tools/webhook.js.map +1 -0
- package/resources/senders/agent/tools/webhook.mjs +24 -0
- package/resources/senders/agent/tools/webhook.mjs.map +1 -0
- package/resources/senders/agent/tools.d.mts +1 -270
- package/resources/senders/agent/tools.d.mts.map +1 -1
- package/resources/senders/agent/tools.d.ts +1 -270
- package/resources/senders/agent/tools.d.ts.map +1 -1
- package/resources/senders/agent/tools.js +2 -131
- package/resources/senders/agent/tools.js.map +1 -1
- package/resources/senders/agent/tools.mjs +1 -129
- package/resources/senders/agent/tools.mjs.map +1 -1
- package/resources/senders/index.d.mts +2 -1
- package/resources/senders/index.d.mts.map +1 -1
- package/resources/senders/index.d.ts +2 -1
- package/resources/senders/index.d.ts.map +1 -1
- package/resources/senders/index.js +3 -1
- package/resources/senders/index.js.map +1 -1
- package/resources/senders/index.mjs +1 -0
- package/resources/senders/index.mjs.map +1 -1
- package/resources/senders/senders.d.mts +4 -0
- package/resources/senders/senders.d.mts.map +1 -1
- package/resources/senders/senders.d.ts +4 -0
- package/resources/senders/senders.d.ts.map +1 -1
- package/resources/senders/senders.js +4 -0
- package/resources/senders/senders.js.map +1 -1
- package/resources/senders/senders.mjs +4 -0
- package/resources/senders/senders.mjs.map +1 -1
- package/resources/senders/telegram.d.mts +48 -0
- package/resources/senders/telegram.d.mts.map +1 -0
- package/resources/senders/telegram.d.ts +48 -0
- package/resources/senders/telegram.d.ts.map +1 -0
- package/resources/senders/telegram.js +41 -0
- package/resources/senders/telegram.js.map +1 -0
- package/resources/senders/telegram.mjs +37 -0
- package/resources/senders/telegram.mjs.map +1 -0
- package/resources/templates.d.mts +66 -1
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +66 -1
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +31 -0
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +31 -0
- package/resources/templates.mjs.map +1 -1
- package/resources/urls.d.mts +24 -1
- package/resources/urls.d.mts.map +1 -1
- package/resources/urls.d.ts +24 -1
- package/resources/urls.d.ts.map +1 -1
- package/resources/urls.js +15 -0
- package/resources/urls.js.map +1 -1
- package/resources/urls.mjs +15 -0
- package/resources/urls.mjs.map +1 -1
- package/src/client.ts +129 -3
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/utils/query.ts +2 -18
- package/src/resources/agent-templates.ts +128 -0
- package/src/resources/agents/agents.ts +603 -0
- package/src/resources/agents/index.ts +21 -0
- package/src/resources/agents/senders.ts +79 -0
- package/src/resources/agents.ts +3 -0
- package/src/resources/broadcasts/broadcasts.ts +16 -9
- package/src/resources/calls.ts +647 -0
- package/src/resources/contacts/contacts.ts +35 -20
- package/src/resources/conversations.ts +472 -0
- package/src/resources/email-domains.ts +337 -0
- package/src/resources/functions/functions.ts +202 -0
- package/src/resources/functions/git-link.ts +398 -0
- package/src/resources/functions/index.ts +22 -0
- package/src/resources/functions/triggers.ts +227 -0
- package/src/resources/index.ts +57 -0
- package/src/resources/introspect.ts +105 -0
- package/src/resources/messages.ts +102 -0
- package/src/resources/number-10dlc/brands.ts +10 -5
- package/src/resources/number-10dlc/campaigns/campaigns.ts +8 -7
- package/src/resources/phone-numbers.ts +6 -1
- package/src/resources/senders/agent/agent.ts +23 -17
- package/src/resources/senders/agent/index.ts +4 -1
- package/src/resources/senders/agent/knowledge-bases/documents.ts +89 -0
- package/src/resources/senders/agent/knowledge-bases/index.ts +4 -0
- package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +8 -0
- package/src/resources/senders/agent/tools/index.ts +21 -0
- package/src/resources/senders/agent/tools/tools.ts +460 -0
- package/src/resources/senders/agent/tools/webhook.ts +40 -0
- package/src/resources/senders/agent/tools.ts +1 -364
- package/src/resources/senders/index.ts +2 -0
- package/src/resources/senders/senders.ts +10 -0
- package/src/resources/senders/telegram.ts +73 -0
- package/src/resources/templates.ts +80 -0
- package/src/resources/urls.ts +35 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -182,15 +182,22 @@ export class Broadcasts extends APIResource {
|
|
|
182
182
|
/**
|
|
183
183
|
* Start sending the broadcast immediately or schedule for later.
|
|
184
184
|
*
|
|
185
|
-
* **
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
185
|
+
* **The account must be past the unverified level to send, except on WhatsApp.**
|
|
186
|
+
* An account that has verified nothing is refused with `403` and code
|
|
187
|
+
* `kyc_required` on every channel other than `whatsapp`. Any one of these lifts
|
|
188
|
+
* it: identity verification (KYC), a saved payment method, a settled deposit, or a
|
|
189
|
+
* paid plan. Business verification (KYB) is not required to broadcast; it gates
|
|
190
|
+
* 10DLC registration only. A `whatsapp` broadcast is exempt: it can only be built
|
|
191
|
+
* on a template, and Meta vets the business and the content when it approves that
|
|
192
|
+
* template, so an unapproved template is refused instead. `smart` is not exempt,
|
|
193
|
+
* since it can route a contact to SMS or email. Drafts can be created, edited and
|
|
194
|
+
* kept without any check. Every send path (dashboard, API and CLI) enforces the
|
|
195
|
+
* same rule.
|
|
196
|
+
*
|
|
197
|
+
* **Daily ceilings apply per recipient.** Each message a broadcast sends counts
|
|
198
|
+
* against the channel's daily ceiling (see `POST /v1/messages`). Once the ceiling
|
|
199
|
+
* is reached, the remaining recipients are marked `failed` with `errorCode`
|
|
200
|
+
* `DAILY_LIMIT_EXCEEDED`; they are not retried the next day.
|
|
194
201
|
*
|
|
195
202
|
* **Review depends on the channel, and cannot be bypassed.** A draft is submitted
|
|
196
203
|
* to automated content review here; it does not go straight out. A WhatsApp
|
|
@@ -0,0 +1,647 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Calls extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Place an outbound voice call answered by the voice agent configured on the
|
|
12
|
+
* sender. Zavu dials the recipient and runs the conversation through its managed
|
|
13
|
+
* voice pipeline (speech recognition, the agent's LLM, and speech synthesis, with
|
|
14
|
+
* real-time interruption handling).
|
|
15
|
+
*
|
|
16
|
+
* **Requirements:**
|
|
17
|
+
*
|
|
18
|
+
* - The Voice Agents feature must be enabled for your team (otherwise `403`).
|
|
19
|
+
* - An account that has verified nothing may only call the phone numbers the
|
|
20
|
+
* project has verified (`403` with code `destination_not_verified`, and
|
|
21
|
+
* `details.verifiedNumbers` lists them), and at most 5 calls a day (`429` with
|
|
22
|
+
* code `daily_limit_exceeded`). A number is verified from the dashboard's
|
|
23
|
+
* Sandbox screen by sending the pre-filled WhatsApp message from that phone; the
|
|
24
|
+
* same verification covers SMS and calls. Verify your identity, add a payment
|
|
25
|
+
* method, settle a deposit or subscribe to call any destination. That raises the
|
|
26
|
+
* ceiling to 50 calls a day on Free; paid plans have no daily call ceiling. Full
|
|
27
|
+
* reference: https://docs.zavu.dev/concepts/sending-limits
|
|
28
|
+
* - The sender's agent must have `voice.enabled` set to `true`.
|
|
29
|
+
* - Not available with test-mode API keys.
|
|
30
|
+
*
|
|
31
|
+
* **Billing:** Voice calls are billed per minute of connected time plus telephony,
|
|
32
|
+
* deducted from your prepaid balance. A short-duration estimate is reserved when
|
|
33
|
+
* the call is placed; you are charged for the actual duration when the call ends.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const call = await client.calls.create({
|
|
38
|
+
* to: '+56912345678',
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
create(body: CallCreateParams, options?: RequestOptions): APIPromise<CallCreateResponse> {
|
|
43
|
+
return this._client.post('/v1/calls', { body, ...options });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve a single voice call, including its full transcript once the
|
|
48
|
+
* conversation has produced turns.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const call = await client.calls.retrieve('callId');
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
retrieve(callID: string, options?: RequestOptions): APIPromise<CallRetrieveResponse> {
|
|
56
|
+
return this._client.get(path`/v1/calls/${callID}`, options);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* List voice calls for this project, most recent first. Transcripts are omitted
|
|
61
|
+
* from the list; fetch a single call to get its transcript.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* // Automatically fetches more pages as needed.
|
|
66
|
+
* for await (const callListResponse of client.calls.list()) {
|
|
67
|
+
* // ...
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
list(
|
|
72
|
+
query: CallListParams | null | undefined = {},
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): PagePromise<CallListResponsesCursor, CallListResponse> {
|
|
75
|
+
return this._client.getAPIList('/v1/calls', Cursor<CallListResponse>, { query, ...options });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* End an active voice call. The call must still be ringing or in progress. Not
|
|
80
|
+
* available with test-mode API keys.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const response = await client.calls.hangup('callId');
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
hangup(callID: string, options?: RequestOptions): APIPromise<CallHangupResponse> {
|
|
88
|
+
return this._client.post(path`/v1/calls/${callID}/hangup`, options);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type CallListResponsesCursor = Cursor<CallListResponse>;
|
|
93
|
+
|
|
94
|
+
export interface CallCreateResponse {
|
|
95
|
+
call: CallCreateResponse.Call;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export namespace CallCreateResponse {
|
|
99
|
+
export interface Call {
|
|
100
|
+
id: string;
|
|
101
|
+
|
|
102
|
+
createdAt: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Whether the call was placed by Zavu (outbound) or received from a caller
|
|
106
|
+
* (inbound).
|
|
107
|
+
*/
|
|
108
|
+
direction: 'inbound' | 'outbound';
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Caller phone number in E.164 format. Your sender's number for outbound calls;
|
|
112
|
+
* the caller's number for inbound calls.
|
|
113
|
+
*/
|
|
114
|
+
from: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Lifecycle status of a voice call.
|
|
118
|
+
*
|
|
119
|
+
* - `queued`: outbound call created, not yet dialing.
|
|
120
|
+
* - `ringing`: dialing (outbound) or received and ringing (inbound).
|
|
121
|
+
* - `in_progress`: answered, the agent is connected.
|
|
122
|
+
* - `completed`: ended after a conversation.
|
|
123
|
+
* - `failed`: could not be completed.
|
|
124
|
+
* - `busy`: the line was busy.
|
|
125
|
+
* - `no_answer`: rang but was not answered.
|
|
126
|
+
* - `canceled`: canceled before it was answered.
|
|
127
|
+
*/
|
|
128
|
+
status: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Callee phone number in E.164 format.
|
|
132
|
+
*/
|
|
133
|
+
to: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* When the call was answered.
|
|
137
|
+
*/
|
|
138
|
+
answeredAt?: string | null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Total cost of the call in USD, combining the managed voice pipeline per-minute
|
|
142
|
+
* charge and telephony. Available once the call has ended.
|
|
143
|
+
*/
|
|
144
|
+
cost?: number | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Billable talk time in seconds, measured from answer to hangup.
|
|
148
|
+
*/
|
|
149
|
+
durationSeconds?: number | null;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* When the call ended.
|
|
153
|
+
*/
|
|
154
|
+
endedAt?: string | null;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
|
|
158
|
+
* Present once the call is no longer active.
|
|
159
|
+
*/
|
|
160
|
+
endReason?: string | null;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Arbitrary metadata you attached when creating the call.
|
|
164
|
+
*/
|
|
165
|
+
metadata?: { [key: string]: string };
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Ordered transcript of the call. Included when retrieving a single call; omitted
|
|
169
|
+
* from list responses.
|
|
170
|
+
*/
|
|
171
|
+
transcript?: Array<Call.Transcript>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Number of conversation turns exchanged during the call.
|
|
175
|
+
*/
|
|
176
|
+
turnCount?: number | null;
|
|
177
|
+
|
|
178
|
+
updatedAt?: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export namespace Call {
|
|
182
|
+
/**
|
|
183
|
+
* A single turn in a voice call transcript.
|
|
184
|
+
*/
|
|
185
|
+
export interface Transcript {
|
|
186
|
+
/**
|
|
187
|
+
* Who produced the turn. `tool` records a tool call the agent made during the
|
|
188
|
+
* conversation.
|
|
189
|
+
*/
|
|
190
|
+
role: 'user' | 'assistant' | 'tool';
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Ordinal position of the turn within the call, starting at 0.
|
|
194
|
+
*/
|
|
195
|
+
seq: number;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
|
|
199
|
+
* tool call for `tool` turns.
|
|
200
|
+
*/
|
|
201
|
+
text: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* When the turn ended.
|
|
205
|
+
*/
|
|
206
|
+
endedAt?: string | null;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* When the turn started.
|
|
210
|
+
*/
|
|
211
|
+
startedAt?: string | null;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface CallRetrieveResponse {
|
|
217
|
+
call: CallRetrieveResponse.Call;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export namespace CallRetrieveResponse {
|
|
221
|
+
export interface Call {
|
|
222
|
+
id: string;
|
|
223
|
+
|
|
224
|
+
createdAt: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Whether the call was placed by Zavu (outbound) or received from a caller
|
|
228
|
+
* (inbound).
|
|
229
|
+
*/
|
|
230
|
+
direction: 'inbound' | 'outbound';
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Caller phone number in E.164 format. Your sender's number for outbound calls;
|
|
234
|
+
* the caller's number for inbound calls.
|
|
235
|
+
*/
|
|
236
|
+
from: string;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Lifecycle status of a voice call.
|
|
240
|
+
*
|
|
241
|
+
* - `queued`: outbound call created, not yet dialing.
|
|
242
|
+
* - `ringing`: dialing (outbound) or received and ringing (inbound).
|
|
243
|
+
* - `in_progress`: answered, the agent is connected.
|
|
244
|
+
* - `completed`: ended after a conversation.
|
|
245
|
+
* - `failed`: could not be completed.
|
|
246
|
+
* - `busy`: the line was busy.
|
|
247
|
+
* - `no_answer`: rang but was not answered.
|
|
248
|
+
* - `canceled`: canceled before it was answered.
|
|
249
|
+
*/
|
|
250
|
+
status: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Callee phone number in E.164 format.
|
|
254
|
+
*/
|
|
255
|
+
to: string;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* When the call was answered.
|
|
259
|
+
*/
|
|
260
|
+
answeredAt?: string | null;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Total cost of the call in USD, combining the managed voice pipeline per-minute
|
|
264
|
+
* charge and telephony. Available once the call has ended.
|
|
265
|
+
*/
|
|
266
|
+
cost?: number | null;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Billable talk time in seconds, measured from answer to hangup.
|
|
270
|
+
*/
|
|
271
|
+
durationSeconds?: number | null;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* When the call ended.
|
|
275
|
+
*/
|
|
276
|
+
endedAt?: string | null;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
|
|
280
|
+
* Present once the call is no longer active.
|
|
281
|
+
*/
|
|
282
|
+
endReason?: string | null;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Arbitrary metadata you attached when creating the call.
|
|
286
|
+
*/
|
|
287
|
+
metadata?: { [key: string]: string };
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Ordered transcript of the call. Included when retrieving a single call; omitted
|
|
291
|
+
* from list responses.
|
|
292
|
+
*/
|
|
293
|
+
transcript?: Array<Call.Transcript>;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Number of conversation turns exchanged during the call.
|
|
297
|
+
*/
|
|
298
|
+
turnCount?: number | null;
|
|
299
|
+
|
|
300
|
+
updatedAt?: string;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export namespace Call {
|
|
304
|
+
/**
|
|
305
|
+
* A single turn in a voice call transcript.
|
|
306
|
+
*/
|
|
307
|
+
export interface Transcript {
|
|
308
|
+
/**
|
|
309
|
+
* Who produced the turn. `tool` records a tool call the agent made during the
|
|
310
|
+
* conversation.
|
|
311
|
+
*/
|
|
312
|
+
role: 'user' | 'assistant' | 'tool';
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Ordinal position of the turn within the call, starting at 0.
|
|
316
|
+
*/
|
|
317
|
+
seq: number;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
|
|
321
|
+
* tool call for `tool` turns.
|
|
322
|
+
*/
|
|
323
|
+
text: string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* When the turn ended.
|
|
327
|
+
*/
|
|
328
|
+
endedAt?: string | null;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* When the turn started.
|
|
332
|
+
*/
|
|
333
|
+
startedAt?: string | null;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface CallListResponse {
|
|
339
|
+
id: string;
|
|
340
|
+
|
|
341
|
+
createdAt: string;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Whether the call was placed by Zavu (outbound) or received from a caller
|
|
345
|
+
* (inbound).
|
|
346
|
+
*/
|
|
347
|
+
direction: 'inbound' | 'outbound';
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Caller phone number in E.164 format. Your sender's number for outbound calls;
|
|
351
|
+
* the caller's number for inbound calls.
|
|
352
|
+
*/
|
|
353
|
+
from: string;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Lifecycle status of a voice call.
|
|
357
|
+
*
|
|
358
|
+
* - `queued`: outbound call created, not yet dialing.
|
|
359
|
+
* - `ringing`: dialing (outbound) or received and ringing (inbound).
|
|
360
|
+
* - `in_progress`: answered, the agent is connected.
|
|
361
|
+
* - `completed`: ended after a conversation.
|
|
362
|
+
* - `failed`: could not be completed.
|
|
363
|
+
* - `busy`: the line was busy.
|
|
364
|
+
* - `no_answer`: rang but was not answered.
|
|
365
|
+
* - `canceled`: canceled before it was answered.
|
|
366
|
+
*/
|
|
367
|
+
status: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Callee phone number in E.164 format.
|
|
371
|
+
*/
|
|
372
|
+
to: string;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* When the call was answered.
|
|
376
|
+
*/
|
|
377
|
+
answeredAt?: string | null;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Total cost of the call in USD, combining the managed voice pipeline per-minute
|
|
381
|
+
* charge and telephony. Available once the call has ended.
|
|
382
|
+
*/
|
|
383
|
+
cost?: number | null;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Billable talk time in seconds, measured from answer to hangup.
|
|
387
|
+
*/
|
|
388
|
+
durationSeconds?: number | null;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* When the call ended.
|
|
392
|
+
*/
|
|
393
|
+
endedAt?: string | null;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
|
|
397
|
+
* Present once the call is no longer active.
|
|
398
|
+
*/
|
|
399
|
+
endReason?: string | null;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Arbitrary metadata you attached when creating the call.
|
|
403
|
+
*/
|
|
404
|
+
metadata?: { [key: string]: string };
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Ordered transcript of the call. Included when retrieving a single call; omitted
|
|
408
|
+
* from list responses.
|
|
409
|
+
*/
|
|
410
|
+
transcript?: Array<CallListResponse.Transcript>;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Number of conversation turns exchanged during the call.
|
|
414
|
+
*/
|
|
415
|
+
turnCount?: number | null;
|
|
416
|
+
|
|
417
|
+
updatedAt?: string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export namespace CallListResponse {
|
|
421
|
+
/**
|
|
422
|
+
* A single turn in a voice call transcript.
|
|
423
|
+
*/
|
|
424
|
+
export interface Transcript {
|
|
425
|
+
/**
|
|
426
|
+
* Who produced the turn. `tool` records a tool call the agent made during the
|
|
427
|
+
* conversation.
|
|
428
|
+
*/
|
|
429
|
+
role: 'user' | 'assistant' | 'tool';
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Ordinal position of the turn within the call, starting at 0.
|
|
433
|
+
*/
|
|
434
|
+
seq: number;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
|
|
438
|
+
* tool call for `tool` turns.
|
|
439
|
+
*/
|
|
440
|
+
text: string;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* When the turn ended.
|
|
444
|
+
*/
|
|
445
|
+
endedAt?: string | null;
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* When the turn started.
|
|
449
|
+
*/
|
|
450
|
+
startedAt?: string | null;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export interface CallHangupResponse {
|
|
455
|
+
call: CallHangupResponse.Call;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export namespace CallHangupResponse {
|
|
459
|
+
export interface Call {
|
|
460
|
+
id: string;
|
|
461
|
+
|
|
462
|
+
createdAt: string;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Whether the call was placed by Zavu (outbound) or received from a caller
|
|
466
|
+
* (inbound).
|
|
467
|
+
*/
|
|
468
|
+
direction: 'inbound' | 'outbound';
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Caller phone number in E.164 format. Your sender's number for outbound calls;
|
|
472
|
+
* the caller's number for inbound calls.
|
|
473
|
+
*/
|
|
474
|
+
from: string;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Lifecycle status of a voice call.
|
|
478
|
+
*
|
|
479
|
+
* - `queued`: outbound call created, not yet dialing.
|
|
480
|
+
* - `ringing`: dialing (outbound) or received and ringing (inbound).
|
|
481
|
+
* - `in_progress`: answered, the agent is connected.
|
|
482
|
+
* - `completed`: ended after a conversation.
|
|
483
|
+
* - `failed`: could not be completed.
|
|
484
|
+
* - `busy`: the line was busy.
|
|
485
|
+
* - `no_answer`: rang but was not answered.
|
|
486
|
+
* - `canceled`: canceled before it was answered.
|
|
487
|
+
*/
|
|
488
|
+
status: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Callee phone number in E.164 format.
|
|
492
|
+
*/
|
|
493
|
+
to: string;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* When the call was answered.
|
|
497
|
+
*/
|
|
498
|
+
answeredAt?: string | null;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Total cost of the call in USD, combining the managed voice pipeline per-minute
|
|
502
|
+
* charge and telephony. Available once the call has ended.
|
|
503
|
+
*/
|
|
504
|
+
cost?: number | null;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Billable talk time in seconds, measured from answer to hangup.
|
|
508
|
+
*/
|
|
509
|
+
durationSeconds?: number | null;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* When the call ended.
|
|
513
|
+
*/
|
|
514
|
+
endedAt?: string | null;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
|
|
518
|
+
* Present once the call is no longer active.
|
|
519
|
+
*/
|
|
520
|
+
endReason?: string | null;
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Arbitrary metadata you attached when creating the call.
|
|
524
|
+
*/
|
|
525
|
+
metadata?: { [key: string]: string };
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Ordered transcript of the call. Included when retrieving a single call; omitted
|
|
529
|
+
* from list responses.
|
|
530
|
+
*/
|
|
531
|
+
transcript?: Array<Call.Transcript>;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Number of conversation turns exchanged during the call.
|
|
535
|
+
*/
|
|
536
|
+
turnCount?: number | null;
|
|
537
|
+
|
|
538
|
+
updatedAt?: string;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export namespace Call {
|
|
542
|
+
/**
|
|
543
|
+
* A single turn in a voice call transcript.
|
|
544
|
+
*/
|
|
545
|
+
export interface Transcript {
|
|
546
|
+
/**
|
|
547
|
+
* Who produced the turn. `tool` records a tool call the agent made during the
|
|
548
|
+
* conversation.
|
|
549
|
+
*/
|
|
550
|
+
role: 'user' | 'assistant' | 'tool';
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Ordinal position of the turn within the call, starting at 0.
|
|
554
|
+
*/
|
|
555
|
+
seq: number;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
|
|
559
|
+
* tool call for `tool` turns.
|
|
560
|
+
*/
|
|
561
|
+
text: string;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* When the turn ended.
|
|
565
|
+
*/
|
|
566
|
+
endedAt?: string | null;
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* When the turn started.
|
|
570
|
+
*/
|
|
571
|
+
startedAt?: string | null;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export interface CallCreateParams {
|
|
577
|
+
/**
|
|
578
|
+
* Recipient phone number in E.164 format.
|
|
579
|
+
*/
|
|
580
|
+
to: string;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Overrides the agent's configured greeting for this call only.
|
|
584
|
+
*/
|
|
585
|
+
greeting?: string;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`,
|
|
589
|
+
* `es-ES`, `pt-BR`), or `auto` to detect the caller's language and follow it.
|
|
590
|
+
* Overrides the agent's configured language for speech recognition, the agent's
|
|
591
|
+
* replies, and the synthesized voice. If the agent uses a custom voice you
|
|
592
|
+
* supplied, that voice is kept and only the language changes. When omitted, the
|
|
593
|
+
* agent's configured language is used.
|
|
594
|
+
*/
|
|
595
|
+
language?: string;
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Overrides the agent's maximum call duration for this call only.
|
|
599
|
+
*/
|
|
600
|
+
maxDurationMinutes?: number;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Arbitrary metadata to associate with the call. Returned on the call object and
|
|
604
|
+
* included in voice webhooks.
|
|
605
|
+
*/
|
|
606
|
+
metadata?: { [key: string]: string };
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Sender profile that places the call. Uses the project's default sender if
|
|
610
|
+
* omitted. The sender's agent must have voice enabled.
|
|
611
|
+
*/
|
|
612
|
+
senderId?: string;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export interface CallListParams extends CursorParams {
|
|
616
|
+
/**
|
|
617
|
+
* Whether the call was placed by Zavu (outbound) or received from a caller
|
|
618
|
+
* (inbound).
|
|
619
|
+
*/
|
|
620
|
+
direction?: 'inbound' | 'outbound';
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Lifecycle status of a voice call.
|
|
624
|
+
*
|
|
625
|
+
* - `queued`: outbound call created, not yet dialing.
|
|
626
|
+
* - `ringing`: dialing (outbound) or received and ringing (inbound).
|
|
627
|
+
* - `in_progress`: answered, the agent is connected.
|
|
628
|
+
* - `completed`: ended after a conversation.
|
|
629
|
+
* - `failed`: could not be completed.
|
|
630
|
+
* - `busy`: the line was busy.
|
|
631
|
+
* - `no_answer`: rang but was not answered.
|
|
632
|
+
* - `canceled`: canceled before it was answered.
|
|
633
|
+
*/
|
|
634
|
+
status?: 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export declare namespace Calls {
|
|
638
|
+
export {
|
|
639
|
+
type CallCreateResponse as CallCreateResponse,
|
|
640
|
+
type CallRetrieveResponse as CallRetrieveResponse,
|
|
641
|
+
type CallListResponse as CallListResponse,
|
|
642
|
+
type CallHangupResponse as CallHangupResponse,
|
|
643
|
+
type CallListResponsesCursor as CallListResponsesCursor,
|
|
644
|
+
type CallCreateParams as CallCreateParams,
|
|
645
|
+
type CallListParams as CallListParams,
|
|
646
|
+
};
|
|
647
|
+
}
|