Skip to main content
The SDK includes helpers for Meta’s Calling API and Kapso’s call logs.

Initiate a call

await client.calls.connect({
  phoneNumberId: '123',
  to: '14085551234',
  session: { sdpType: 'offer', sdp: 'v=0...' },
  bizOpaqueCallbackData: 'tracking'
});

Pre-accept / Accept

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' }
});

Reject / Terminate

await client.calls.reject({ phoneNumberId: '123', callId: 'wacid....' });
await client.calls.terminate({ phoneNumberId: '123', callId: 'wacid....' });

Check call permission

const perm = await client.calls.permissions.get({
  phoneNumberId: '123',
  userWaId: '15551234567'
});

Call logs (Kapso)

const logs = await client.calls.list({
  phoneNumberId: '123',
  direction: 'INBOUND',
  perPage: 20
});
Calling is gradually rolling out in WhatsApp and may not be enabled for all numbers.
I