curl -X POST https://api.livchat.ai/v1/messages/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "5511999999999",
"body": "Hello from LivChat!",
"from": "5585912345678"
}'
const response = await fetch("https://api.livchat.ai/v1/messages/send", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
phone: "5511999999999",
body: "Hello from LivChat!",
from: "5585912345678", // Optional: specify sender instance
}),
});
const data = await response.json();
import requests
response = requests.post(
"https://api.livchat.ai/v1/messages/send",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"phone": "5511999999999",
"body": "Hello from LivChat!",
"from": "5585912345678", # Optional: specify sender instance
},
)
print(response.json())
{
"success": true,
"code": 200,
"data": {
"details": "Sent",
"id": "3EB04A45DCA355D01DB68C",
"timestamp": "2024-12-10T12:00:00-03:00"
}
}
{
"error": {
"code": 400,
"message": "Phone number is required"
}
}
Messages
Send Text Message
Send a text message to a WhatsApp number
POST
/
v1
/
messages
/
send
curl -X POST https://api.livchat.ai/v1/messages/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "5511999999999",
"body": "Hello from LivChat!",
"from": "5585912345678"
}'
const response = await fetch("https://api.livchat.ai/v1/messages/send", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
phone: "5511999999999",
body: "Hello from LivChat!",
from: "5585912345678", // Optional: specify sender instance
}),
});
const data = await response.json();
import requests
response = requests.post(
"https://api.livchat.ai/v1/messages/send",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"phone": "5511999999999",
"body": "Hello from LivChat!",
"from": "5585912345678", # Optional: specify sender instance
},
)
print(response.json())
{
"success": true,
"code": 200,
"data": {
"details": "Sent",
"id": "3EB04A45DCA355D01DB68C",
"timestamp": "2024-12-10T12:00:00-03:00"
}
}
{
"error": {
"code": 400,
"message": "Phone number is required"
}
}
Send a text message to any WhatsApp number.
Request Body
string
required
Recipient phone number in international format without
+ (e.g., 5511999999999)string
required
Message text content. Supports emojis and basic formatting.
string
Optional message ID to reply to. Creates a quoted reply.
boolean
Enable link preview for URLs in the message. Default:
falsestring
Sender instance identifier for multi-instance organizations. Can be:
- Phone number: WhatsApp number (e.g.,
5585912345678) - Instance ID: UUID of the instance
Required for organizations with multiple WhatsApp numbers to specify which number sends the message.
Text Formatting
WhatsApp supports basic text formatting:| Format | Syntax | Result |
|---|---|---|
| Bold | *text* | text |
| Italic | _text_ | text |
| Strikethrough | ~text~ | |
| Monospace | `text` | text |
curl -X POST https://api.livchat.ai/v1/messages/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "5511999999999",
"body": "Hello from LivChat!",
"from": "5585912345678"
}'
const response = await fetch("https://api.livchat.ai/v1/messages/send", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
phone: "5511999999999",
body: "Hello from LivChat!",
from: "5585912345678", // Optional: specify sender instance
}),
});
const data = await response.json();
import requests
response = requests.post(
"https://api.livchat.ai/v1/messages/send",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"phone": "5511999999999",
"body": "Hello from LivChat!",
"from": "5585912345678", # Optional: specify sender instance
},
)
print(response.json())
{
"success": true,
"code": 200,
"data": {
"details": "Sent",
"id": "3EB04A45DCA355D01DB68C",
"timestamp": "2024-12-10T12:00:00-03:00"
}
}
{
"error": {
"code": 400,
"message": "Phone number is required"
}
}