Calls Client API
Generated client method reference for the calls namespace.
This page documents 11 schema-registry client methods in the calls namespace.
acceptCall
Prepare media and accept this incoming call.
Signature client.acceptCall(call: { generation: string; id: string; sessionId: string }, media?: { camera?: any; microphone?: any; onMediaFailure?: "end" \| "keep-open"; speaker?: any }): Promise<{ ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.acceptCall({});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | call, media |
| Aliases | calls.acceptCall |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/acceptCall | acceptCall | Active |
| Alias | POST | /api/acceptCall | acceptCall | Active |
clearCallAudio
Discard queued outgoing audio.
Signature client.clearCallAudio(call: { generation: string; id: string; sessionId: string }): Promise<{ ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.clearCallAudio({});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | call |
| Aliases | calls.clearCallAudio |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/clearCallAudio | clearCallAudio | Active |
| Alias | POST | /api/clearCallAudio | clearCallAudio | Active |
endCall
Request hangup for this call.
Signature client.endCall(call: { generation: string; id: string; sessionId: string }): Promise<{ ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.endCall({});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | call |
| Aliases | calls.endCall |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/endCall | endCall | Active |
| Alias | POST | /api/endCall | endCall | Active |
getActiveCall
Get the current call snapshot. SDK clients hydrate its bound methods.
Signature client.getActiveCall(): Promise<{ id: string; sessionId: string; generation: string; peer: string; state: string; direction: "incoming" \| "outgoing"; video: boolean; terminal: boolean; observedAt: number \| "Infinity" \| "-Infinity" \| "NaN"; endReason?: { code: string; message: string; source: "local" \| "media" \| "license" \| "session" \| "whatsapp" } \| null; media?: { state: "attached" \| "ended"; reason?: string \| null } \| null>
Usage
const result = await client.getActiveCall();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ id: string; sessionId: string; generation: string; peer: string; state: string; direction: "incoming" | "outgoing"; video: boolean; terminal: boolean; observedAt: number | "Infinity" | "-Infinity" | "NaN"; endReason?: { code: string; message: string; source: "local" | "media" | "license" | "session" | "whatsapp" } | null; media?: { state: "attached" | "ended"; reason?: string | null } | null> |
Resolves to { id: string; sessionId: string; generation: string; peer: string; state: string; direction: "incoming" \| "outgoing"; video: boolean; terminal: boolean; observedAt: number \| "Infinity" \| "-Infinity" \| "NaN"; endReason?: { code: string; message: string; source: "local" \| "media" \| "license" \| "session" \| "whatsapp" } \| null; media?: { state: "attached" \| "ended"; reason?: string \| null } \| null. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<Call \| null>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | - |
| Aliases | calls.getActiveCall |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/getActiveCall | getActiveCall | Active |
| Alias | POST | /api/getActiveCall | getActiveCall | Active |
getCallCapabilities
Optional calling availability for UI and diagnostics. Actions perform admission automatically.
Signature client.getCallCapabilities(): Promise<{ control: boolean; audio: boolean; video: boolean; reason?: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" } }>
Usage
const result = await client.getCallCapabilities();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ control: boolean; audio: boolean; video: boolean; reason?: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" } }> |
Resolves to { control: boolean; audio: boolean; video: boolean; reason?: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" } }. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallCapabilities>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | - |
| Aliases | calls.getCallCapabilities |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/getCallCapabilities | getCallCapabilities | Active |
| Alias | POST | /api/getCallCapabilities | getCallCapabilities | Active |
muteCall
Mute or unmute the microphone without ending reception.
Signature client.muteCall(call: { generation: string; id: string; sessionId: string }, muted: boolean): Promise<{ ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.muteCall({}, true);Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | call, muted |
| Aliases | calls.muteCall |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/muteCall | muteCall | Active |
| Alias | POST | /api/muteCall | muteCall | Active |
observeCallAudio
Attach an isolated receive-only audio sink. Its failure does not interrupt the call owner.
Signature client.observeCallAudio(call: { generation: string; id: string; sessionId: string }, speaker?: unknown): Promise<{ ok: true; status: "requested"; observerId: string } \| { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.observeCallAudio({});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; observerId: string } | { ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; observerId: string } \| { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult & { observerId?: string }>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | call, speaker |
| Aliases | calls.observeCallAudio |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/observeCallAudio | observeCallAudio | Active |
| Alias | POST | /api/observeCallAudio | observeCallAudio | Active |
rejectCall
Reject this call with native state confirmation.
Signature client.rejectCall(call: { generation: string; id: string; sessionId: string }): Promise<{ ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.rejectCall({});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | call |
| Aliases | calls.rejectCall |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/rejectCall | rejectCall | Active |
| Alias | POST | /api/rejectCall | rejectCall | Active |
setCallMedia
Prepare a replacement before releasing the working media.
Signature client.setCallMedia(call: { generation: string; id: string; sessionId: string }, media?: { camera?: any; microphone?: any; onMediaFailure?: "end" \| "keep-open"; speaker?: any }): Promise<{ ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.setCallMedia({});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | call, media |
| Aliases | calls.setCallMedia |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/setCallMedia | setCallMedia | Active |
| Alias | POST | /api/setCallMedia | setCallMedia | Active |
startCall
Prepare media and place an outgoing audio or video call.
Signature client.startCall(to: string, microphone?: unknown, speaker?: unknown, camera?: unknown): Promise<{ ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.startCall("to");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | to, microphone, speaker, camera |
| Aliases | calls.startCall |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/startCall | startCall | Active |
| Alias | POST | /api/startCall | startCall | Active |
stopCallAudioObserver
Stop an audio observer and finalize its sink.
Signature client.stopCallAudioObserver(call: { generation: string; id: string; sessionId: string }, observerId: string): Promise<{ ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string>
Usage
const result = await client.stopCallAudioObserver({}, "observerId");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string> |
Resolves to { ok: true; status: "requested"; callId?: string \| null } \| { ok: false; status: "unavailable" \| "failed" \| "unknown"; reason: { code: string; message: string; status: number \| "Infinity" \| "-Infinity" \| "NaN" }; callId?: string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<CallActionResult>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | calls |
| Action | update |
| Functionality | both |
| Positional parameter order | call, observerId |
| Aliases | calls.stopCallAudioObserver |
| Deprecated aliases | - |
| License | restricted |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | POST | /api/calls/stopCallAudioObserver | stopCallAudioObserver | Active |
| Alias | POST | /api/stopCallAudioObserver | stopCallAudioObserver | Active |
Was this helpful?
Your answer includes the page path and docs version.
