For AI agents: markdown of this page — /docs-content-en/chats/messages/keyboard.md documentation index — /llms.txt
Keyboard
Interactive buttons under a message. Passed in the keyboard field when sending — an array where each button is a separate object.
Button fields
| Field | Type | Default | Description |
|---|---|---|---|
TEXT |
string | — | Button text. Required for all buttons except TYPE: "NEWLINE" |
TYPE |
string | — | Special type: NEWLINE — wrap to a new line |
LINK |
string | — | URL — the button becomes a link |
ACTION |
string | — | Action on click: PUT (insert into the input field), SEND (send text), COPY (copy), CALL (call), DIALOG (open chat) |
ACTION_VALUE |
string | — | Value for ACTION: text, phone number or chat ID |
BG_COLOR_TOKEN |
string | base |
Preset background color (see tokens below) |
BG_COLOR |
string | — | Background color in hexadecimal format (#ff6600) |
TEXT_COLOR |
string | — | Text color in hexadecimal format |
DISPLAY |
string | BLOCK |
Layout: LINE (inline with others) or BLOCK (full width) |
DISABLED |
string | N |
Inactive button: Y or N |
BLOCK |
string | N |
Y — the button is disabled after a click |
WIDTH |
integer | — | Button width in pixels |
CONTEXT |
string | ALL |
Where to show: MOBILE, DESKTOP, ALL |
Color tokens
| Token | Color | Purpose |
|---|---|---|
primary |
Blue | Primary action |
secondary |
Gray | Secondary action |
alert |
Red | Dangerous action |
base |
White | Neutral button (default) |
Example
{
"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://example.com/tasks/42", "BG_COLOR_TOKEN": "secondary", "DISPLAY": "LINE" }
]
}