Send an approved template message to a single recipient, or to a small batch at once.
Endpoint
POST https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/messages
Request body
to
string | string[]
required
A single E.164 number, or an array of up to 100 numbers.
Must be template for this use case.
Response
A single recipient returns one message object. Multiple recipients return a batch summary plus a per-recipient results array — there’s no separate polling endpoint; the message_id in each result is what you look up via GET /v1/messages/{message_id}.
curl https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/messages \
-H "Authorization: Bearer tvk_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template": {
"name": "order_shipped",
"language": "en",
"variables": ["Priya", "#4821", "July 16"]
}
}'
curl https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/messages \
-H "Authorization: Bearer tvk_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": ["+919876543210", "+919812345678"],
"type": "template",
"template": { "name": "festive_offer", "language": "en", "variables": ["Priya"] }
}'
{
"message_id": "5a9e6f1c-9e2f-4b1c-8a5c-7e8f9a0b1c2d",
"status": "accepted"
}
{
"batch_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"recipient_count": 2,
"failed_count": 0,
"status": "queued",
"results": [
{ "to": "+919876543210", "ok": true, "message_id": "5a9e6f1c-9e2f-4b1c-8a5c-7e8f9a0b1c2d" },
{ "to": "+919812345678", "ok": true, "message_id": "8b2d4e5f-1a3b-4c5d-9e6f-7a8b9c0d1e2f" }
]
}
This endpoint sends recipients concurrently, not through the wave-throttled broadcast engine the dashboard uses. It’s built for small, immediate sends (confirmations, alerts) — for anything larger than 100 recipients, use the dashboard’s broadcast tool, which paces sends properly for large audiences.
There’s no batch_id lookup endpoint yet — track individual sends via the results array’s message_ids, or via the message.status webhook.