convoup Docs
Docs / API Reference / Methods Reference

Methods Reference

Complete reference for all Convoup SDK methods.

client.sendOtp(args)

Send an OTP (one-time password) message.

ArgTypeRequiredDescription
tostringYesRecipient phone in international format (e.g. +918851479441)
templatestringYesName of the approved template
codestring | numberYesOTP code to send
languagestringNoLanguage code (default: en_US)
extraParams(string | number)[]NoAdditional body params after the code

Example

TypeScript
await client.sendOtp({
  to: '+918851479441',
  template: 'test_welcome_template',
  code: '123456',
  extraParams: ['Acme Corp'],
});

client.sendInvoice(args)

Send an invoice or billing notification with optional media attachment.

ArgTypeRequiredDescription
tostringYesRecipient phone
templatestringYesName of the approved template
params(string | number)[]NoBody placeholder values
pdfUrlstringNoPDF URL for document header (shorthand for headerMedia)
headerMediaHeaderMediaNoFull media control (overrides pdfUrl)
languagestringNoLanguage code (default: en_US)

Example

TypeScript
await client.sendInvoice({
  to: '+918851479441',
  template: 'test_welcome_template',
  params: ['INV-2024-001', 'Rs. 2,500'],
  pdfUrl: 'https://files.example.com/invoices/INV-2024-001.pdf',
});

client.sendReminder(args)

Send an appointment reminder or follow-up.

ArgTypeRequiredDescription
tostringYesRecipient phone
templatestringYesName of the approved template
params(string | number)[]NoBody placeholder values
languagestringNoLanguage code (default: en_US)

Example

TypeScript
await client.sendReminder({
  to: '+918851479441',
  template: 'test_welcome_template',
  params: ['Rahul', 'Jul 20, 3:00 PM'],
  language: 'hi_IN',
});

client.sendTemplate(args)

Full-control template send with header, body, and button parameters.

ArgTypeRequiredDescription
tostringYesRecipient phone
templatestringYesName of the approved template
languagestringNoLanguage code (default: en_US)
bodyParams(string | number)[]NoBody placeholder values
headerParams(string | number)[]NoText header placeholder values
headerMediaHeaderMediaNoMedia attachment
buttonParamsButtonParam[]NoDynamic button values

Example

TypeScript
await client.sendTemplate({
  to: '+918851479441',
  template: 'test_welcome_template',
  language: 'en_US',
  headerParams: ['Acme Store'],
  bodyParams: ['ORD-99', 'shipped'],
  buttonParams: [
    { subType: 'url', index: 0, text: 'TRACK123' },
  ],
});

Types

HeaderMedia

TypeScript
{
  type: 'image' | 'video' | 'document';
  link: string;
}

ButtonParam

TypeScript
{
  subType?: 'url' | 'quick_reply';
  index?: number;
  text: string;
}

ConvoupResponse

TypeScript
{
  messageId: string;
  waId: string;
}

Next Steps