CallsResource
Defined in: src/resources/calls.ts:35
WhatsApp Business Calling API exposed as client.calls.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CallsResource(
request,getDefaultPhoneNumberId):CallsResource
Defined in: src/resources/calls.ts:39
Parameters
Section titled “Parameters”request
Section titled “request”RequestFn
getDefaultPhoneNumberId
Section titled “getDefaultPhoneNumberId”PhoneNumberIdAccessor
Returns
Section titled “Returns”CallsResource
Methods
Section titled “Methods”accept()
Section titled “accept()”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.
Parameters
Section titled “Parameters”callId
Section titled “callId”string
phoneNumberId?
Section titled “phoneNumberId?”string
Returns
Section titled “Returns”Promise<SuccessResponse>
getSettings()
Section titled “getSettings()”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.
Parameters
Section titled “Parameters”phoneNumberId?
Section titled “phoneNumberId?”string
fields?
Section titled “fields?”string[]
Returns
Section titled “Returns”Promise<PhoneNumberSettings>
initiate()
Section titled “initiate()”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.
Parameters
Section titled “Parameters”options
Section titled “options”phoneNumberId?
Section titled “phoneNumberId?”string
Returns
Section titled “Returns”Promise<CallResponse>
preAccept()
Section titled “preAccept()”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.
Parameters
Section titled “Parameters”callId
Section titled “callId”string
phoneNumberId?
Section titled “phoneNumberId?”string
Returns
Section titled “Returns”Promise<SuccessResponse>
reject()
Section titled “reject()”reject(
callId,phoneNumberId?):Promise<SuccessResponse>
Defined in: src/resources/calls.ts:135
Rejects an inbound call.
Parameters
Section titled “Parameters”callId
Section titled “callId”string
phoneNumberId?
Section titled “phoneNumberId?”string
Returns
Section titled “Returns”Promise<SuccessResponse>
terminate()
Section titled “terminate()”terminate(
callId,phoneNumberId?):Promise<SuccessResponse>
Defined in: src/resources/calls.ts:150
Terminates an active call.
Parameters
Section titled “Parameters”callId
Section titled “callId”string
phoneNumberId?
Section titled “phoneNumberId?”string
Returns
Section titled “Returns”Promise<SuccessResponse>
updateSettings()
Section titled “updateSettings()”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.
Parameters
Section titled “Parameters”settings
Section titled “settings”phoneNumberId?
Section titled “phoneNumberId?”string
Returns
Section titled “Returns”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.