Browse guides

Sending Text Messages

How to send a plain text message on the WhatsApp Cloud API, with or without URL preview.

On this page

Sending a text message through the WhatsApp Cloud API uses type: "text". Text messages can contain plain text or URLs. When a URL is included, you can optionally turn on a URL preview that shows the link's thumbnail, title, and description below the message.

Basic text message#

json
{
  "messaging_product": "whatsapp",
  "to": "919959623255",
  "type": "text",
  "text": {
    "body": "Hello! How can I help you?"
  }
}

This works only inside the 24-hour customer service window — within 24 hours of the customer's last message to you. Outside that window, plain text is blocked and you must send an approved template instead. See The 24-hour window.

URL preview — on vs off#

When your message body contains a URL, WhatsApp can show a preview card with the website's thumbnail, title, and description below the message text.

json
{
  "messaging_product": "whatsapp",
  "to": "919959623255",
  "type": "text",
  "text": {
    "preview_url": true,
    "body": "Check this: https://www.youtube.com"
  }
}
preview_urlResult
false (default)Plain text only, no card
trueWhatsApp fetches the URL and shows a preview card

Rule: The URL must be present in the body text. If there is no URL in the body, preview_url: true does nothing.

URL preview example
A WhatsApp text message with URL preview enabled, showing the thumbnail and link details below the text.
Link preview example
The link preview card fetched automatically from the URL in the message body.

Frequently asked#

Why can't I send a normal text message to a customer?

Free text only works inside the 24-hour window after the customer last messaged you. Outside it, use an approved template. See The 24-hour window.

My text message failed — why?

Most likely the 24-hour window has closed. If the customer's last message is over 24 hours old, switch to a template message.

The URL preview isn't showing even though I set preview_url: true — why?

Check that the URL is actually in the body text. Also, the URL must be publicly accessible and return a valid page with Open Graph meta tags for WhatsApp to build the preview.

What is the maximum length for a text message body?

4096 characters.

Gotchas & common mistakes#

Still stuck? Open a support ticket and our team will help.