Send Message
curl --request POST \
--url https://api.linkupapi.com/messages/send \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"account_id": "<string>",
"to": "<string>",
"message": "<string>",
"quoted_message_id": "<string>",
"quoted_text": "<string>",
"quoted_timestamp": 123,
"quoted_from_me": true
}
'import requests
url = "https://api.linkupapi.com/messages/send"
payload = {
"account_id": "<string>",
"to": "<string>",
"message": "<string>",
"quoted_message_id": "<string>",
"quoted_text": "<string>",
"quoted_timestamp": 123,
"quoted_from_me": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account_id: '<string>',
to: '<string>',
message: '<string>',
quoted_message_id: '<string>',
quoted_text: '<string>',
quoted_timestamp: 123,
quoted_from_me: true
})
};
fetch('https://api.linkupapi.com/messages/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linkupapi.com/messages/send",
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([
'account_id' => '<string>',
'to' => '<string>',
'message' => '<string>',
'quoted_message_id' => '<string>',
'quoted_text' => '<string>',
'quoted_timestamp' => 123,
'quoted_from_me' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.linkupapi.com/messages/send"
payload := strings.NewReader("{\n \"account_id\": \"<string>\",\n \"to\": \"<string>\",\n \"message\": \"<string>\",\n \"quoted_message_id\": \"<string>\",\n \"quoted_text\": \"<string>\",\n \"quoted_timestamp\": 123,\n \"quoted_from_me\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.linkupapi.com/messages/send")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"<string>\",\n \"to\": \"<string>\",\n \"message\": \"<string>\",\n \"quoted_message_id\": \"<string>\",\n \"quoted_text\": \"<string>\",\n \"quoted_timestamp\": 123,\n \"quoted_from_me\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkupapi.com/messages/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"<string>\",\n \"to\": \"<string>\",\n \"message\": \"<string>\",\n \"quoted_message_id\": \"<string>\",\n \"quoted_text\": \"<string>\",\n \"quoted_timestamp\": 123,\n \"quoted_from_me\": true\n}"
response = http.request(request)
puts response.read_body{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "Hello from API!"
}
{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "This is a reply!",
"quoted_message_id": "3A08D06E227129496664",
"quoted_text": "Bonjour!",
"quoted_timestamp": 1672567200000,
"quoted_from_me": false
}
{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "Correction!",
"quoted_message_id": "3B828C18BCB5EE8A174F",
"quoted_text": "Mon message précédent",
"quoted_timestamp": 1672567100000,
"quoted_from_me": true
}
WhatsApp Engagement API
Send Message
Send a message to a WhatsApp user
POST
/
messages
/
send
Send Message
curl --request POST \
--url https://api.linkupapi.com/messages/send \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"account_id": "<string>",
"to": "<string>",
"message": "<string>",
"quoted_message_id": "<string>",
"quoted_text": "<string>",
"quoted_timestamp": 123,
"quoted_from_me": true
}
'import requests
url = "https://api.linkupapi.com/messages/send"
payload = {
"account_id": "<string>",
"to": "<string>",
"message": "<string>",
"quoted_message_id": "<string>",
"quoted_text": "<string>",
"quoted_timestamp": 123,
"quoted_from_me": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account_id: '<string>',
to: '<string>',
message: '<string>',
quoted_message_id: '<string>',
quoted_text: '<string>',
quoted_timestamp: 123,
quoted_from_me: true
})
};
fetch('https://api.linkupapi.com/messages/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linkupapi.com/messages/send",
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([
'account_id' => '<string>',
'to' => '<string>',
'message' => '<string>',
'quoted_message_id' => '<string>',
'quoted_text' => '<string>',
'quoted_timestamp' => 123,
'quoted_from_me' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.linkupapi.com/messages/send"
payload := strings.NewReader("{\n \"account_id\": \"<string>\",\n \"to\": \"<string>\",\n \"message\": \"<string>\",\n \"quoted_message_id\": \"<string>\",\n \"quoted_text\": \"<string>\",\n \"quoted_timestamp\": 123,\n \"quoted_from_me\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.linkupapi.com/messages/send")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"<string>\",\n \"to\": \"<string>\",\n \"message\": \"<string>\",\n \"quoted_message_id\": \"<string>\",\n \"quoted_text\": \"<string>\",\n \"quoted_timestamp\": 123,\n \"quoted_from_me\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkupapi.com/messages/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"<string>\",\n \"to\": \"<string>\",\n \"message\": \"<string>\",\n \"quoted_message_id\": \"<string>\",\n \"quoted_text\": \"<string>\",\n \"quoted_timestamp\": 123,\n \"quoted_from_me\": true\n}"
response = http.request(request)
puts response.read_body{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "Hello from API!"
}
{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "This is a reply!",
"quoted_message_id": "3A08D06E227129496664",
"quoted_text": "Bonjour!",
"quoted_timestamp": 1672567200000,
"quoted_from_me": false
}
{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "Correction!",
"quoted_message_id": "3B828C18BCB5EE8A174F",
"quoted_text": "Mon message précédent",
"quoted_timestamp": 1672567100000,
"quoted_from_me": true
}
Send a direct message to any WhatsApp user. You can send a simple message or reply to an existing message.
This endpoint costs 1 credit per message sent. Ignore this if you’re on per-seat pricing: usage is unlimited.
To get your
account_id, you need to first authenticate your WhatsApp account. See WhatsApp Authentication for details on how to log your WhatsApp account and obtain the account ID.Header Parameters
string
required
Your API key
Body Parameters
string
required
The ID of your WhatsApp account
string
required
The recipient’s phone number (international format without +)
string
required
The text message to send
string
The ID of the message you’re replying to
string
The text of the quoted message
number
Unix timestamp in milliseconds of the quoted message
boolean
true if the quoted message is from you, false if from the recipient
Response
string
Request status (success/error)
string
Detailed message about the sending status
object
Additional data returned when message is sent successfully
{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "Hello from API!"
}
{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "This is a reply!",
"quoted_message_id": "3A08D06E227129496664",
"quoted_text": "Bonjour!",
"quoted_timestamp": 1672567200000,
"quoted_from_me": false
}
{
"account_id": "68e63a4fe364c1ce41688865",
"to": "33673748743",
"message": "Correction!",
"quoted_message_id": "3B828C18BCB5EE8A174F",
"quoted_text": "Mon message précédent",
"quoted_timestamp": 1672567100000,
"quoted_from_me": true
}
Notes
- Phone numbers must be in international format without the + prefix
- All quoted parameters must be provided together when replying to a message
- The
quoted_from_meparameter helps distinguish between replies to your messages vs received messages
Was this page helpful?