Skip to content

CallsResource

Defined in: src/resources/calls.ts:35

WhatsApp Business Calling API exposed as client.calls.

new CallsResource(request, getDefaultPhoneNumberId): CallsResource

Defined in: src/resources/calls.ts:39

RequestFn

PhoneNumberIdAccessor

CallsResource

accept(callId, sdp, phoneNumberId?): Promise<SuccessResponse>

Defined in: src/resources/calls.ts:119

Accepts an inbound call with an SDP answer. The SDP is passed through unchanged.

string

CallSdp

string

Promise<SuccessResponse>


getSettings(phoneNumberId?, fields?): Promise<PhoneNumberSettings>

Defined in: src/resources/calls.ts:49

Reads a phone number’s settings, including the calling block. Pass fields to request specific Graph fields; when omitted no field selection is sent.

string

string[]

Promise<PhoneNumberSettings>


initiate(options, phoneNumberId?): Promise<CallResponse>

Defined in: src/resources/calls.ts:79

Initiates (connects) an outbound call to a WhatsApp user. Validates a non-empty to before sending. When an SDP offer is supplied it is wrapped into the request session as opaque strings.

InitiateCallOptions

string

Promise<CallResponse>


preAccept(callId, sdp, phoneNumberId?): Promise<SuccessResponse>

Defined in: src/resources/calls.ts:100

Pre-accepts an inbound call with an SDP answer, letting media connect before the user fully accepts. The SDP is passed through unchanged.

string

CallSdp

string

Promise<SuccessResponse>


reject(callId, phoneNumberId?): Promise<SuccessResponse>

Defined in: src/resources/calls.ts:135

Rejects an inbound call.

string

string

Promise<SuccessResponse>


terminate(callId, phoneNumberId?): Promise<SuccessResponse>

Defined in: src/resources/calls.ts:150

Terminates an active call.

string

string

Promise<SuccessResponse>


updateSettings(settings, phoneNumberId?): Promise<SuccessResponse>

Defined in: src/resources/calls.ts:62

Updates a phone number’s calling settings. Only provided fields are sent, mapped from camelCase to the snake_case API shape; callHours and sip are passed through unchanged.

UpdateCallSettingsPayload

string

Promise<SuccessResponse>

Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.