WaConnect|API Documentation Dashboard Swagger UI

Template Messages

Send pre-approved authentication templates for OTP (One-Time Password) delivery. Templates must be created and approved in your WhatsApp Manager before use.

Authentication Templates

POST /api/messages/auth-template

Send OTP codes using Meta's authentication template format. Two button types are supported:

Button TypeDescriptionPlatform
copy_codeDisplays a "Copy Code" button the user can tap to copy the OTPAll platforms
one_tapAuto-fills the OTP in your Android app (requires package name and signature hash)Android only

Request Body

FieldTypeRequiredDescription
tostringYesRecipient phone number with country code
templateNamestringYesName of the approved authentication template
languageCodestringYesTemplate language code (e.g., "en_US")
otpstringYesThe one-time password to send
buttonTypestringYes"copy_code" or "one_tap"
packageNamestringone_tap onlyAndroid app package name
signatureHashstringone_tap onlyAndroid app signature hash
phoneNumberIdstringNoSend from a specific number

Copy Code Example

{
  "to": "15551234567",
  "templateName": "auth_otp_template",
  "languageCode": "en_US",
  "otp": "847294",
  "buttonType": "copy_code"
}JSON

One-Tap Example (Android)

{
  "to": "15551234567",
  "templateName": "auth_otp_template",
  "languageCode": "en_US",
  "otp": "847294",
  "buttonType": "one_tap",
  "packageName": "com.yourcompany.app",
  "signatureHash": "a1b2c3d4e5f6g7h8i9j0"
}JSON

C# Example

var payload = new
{
    to = "15551234567",
    templateName = "auth_otp_template",
    languageCode = "en_US",
    otp = "847294",
    buttonType = "copy_code"
};

var json = JsonSerializer.Serialize(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await client.PostAsync(
    "https://app.waconnect.me/api/messages/auth-template", content);C#

Templates must be pre-approved. Create and submit authentication templates for approval in WhatsApp Manager > Message Templates before using this endpoint.