> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zixflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Whatsapp Text Message

You can send messages only if the user session is already active; otherwise, the messages will fail. We recommend sending a approved template message the first time you contact users. Once the session is open, you can send unlimited messages via these APIs. For more info [click here](https://help.zixflow.com/en/articles/65-what-is-conversation-based-pricing)

#### Body

<ParamField body="to" type="string" required placeholder="Enter phone number">
  Specifies the recipient's phone number in international format (e.g.,
  "1xxxxxxxxxx").
</ParamField>

<ParamField body="phoneId" type="string" required placeholder="Enter phone ID (Not Phone Number)">
  This is the unique identifier associated with the sender's phone number given
  by WhatsApp. Find the Phone ID on the Zixflow WhatsApp Settings page next to
  the number. [Whatsapp
  Settings](https://app.zixflow.com/campaign/settings/whatsapp)
</ParamField>

<ParamField body="type" type="string" required placeholder="Enter Message Type" initialValue="text" default="text">
  To send text messages keep message type as "text"
</ParamField>

<ParamField body="text" type="object" required>
  A Text Object consists of the following fields and formatting options:

  <Expandable title="text" defaultOpen="true">
    <ParamField body="preview_url" type="boolean" required>
      Optional.

      By default, WhatsApp recognizes URLs and makes them clickable, but you can also include a preview box with more information about the link. Set this field to true if you want to include a URL preview box.

      The majority of the time when you send a URL, whether with a preview or not, the receiver of the message will see a URL that they can click on.

      URL previews are only rendered after one of the following has occurred:

      The business has sent a message template to the user.

      The user initiates a conversation with a "click to chat" link.

      The user adds the business phone number to their address book and initiates a conversation.

      Default: false
    </ParamField>

    <ParamField body="body" type="string" required>
      Required for text messages.

      The text of the text message that can contain URLs and supports formatting. To view available formatting options, see Text Object Formatting Options.

      If you include URLs in your text and want to include a preview box in text messages ("preview\_url": true), ensure it starts with http\:// or https\://. You must include a hostname, since IP addresses are not matched.

      Maximum length: 4096 characters.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="source" type="string" placeholder="Enter Source Type" initialValue="API" default="API">
  If the "linkWithRecord" is set to true, the source from which the WhatsApp
  message is sent should be mentioned; otherwise, it defaults to API.
</ParamField>

<ParamField body="linkWithRecord" type="boolean" placeholder="Enter true or false">
  Specify whether to associate the current message with a record and display it
  in the inbox. Set it to "true" for linking with a record; otherwise, it
  defaults to "false."
</ParamField>

<ParamField body="reportURL" type="string" placeholder="Enter report URL">
  (Optional) Specify the URL where the user's report and deliveries should be
  delivered.
</ParamField>

<ParamField body="submissionStatus" type="boolean" placeholder="Enter true or false">
  Indicates whether to wait for the submission status. Set it to "true" if you
  want to wait for the submission status; otherwise, it defaults to "false."
</ParamField>

#### Response

<ResponseField name="status" type="boolean">
  Indicates whether the call was successful. true if successful, false if not.
</ResponseField>

<ResponseField name="message" type="string">
  success or error response message
</ResponseField>

<ResponseExample>
  ```json 200-Success theme={null}
  {
    "status": true,
    "message": "Message sent successfully"
  }
  ```

  ```json 400-Bad Request theme={null}
  {
    "status": false,
    "message": "Invalid data Provided"
  }
  ```

  ```json 401-Unauthorised theme={null}
  {
    "status": false,
    "message": "Unauthorised"
  }
  ```
</ResponseExample>
