Messages API
Send different types of WhatsApp messages.
All requests are POST with Content-Type: application/json and must include the X-API-KEY header. Responses follow {message: string, success: boolean}
.
Receivers must be E.164 digits without plus (e.g., 14155552671).
Text
POST /messages/text
When to use it
- Send plain text updates, OTPs, and quick replies.
- Ideal for low-latency transactional notifications.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- text: string — The message text.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
import axios from 'axios';
const url = 'https://api.communiktor.com/messages/text';
const headers = {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
};
const body = {
instance: 'my-instance-1',
receiver: '14155552671',
text: 'Hello from Communiktor!',
};
axios.post(url, body, { headers })
.then(res => console.log(res.data))
.catch(err => console.error(err.response?.data || err.message));
const url = 'https://api.communiktor.com/messages/text';
const res = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
},
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
text: 'Hello from Communiktor!',
}),
});
const data = await res.json();
console.log(data);
import requests
url = 'https://api.communiktor.com/messages/text'
headers = {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
}
payload = {
'instance': 'my-instance-1',
'receiver': '14155552671',
'text': 'Hello from Communiktor!'
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
curl -X POST https://api.communiktor.com/messages/text \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"text": "Hello from Communiktor!"
}'
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client([
'base_uri' => 'https://api.communiktor.com',
]);
$response = $client->post('/messages/text', [
'headers' => [
'Content-Type' => 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'text' => 'Hello from Communiktor!'
],
]);
echo $response->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/text');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'text' => 'Hello from Communiktor!'
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
echo $response;
Image
POST /messages/image
When to use it
- Send product photos, tickets, receipts, or screenshots.
- Use viewOnce for sensitive content that should not persist in the chat.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- url: string — Publicly accessible image URL.
- viewOnce?: boolean — If true, the media disappears after being viewed once.
- caption?: string — Optional text shown below the image.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/image \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/image.jpg",
"caption": "Order #12345",
"viewOnce": false
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/image', {
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/image.jpg',
caption: 'Order #12345',
viewOnce: false,
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/image', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/image.jpg',
caption: 'Order #12345',
viewOnce: false,
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/image', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/image.jpg',
'caption' => 'Order #12345',
'viewOnce' => false,
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/image');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/image.jpg',
'caption' => 'Order #12345',
'viewOnce' => false,
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/image', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'url': 'https://example.com/image.jpg',
'caption': 'Order #12345',
'viewOnce': False,
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Video
POST /messages/video
When to use it
- Send feature demos, announcements, or short clips.
- Use asGif/asNote for lightweight previews when appropriate.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- url: string — Publicly accessible video URL.
- asGif?: boolean — Send as short looping preview (no sound).
- asNote?: boolean — Send as a circular video note (like push-to-talk style).
- caption?: string — Optional text shown below the video.
- viewOnce?: boolean — If true, the media disappears after being viewed once.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/video \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/video.mp4",
"caption": "Feature demo",
"asGif": false,
"asNote": false,
"viewOnce": false
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/video', {
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/video.mp4',
caption: 'Feature demo',
asGif: false,
asNote: false,
viewOnce: false,
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/video', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/video.mp4',
caption: 'Feature demo',
asGif: false,
asNote: false,
viewOnce: false,
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/video', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/video.mp4',
'caption' => 'Feature demo',
'asGif' => false,
'asNote' => false,
'viewOnce' => false,
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/video');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/video.mp4',
'caption' => 'Feature demo',
'asGif' => false,
'asNote' => false,
'viewOnce' => false,
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/video', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'url': 'https://example.com/video.mp4',
'caption': 'Feature demo',
'asGif': False,
'asNote': False,
'viewOnce': False,
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Audio
POST /messages/audio
When to use it
- Share voice notes, short audio confirmations, or hotline messages.
- Use asNote for a push-to-talk style waveform.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- url: string — Publicly accessible audio URL.
- asNote?: boolean — Send as a voice note (push-to-talk style).
- viewOnce?: boolean — If true, the media disappears after being viewed once.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/audio \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/audio.mp3",
"asNote": false,
"viewOnce": false
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/audio', {
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/audio.mp3',
asNote: false,
viewOnce: false,
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/audio', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/audio.mp3',
asNote: false,
viewOnce: false,
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/audio', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/audio.mp3',
'asNote' => false,
'viewOnce' => false,
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/audio');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/audio.mp3',
'asNote' => false,
'viewOnce' => false,
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/audio', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'url': 'https://example.com/audio.mp3',
'asNote': False,
'viewOnce': False,
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Document
POST /messages/document
When to use it
- Send PDFs, invoices, contracts, or other business files.
- Set filename to control how the file appears to the recipient.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- url: string — Publicly accessible document URL.
- viewOnce?: boolean — If true, the media disappears after being viewed once.
- caption?: string — Optional text shown below the document.
- filename?: string — File name shown to the recipient.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/document \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/invoice.pdf",
"caption": "Invoice May",
"filename": "invoice-may.pdf",
"viewOnce": false
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/document', {
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/invoice.pdf',
caption: 'Invoice May',
filename: 'invoice-may.pdf',
viewOnce: false,
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/document', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/invoice.pdf',
caption: 'Invoice May',
filename: 'invoice-may.pdf',
viewOnce: false,
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/document', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/invoice.pdf',
'caption' => 'Invoice May',
'filename' => 'invoice-may.pdf',
'viewOnce' => false,
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/document');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/invoice.pdf',
'caption' => 'Invoice May',
'filename' => 'invoice-may.pdf',
'viewOnce' => false,
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/document', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'url': 'https://example.com/invoice.pdf',
'caption': 'Invoice May',
'filename': 'invoice-may.pdf',
'viewOnce': False,
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Location
POST /messages/location
When to use it
- Share store locations, delivery coordinates, or meeting points.
- Include name/address to display a readable pin name.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- location: object — Coordinates and label to pin on the map:
- latitude: number — Latitude in decimal degrees.
- longitude: number — Longitude in decimal degrees.
- name: string — Pin title shown to the user.
- address: string — Human‑readable address for the pin.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/location \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"location": {"latitude": 37.7749, "longitude": -122.4194, "name": "Communiktor HQ", "address": "1 Market St, San Francisco"}
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/location', {
instance: 'my-instance-1',
receiver: '14155552671',
location: { latitude: 37.7749, longitude: -122.4194, name: 'Communiktor HQ', address: '1 Market St, San Francisco' },
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/location', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
location: { latitude: 37.7749, longitude: -122.4194, name: 'Communiktor HQ', address: '1 Market St, San Francisco' },
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/location', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'location' => [ 'latitude' => 37.7749, 'longitude' => -122.4194, 'name' => 'Communiktor HQ', 'address' => '1 Market St, San Francisco' ],
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/location');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'location' => [ 'latitude' => 37.7749, 'longitude' => -122.4194, 'name' => 'Communiktor HQ', 'address' => '1 Market St, San Francisco' ],
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/location', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'location': { 'latitude': 37.7749, 'longitude': -122.4194, 'name': 'Communiktor HQ', 'address': '1 Market St, San Francisco' },
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
vCard
POST /messages/vcard
When to use it
- Share a contact card for sales agents, stores, or support lines.
- Ensure the contact phone is E.164 digits to allow immediate messaging.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- name: string — Title of the card shown in the chat.
- contact: object with fields:
- fullname: string — Contact full name.
- phone: string — E.164 digits without plus.
- waid?: string — WhatsApp ID of the contact (if known).
- organization?: string — Company or organization name.
- title?: string — Role or job title.
- email?: string — Contact email address.
- url?: string — Website or profile URL.
- address?: string — Postal address.
- note?: string — Additional notes.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/vcard \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"name": "Sales Contact",
"contact": {
"fullname": "Jane Doe",
"phone": "14155552671",
"organization": "ACME Inc.",
"title": "Account Executive",
"email": "jane.doe@example.com",
"url": "https://example.com",
"address": "1 Market St, San Francisco",
"note": "VIP client handler"
}
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/vcard', {
instance: 'my-instance-1',
receiver: '14155552671',
name: 'Sales Contact',
contact: {
fullname: 'Jane Doe',
phone: '14155552671',
organization: 'ACME Inc.',
title: 'Account Executive',
email: 'jane.doe@example.com',
url: 'https://example.com',
address: '1 Market St, San Francisco',
note: 'VIP client handler'
}
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/vcard', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
name: 'Sales Contact',
contact: {
fullname: 'Jane Doe',
phone: '14155552671',
organization: 'ACME Inc.',
title: 'Account Executive',
email: 'jane.doe@example.com',
url: 'https://example.com',
address: '1 Market St, San Francisco',
note: 'VIP client handler'
}
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/vcard', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'name' => 'Sales Contact',
'contact' => [
'fullname' => 'Jane Doe',
'phone' => '14155552671',
'organization' => 'ACME Inc.',
'title' => 'Account Executive',
'email' => 'jane.doe@example.com',
'url' => 'https://example.com',
'address' => '1 Market St, San Francisco',
'note' => 'VIP client handler'
]
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/vcard');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'name' => 'Sales Contact',
'contact' => [
'fullname' => 'Jane Doe',
'phone' => '14155552671',
'organization' => 'ACME Inc.',
'title' => 'Account Executive',
'email' => 'jane.doe@example.com',
'url' => 'https://example.com',
'address' => '1 Market St, San Francisco',
'note' => 'VIP client handler'
]
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/vcard', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'name': 'Sales Contact',
'contact': {
'fullname': 'Jane Doe',
'phone': '14155552671',
'organization': 'ACME Inc.',
'title': 'Account Executive',
'email': 'jane.doe@example.com',
'url': 'https://example.com',
'address': '1 Market St, San Francisco',
'note': 'VIP client handler'
}
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())