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