Skip to content

TemplateMessage

An approved WhatsApp template. Can be sent at any time, no active chat window needed.

Fields

  • wabaNumberstringrequired

    Your WhatsApp API number to send from, with country code.

    Example: "919705182126"
  • recipientobjectrequired
    3 properties
    • phoneNumberstringrequired

      The contact's phone number, with country code.

      Example: "919999999999"
    • nameoptionalstring

      Optional display name, saved to the contact if it is new.

      Example: "Raj S"
    • emailoptionalstring

      Optional email, saved to the contact if it is new.

      format: email
  • typeunknownrequired
  • templateobjectrequired
    5 properties
    • namestringrequired

      The template name as approved in your workspace.

      Example: "confirmation"
    • languagestringrequired

      Template language code.

      Example: "en"
    • headeroptionalobject

      Only for templates whose header is not None. Pass text for a text header, url for an image, video, or document header, and filename for document headers.

      3 properties
      • textoptionalstring

        Header text. Text-header templates only.

        Example: "Welcome"
      • urloptionalstring

        Public URL of the image, video, or document.

        format: uri
        Example: "https://example.com/header.jpg"
      • filenameoptionalstring

        File name shown to the contact. Document-header templates only.

        Example: "invoice.pdf"
    • bodyoptionalarray ofstring

      Values for the body variables {{1}}, {{2}}, … in order. Omit when the template has no variables.

      Example: ["John","Premium Plan"]
    • buttonsoptionalarray ofstring

      Values for button variables, in button order. Only for templates with a dynamic button such as a Visit website URL.

      Example: ["button1_param"]
Navigation

Type to search…

↑↓ navigate↵ selectEsc close