Text Formatting (BB Codes)
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
Chatbot messages support BB codes: text highlighting, quotes, links, line breaks, and control tags for commands.
Currently, the platform only supports BBCode.
Support for Markdown will be added in future updates.
At this time, Markdown is not supported.
Methods that support formatting:
Chatbots 2.0 (imbot.v2)
- imbot.v2.Chat.Message.send — send a message on behalf of the bot
- imbot.v2.Chat.Message.update — update the text of a sent message
- imbot.v2.Command.answer — send a response to a command
Chats (im)
- im.message.add — send a message in a chat
- im.message.update — update a sent message
Notifications (im.notify)
- im.notify — send a notification
- im.notify.personal.add — send a personal notification
- im.notify.system.add — send a system notification
Outdated Chatbots (imbot)
- imbot.message.add — send a message on behalf of the chatbot
- imbot.message.update — update a sent message from the chatbot
- imbot.command.answer — send a response to a chatbot command
Supported BB Codes
Text Formatting
|
Code |
Purpose |
Example |
|
|
Bold text |
|
|
|
Italic |
|
|
|
Underline |
|
|
|
Strikethrough |
|
|
|
Font size |
|
|
|
Text color |
|
For size, a range of 8-30px is used. For color, HEX values of 3 or 6 characters are supported.
Links and Navigation
|
Code |
Purpose |
Example |
||
|
|
Link where text equals URL |
|
||
|
|
Link with custom text |
|
||
|
|
User mention |
|
||
|
|
Mention all chat participants |
|
||
|
|
Chat mention |
|
||
|
`[chat=imol |
ID]...[/chat]` |
Mention open channel |
`[chat=imol |
789]Line[/chat]` |
|
|
Link to a message in a dialog |
|
Quotes and Code
|
Code |
Purpose |
Example |
|
|
Quote line (at the beginning of the line) |
|
|
|
Full quote of a message |
|
|
|
Code block |
|
Images and Icons
|
Code |
Purpose |
Example |
|
|
Insert image |
|
|
|
Inline icon |
|
For the img tag, the size parameter is required: small, medium, large. A space is required after the URL before [/img].
Actions and Calls
|
Code |
Purpose |
Example |
|
|
Insert command into input field |
|
|
|
Immediately send command |
|
|
|
Link to call |
|
|
|
Number taken from text |
|
Date/Time and Files
|
Code |
Purpose |
Example |
|
|
Formatted date/time in user's timezone |
|
|
|
Link to a file on Bitrix24.Drive |
|
Service Elements
|
Element |
Purpose |
|
|
Line break |
|
|
Line break |
|
|
Tabulation |
Examples
Basic Formatting
[b]bold[/b] text
[u]underlined[/u] text
[i]italic[/i] text
[s]strikethrough[/s] text

Line Breaks and Quotes
First line[br]Second line
>>first line of quote
>>second line of quote


Links and Commands
[url=https://bitrix24.com]Link to Bitrix24[/url]
[send=/help]Show help[/send]
[put=/search]Enter search string[/put]


Icons
[icon=http://files.shelenkov.com/images/unicorn.png size=30 title=Unicorn]

Example of Sending a Formatted Message
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"botId":456,"botToken":"my_bot_token","dialogId":"chat2725","fields":{"message":"[b]Important message[/b][br]Open [url=https://bitrix24.com]site[/url][br][send=/help]Help[/send]"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/imbot.v2.Chat.Message.send
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"botId":456,"dialogId":"chat2725","fields":{"message":"[b]Important message[/b][br]Open [url=https://bitrix24.com]site[/url][br][send=/help]Help[/send]"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/imbot.v2.Chat.Message.send
try {
const response = await $b24.callMethod('imbot.v2.Chat.Message.send', {
botId: 456,
dialogId: 'chat2725',
fields: {
message: '[b]Important message[/b][br]Open [url=https://bitrix24.com]site[/url][br][send=/help]Help[/send]',
},
});
const result = response.getData().result.id;
console.log('Created message ID:', result);
} catch (error) {
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'imbot.v2.Chat.Message.send',
[
'botId' => 456,
'dialogId' => 'chat2725',
'fields' => [
'message' => '[b]Important message[/b][br]Open [url=https://bitrix24.com]site[/url][br][send=/help]Help[/send]',
],
]
);
$result = $response
->getResponseData()
->getResult()['id'];
echo 'Created message ID: ' . $result;
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error: ' . $e->getMessage();
}
BX24.callMethod(
'imbot.v2.Chat.Message.send',
{
botId: 456,
dialogId: 'chat2725',
fields: {
message: '[b]Important message[/b][br]Open [url=https://bitrix24.com]site[/url][br][send=/help]Help[/send]',
},
},
function(result) {
if (result.error()) {
console.error(result.error().ex);
} else {
console.log('Message ID:', result.data().id);
}
}
);
require_once('crest.php');
$result = CRest::call(
'imbot.v2.Chat.Message.send',
[
'botId' => 456,
'dialogId' => 'chat2725',
'fields' => [
'message' => '[b]Important message[/b][br]Open [url=https://bitrix24.com]site[/url][br][send=/help]Help[/send]',
],
]
);
if (!empty($result['error'])) {
echo 'Error: ' . $result['error_description'];
} else {
echo 'Message ID: ' . $result['result']['id'];
}
Continue Learning
- API imbot.v2 Change Log
- Working with Keyboards
- Attachments in Messages ATTACH
- Send Message imbot.v2.Chat.Message.send
- Update Message imbot.v2.Chat.Message.update