Updated on November 24, 2026
To send bold text with the WhatsApp Business API, wrap the words in asterisks inside the message text, as in *order confirmed*. The Cloud API has no style field: the text goes out as a plain string and the customer’s WhatsApp app renders the markers. The same applies to italics with underscores, strikethrough with tildes, monospace with three backticks, lists, quotes and inline code.
Below: the official syntax, JSON with line breaks, where formatting works and the most common mistakes.
Formatting syntax supported by WhatsApp
The reference is the WhatsApp Help Center article How to format your messages. It lists eight formats:
| Format | How to write it | Example in the text |
|---|---|---|
| Italics | underscore before and after | _text_ |
| Bold | asterisk before and after | *text* |
| Strikethrough | tilde before and after | ~text~ |
| Monospace | three backticks before and after | see the JSON below |
| Bulleted list | asterisk or hyphen + space at the start of the line | - text |
| Numbered list | number, period and space at the start of the line | 1. text |
| Quote | greater-than sign + space at the start of the line | > text |
| Inline code | one backtick before and after | see the JSON below |
Two notes from the FAQ itself matter for developers:
- Formatting cannot be turned off. If a coupon code, a temporary password or a file name contains underscores or asterisks, the app may render part of it in italics or bold.
- The newer formats have limited support. The FAQ says lists, quotes and inline code are available only on WhatsApp Web and WhatsApp for Mac. Before relying on them in an important message, test on the devices your customers use (Android and iPhone).
Bold, italics, strikethrough and monospace are the classic formats and the safest choice for business messages.
How to send formatted text with the Cloud API
A text message uses type: "text" and the content goes in text.body. The markers go straight into the string. Line breaks are the \n character inside the JSON:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "15551234567",
"type": "text",
"text": {
"preview_url": false,
"body": "*Order confirmed* ✅\n\nHi Anna! We received order _#4821_.\n\n- 1x Basic T-shirt\n- 2x Sports socks\n\nCoupon for your next order: ```COMEBACK10```\n~Shipping $9.90~ Free shipping"
}
}
On the customer’s phone, “Order confirmed” shows in bold, the order number in italics, the items one per line with a hyphen, the coupon in monospace and the old shipping price struck through.
The call is a POST to https://graph.facebook.com/<version>/<PHONE_NUMBER_ID>/messages with the token in the Authorization: Bearer header, like any send. Full cURL, Node.js and Python examples are in how to send a message with the WhatsApp API.
Rules for the text field according to the text messages documentation:
- Maximum
bodylength: 4,096 characters. Markers and every\ncount as characters. preview_url. Withtrue, the app tries to show a preview of the first link in the text, which must start withhttp://orhttps://. Without the field, the link is clickable but has no preview.
Free-form text messages can only be sent inside the 24-hour customer service window opened by the customer’s last message. Outside it, only templates.
Line breaks in your code
The most common mistake is not a WhatsApp one, it is a JSON one. A real line break inside a string breaks parsing. Always use the escaped \n, or let your library serialize the object:
const body = [
"*Order confirmed* ✅",
"",
`Hi ${name}! We received order _#${orderId}_.`,
"",
...items.map((i) => `- ${i.qty}x ${i.name}`),
].join("\n");
const payload = {
messaging_product: "whatsapp",
to: phone,
type: "text",
text: { body },
};
// JSON.stringify turns each line break into \n
await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
Want to try it while you read? Create a Vectalk account and send your first message through the official API. Create free account →
Formatting in message templates
Outside the 24-hour window, the message must be an approved template. Formatting works there too, with different rules per component. Limits come from the template components page:
| Component | Limit | Formatting |
|---|---|---|
| Text header | 60 characters, 1 variable | The docs say not to use Markdown special characters |
| Body | 1,024 characters, multiple variables | No restriction in the docs; test the preview |
| Footer | 60 characters | No specific rule in the docs; test first |
| Button text | 25 characters | Treat as plain text |
In practice:
- No asterisks in the header. Since the docs ask you not to use Markdown characters in the header, keep emphasis for the body.
- Format the fixed text, not the variable. Write something like
Your order *{{1}}* has shippedin the body. The marker stays fixed and the variable only carries the value. Review stays predictable, and a value with special characters cannot break the layout. - Type line breaks in the editor. In WhatsApp Manager you type the body with Enter. When creating the template through the API, use
\nin thetextstring of theBODYcomponent. - Check the preview. WhatsApp Manager shows a template preview. After approval, send a test to your own number.
For variable values at send time, the docs do not publish a detailed rule on allowed characters. If a send fails with error 132018 (generic parameter validation error) or 132012 (parameter formatted incorrectly), review the value and test a simplified version. At template creation, error 2388040 means a field exceeds its character limit and 2388299 means a variable at the start or end of the text (error codes). Each field is covered in the guides to character limits and template variables.
For the full send flow with variables, media and buttons, see how to send a WhatsApp template message via API and the guide to WhatsApp API message templates.
Formatting in interactive messages
Reply buttons, lists and the CTA URL button have a body of up to 1,024 characters (4,096 for lists). Body text follows the same logic as a text message: the markers go in the string. The interactive messages docs do not describe formatting in button titles, list rows or action labels, so treat those fields as short plain text: 20 characters for a reply button title and 24 for a list row title, according to the reply buttons docs and the list messages docs.
Common formatting mistakes
1. Two asterisks instead of one. WhatsApp uses a single asterisk for bold. Standard Markdown, common in AI output and CMS editors, uses two. The result does not follow the FAQ syntax and the customer may see leftover asterisks.
2. A space between the marker and the word. According to the FAQ, an asterisk or hyphen followed by a space at the start of a line is a list item. A line that starts with an asterisk and a space becomes a list, not bold text.
3. Special characters in customer data. A username with an underscore, a coupon code with an asterisk, a random Pix key (Pix is Brazil’s instant payment system): since formatting cannot be turned off, these values may show partly in italics. For codes, use monospace or the copy-code button in templates.
4. Hash headings and Markdown links. The FAQ does not list headings or formatted links. A line starting with a hash sign shows the symbol, and a link in brackets-and-parentheses format shows raw. Use bold for headings and paste the full URL.
5. Hand-built JSON. A real line break, unescaped quotes or a stray backslash cause a parse error before the message is even sent. Serialize with your language’s library.
A simple Markdown-to-WhatsApp converter
If the text comes from an AI model or an editor that outputs Markdown, convert it before sending. A minimal JavaScript function:
function markdownToWhatsApp(text) {
return text
// single-asterisk Markdown italics become underscores
.replace(/(?<![*\w])\*(?![\s*])(.+?)(?<![\s*])\*(?![*\w])/g, "_$1_")
// double-asterisk bold becomes a single asterisk
.replace(/\*\*(.+?)\*\*/g, "*$1*")
// double-tilde strikethrough becomes a single tilde
.replace(/~~(.+?)~~/g, "~$1~")
// headings become bold
.replace(/^#{1,6}\s+(.+)$/gm, "*$1*")
// links become "text: url"
.replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g, "$1: $2");
}
Order matters: single-asterisk italics are converted before bold, so converted bold is not read as italics afterwards. Test with your bot’s real texts, because simple converters do not cover every Markdown case.
For tone, length and structure of promotional messages, see how to write WhatsApp marketing messages.
How to do this with Vectalk
Vectalk is a proxy for the official WhatsApp API: the request body is the same as the Cloud API, so formatting works the same way. Only the base URL and the token change, as described in the Vectalk documentation:
curl --request POST \
--url https://apis.vectalk.com.br/api/messages \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"messaging_product": "whatsapp",
"to": "15551234567",
"type": "text",
"text": { "body": "*Payment approved* ✅\nYour order _#4821_ is being prepared." }
}'
Templates are created in the panel’s templates area, which includes a template library (Biblioteca de Modelos) to start from ready-made texts. The panel logs help you check the payload that went out when formatting does not show as expected. To get started, create your account at apps.vectalk.com.br/register.
Frequently asked questions
How do I send bold text with the WhatsApp API?
Wrap the words in single asterisks inside the text.body field, for example *Order confirmed*. The API has no style parameter: the customer’s app renders the markers.
Can I use standard Markdown with double asterisks?
It does not follow the syntax documented by WhatsApp, which uses one asterisk for bold. Convert the text before sending, especially when it comes from an AI model.
How do I add a line break in a message sent through the API?
Use \n inside the JSON string. For a blank line between paragraphs, use \n\n. In templates created in WhatsApp Manager, just type the line break in the editor.
Can I use bold in a template header?
The components documentation asks you not to use Markdown special characters in the text header. Use formatting in the template body instead.
Do lists and quotes work on every phone?
The WhatsApp FAQ says lists, quotes and inline code are available only on WhatsApp Web and WhatsApp for Mac. Test on your audience’s devices before using these formats in important messages.
Official sources consulted on November 24, 2026: WhatsApp: how to format your messages · Text messages · Template components · Interactive reply buttons messages · Interactive list messages · Error codes · Vectalk documentation
Put your business on the official WhatsApp
Create your account, connect your number to the official API (you can keep the app with coexistence) and start serving customers and sending messages.
