waiaconnect

Documentation / Essential

Send a text message

POST /v1/messages

POST /v1/messages with type: "text". Returns 202 (accepted, NOT sent): it is queued and drained at a controlled rate. The Idempotency-Key header (UUID) is required — retrying with the same key returns the same record (200) instead of duplicating. Identify the sending number with connectionId (conn_…) or from (phoneNumberId).

curl -X POST https://api.waiaconnect.com/v1/messages \
  -H "Authorization: Bearer wc_live_YOUR_API_KEY" \
  -H "Idempotency-Key: REPLACE-WITH-A-UNIQUE-ID" \
  -H "Content-Type: application/json" \
  -d '{"connectionId":"conn_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","to":"5493511234567","type":"text","text":{"body":"Hello from WAIA Connect 👋"}}'
const res = await fetch("https://api.waiaconnect.com/v1/messages", {
  method: "POST",
  headers: {
    "Authorization": "Bearer wc_live_YOUR_API_KEY",
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "connectionId": "conn_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "to": "5493511234567",
  "type": "text",
  "text": {
    "body": "Hello from WAIA Connect 👋"
  }
})
});
console.log(await res.json()); // { id: "msg_…", status: "queued" }
<?php
$ch = curl_init("https://api.waiaconnect.com/v1/messages");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer wc_live_YOUR_API_KEY",
    "Idempotency-Key: " . bin2hex(random_bytes(16)),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode(["connectionId" => "conn_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","to" => "5493511234567","type" => "text","text" => ["body" => "Hello from WAIA Connect 👋"]]),
]);
echo curl_exec($ch);
import requests, uuid
res = requests.post("https://api.waiaconnect.com/v1/messages",
  headers={
    "Authorization": "Bearer wc_live_YOUR_API_KEY",
    "Idempotency-Key": str(uuid.uuid4()),
  },
  json={"connectionId":"conn_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","to":"5493511234567","type":"text","text":{"body":"Hello from WAIA Connect 👋"}})
print(res.json())  # {"id": "msg_…", "status": "queued"}

to is E.164 (digits only, 8–15). The example uses your own number so you can test against yourself.

Response: { id: "msg…", status: "queued" } (or held with a reason). Track the status with GET /v1/messages/:id._