Skip to content

Create WhatsApp template

Request

Create a new WhatsApp template. The template body is limited to 1024 characters.

Security
ApiKeyAuth
Bodyapplication/jsonrequired

The WhatsApp template to create

namestringrequired

Template name; may only contain lowercase letters, digits, and underscores

languagestringrequired

Supported language codes: ar, bg, hr, cs, da, nl, en, et, fi, fr, de, el, he, hu, it, ja, ko, lv, lt, nb, pl, ro, ru, sr, sk, sl, es, sv, th, tr, uk, pt_PT, zh_CN, zh_TW, zh_HK

templateTypeMedia (object) or Text (object)(TemplateTypeInput)required
One of:

Template body and type; use Text for text-only messages, Media for messages with an attachment

categorystringrequired

values: [UTILITY, MARKETING]

variablesobject(Map_String)required

Sample values for the template's placeholders (e.g. {"1": "John"}), submitted to WhatsApp as example content during template approval

POST
/beta/whatsapp/templates
curl -i -X POST \
  https://dev.dixa.io/beta/whatsapp/templates \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "order_confirmation",
    "language": "en",
    "templateType": {
      "body": "Your order {{1}} has been confirmed.",
      "_type": "Text"
    },
    "category": "UTILITY",
    "variables": {
      "1": "12345"
    }
  }'

Responses

The created WhatsApp template

Bodyapplication/json
dataobject(CreateTemplateOutput)required
Response
{ "data": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } }