waiaconnect

Documentation / Complete

Create, list and sync templates

POST /v1/templates

You can now manage templates from Connect: GET /v1/templates (list by number/status/category), POST /v1/templates (create — the pre-checker runs BEFORE Meta: a blocking issue means we never call Meta, so you don't burn the slow reject cycle), POST /v1/templates/precheck (validate a draft live), GET /v1/templates/catalog + POST /v1/templates/seed (adopt approve-safe templates by rubro), POST /v1/templates/bulk (apply them to many numbers), POST /v1/templates/sync and DELETE /v1/templates/:id. A template is born PENDING; subscribe to template.status_changed to be notified when Meta approves or rejects it, with a human-readable reason. Status is refreshed every few minutes (not in real time), and Meta itself can take from minutes to hours to review a template — the event arrives, with that delay. Use the per-connection Refresh button in the panel for an on-demand check.

curl -X POST https://api.waiaconnect.com/v1/templates \
  -H "Authorization: Bearer wc_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"connectionId":"conn_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","name":"order_confirmation","language":"es","category":"UTILITY","body":{"text":"Hola {{1}}, tu pedido {{2}} está listo.","examples":["María","#A-1042"]}}'
# Pre-checked before Meta. On success the template is PENDING; subscribe to
# template.status_changed to hear when Meta approves or rejects it.
const res = await fetch("https://api.waiaconnect.com/v1/templates", {
  method: "POST",
  headers: {
    "Authorization": "Bearer wc_live_YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  // Pre-checked before Meta; give every {{n}} an example (the #1 rejection cause).
  body: JSON.stringify({
  "connectionId": "conn_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "name": "order_confirmation",
  "language": "es",
  "category": "UTILITY",
  "body": {
    "text": "Hola {{1}}, tu pedido {{2}} está listo.",
    "examples": [
      "María",
      "#A-1042"
    ]
  }
})
});
console.log(await res.json());
<?php
$ch = curl_init("https://api.waiaconnect.com/v1/templates");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer wc_live_YOUR_API_KEY",
    "Content-Type: application/json",
  ],
  // Pre-checked before Meta; each {{n}} needs an example.
  CURLOPT_POSTFIELDS => json_encode(["connectionId" => "conn_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","name" => "order_confirmation","language" => "es","category" => "UTILITY","body" => ["text" => "Hola [[1]], tu pedido [[2]] está listo.","examples" => ["María","#A-1042"]]]),
]);
echo curl_exec($ch);
import requests
res = requests.post("https://api.waiaconnect.com/v1/templates",
  headers={ "Authorization": "Bearer wc_live_YOUR_API_KEY" },
  # Pre-checked before Meta; each "{{n}}" needs an example (the #1 rejection cause).
  json={"connectionId":"conn_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","name":"order_confirmation","language":"es","category":"UTILITY","body":{"text":"Hola {{1}}, tu pedido {{2}} está listo.","examples":["María","#A-1042"]}})
print(res.json())

The #1 rejection cause is a {{n}} variable with no example — give each one an example (the pre-checker generates them).

Categories: UTILITY (transactional, cheapest) · MARKETING (promos, more per message) · AUTHENTICATION (codes). Marking a transactional message as MARKETING makes you overpay.

⚠ A created template cannot be edited. If you got it wrong, create another.