ATTACH blocks
Extended message formatting via the fields.attach field. Maximum size: 60,000 characters after serialization.
Full format (with metadata):
JSON
{
"fields": {
"attach": {
"ID": 1,
"COLOR_TOKEN": "primary",
"COLOR": "#29619b",
"BLOCKS": [
{ "MESSAGE": [{ "MESSAGE": "Block text", "STYLE": "bold" }] },
{ "DELIMITER": [{ "SIZE": 200, "COLOR": "#c6c6c6" }] }
]
}
}
}
Short format (array of blocks):
JSON
{
"fields": {
"attach": [
{ "MESSAGE": [{ "MESSAGE": "Block text", "STYLE": "bold" }] },
{ "DELIMITER": [{}] },
{ "GRID": [{ "NAME": "Field", "VALUE": "Value" }] }
]
}
}
If attach has no BLOCKS key, the server treats it as the short format.
Block types
MESSAGE — styled text
| Field |
Type |
Description |
FieldMESSAGE |
Typestring |
DescriptionMessage text |
FieldSTYLE |
Typestring |
DescriptionStyle: bold, italic, base |
JSON
{ "MESSAGE": [{ "MESSAGE": "Status updated", "STYLE": "bold" }] }
USER — user card
| Field |
Type |
Description |
FieldNAME |
Typestring |
DescriptionUser name |
FieldAVATAR |
Typestring |
DescriptionAvatar URL |
FieldLINK |
Typestring |
DescriptionProfile URL |
JSON
{ "USER": [{ "NAME": "John Smith", "AVATAR": "https://example.com/avatar.jpg", "LINK": "https://portal.bitrix24.com/company/personal/user/1/" }] }
LINK — link preview
| Field |
Type |
Description |
FieldNAME |
Typestring |
DescriptionLink title |
FieldLINK |
Typestring |
DescriptionURL |
FieldDESC |
Typestring |
DescriptionDescription |
FieldPREVIEW |
Typestring |
DescriptionPreview image URL |
JSON
{ "LINK": [{ "NAME": "API documentation", "LINK": "https://vibecode.bitrix24.com/docs", "DESC": "Full Vibecode API documentation" }] }
DELIMITER — divider line
| Field |
Type |
Description |
FieldSIZE |
Typeinteger |
DescriptionWidth in pixels |
FieldCOLOR |
Typestring |
DescriptionColor in HEX format |
JSON
{ "DELIMITER": [{ "SIZE": 200, "COLOR": "#c6c6c6" }] }
GRID — table / grid
| Field |
Type |
Description |
FieldNAME |
Typestring |
DescriptionField name |
FieldVALUE |
Typestring |
DescriptionField value |
FieldDISPLAY |
Typestring |
DescriptionDisplay: LINE (inline), BLOCK (block), ROW (row) |
FieldWIDTH |
Typeinteger |
DescriptionColumn width in pixels |
JSON
{
"GRID": [
{ "NAME": "Task", "VALUE": "Prepare the report", "DISPLAY": "LINE" },
{ "NAME": "Status", "VALUE": "Done", "DISPLAY": "LINE" }
]
}
IMAGE — image
| Field |
Type |
Description |
FieldLINK |
Typestring |
DescriptionFull image URL |
FieldNAME |
Typestring |
DescriptionCaption |
FieldPREVIEW |
Typestring |
DescriptionPreview URL |
FieldWIDTH |
Typeinteger |
DescriptionWidth in pixels |
FieldHEIGHT |
Typeinteger |
DescriptionHeight in pixels |
JSON
{ "IMAGE": [{ "LINK": "https://example.com/chart.png", "NAME": "Sales chart", "WIDTH": 600, "HEIGHT": 400 }] }
FILE — attached file
| Field |
Type |
Description |
FieldLINK |
Typestring |
DescriptionFile URL |
FieldNAME |
Typestring |
DescriptionFile name |
FieldSIZE |
Typeinteger |
DescriptionSize in bytes |
JSON
{ "FILE": [{ "LINK": "https://example.com/report.pdf", "NAME": "report.pdf", "SIZE": 2048576 }] }
Color tokens (COLOR_TOKEN)
primary, secondary, alert, base
Full example
JSON
{
"dialogId": "chat123",
"fields": {
"message": "",
"attach": [
{
"MESSAGE": [
{ "MESSAGE": "Task status updated", "STYLE": "bold" }
]
},
{ "DELIMITER": [{}] },
{
"GRID": [
{ "DISPLAY": "LINE", "NAME": "Task", "VALUE": "Prepare the report" },
{ "DISPLAY": "LINE", "NAME": "Status", "VALUE": "Done" },
{ "DISPLAY": "LINE", "NAME": "Assignee", "VALUE": "A. Smith" }
]
},
{
"LINK": [
{ "NAME": "Open task", "LINK": "https://portal.bitrix24.com/tasks/42/" }
]
}
]
}
}
See also