Send Voice

Make voice calls with text-to-speech for OTP delivery and transactional notifications.

Basic Voice Call

send-voice.ts
import { YourSend } from 'yoursend';

const ys = new YourSend({ apiKey: 'ys_live_...' });

await ys.send({
  channel: 'voice',
  to: '+14155551234',
  body: 'Hello, this is a notification from YourApp. Your appointment is confirmed for tomorrow at 3 PM.',
});

OTP via Voice

Voice OTP is ideal for users who cannot receive SMS. The code is spoken aloud and repeated.

otp-voice.ts
// No body/template_id → YourSend places an OTP call
const otp = await ys.send({
  channel: 'voice',
  to: '+14155551234',
});

// The user receives a call reading: "Your verification code is 1. 2. 3. 4. 5. 6."
// Verify with:
const result = await ys.check({
  message_id: otp.message_id,
  code: '123456',
});

console.log(result.verified); // true or false

Parameters

ParameterTypeRequiredDescription
channelstringYes"voice"
tostringYesPhone number in E.164 format
bodystringYes*Text-to-speech content