Sri Lanka's #1 AI Chatbot Platform • API v1.0 Live

ChatMe.lk Developer Documentation

Connect any website, contact form, WordPress Elementor, or CRM directly to ChatMe.lk — Sri Lanka's #1 Bilingual AI Chatbot (Sinhala & English). Capture leads in real time, automatically deliver customized WhatsApp welcome texts with PDF brochures, and notify the business owner instantly.

Platform Overview

The ChatMe.lk WhatsApp Lead API empowers businesses to automate instant client onboarding through their connected WhatsApp devices with zero socket complexity.

Instant Visitor Welcome

Automatically sends your customized welcome text, company brochure PDF, and promotional flyers to the visitor's WhatsApp.

Real-Time Owner Alert

Sends an instant push notification alert directly to the Business Owner's personal WhatsApp phone with the lead's inquiry details.

Anti-Ban Verification

Validates whether the visitor's phone number is actively registered on WhatsApp before dispatching stanzas, keeping your number safe.

Website Chatbot Widget Embed (1-Line Quick Setup)

Add the ChatMe.lk bilingual chatbot widget to any website with a single line of script.

Paste the following <script> tag into your website template right before the closing </body> tag. Your customized AI persona, greeting message, theme colors, and quick suggestion buttons will load automatically:

HTML Snippet (Global Embed)
<!-- ChatMe.lk Chatbot --> <script src="https://cdn.jsdelivr.net/gh/color-studiox/csx-cdn-me@main/csx.ai.chatbot.embed.js" data-bot-id="csx_live_xxxxxxxxxxxxxxxx" defer> </script>
Strict Domain Whitelist & Origin Lockdown: For security against unauthorized copying, ensure your website domain is active in your Customer Dashboard. The API strictly verifies browser Origin & Referer headers and blocks any unauthorized websites.

Platform Installation Guides

WordPress

Install the WPCode or Insert Headers and Footers plugin → Add the script snippet to the Footer (Body End) section.

Shopify

Go to Online Store > Themes > Edit Code. Open theme.liquid and paste the script directly above </body>.

Wix / Webflow / Squarespace

Navigate to Settings > Custom Code / Tracking Tools → Add Custom Code → Paste in Body - End → Apply to All Pages.

HTML, PHP, React & Next.js

Add to your root index.html template or load dynamically in Next.js via <Script strategy="lazyOnload" ... />.

Security & Authentication

All incoming API requests are authenticated against your domain's unique Secret API Key.

Every customer domain registered on ChatMe.lk receives a cryptographically secure Secret API Key (format: csx_live_...). You can authenticate requests using any of the following standard methods:

Recommended Authorization Header: Pass your secret API key in the request header as Authorization: Bearer YOUR_API_KEY, or in the JSON payload body as "api_key": "YOUR_API_KEY".

Send WhatsApp Welcome Pack & Capture Lead

Submits a new visitor lead into your ChatMe.lk CRM and automatically triggers the instant WhatsApp Welcome Pack.

POST https://chatme.lk/api/send-welcome.php
application/json

Request Parameters

Parameter Type Status Description
api_key string Required* Your domain secret API key (or pass via Authorization: Bearer header).
domain string Optional* Your registered website domain (e.g. example.com). Required if API key is omitted.
phone string Required Visitor WhatsApp mobile number (e.g. 0771234567 or +94771234567).
name string Optional Visitor full name (defaults to 'Website Visitor').
email string Optional Visitor email address.
message string Optional Inquiry or requirement text submitted by the customer.
custom_message string Optional Custom text to override default welcome text for this specific submission.

Implementation Code Snippets

curl -X POST https://chatme.lk/api/send-welcome.php \ -H "Content-Type: application/json" \ -H "Authorization: Bearer csx_live_xxxxxxxxxxxxxxxx" \ -d '{ "name": "Kamal Silva", "phone": "0771234567", "email": "[email protected]", "message": "I would like to request a quotation for AI Chatbot." }'
// Submit lead & trigger WhatsApp Welcome Pack from client-side HTML form async function submitLeadToWhatsApp(formData) { try { const response = await fetch('https://chatme.lk/api/send-welcome.php', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer csx_live_xxxxxxxxxxxxxxxx' }, body: JSON.stringify({ name: formData.name, phone: formData.phone, email: formData.email, message: formData.message }) }); const result = await response.json(); if (result.success) { console.log('WhatsApp Welcome Pack sent! Lead ID:', result.lead_id); } else { console.error('Error:', result.error); } } catch (err) { console.error('Network error:', err); } }
<?php $apiKey = 'csx_live_xxxxxxxxxxxxxxxx'; $payload = [ 'name' => 'Kamal Silva', 'phone' => '0771234567', 'email' => '[email protected]', 'message' => 'Requested AI Chatbot Package details' ]; $ch = curl_init('https://chatme.lk/api/send-welcome.php'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'Authorization: Bearer ' . $apiKey ], CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_TIMEOUT => 15 ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $data = json_decode($response, true); if ($httpCode === 200 && !empty($data['success'])) { echo "WhatsApp Welcome Pack delivered! Lead ID: " . $data['lead_id']; } ?>
import requests url = "https://chatme.lk/api/send-welcome.php" headers = { "Content-Type": "application/json", "Authorization": "Bearer csx_live_xxxxxxxxxxxxxxxx" } payload = { "name": "Kamal Silva", "phone": "0771234567", "email": "[email protected]", "message": "Interested in ChatMe.lk Staff Solution" } response = requests.post(url, json=payload, headers=headers, timeout=15) print(response.json())

Successful Response (200 OK)

JSON (HTTP 200 OK)
{ "success": true, "message": "Lead captured and WhatsApp Welcome Pack processed successfully.", "lead_id": 142, "domain": "example.com", "visitor_phone": "0771234567", "welcome_pack_sent": true, "owner_alert_sent": true, "timestamp": "2026-09-17 18:30:00" }

WordPress Elementor Pro Forms Integration

Connect WordPress Elementor Pro forms directly via webhooks without installing any extra plugins.

  • 1
    Open your page in Elementor Editor and select your Contact / Lead Form widget.
  • 2
    In the left sidebar, navigate to Actions After Submit → Click + Add Action → Select Webhook.
  • 3
    Open the new Webhook tab:
    Set Webhook URL to: https://chatme.lk/api/send-welcome.php
  • 4
    In the Form Fields section, click each field and set Advanced > ID names:
    • Phone Field ID: phone (or visitor_phone)
    • Name Field ID: name
    • Email Field ID: email
    • Message Field ID: message
  • 5
    Add a Hidden Field named api_key and paste your Secret API Key in its Default Value.
  • 6
    Click Update / Publish. Your Elementor Form will now automatically trigger WhatsApp Welcome Packs instantly!

WhatsApp Anti-Ban & Delivery Protection

ChatMe.lk includes an enterprise safety layer designed to protect your linked WhatsApp device against spam flags and disconnects.

Silent Pre-Check Verification

Every phone number is verified against WhatsApp metadata servers before dispatching stanzas.

Bad Number Auto-Filter

Invalid numbers, landlines, or unlinked accounts are automatically skipped to preserve socket integrity.

Smart Multi-Device Queue

Outbound welcome packs are throttled with human-like delays adhering to WhatsApp Multi-Device safety limits.

Rate Limiting & Queue Policies

Guidelines on API request throttling and automated delivery rates.

Policy Rule Standard Limit Behavior When Exceeded
API Request Rate 60 requests / minute per API key HTTP 429 Too Many Requests (Cooldown 60s)
WhatsApp Outbound Delay 2.5s – 4.0s randomized delay Queued smoothly in background worker
Concurrent Socket Limit 1 active device session per domain Automatic reconnection with QR keep-alive
High-Volume Campaigns: For enterprise traffic or event launches requiring higher throughput, contact ChatMe.lk Support to provision dedicated node instances.

Frequently Asked Questions (FAQ)

Quick answers to common developer and integration questions regarding the ChatMe.lk Chatbot & WhatsApp API platform in Sri Lanka.

How do I embed the ChatMe.lk chatbot on my website?

Simply copy the 1-line <script> tag provided in the Widget Embed section and paste it right before the closing </body> tag of your website template. The widget loads asynchronously without affecting your site's load speed.

Does ChatMe.lk natively understand Sinhala, Singlish, and English?

Yes. ChatMe.lk is powered by specialized bilingual NLP models designed for Sri Lankan businesses. It effortlessly handles pure Sinhala (සිංහල), Singlish (e.g. "Mata details one"), and English with automatic language detection.

How does the automated WhatsApp Welcome Pack feature work?

As soon as a website visitor submits their phone number in the chat widget or a contact form, the ChatMe.lk server triggers your connected WhatsApp device to send an instant welcome message accompanied by your uploaded company PDF profile or promo brochure.

How do I connect WordPress Elementor Pro forms without extra plugins?

In the Elementor editor, open your Form widget settings, add a Webhook action in Actions After Submit, set the Webhook URL to https://chatme.lk/api/send-welcome.php, and add a hidden field for your API key as shown in our Elementor Guide.

What are the API rate limits and safety protections?

Standard rate limits allow up to 60 API requests per minute. Outbound WhatsApp messages are safely throttled with 2.5s – 4.0s intervals through a background queue to ensure compliance with WhatsApp Anti-Ban protocols.