> ## Documentation Index
> Fetch the complete documentation index at: https://meta-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Text Messages

> Text messages are messages containing only a text body and an optional link preview.

<Frame>
  <img src="https://scontent.fixe1-1.fna.fbcdn.net/v/t39.2365-6/440742591_797870012016470_1123226266833971975_n.png?_nc_cat=106&ccb=1-7&_nc_sid=e280be&_nc_ohc=gR4S8TQFizYQ7kNvgFSxF45&_nc_oc=AdipnabRPBAb025oh7l5xtHsCelyinwLXwWscN9zrnelyxf0ubcOJOF2oZ8HNSmCnhD90CxZbZFF-dOQf6k-h1rN&_nc_zt=14&_nc_ht=scontent.fixe1-1.fna&_nc_gid=A6pSCadDxakx4oDGqvF6FAy&oh=00_AYBeGRI-mf5eXz_u4DpkCKHRlq_HrW-V-lE1Ajb9-Hkqng&oe=67D595AB" />
</Frame>

## Sending Text Messages

Use the [POST /\<WHATSAPP\_BUSINESS\_PHONE\_NUMBER\_ID>/messages](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages) endpoint to send a text message to a WhatsApp user.

### Request Syntax

```bash theme={null}
POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages
```

### Post body

```JSON theme={null}
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<WHATSAPP_USER_PHONE_NUMBER>",
  "type": "text",
  "text": {
    "preview_url": <ENABLE_LINK_PREVIEW>,
    "body": "<BODY_TEXT>"
  }
}
```

### Post Body Parameters

<ParamField body="<BODY_TEXT>" type="string" required>
  Message body text. Supports URLs.

  Maximum 4096 characters.

  Example: As requested, here's the link to our latest product: [https://www.meta.com/quest/quest-3/](https://www.meta.com/quest/quest-3/)
</ParamField>

<ParamField body="<ENABLE_LINK_PREVIEW>" type="boolean" optional>
  Set to `true` to have the WhatsApp client attempt to render a link preview of any URL in the body text string.

  See [Link Preview](https://developers.facebook.com/docs/whatsapp/cloud-api/messages/#link-preview) below.

  Example: true
</ParamField>

<ParamField body="<WHATSAPP_USER_PHONE_NUMBER>" type="string" required>
  WhatsApp user phone number.

  Example: +16505551234
</ParamField>

## Link Preview

You can have the WhatsApp client attempt to render a preview of the first URL in the body text string, if it contains one. URLs must begin with `http://` or `https://`. If multiple URLs are in the body text string, only the first URL will be rendered.

If omitted, or if unable to retrieve a link preview, a clickable link will be rendered instead.

## Example Request

Example Request to send a text message with link previews enabled and a body text string that contains a link.

<RequestExample>
  ```JSON theme={null}
  curl 'https://graph.facebook.com/v22.0/106540352242922/messages' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer EAAJB...' \
  -d '
  {
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "+16505551234",
    "type": "text",
    "text": {
      "preview_url": true,
      "body": "As requested, here'\''s the link to our latest product: https://www.meta.com/quest/quest-3/"
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```JSON theme={null}
  {
    "messaging_product": "whatsapp",
    "contacts": [
      {
        "input": "+16505551234",
        "wa_id": "16505551234"
      }
    ],
    "messages": [
      {
        "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
      }
    ]
  }
  ```
</ResponseExample>
