LetsBot Menu
Get Started English Language

Meta Business Partner UK Registered Company

Language

Templates (Official API) · API endpoint

POST /api/v1/template/send New

Send Template Message (Full Featured)

Send any WhatsApp template message with full component support.

Send any WhatsApp template message with full component support.

Supports:

  • Header: text, image, document, video, location
  • Body: text parameters (variables)
  • Buttons: URL buttons, Quick Reply buttons

Example for added_to_course template:

  • Header with confirmation title
  • Body with customer name and course name
  • URL buttons for iOS and Android app download

JSON body

{
  "phone": "{{phone}}",
  "template_name": "added_to_course",
  "template_language": "ar",
  "components": {
    "header": {
      "type": "text",
      "parameters": [
        {"type": "text", "text": "تأكيد التسجيل"}
      ]
    },
    "body": [
      "أحمد",
      "دورة البرمجة المتقدمة"
    ],
    "buttons": [
      {
        "index": 0,
        "sub_type": "url",
        "parameters": [{"type": "text", "text": "app/course/123"}]
      },
      {
        "index": 1,
        "sub_type": "url",
        "parameters": [{"type": "text", "text": "store/app/456"}]
      }
    ]
  }
}

Example request

curl -X POST "https://letsbot.net/api/v1/template/send" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "9665xxxxxxxx",
  "template_name": "added_to_course",
  "template_language": "ar",
  "components": {
    "header": {
      "type": "text",
      "parameters": [
        {"type": "text", "text": "تأكيد التسجيل"}
      ]
    },
    "body": [
      "أحمد",
      "دورة البرمجة المتقدمة"
    ],
    "buttons": [
      {
        "index": 0,
        "sub_type": "url",
        "parameters": [{"type": "text", "text": "app/course/123"}]
      },
      {
        "index": 1,
        "sub_type": "url",
        "parameters": [{"type": "text", "text": "store/app/456"}]
      }
    ]
  }
}'
const response = await fetch("https://letsbot.net/api/v1/template/send", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_LB_API_KEY",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "phone": "9665xxxxxxxx",
    "template_name": "added_to_course",
    "template_language": "ar",
    "components": {
      "header": {
        "type": "text",
        "parameters": [
          {
            "type": "text",
            "text": "تأكيد التسجيل"
          }
        ]
      },
      "body": [
        "أحمد",
        "دورة البرمجة المتقدمة"
      ],
      "buttons": [
        {
          "index": 0,
          "sub_type": "url",
          "parameters": [
            {
              "type": "text",
              "text": "app/course/123"
            }
          ]
        },
        {
          "index": 1,
          "sub_type": "url",
          "parameters": [
            {
              "type": "text",
              "text": "store/app/456"
            }
          ]
        }
      ]
    }
  }),
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init('https://letsbot.net/api/v1/template/send');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_LB_API_KEY',
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
    {
        "phone": "9665xxxxxxxx",
        "template_name": "added_to_course",
        "template_language": "ar",
        "components": {
            "header": {
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "تأكيد التسجيل"
                    }
                ]
            },
            "body": [
                "أحمد",
                "دورة البرمجة المتقدمة"
            ],
            "buttons": [
                {
                    "index": 0,
                    "sub_type": "url",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "app/course/123"
                        }
                    ]
                },
                {
                    "index": 1,
                    "sub_type": "url",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "store/app/456"
                        }
                    ]
                }
            ]
        }
    }
    JSON,
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($data);
import requests

response = requests.request(
    "POST",
    "https://letsbot.net/api/v1/template/send",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "phone": "9665xxxxxxxx",
        "template_name": "added_to_course",
        "template_language": "ar",
        "components": {
            "header": {
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "تأكيد التسجيل",
                    },
                ],
            },
            "body": [
                "أحمد",
                "دورة البرمجة المتقدمة",
            ],
            "buttons": [
                {
                    "index": 0,
                    "sub_type": "url",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "app/course/123",
                        },
                    ],
                },
                {
                    "index": 1,
                    "sub_type": "url",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "store/app/456",
                        },
                    ],
                },
            ],
        },
    },
)

print(response.json())

Responses

Success Response200
{
  "success": true,
  "message": "The message has been successfully sent.",
  "data": {
    "key": {
      "remoteJid": "966500000000@s.whatsapp.net",
      "fromMe": true,
      "id": "wamid.HBgLMTIzNDU2Nzg5MBUTQ"
    },
    "messageTimestamp": 1706900000,
    "status": "PENDING"
  }
}

Ready when you are

Try this endpoint on your own number

The API works during the free trial. Create an account, connect your WhatsApp number and copy your key from API → Authentication Data.