curl --request POST \
--url https://api.routa.chat/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"to": "+5581999999999",
"text": "Hi! Your order is confirmed."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ',
to: '+5581999999999',
text: 'Hi! Your order is confirmed.'
})
};
fetch('https://api.routa.chat/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.routa.chat/v1/messages"
payload = {
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"to": "+5581999999999",
"text": "Hi! Your order is confirmed."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.routa.chat/v1/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([
'channel' => 'chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ',
'to' => '+5581999999999',
'text' => 'Hi! Your order is confirmed.'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.routa.chat/v1/messages"
payload := strings.NewReader("{\n \"channel\": \"chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ\",\n \"to\": \"+5581999999999\",\n \"text\": \"Hi! Your order is confirmed.\"\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))
}{
"id": "msg_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"direction": "outbound",
"origin": "api",
"from": "+5581988888888",
"to": "+5581999999999",
"content": {
"type": "text",
"body": "<string>"
},
"content_redacted_at": null,
"status": "accepted",
"failure_code": null,
"metadata": {},
"accepted_at": "2026-09-04T13:22:41.031Z",
"sent_at": "2026-09-04T13:22:41.031Z",
"delivered_at": "2026-09-04T13:22:41.031Z",
"read_at": null,
"failed_at": null
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}Send message
Sends a text or template message through a channel.
The response is 202 Accepted: the message is durably stored, but not delivered yet. Follow sent, delivered, read and failed through webhooks or GET /v1/messages/{id}.
Provide text or template. With neither, the API returns content_rejected. With both, it sends the template and ignores text. Send the Idempotency-Key header to retry the request safely. See Idempotency.
A template send carries exactly what the template asks for: one value in body_parameters for each body variable, header_parameter when the header is text with a variable or is media, and one item in button_parameters for each URL button with a variable. A missing, extra, mismatched or empty parameter returns 422 content_rejected, and so does a value that WhatsApp refuses. See Header and buttons.
The channel, the recipient, the template and the header file are validated when the message is accepted, so the error comes back right away. A refused request stores no message and uses none of your allowance. An imported, read-only template returns template_not_sendable.
curl --request POST \
--url https://api.routa.chat/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"to": "+5581999999999",
"text": "Hi! Your order is confirmed."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ',
to: '+5581999999999',
text: 'Hi! Your order is confirmed.'
})
};
fetch('https://api.routa.chat/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.routa.chat/v1/messages"
payload = {
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"to": "+5581999999999",
"text": "Hi! Your order is confirmed."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.routa.chat/v1/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([
'channel' => 'chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ',
'to' => '+5581999999999',
'text' => 'Hi! Your order is confirmed.'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.routa.chat/v1/messages"
payload := strings.NewReader("{\n \"channel\": \"chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ\",\n \"to\": \"+5581999999999\",\n \"text\": \"Hi! Your order is confirmed.\"\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))
}{
"id": "msg_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"direction": "outbound",
"origin": "api",
"from": "+5581988888888",
"to": "+5581999999999",
"content": {
"type": "text",
"body": "<string>"
},
"content_redacted_at": null,
"status": "accepted",
"failure_code": null,
"metadata": {},
"accepted_at": "2026-09-04T13:22:41.031Z",
"sent_at": "2026-09-04T13:22:41.031Z",
"delivered_at": "2026-09-04T13:22:41.031Z",
"read_at": null,
"failed_at": null
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}Authorizations
Headers
A unique key per logical message (a UUID v4, for example). Repeating the request with the same key and the same body returns the original response, with the Idempotent-Replay: true header. A key reused with a different body returns 409 idempotency_key_reuse. The record is kept for 24 hours.
Body
Body of the text message, up to 4096 characters. It is ignored when the request also carries template.
"Hi! Your order is confirmed."
Response
Accepted. Processing is asynchronous
Where an outbound message came from: api (sent through Routa) or business_app (the business sent it from the WhatsApp Business app, on a number connected in coexistence mode). A business_app message is not billed and does not count as usage. It is null on an inbound message.
api, business_app "api"