Attachments (ATTACH blocks) Rich message layout — cards, field-value tables, images, files and dividers. Passed in the attach field together with message.
attach is an array of blocks. Each block is an object with a single type key. The MESSAGE text block takes a string; the other blocks take an array of objects with fields.
Block types MESSAGE — textA text string. Supports BB codes .
JSON
Copy
{ "MESSAGE": "Task status updated" }
GRID — field-value table
Field
Type
Description
Field NAME
Type string
Description Field name
Field VALUE
Type string
Description Field value
Field DISPLAY
Type string
Description Layout: LINE (inline), BLOCK, ROW
Field WIDTH
Type integer
Description Column width in pixels
JSON
Copy
{ "GRID": [
{ "NAME": "Task", "VALUE": "Prepare the report", "DISPLAY": "LINE" },
{ "NAME": "Status", "VALUE": "Done", "DISPLAY": "LINE" }
] }
LINK — link preview
Field
Type
Description
Field NAME
Type string
Description Link title
Field LINK
Type string
Description URL
Field DESC
Type string
Description Description
Field PREVIEW
Type string
Description Preview image URL
JSON
Copy
{ "LINK": [{ "NAME": "Documentation", "LINK": "https://example.com/docs", "DESC": "API reference" }] }
IMAGE — image
Field
Type
Description
Field LINK
Type string
Description Image URL
Field NAME
Type string
Description Caption
Field PREVIEW
Type string
Description Preview URL
Field WIDTH
Type integer
Description Width in pixels
Field HEIGHT
Type integer
Description Height in pixels
JSON
Copy
{ "IMAGE": [{ "LINK": "https://example.com/chart.png", "NAME": "Sales chart", "WIDTH": 600, "HEIGHT": 400 }] }
FILE — file
Field
Type
Description
Field LINK
Type string
Description File URL
Field NAME
Type string
Description File name
Field SIZE
Type integer
Description Size in bytes
JSON
Copy
{ "FILE": [{ "LINK": "https://example.com/report.pdf", "NAME": "report.pdf", "SIZE": 2048576 }] }
USER — user card
Field
Type
Description
Field NAME
Type string
Description User name
Field AVATAR
Type string
Description Avatar URL
Field LINK
Type string
Description Profile URL
JSON
Copy
{ "USER": [{ "NAME": "John Brown", "LINK": "https://example.com/u/42" }] }
DELIMITER — divider line
Field
Type
Description
Field SIZE
Type integer
Description Width in pixels
Field COLOR
Type string
Description Color in hexadecimal format
JSON
Copy
{ "DELIMITER": [{ "SIZE": 200, "COLOR": "#c6c6c6" }] }
Full example
JSON
Copy
{
"message": "Task report",
"attach": [
{ "MESSAGE": "[B]Task status updated[/B]" },
{ "DELIMITER": [{}] },
{ "GRID": [
{ "NAME": "Task", "VALUE": "Prepare the report", "DISPLAY": "LINE" },
{ "NAME": "Status", "VALUE": "Done", "DISPLAY": "LINE" }
] },
{ "LINK": [{ "NAME": "Open the task", "LINK": "https://example.com/tasks/42" }] }
]
}
See also