How do I make my first API call?
Replace $FLAXXA_KEY with a key from your workspace. The first call returns a real id you can use for the next ones.
curl -X POST https://flaxxa.com/api/wapi/v1/messages/template \
-H "Authorization: Bearer flx_live_YOUR_KEY" \
-H "Accept: application/json" -H "Content-Type: application/json" \
-d '{
"to": "919876543210",
"template": "order_update",
"language": "en",
"body_params": ["Asha", "ORD-18429"],
"button_params": { "0": "ORD-18429" }
}'$res = Http::withToken(env('FLAXXA_WAPI_KEY'))->acceptJson()
->post('https://flaxxa.com/api/wapi/v1/messages/template', [
'to' => $customer->phone, // E.164 or plain international
'template' => 'order_update',
'language' => 'en',
'body_params' => [$customer->name, $order->number],
])->throw()->json();
// $res['message_id'], $res['message_wamid'], $res['status'] === 'success'const res = await fetch("https://flaxxa.com/api/wapi/v1/messages/text", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.FLAXXA_WAPI_KEY}`, Accept: "application/json", "Content-Type": "application/json" },
body: JSON.stringify({ to: "919876543210", text: "Your order ORD-18429 has shipped 🚚" }),
});
const { data } = await res.json(); // data.id, data.wa_message_id, data.status
// text / media / buttons / list / flow need an open 24-hour window — otherwise send a template.import requests
r = requests.post("https://flaxxa.com/api/wapi/v1/messages/template",
headers={"Authorization": f"Bearer {KEY}", "Accept": "application/json"},
json={"to": "919876543210", "template": "order_update", "language": "en",
"body_params": ["Asha", "ORD-18429"]})
r.raise_for_status()
print(r.json()["message_wamid"])POST /api/wapi/v1/messages/template HTTP/1.1
Host: flaxxa.com
Authorization: Bearer flx_live_·············
Content-Type: application/json
{
"to": "919876543210",
"template": "order_update",
"language": "en",
"body_params": ["Asha", "ORD-18429"],
"button_params": { "0": "ORD-18429" }
}HTTP/1.1 201 Created
Content-Type: application/json
{
"status": "success",
"message_id": 9124,
"message_wamid": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgS…",
"data": {
"id": 9124, "wa_message_id": "wamid.HBgM…", "status": "sent",
"conversation_id": 412, "wapi_number_id": 3, "to": "+919876543210",
"type": "template", "sent_at": "2026-10-27T10:00:00+00:00"
}
}
