Send a text message with CUSTOM link preview
curl --request POST \
--url https://{host}/api/send/link-custom-preview \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"chatId": "5511999999999@c.us",
"text": "Check this out! https://github.com/",
"preview": {
"url": "https://github.com/",
"title": "Your Title",
"description": "Check this out, amazing!",
"image": {
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg"
}
},
"session": "my-session",
"reply_to": null,
"linkPreviewHighQuality": true
}
'import requests
url = "https://{host}/api/send/link-custom-preview"
payload = {
"chatId": "5511999999999@c.us",
"text": "Check this out! https://github.com/",
"preview": {
"url": "https://github.com/",
"title": "Your Title",
"description": "Check this out, amazing!",
"image": { "url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg" }
},
"session": "my-session",
"reply_to": None,
"linkPreviewHighQuality": True
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '5511999999999@c.us',
text: 'Check this out! https://github.com/',
preview: {
url: 'https://github.com/',
title: 'Your Title',
description: 'Check this out, amazing!',
image: {url: 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg'}
},
session: 'my-session',
reply_to: null,
linkPreviewHighQuality: true
})
};
fetch('https://{host}/api/send/link-custom-preview', 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://{host}/api/send/link-custom-preview",
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([
'chatId' => '5511999999999@c.us',
'text' => 'Check this out! https://github.com/',
'preview' => [
'url' => 'https://github.com/',
'title' => 'Your Title',
'description' => 'Check this out, amazing!',
'image' => [
'url' => 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg'
]
],
'session' => 'my-session',
'reply_to' => null,
'linkPreviewHighQuality' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <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://{host}/api/send/link-custom-preview"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\",\n \"text\": \"Check this out! https://github.com/\",\n \"preview\": {\n \"url\": \"https://github.com/\",\n \"title\": \"Your Title\",\n \"description\": \"Check this out, amazing!\",\n \"image\": {\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\"\n }\n },\n \"session\": \"my-session\",\n \"reply_to\": null,\n \"linkPreviewHighQuality\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<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://{host}/api/send/link-custom-preview")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\",\n \"text\": \"Check this out! https://github.com/\",\n \"preview\": {\n \"url\": \"https://github.com/\",\n \"title\": \"Your Title\",\n \"description\": \"Check this out, amazing!\",\n \"image\": {\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\"\n }\n },\n \"session\": \"my-session\",\n \"reply_to\": null,\n \"linkPreviewHighQuality\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/send/link-custom-preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\",\n \"text\": \"Check this out! https://github.com/\",\n \"preview\": {\n \"url\": \"https://github.com/\",\n \"title\": \"Your Title\",\n \"description\": \"Check this out, amazing!\",\n \"image\": {\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\"\n }\n },\n \"session\": \"my-session\",\n \"reply_to\": null,\n \"linkPreviewHighQuality\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Messaging
Custom Link Preview
Send link with custom preview
POST
/
api
/
send
/
link-custom-preview
Send a text message with CUSTOM link preview
curl --request POST \
--url https://{host}/api/send/link-custom-preview \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"chatId": "5511999999999@c.us",
"text": "Check this out! https://github.com/",
"preview": {
"url": "https://github.com/",
"title": "Your Title",
"description": "Check this out, amazing!",
"image": {
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg"
}
},
"session": "my-session",
"reply_to": null,
"linkPreviewHighQuality": true
}
'import requests
url = "https://{host}/api/send/link-custom-preview"
payload = {
"chatId": "5511999999999@c.us",
"text": "Check this out! https://github.com/",
"preview": {
"url": "https://github.com/",
"title": "Your Title",
"description": "Check this out, amazing!",
"image": { "url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg" }
},
"session": "my-session",
"reply_to": None,
"linkPreviewHighQuality": True
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '5511999999999@c.us',
text: 'Check this out! https://github.com/',
preview: {
url: 'https://github.com/',
title: 'Your Title',
description: 'Check this out, amazing!',
image: {url: 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg'}
},
session: 'my-session',
reply_to: null,
linkPreviewHighQuality: true
})
};
fetch('https://{host}/api/send/link-custom-preview', 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://{host}/api/send/link-custom-preview",
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([
'chatId' => '5511999999999@c.us',
'text' => 'Check this out! https://github.com/',
'preview' => [
'url' => 'https://github.com/',
'title' => 'Your Title',
'description' => 'Check this out, amazing!',
'image' => [
'url' => 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg'
]
],
'session' => 'my-session',
'reply_to' => null,
'linkPreviewHighQuality' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <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://{host}/api/send/link-custom-preview"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\",\n \"text\": \"Check this out! https://github.com/\",\n \"preview\": {\n \"url\": \"https://github.com/\",\n \"title\": \"Your Title\",\n \"description\": \"Check this out, amazing!\",\n \"image\": {\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\"\n }\n },\n \"session\": \"my-session\",\n \"reply_to\": null,\n \"linkPreviewHighQuality\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<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://{host}/api/send/link-custom-preview")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\",\n \"text\": \"Check this out! https://github.com/\",\n \"preview\": {\n \"url\": \"https://github.com/\",\n \"title\": \"Your Title\",\n \"description\": \"Check this out, amazing!\",\n \"image\": {\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\"\n }\n },\n \"session\": \"my-session\",\n \"reply_to\": null,\n \"linkPreviewHighQuality\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/send/link-custom-preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\",\n \"text\": \"Check this out! https://github.com/\",\n \"preview\": {\n \"url\": \"https://github.com/\",\n \"title\": \"Your Title\",\n \"description\": \"Check this out, amazing!\",\n \"image\": {\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\"\n }\n },\n \"session\": \"my-session\",\n \"reply_to\": null,\n \"linkPreviewHighQuality\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Description
This endpoint allows you to send messages with links that include custom previews. You can define the title, description and image that will appear in the link preview, instead of using WhatsApp’s automatic preview.Body
{
"sessionId": "my-session",
"jid": "5511999999999@s.whatsapp.net",
"text": "Hello, how are you?",
"preview": {
"url": "https://example.com",
"title": "Title",
"description": "Description",
"image": "value"
}
}
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
sessionId | string | ✅ Yes | Authenticated session ID that will send the message |
jid | string | ✅ Yes | Recipient identifier (WhatsApp JID). Format: 5511999999999@s.whatsapp.net for contacts or 120363XXXXX@g.us for groups |
text | string | ✅ Yes | Message text accompanying the link |
preview | object | ✅ Yes | Object containing the custom preview information |
preview.url | string | ✅ Yes | Link URL |
preview.title | string | ✅ Yes | Title that will appear in the preview |
preview.description | string | ✅ Yes | Description that will appear in the preview |
preview.image | string | ❌ No | Preview image encoded in base64 |
{
"success": true,
"messageId": "3EB0XXXXXX"
}
Status Codes
200- Link with custom preview sent successfully400- Invalid parameters401- Unauthorized session404- Session not found
Usage Example
curl -X POST https://api.wappfy.com.br/api/send/link-custom-preview \
-H "Content-Type: application/json" \
-d '{
"sessionId": "my-session",
"jid": "5511999999999@s.whatsapp.net",
"text": "Confira nossa promoção especial!",
"preview": {
"url": "https://exemplo.com/promocao",
"title": "Promoção Especial - 50% OFF",
"description": "Aproveite descontos incríveis em todos os produtos",
"image": "iVBORw0KGgoAAAANSUhEUgA..."
}
}'
const response = await fetch('https://api.wappfy.com.br/api/send/link-custom-preview', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
sessionId: 'my-session',
jid: '5511999999999@s.whatsapp.net',
text: 'Confira nossa promoção especial!',
preview: {
url: 'https://exemplo.com/promocao',
title: 'Promoção Especial - 50% OFF',
description: 'Aproveite descontos incríveis em todos os produtos',
image: 'iVBORw0KGgoAAAANSUhEUgA...' // base64 optional
}
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.wappfy.com.br/api/send/link-custom-preview',
json={
'sessionId': 'my-session',
'jid': '5511999999999@s.whatsapp.net',
'text': 'Confira nossa promoção especial!',
'preview': {
'url': 'https://exemplo.com/promocao',
'title': 'Promoção Especial - 50% OFF',
'description': 'Aproveite descontos incríveis em todos os produtos',
'image': 'iVBORw0KGgoAAAANSUhEUgA...' # base64 optional
}
}
)
data = response.json()
print(data)
Authorizations
Your Wappfy API key (get it at dash.wappfy.com.br)
Body
application/json
Example:
"5511999999999@c.us"
Message text. MUST include the URL provided in preview.url
Show child attributes
Show child attributes
Session name (instanceName)
Example:
"my-session"
Message ID you want to reply to
Example:
null
Response
201 - application/json
The response is of type object.
⌘I
