Skip to content

Messaging

Direct send

Send one message on a channel without an existing conversation: an OTP, an order update, a reminder. One endpoint per channel, plus a multi-channel fallback. Scoped keys need connect or the channel sub-scope (erix_connect_whatsapp_…). Bulk sends are Flow campaigns, not this endpoint.

POST/v1/api/infra/connect/send/whatsapp

Send one WhatsApp message.

phonestringRequired
Recipient with country code.
templateNamestringOptional
An approved template. Send this or text.
languagestringOptional
Template language, e.g. en.
variablesstring[]Optional
Template variables, in order.
textstringOptional
Free text. Needs an open 24-hour window.

POST/v1/api/infra/connect/send/email

Send one email.

tostringRequired
Recipient address.
subjectstringOptional
Required unless you send templateId.
htmlstringOptional
Email body.
templateIdstringOptional
A saved email template.
variablesobjectOptional
Template variables.

POST/v1/api/infra/connect/send/telegram

Send one Telegram message.

chatIdstringRequired
Telegram chat id.
textstringRequired
Message text.

POST/v1/api/infra/connect/send

Try channels in order until one succeeds.

tostringRequired
Recipient: phone or email.
messagestringOptional
Text. Send this or template.
templatestringOptional
Template name.
channelPreferencestring[]Optional
Order to try. Default ["whatsapp", "email"].
// WhatsApp template
await ecod.product.erix.chat.messages.sendTemplate({
  to: "+91XXXXXXXXXX",
  templateName: "order_update",
  language: "en",
  variables: ["Asha", "ORD-1001"],
});

// Email: no typed method yet, so use the raw request
await ecod.request("POST", "/infra/connect/send/email", {
  to: "customer@example.com",
  subject: "Your invoice",
  html: "<p>Thanks for your order.</p>",
});