For AI agents: markdown of this page — /docs-content-en/bots/messages/attach.md documentation index — /llms.txt

ATTACH blocks

Extended message formatting via the fields.attach field. Maximum size: 60,000 characters after serialization.

Two transfer formats

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 assumes the short format was passed.

Block types

MESSAGE — styled text

Field Type Description
MESSAGE string Message text
STYLE string Style: bold, italic, base
JSON
{ "MESSAGE": [{ "MESSAGE": "Status updated", "STYLE": "bold" }] }

USER — user card

Field Type Description
NAME string User name
AVATAR string Avatar URL
LINK string Profile URL
JSON
{ "USER": [{ "NAME": "John Smith", "AVATAR": "https://example.com/avatar.jpg", "LINK": "https://portal.bitrix24.com/company/personal/user/1/" }] }
Field Type Description
NAME string Link title
LINK string URL
DESC string Description
PREVIEW string Preview image URL
JSON
{ "LINK": [{ "NAME": "API documentation", "LINK": "https://vibecode.bitrix24.com/docs", "DESC": "Full Vibecode API documentation" }] }

DELIMITER — divider line

Field Type Description
SIZE integer Width in pixels
COLOR string Color in HEX format
JSON
{ "DELIMITER": [{ "SIZE": 200, "COLOR": "#c6c6c6" }] }

GRID — table / grid

Field Type Description
NAME string Field name
VALUE string Field value
DISPLAY string Display: LINE (inline), BLOCK (block), ROW (row)
WIDTH integer Column width in pixels
JSON
{
  "GRID": [
    { "NAME": "Task", "VALUE": "Prepare the report", "DISPLAY": "LINE" },
    { "NAME": "Status", "VALUE": "Done", "DISPLAY": "LINE" }
  ]
}

IMAGE — image

Field Type Description
LINK string Full image URL
NAME string Caption
PREVIEW string Preview URL
WIDTH integer Width in pixels
HEIGHT integer Height in pixels
JSON
{ "IMAGE": [{ "LINK": "https://example.com/chart.png", "NAME": "Sales chart", "WIDTH": 600, "HEIGHT": 400 }] }

FILE — attached file

Field Type Description
LINK string File URL
NAME string File name
SIZE integer Size 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