The menuCallback method represents a unified response triggered when a user interacts with any type of menu — whether it's an inline menu, a chat-attached (keypad) menu, or a custom component (also known as a workflow-driven menu ). When a user interacts with a cell (such as submitting a form, selecting an option, or pressing a button), this method is sent to the API to reflect the action and pass captured values.

This method returns context about:

The callback allows the API to:


Top-Level Fields

Field Type Required Description
method String Yes "menuCallback" — indicates a unified menu interaction.
source String Yes Origin of the interaction: "chat", "inline", or "workflow".
api_id String Yes Identifier of the API (bot) that owns the interaction.
app_id String Yes Identifier of the app where the menu was displayed.
from User Yes User context (includes user id, type).
chat Chat Conditional Chat context (includes chat id, type).
message Message Conditional Present only if source = "inline" — the message to which the inline menu was attached includes message_id , message reference and gmid
menu_group String Yes Menu group ID that the currently interacted cell belongs to. Used to organize related menus under one context or workflow.
menu_id String Yes Unique identifier of the specific menu containing the current interacted cell.
cell_id String Yes Unique identifier of the current interacted cell.
callback String Yes Callback id of the current interacted cell.
submit String Conditional Defines the API submission scope when the current interacted cell is triggered
cell – sends only the current cell’s value.
menu – sends values of all cells in the current menu.
all – sends all values filled or triggered across all menus.
date Long Yes Unix Epoch timestamp in milliseconds of when the interaction occurred.
cells Array of Cell Interactions Yes List of interacted cells with their submitted values
reference String Optional Unique identifier for the request. This reference will be echoed in the response.

Cell Interactions Array (Per Cell Interaction)

Each object in Cell Interactions corresponds to a user interaction with a cell. The structure is consistent for inputs, toggles, choices, and button presses.

Field Type Required Description
menu_id String Yes Unique identifier for the menu the cell belongs to.
cell_id String Yes Unique identifier of the interacted cell.
callback String Yes Callback id of the interacted cell.
form String Yes Type of UI component (button, dropdown, switch, etc.).
style String Optional Visual style of the cell (filled, outlined, etc.).
label String Optional Display the label of the cell.
version String Optional System-generated random version after each cell update.
value_type Value Type Yes Type of the returned value (string, boolean, number, array, object).
value Value Yes The submitted or selected value for the cell.