Send an image
curl --request POST \
--url https://{host}/api/sendImage \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"session": "session",
"chatId": "5511999999999@c.us",
"url": "https://example.com/image.jpg",
"caption": "Image caption"
}
'import requests
url = "https://{host}/api/sendImage"
payload = {
"session": "session",
"chatId": "5511999999999@c.us",
"url": "https://example.com/image.jpg",
"caption": "Image caption"
}
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({
session: 'session',
chatId: '5511999999999@c.us',
url: 'https://example.com/image.jpg',
caption: 'Image caption'
})
};
fetch('https://{host}/api/sendImage', 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/sendImage",
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([
'session' => 'session',
'chatId' => '5511999999999@c.us',
'url' => 'https://example.com/image.jpg',
'caption' => 'Image caption'
]),
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/sendImage"
payload := strings.NewReader("{\n \"session\": \"session\",\n \"chatId\": \"5511999999999@c.us\",\n \"url\": \"https://example.com/image.jpg\",\n \"caption\": \"Image caption\"\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/sendImage")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session\": \"session\",\n \"chatId\": \"5511999999999@c.us\",\n \"url\": \"https://example.com/image.jpg\",\n \"caption\": \"Image caption\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/sendImage")
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 \"session\": \"session\",\n \"chatId\": \"5511999999999@c.us\",\n \"url\": \"https://example.com/image.jpg\",\n \"caption\": \"Image caption\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Messaging
Send Image
Send image to a contact or group
POST
/
api
/
sendImage
Send an image
curl --request POST \
--url https://{host}/api/sendImage \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"session": "session",
"chatId": "5511999999999@c.us",
"url": "https://example.com/image.jpg",
"caption": "Image caption"
}
'import requests
url = "https://{host}/api/sendImage"
payload = {
"session": "session",
"chatId": "5511999999999@c.us",
"url": "https://example.com/image.jpg",
"caption": "Image caption"
}
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({
session: 'session',
chatId: '5511999999999@c.us',
url: 'https://example.com/image.jpg',
caption: 'Image caption'
})
};
fetch('https://{host}/api/sendImage', 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/sendImage",
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([
'session' => 'session',
'chatId' => '5511999999999@c.us',
'url' => 'https://example.com/image.jpg',
'caption' => 'Image caption'
]),
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/sendImage"
payload := strings.NewReader("{\n \"session\": \"session\",\n \"chatId\": \"5511999999999@c.us\",\n \"url\": \"https://example.com/image.jpg\",\n \"caption\": \"Image caption\"\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/sendImage")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session\": \"session\",\n \"chatId\": \"5511999999999@c.us\",\n \"url\": \"https://example.com/image.jpg\",\n \"caption\": \"Image caption\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/sendImage")
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 \"session\": \"session\",\n \"chatId\": \"5511999999999@c.us\",\n \"url\": \"https://example.com/image.jpg\",\n \"caption\": \"Image caption\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Description
This endpoint allows you to send images to individual contacts or groups on WhatsApp. The image must be sent in base64 format. Optionally, you can add a caption to the image.Body
{
"sessionId": "my-session",
"jid": "5511999999999@s.whatsapp.net",
"image": {
"content": "iVBORw0KGgoAAAANSUhEUgAAAA...",
"mimetype": "image/png",
"filename": "my_image.png"
},
"caption": "Image caption"
}
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
sessionId | string | ✅ Yes | Authenticated session ID that will send the image |
jid | string | ✅ Yes | Recipient identifier (WhatsApp JID). Format: 5511999999999@s.whatsapp.net for contacts or 120363XXXXX@g.us for groups |
image | object | ✅ Yes | Object containing the image data |
image.content | string | ✅ Yes | Image content encoded in base64 |
image.mimetype | string | ❌ No | Image MIME type (e.g., image/png, image/jpeg). If not specified, will be detected automatically |
image.filename | string | ❌ No | Image file name |
caption | string | ❌ No | Caption/text accompanying the image |
{
"success": true,
"messageId": "3EB0XXXXXX"
}
Status Codes
200- Image sent successfully400- Invalid parameters or image corrupted401- Unauthorized session404- Session not found413- Image too large
Usage Example
curl -X POST https://api.wappfy.com.br/api/sendImage \
-H "Content-Type: application/json" \
-d '{
"sessionId": "my-session",
"jid": "5511999999999@s.whatsapp.net",
"image": {
"content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"mimetype": "image/png",
"filename": "image.png"
},
"caption": "Check out this image!"
}'
// Read file and convert to base64
const fs = require('fs');
const imageBuffer = fs.readFileSync('image.png');
const base64Image = imageBuffer.toString('base64');
const response = await fetch('https://api.wappfy.com.br/api/sendImage', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
sessionId: 'my-session',
jid: '5511999999999@s.whatsapp.net',
image: {
content: base64Image,
mimetype: 'image/png',
filename: 'image.png'
},
caption: 'Check out this image!'
})
});
const data = await response.json();
console.log(data);
import requests
import base64
# Read file and convert to base64
with open('image.png', 'rb') as image_file:
base64_image = base64.b64encode(image_file.read()).decode('utf-8')
response = requests.post(
'https://api.wappfy.com.br/api/sendImage',
json={
'sessionId': 'my-session',
'jid': '5511999999999@s.whatsapp.net',
'image': {
'content': base64_image,
'mimetype': 'image/png',
'filename': 'image.png'
},
'caption': 'Check out this image!'
}
)
data = response.json()
print(data)
Authorizations
Your Wappfy API key (get it at dash.wappfy.com.br)
Body
application/json
Chat ID (WhatsApp JID)
Example:
"5511999999999@c.us"
Image file (remote URL or base64 data)
- Option 1
- Option 2
Show child attributes
Show child attributes
Session name (instanceName)
Example:
"my-session"
Message ID you want to reply to
Example:
null
Caption/text that accompanies the image
Response
201 - application/json
The response is of type object.
⌘I
