Send a WhatsApp message
Send one message from a connected number: text, a knowledge-base file (knowledge_file_id), or an approved template. Text and files can only be sent within 24 hours of the person’s last message to the number; outside that window, send a template. Set send_at to schedule it instead.
A refusal by WhatsApp’s rules is a 400 whose code says which: window_closed, opted_out, template_not_found, template_not_approved, template_params. Each message costs the WhatsApp message fee from credit; Meta bills its own fee for templates to the payment method in WhatsApp Manager. Requires whatsapp:write and an Idempotency-Key header.
curl --request POST \
--url https://api.voice.wixzel.com/v1/whatsapp/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"account_id": "6a96a3ead6e886d42462dd3e",
"to": "+14155550100",
"text": "<string>",
"knowledge_file_id": "6a96a3ead6e886d42462dd3e",
"caption": "<string>",
"send_at": "2026-09-01T12:00:00.000Z"
}
'import requests
url = "https://api.voice.wixzel.com/v1/whatsapp/messages"
payload = {
"account_id": "6a96a3ead6e886d42462dd3e",
"to": "+14155550100",
"text": "<string>",
"knowledge_file_id": "6a96a3ead6e886d42462dd3e",
"caption": "<string>",
"send_at": "2026-09-01T12:00:00.000Z"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: '6a96a3ead6e886d42462dd3e',
to: '+14155550100',
text: '<string>',
knowledge_file_id: '6a96a3ead6e886d42462dd3e',
caption: '<string>',
send_at: '2026-09-01T12:00:00.000Z'
})
};
fetch('https://api.voice.wixzel.com/v1/whatsapp/messages', 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://api.voice.wixzel.com/v1/whatsapp/messages",
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([
'account_id' => '6a96a3ead6e886d42462dd3e',
'to' => '+14155550100',
'text' => '<string>',
'knowledge_file_id' => '6a96a3ead6e886d42462dd3e',
'caption' => '<string>',
'send_at' => '2026-09-01T12:00:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://api.voice.wixzel.com/v1/whatsapp/messages"
payload := strings.NewReader("{\n \"account_id\": \"6a96a3ead6e886d42462dd3e\",\n \"to\": \"+14155550100\",\n \"text\": \"<string>\",\n \"knowledge_file_id\": \"6a96a3ead6e886d42462dd3e\",\n \"caption\": \"<string>\",\n \"send_at\": \"2026-09-01T12:00:00.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.voice.wixzel.com/v1/whatsapp/messages")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"6a96a3ead6e886d42462dd3e\",\n \"to\": \"+14155550100\",\n \"text\": \"<string>\",\n \"knowledge_file_id\": \"6a96a3ead6e886d42462dd3e\",\n \"caption\": \"<string>\",\n \"send_at\": \"2026-09-01T12:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voice.wixzel.com/v1/whatsapp/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"6a96a3ead6e886d42462dd3e\",\n \"to\": \"+14155550100\",\n \"text\": \"<string>\",\n \"knowledge_file_id\": \"6a96a3ead6e886d42462dd3e\",\n \"caption\": \"<string>\",\n \"send_at\": \"2026-09-01T12:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"object": "whatsapp_send",
"status": "sent",
"message": {
"id": "6a96a3ead6e886d42462dd3e",
"object": "whatsapp_message",
"account_id": "6a96a3ead6e886d42462dd3e",
"conversation_id": "6a96a3ead6e886d42462dd3e",
"wamid": "<string>",
"direction": "in",
"type": "text",
"text": "<string>",
"transcript": "<string>",
"origin": "contact",
"status": "received",
"error": {
"code": 123,
"message": "<string>"
},
"template": {
"name": "<string>",
"language": "<string>",
"category": "<string>"
},
"pricing": {
"category": "<string>",
"billable": true,
"type": "<string>"
},
"meta_cost_micros": 194000,
"charged_micros": 194000,
"created_at": "2026-09-01T12:00:00.000Z"
},
"scheduled_message": {
"id": "6a96a3ead6e886d42462dd3e",
"object": "whatsapp_scheduled_message",
"account_id": "6a96a3ead6e886d42462dd3e",
"to": "<string>",
"purpose": "reminder",
"send_at": "2026-09-01T12:00:00.000Z",
"status": "pending",
"attempts": 123,
"last_error": "<string>",
"text": "<string>",
"template": {
"name": "<string>",
"language": "<string>",
"parameters": [
"<string>"
]
},
"knowledge_file_id": "6a96a3ead6e886d42462dd3e",
"message_id": "6a96a3ead6e886d42462dd3e",
"created_at": "2026-09-01T12:00:00.000Z"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}Authorizations
Your Wixzel Voice API key: Authorization: Bearer wv_live_.... Keys are scoped; grant only what the integration needs.
Headers
A unique value per message, e.g. a UUID. A retry with the same key returns the first result.
1 - 255Body
^[0-9a-f]{24}$"6a96a3ead6e886d42462dd3e"
^\+?\d{8,15}$"+14155550100"
Free text. Only inside the 24-hour window.
1 - 4096Show child attributes
Show child attributes
A knowledge-base file to send, uploaded with its original kept. Only inside the 24-hour window.
^[0-9a-f]{24}$"6a96a3ead6e886d42462dd3e"
1024Send later instead of now, up to 30 days ahead.
"2026-09-01T12:00:00.000Z"
curl --request POST \
--url https://api.voice.wixzel.com/v1/whatsapp/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"account_id": "6a96a3ead6e886d42462dd3e",
"to": "+14155550100",
"text": "<string>",
"knowledge_file_id": "6a96a3ead6e886d42462dd3e",
"caption": "<string>",
"send_at": "2026-09-01T12:00:00.000Z"
}
'import requests
url = "https://api.voice.wixzel.com/v1/whatsapp/messages"
payload = {
"account_id": "6a96a3ead6e886d42462dd3e",
"to": "+14155550100",
"text": "<string>",
"knowledge_file_id": "6a96a3ead6e886d42462dd3e",
"caption": "<string>",
"send_at": "2026-09-01T12:00:00.000Z"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: '6a96a3ead6e886d42462dd3e',
to: '+14155550100',
text: '<string>',
knowledge_file_id: '6a96a3ead6e886d42462dd3e',
caption: '<string>',
send_at: '2026-09-01T12:00:00.000Z'
})
};
fetch('https://api.voice.wixzel.com/v1/whatsapp/messages', 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://api.voice.wixzel.com/v1/whatsapp/messages",
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([
'account_id' => '6a96a3ead6e886d42462dd3e',
'to' => '+14155550100',
'text' => '<string>',
'knowledge_file_id' => '6a96a3ead6e886d42462dd3e',
'caption' => '<string>',
'send_at' => '2026-09-01T12:00:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://api.voice.wixzel.com/v1/whatsapp/messages"
payload := strings.NewReader("{\n \"account_id\": \"6a96a3ead6e886d42462dd3e\",\n \"to\": \"+14155550100\",\n \"text\": \"<string>\",\n \"knowledge_file_id\": \"6a96a3ead6e886d42462dd3e\",\n \"caption\": \"<string>\",\n \"send_at\": \"2026-09-01T12:00:00.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.voice.wixzel.com/v1/whatsapp/messages")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"6a96a3ead6e886d42462dd3e\",\n \"to\": \"+14155550100\",\n \"text\": \"<string>\",\n \"knowledge_file_id\": \"6a96a3ead6e886d42462dd3e\",\n \"caption\": \"<string>\",\n \"send_at\": \"2026-09-01T12:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voice.wixzel.com/v1/whatsapp/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"6a96a3ead6e886d42462dd3e\",\n \"to\": \"+14155550100\",\n \"text\": \"<string>\",\n \"knowledge_file_id\": \"6a96a3ead6e886d42462dd3e\",\n \"caption\": \"<string>\",\n \"send_at\": \"2026-09-01T12:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"object": "whatsapp_send",
"status": "sent",
"message": {
"id": "6a96a3ead6e886d42462dd3e",
"object": "whatsapp_message",
"account_id": "6a96a3ead6e886d42462dd3e",
"conversation_id": "6a96a3ead6e886d42462dd3e",
"wamid": "<string>",
"direction": "in",
"type": "text",
"text": "<string>",
"transcript": "<string>",
"origin": "contact",
"status": "received",
"error": {
"code": 123,
"message": "<string>"
},
"template": {
"name": "<string>",
"language": "<string>",
"category": "<string>"
},
"pricing": {
"category": "<string>",
"billable": true,
"type": "<string>"
},
"meta_cost_micros": 194000,
"charged_micros": 194000,
"created_at": "2026-09-01T12:00:00.000Z"
},
"scheduled_message": {
"id": "6a96a3ead6e886d42462dd3e",
"object": "whatsapp_scheduled_message",
"account_id": "6a96a3ead6e886d42462dd3e",
"to": "<string>",
"purpose": "reminder",
"send_at": "2026-09-01T12:00:00.000Z",
"status": "pending",
"attempts": 123,
"last_error": "<string>",
"text": "<string>",
"template": {
"name": "<string>",
"language": "<string>",
"parameters": [
"<string>"
]
},
"knowledge_file_id": "6a96a3ead6e886d42462dd3e",
"message_id": "6a96a3ead6e886d42462dd3e",
"created_at": "2026-09-01T12:00:00.000Z"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}
