For AI agents: markdown of this page — /docs-content-en/bots/messages/keyboard.md documentation index — /llms.txt
Keyboard
Interactive buttons attached to a message via the fields.keyboard field. Each button is an object in the array.
Button fields
| Field | Type | Default | Description |
|---|---|---|---|
FieldTEXT |
Typestring | Default— | DescriptionButton text. Required for all buttons except TYPE: "NEWLINE" |
FieldTYPE |
Typestring | Default— | DescriptionSpecial type: NEWLINE (move to a new line) |
FieldLINK |
Typestring | Default— | DescriptionURL — the button becomes a link |
FieldCOMMAND |
Typestring | Default— | DescriptionBot command (triggers the ONIMBOTV2COMMANDADD event) |
FieldCOMMAND_PARAMS |
Typestring | Default— | DescriptionCommand parameters |
FieldACTION |
Typestring | Default— | DescriptionAction on click: PUT (insert into the input field), SEND (send text), COPY (copy), CALL (call), DIALOG (open chat) |
FieldACTION_VALUE |
Typestring | Default— | DescriptionValue for ACTION (text, phone number, chat ID) |
FieldBG_COLOR |
Typestring | Default— | DescriptionBackground color in HEX format (#ff6600) |
FieldBG_COLOR_TOKEN |
Typestring | Defaultbase |
DescriptionColor token (see the table below) |
FieldTEXT_COLOR |
Typestring | Default— | DescriptionText color in HEX format |
FieldDISPLAY |
Typestring | DefaultBLOCK |
DescriptionDisplay: LINE (in line with others) or BLOCK (full width) |
FieldDISABLED |
Typestring | DefaultN |
DescriptionInactive button: Y or N |
FieldBLOCK |
Typestring | DefaultN |
DescriptionLock after click: Y (deactivated after click) or N |
FieldWIDTH |
Typeinteger | Default— | DescriptionButton width in pixels |
FieldCONTEXT |
Typestring | DefaultALL |
DescriptionContext: MOBILE, DESKTOP, ALL |
FieldOFF_BG_COLOR |
Typestring | Default— | DescriptionBackground color in the inactive state (after click when BLOCK: "Y") |
FieldOFF_TEXT_COLOR |
Typestring | Default— | DescriptionText color in the inactive state |
Color tokens
| Token | Color | Purpose |
|---|---|---|
Tokenprimary |
ColorBlue | PurposePrimary action |
Tokensecondary |
ColorGray | PurposeSecondary action |
Tokenalert |
ColorRed | PurposeDestructive action |
Tokenbase |
ColorWhite | PurposeNeutral button (default) |
Example
{
"dialogId": "chat123",
"fields": {
"message": "Confirm the action:",
"keyboard": [
{
"TEXT": "Approve",
"BG_COLOR_TOKEN": "primary",
"ACTION": "SEND",
"ACTION_VALUE": "/approve",
"BLOCK": "Y"
},
{
"TEXT": "Reject",
"BG_COLOR_TOKEN": "alert",
"ACTION": "SEND",
"ACTION_VALUE": "/reject",
"BLOCK": "Y"
},
{ "TYPE": "NEWLINE" },
{
"TEXT": "Details",
"LINK": "https://portal.bitrix24.com/tasks/42/",
"BG_COLOR_TOKEN": "secondary",
"DISPLAY": "LINE"
},
{
"TEXT": "Call the manager",
"ACTION": "CALL",
"ACTION_VALUE": "+12025550123",
"DISPLAY": "LINE",
"CONTEXT": "MOBILE"
}
]
}
}