Text Message
With Link Preview (preview_url: true)

Example of a text message with link preview (shows thumbnail, title, and snippet).
When preview_url is set to true, WhatsApp automatically generates a rich preview for the first link found in the message body — including the website title, description, and thumbnail image.
curl -X POST '<BASE_URL>/api/whatsapp/text' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-d '{
"contacts": [
"<WHATSAPP_USER_PHONE_NUMBER>"
],
"body": "As requested, here's the link to our latest product: https://www.meta.com/quest/quest-3/",
"preview_url": true
}'Without Link Preview (preview_url: false)

Example of a plain text message without any link preview.
When preview_url is false, the link is sent as plain text only. The recipient sees the raw URL without a preview card. This is useful for clean, minimal messages or automated alerts.
curl -X POST '<BASE_URL>/api/whatsapp/text' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-d '{
"contacts": [
"<WHATSAPP_USER_PHONE_NUMBER>"
],
"body": "As requested, here's the link to our latest product: https://www.meta.com/quest/quest-3/",
"preview_url": false
}'Text Formatting
WhatsApp supports limited text formatting in text messages. You can use specific markup characters to format your messages. These formatting characters need to be properly spaced to take effect. Text messages should be encoded in UTF-8 and support emojis. Note that emoji rendering is device-dependent and may appear differently across devices.
| Formatting Type | WhatsApp Syntax | Example Input Text | Example Rendered Output |
|---|---|---|---|
| Bold | *text* | Your total is *$10.50*. | Your total is $10.50. |
| Italic | _text_ | Welcome to _WhatsApp_! | Welcome to WhatsApp! |
| Strikethrough | ~text~ | This is ~better~ best! | This is |
| Monospace | ```text``` | ```print 'Hello World';``` | print 'Hello World'; |
Important Notes:
- Formatting characters must be prefixed with a space character to take effect.
- Text messages support a maximum of 4096 characters.
- Line breaks can be added using
\n(newline character). - Emoji support is device-dependent and may render differently across platforms.
Example with Multiple Formatting
curl -X POST '<BASE_URL>/api/whatsapp/text' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-d '{
"contacts": [
"<WHATSAPP_USER_PHONE_NUMBER>"
],
"body": "Hello! Your order *#12345* is ready. Please visit _our store_ to pick it up. ~Old price~ New price: *$99.99*. Code: ```PICKUP2024```"
}'Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| ACCESS_TOKEN | String Required | Whatsapp external api authorization token provided by business account. | ERYHCDIRMWORYFFEXESJDKR6SAZABA |
| CONTACTS | Array Required | Array of WhatsApp user phone numbers with country code. | ["<WHATSAPP_USER_PHONE_NUMBER>"] |
| BODY_TEXT | String Required | Body text. URLs are automatically hyperlinked. Maximum 4096 characters. | As requested, here's the link to our latest product:
https://www.meta.com/quest/quest-3/ |
| ENABLE_LINK_PREVIEW | Boolean Optional | Set to true to have the WhatsApp client attempt to render a link preview of any URL in the body text string.Default: true | true |