Skip to content

Send a message

Sends one WhatsApp message to one recipient. The type field selects the message kind and decides which other fields apply:

type When to use Chat window required
template Approved WhatsApp templates. Works at any time. No
text, image, document, audio, location Free-form messages inside an open conversation. Yes
interactive Reply buttons or a list menu inside an open conversation. Yes

Media URLs (url) must be publicly accessible.

For templates, only pass the header object when the template has a header, only pass body when the template has body variables, and only pass buttons when a button carries a variable (for example a dynamic Visit website URL).

POST
https://api.zacx.io/v1/message/send

Authorisation

  • bearerAuthHTTPrequired

Request bodyJSON

One of the following:

  • TemplateMessagetemplate
    4 properties
    • 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"]
  • TextMessagetext
    4 properties
    • 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
    • textstringrequired
      Example: "Hello, this is a test message!"
  • ImageMessageimage
    5 properties
    • 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
    • urlstringrequired

      Public URL of the image.

      format: uri
      Example: "https://example.com/demo.png"
    • captionoptionalstring
      Example: "Check out this image!"
  • DocumentMessagedocument
    6 properties
    • 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
    • urlstringrequired

      Public URL of the document.

      format: uri
      Example: "https://example.com/document.pdf"
    • filenamestringrequired

      File name shown to the contact.

      Example: "report.pdf"
    • captionoptionalstring
      Example: "Here's the report you requested"
  • AudioMessageaudio
    4 properties
    • 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
    • urlstringrequired

      Public URL of the audio file.

      format: uri
      Example: "https://example.com/sample.mp3"
  • LocationMessagelocation
    7 properties
    • 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
    • latitudenumberrequired
      Example: 37.7749
    • longitudenumberrequired
      Example: -122.4194
    • nameoptionalstring

      Label shown above the address.

      Example: "San Francisco"
    • addressoptionalstring
      Example: "California, USA"
  • InteractiveMessageinteractive
    4 properties
    • 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
    • 2 variants

      One of the following:

Returns

200

The message was accepted. Keep the returned message id to poll delivery status.

JSON
  • statusoptionalstring
  • dataoptionalobject
    1 properties
    • messageIdoptionalstring

      The WhatsApp message id (wamid). Pass it to Get message status.

      Example: "wamid.HBgMOTE5Mjk2MzA0MjI0FQIAERgSMUZDNzgzMjJFNzEwMTkwRjY3AA=="

400

One or more parameters are missing or invalid.

JSON
  • statusstringrequired
  • codestringrequired

    Stable machine-readable error code.

  • messagestringrequired

    Human-readable explanation.

401

The API key is missing or invalid.

JSON
  • statusstringrequired
  • codestringrequired

    Stable machine-readable error code.

  • messagestringrequired

    Human-readable explanation.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close