Initiate a call
Pre-accept / Accept
Reject / Terminate
Check call permission
Call logs (Kapso)
Calling is gradually rolling out in WhatsApp and may not be enabled for all numbers.
Initiate and manage WhatsApp voice calls with the TypeScript SDK
await client.calls.connect({
phoneNumberId: '123',
to: '14085551234',
session: { sdpType: 'offer', sdp: 'v=0...' },
bizOpaqueCallbackData: 'tracking'
});
await client.calls.preAccept({
phoneNumberId: '123',
callId: 'wacid....',
session: { sdpType: 'answer', sdp: 'v=0' }
});
await client.calls.accept({
phoneNumberId: '123',
callId: 'wacid....',
session: { sdpType: 'answer', sdp: 'v=0' }
});
await client.calls.reject({ phoneNumberId: '123', callId: 'wacid....' });
await client.calls.terminate({ phoneNumberId: '123', callId: 'wacid....' });
const perm = await client.calls.permissions.get({
phoneNumberId: '123',
userWaId: '15551234567'
});
const logs = await client.calls.list({
phoneNumberId: '123',
direction: 'INBOUND',
perPage: 20
});
Was this page helpful?