Skip to main content
POST
/
inbox
/
whatsapp
Send WhatsApp Message
curl --request POST \
  --url https://api.lemlist.com/api/inbox/whatsapp \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sendUserId": "usr_FU6yAd3UdBFel0UDy",
  "sendUserWhatsappAccountId": "wha_ABC123",
  "contactId": "ctc_ei6zVayP9B2ugwUPN",
  "leadId": "lea_wadZOcDDSFWSbFaCf",
  "message": "Hi, following up on our conversation"
}
'
import requests

url = "https://api.lemlist.com/api/inbox/whatsapp"

payload = {
    "sendUserId": "usr_FU6yAd3UdBFel0UDy",
    "sendUserWhatsappAccountId": "wha_ABC123",
    "contactId": "ctc_ei6zVayP9B2ugwUPN",
    "leadId": "lea_wadZOcDDSFWSbFaCf",
    "message": "Hi, following up on our conversation"
}
headers = {
    "Authorization": "Basic <encoded-value>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    sendUserId: 'usr_FU6yAd3UdBFel0UDy',
    sendUserWhatsappAccountId: 'wha_ABC123',
    contactId: 'ctc_ei6zVayP9B2ugwUPN',
    leadId: 'lea_wadZOcDDSFWSbFaCf',
    message: 'Hi, following up on our conversation'
  })
};

fetch('https://api.lemlist.com/api/inbox/whatsapp', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
require 'uri'
require 'net/http'

url = URI("https://api.lemlist.com/api/inbox/whatsapp")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"sendUserId\": \"usr_FU6yAd3UdBFel0UDy\",\n  \"sendUserWhatsappAccountId\": \"wha_ABC123\",\n  \"contactId\": \"ctc_ei6zVayP9B2ugwUPN\",\n  \"leadId\": \"lea_wadZOcDDSFWSbFaCf\",\n  \"message\": \"Hi, following up on our conversation\"\n}"

response = http.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.lemlist.com/api/inbox/whatsapp",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'sendUserId' => 'usr_FU6yAd3UdBFel0UDy',
    'sendUserWhatsappAccountId' => 'wha_ABC123',
    'contactId' => 'ctc_ei6zVayP9B2ugwUPN',
    'leadId' => 'lea_wadZOcDDSFWSbFaCf',
    'message' => 'Hi, following up on our conversation'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Basic <encoded-value>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
"Bad team"
"The authentication you supplied is incorrect"

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
sendUserId
string
required

Sender user ID

sendUserWhatsappAccountId
string
required

WhatsApp account ID

contactId
string
required

Contact ID

leadId
string
required

Lead ID

message
string
required

Message content

Response

Success