Templates

List templates

GET/templatesScope templates:read

Returns your approved templates. Each one lists the variables to fill in and its buttons, so you know exactly what Send a template message expects.

Query parameters

  • numberstring

    Only the templates one of your WhatsApp numbers can send. Accepts the number, its Meta phone_number_id or its Wamafy id.

  • statusstring

    Review status to return. Defaults to approved. Use all to follow a template you just submitted.

    One of: approved, pending, rejected, paused, disabled, all

Good to know

  • variableFormat is positional (keys "1", "2") or named (keys are placeholder names such as customer_name). Use these keys in variables when you send.
  • A button with needsValue: true must be given a value in buttons when you send, at the same index.
  • A template with an order_details button (Review and pay, a payment inside WhatsApp) cannot be sent through the API: only renewal reminders in Wamafy send it, and a send is refused with the reason.
  • headerType is image, video, document, text or null. For the first three, send the file as headerMediaUrl.
  • Templates belong to a WhatsApp Business Account. Two numbers in the same account share them.

Errors

StatusCodeWhen
404NOT_FOUNDnumber does not match any of your WhatsApp numbers.

Plus the errors any endpoint can return, such as a missing key or scope. See Errors.

# macOS, Linux or Git Bash, with WAMAFY_API_KEY set. The quoting does not work in Windows cmd or PowerShell.
curl "https://api.wamafy.com/api/v1/public/templates" \
  -H "Authorization: Bearer $WAMAFY_API_KEY"
Response 200
{
  "success": true,
  "data": [
    {
      "name": "order_update",
      "language": "en",
      "category": "UTILITY",
      "status": "APPROVED",
      "bodyText": "Hi {{1}}, your order {{2}} is on its way.",
      "headerType": null,
      "variableFormat": "positional",
      "variables": [
        {
          "key": "1",
          "example": "Priya"
        },
        {
          "key": "2",
          "example": "#1043"
        }
      ],
      "buttons": [
        {
          "index": 0,
          "type": "url",
          "text": "Track order",
          "needsValue": true,
          "tracked": true
        },
        {
          "index": 1,
          "type": "quick_reply",
          "text": "Talk to us",
          "needsValue": false,
          "tracked": false
        }
      ]
    }
  ]
}

Base URL https://api.wamafy.com/api/v1/public

    List templates - Wamafy API