Documentation ›
Messages › Send WhatsApp text (Meta)
POST
Send WhatsApp text (Meta)
POSThttps://app.sendapp.ai/api/whatsapp-meta/send
Send a free-text message through Meta's WhatsApp Cloud API (
type=freetext). You can also attach a media file or add interactive buttons. 24-hour window: free-text messages can only be sent within 24 hours of the customer's last message. Outside this window you must use an approved template.
Parameters
apikey
required
Your API Key.
token
required
Account token.
number
required
Recipient number in international format without + (e.g. 1234567890).
type
required
Must be
freetext.
message
optional
Message text (or caption if you attach a media file). Required if you do not pass a media file.
media_url
optional
Public URL of the file to attach.
media_type
optional
Media type:
image, video, audio or document. Required if you pass media_url.
file_name
optional
File name (only for documents).
header
optional
Header text (for messages with buttons).
footer
optional
Footer text (for messages with buttons).
buttons
optional
Array of quick-reply buttons, maximum 3. Each button has
id and title. Request
# Plain text
curl -X POST 'https://app.sendapp.ai/api/whatsapp-meta/send' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"number": "1234567890",
"type": "freetext",
"message": "Hi! Thanks for reaching out to us."
}'
# Text + image
curl -X POST 'https://app.sendapp.ai/api/whatsapp-meta/send' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"number": "1234567890",
"type": "freetext",
"message": "Here's your coupon!",
"media_url": "https://esempio.com/coupon.jpg",
"media_type": "image"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-meta/send');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'apikey' => 'YOUR_API_KEY',
'token' => 'YOUR_ACCOUNT_TOKEN',
'number' => '1234567890',
'type' => 'freetext',
'message' => 'Hi! Thanks for reaching out to us.',
]),
]);
echo curl_exec($ch);const res = await fetch('https://app.sendapp.ai/api/whatsapp-meta/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
number: '1234567890',
type: 'freetext',
message: 'Hi! Thanks for reaching out to us.'
})
});
console.log(await res.json());Response (200 OK)
{
"status": "success",
"message": "Message sent successfully",
"message_id": "wamid.HBgLMzkxMjM0NTY3ODkwFQIAERgSN0EwMjBBQkZDRDEyMzQ1Njc4"
}Error
{
"status": "error",
"message": "No active WhatsApp Meta instance found"
}