Send a message
curl --request POST \
--url https://api.polymorfa.com/api/{session}/messages/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chatId": "<string>",
"text": "<string>",
"url": "<string>",
"base64": "<string>",
"mimeType": "<string>",
"filename": "<string>",
"caption": "<string>",
"ptt": true,
"pollTitle": "<string>",
"pollOptions": [
"<string>"
],
"pollMultiSelect": true,
"latitude": 123,
"longitude": 123,
"address": "<string>",
"vcard": "<string>",
"isForwarded": true,
"mentions": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '<string>',
text: '<string>',
url: '<string>',
base64: '<string>',
mimeType: '<string>',
filename: '<string>',
caption: '<string>',
ptt: true,
pollTitle: '<string>',
pollOptions: ['<string>'],
pollMultiSelect: true,
latitude: 123,
longitude: 123,
address: '<string>',
vcard: '<string>',
isForwarded: true,
mentions: ['<string>']
})
};
fetch('https://api.polymorfa.com/api/{session}/messages/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/api/{session}/messages/send"
payload = {
"chatId": "<string>",
"text": "<string>",
"url": "<string>",
"base64": "<string>",
"mimeType": "<string>",
"filename": "<string>",
"caption": "<string>",
"ptt": True,
"pollTitle": "<string>",
"pollOptions": ["<string>"],
"pollMultiSelect": True,
"latitude": 123,
"longitude": 123,
"address": "<string>",
"vcard": "<string>",
"isForwarded": True,
"mentions": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/api/{session}/messages/send"
payload := strings.NewReader("{\n \"chatId\": \"<string>\",\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"base64\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"filename\": \"<string>\",\n \"caption\": \"<string>\",\n \"ptt\": true,\n \"pollTitle\": \"<string>\",\n \"pollOptions\": [\n \"<string>\"\n ],\n \"pollMultiSelect\": true,\n \"latitude\": 123,\n \"longitude\": 123,\n \"address\": \"<string>\",\n \"vcard\": \"<string>\",\n \"isForwarded\": true,\n \"mentions\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polymorfa.com/api/{session}/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([
'chatId' => '<string>',
'text' => '<string>',
'url' => '<string>',
'base64' => '<string>',
'mimeType' => '<string>',
'filename' => '<string>',
'caption' => '<string>',
'ptt' => true,
'pollTitle' => '<string>',
'pollOptions' => [
'<string>'
],
'pollMultiSelect' => true,
'latitude' => 123,
'longitude' => 123,
'address' => '<string>',
'vcard' => '<string>',
'isForwarded' => true,
'mentions' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"id": "<string>",
"timestamp": "<string>",
"status": "<string>",
"senderLid": "<string>",
"fromLid": "<string>",
"mediaId": "<string>",
"senderPhoneNumber": "<string>",
"fromPhoneNumber": "<string>"
}
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}Messages
Send a message
Protocols: Linked Device API · Meta Cloud API · Polymorfa Hybrid Link
POST
/
api
/
{session}
/
messages
/
send
Send a message
curl --request POST \
--url https://api.polymorfa.com/api/{session}/messages/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chatId": "<string>",
"text": "<string>",
"url": "<string>",
"base64": "<string>",
"mimeType": "<string>",
"filename": "<string>",
"caption": "<string>",
"ptt": true,
"pollTitle": "<string>",
"pollOptions": [
"<string>"
],
"pollMultiSelect": true,
"latitude": 123,
"longitude": 123,
"address": "<string>",
"vcard": "<string>",
"isForwarded": true,
"mentions": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '<string>',
text: '<string>',
url: '<string>',
base64: '<string>',
mimeType: '<string>',
filename: '<string>',
caption: '<string>',
ptt: true,
pollTitle: '<string>',
pollOptions: ['<string>'],
pollMultiSelect: true,
latitude: 123,
longitude: 123,
address: '<string>',
vcard: '<string>',
isForwarded: true,
mentions: ['<string>']
})
};
fetch('https://api.polymorfa.com/api/{session}/messages/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/api/{session}/messages/send"
payload = {
"chatId": "<string>",
"text": "<string>",
"url": "<string>",
"base64": "<string>",
"mimeType": "<string>",
"filename": "<string>",
"caption": "<string>",
"ptt": True,
"pollTitle": "<string>",
"pollOptions": ["<string>"],
"pollMultiSelect": True,
"latitude": 123,
"longitude": 123,
"address": "<string>",
"vcard": "<string>",
"isForwarded": True,
"mentions": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/api/{session}/messages/send"
payload := strings.NewReader("{\n \"chatId\": \"<string>\",\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"base64\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"filename\": \"<string>\",\n \"caption\": \"<string>\",\n \"ptt\": true,\n \"pollTitle\": \"<string>\",\n \"pollOptions\": [\n \"<string>\"\n ],\n \"pollMultiSelect\": true,\n \"latitude\": 123,\n \"longitude\": 123,\n \"address\": \"<string>\",\n \"vcard\": \"<string>\",\n \"isForwarded\": true,\n \"mentions\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polymorfa.com/api/{session}/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([
'chatId' => '<string>',
'text' => '<string>',
'url' => '<string>',
'base64' => '<string>',
'mimeType' => '<string>',
'filename' => '<string>',
'caption' => '<string>',
'ptt' => true,
'pollTitle' => '<string>',
'pollOptions' => [
'<string>'
],
'pollMultiSelect' => true,
'latitude' => 123,
'longitude' => 123,
'address' => '<string>',
'vcard' => '<string>',
'isForwarded' => true,
'mentions' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"id": "<string>",
"timestamp": "<string>",
"status": "<string>",
"senderLid": "<string>",
"fromLid": "<string>",
"mediaId": "<string>",
"senderPhoneNumber": "<string>",
"fromPhoneNumber": "<string>"
}
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}Linked Device API
Meta Cloud API
Polymorfa Hybrid Link
Authorizations
Polymorfa organization key (titan_ prefix), project token (titan_pt_ prefix), or client token (titan_ct_ prefix), where the operation permits that audience.
Path Parameters
Body
application/json
Minimum string length:
1Available options:
text, image, file, voice, video, poll, location, contact Show child attributes
Show child attributes
Template send (cloud_api only). When set, type is ignored. Rejected on whatsmeow sessions.
Show child attributes
Show child attributes