Skip to content

readBusinessMessage

Returns: TrueOfficial docs ↗

Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.

Parameters

business_connection_idStringRequired
Unique identifier of the business connection on behalf of which to read the message
chat_idIntegerRequired
Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.
message_idIntegerRequired
Unique identifier of the message to mark as read

Returns

On success, True is returned.

GramIO Usage

Mark every incoming business message as read automatically:

ts
bot.on("business_message", async (ctx) => {
  await bot.api.readBusinessMessage({
    business_connection_id: ctx.businessConnectionId,
    chat_id: ctx.chat.id,
    message_id: ctx.id,
  });
});

Mark a message as read only after the bot has processed and replied to it:

ts
bot.on("business_message", async (ctx) => {
  // Process the message first
  if (ctx.text) {
    await bot.api.sendMessage({
      business_connection_id: ctx.businessConnectionId,
      chat_id: ctx.chat.id,
      text: `Echo: ${ctx.text}`,
    });
  }

  // Mark as read after handling
  await bot.api.readBusinessMessage({
    business_connection_id: ctx.businessConnectionId,
    chat_id: ctx.chat.id,
    message_id: ctx.id,
  });
});

Mark a specific message as read by ID (e.g., after a delayed workflow):

ts
async function 
markRead
(
businessConnectionId
: string,
chatId
: number,
messageId
: number
) { return
bot
.
api
.
readBusinessMessage
({
business_connection_id
:
businessConnectionId
,
chat_id
:
chatId
,
message_id
:
messageId
,
}); }

Errors

CodeErrorCause
400Bad Request: business connection not foundThe business_connection_id is invalid or the business connection no longer exists.
400Bad Request: chat not foundThe chat_id does not correspond to an existing or accessible chat.
400Bad Request: message not foundThe message_id does not exist in the specified chat.
400Bad Request: chat is not activeThe chat has not been active in the last 24 hours. Messages in inactive chats cannot be marked as read via this method.
403Forbidden: not enough rightsThe business bot connection does not have the can_read_messages right.
403Forbidden: bot was blocked by the userThe user has blocked the bot.
429Too Many Requests: retry after NFlood control triggered. Wait N seconds before retrying.

Tips & Gotchas

  • can_read_messages right is required. This is a business-specific bot right distinct from standard chat permissions. Ensure it is enabled in BotFather's business bot settings, and verify it via getBusinessConnection if needed.
  • 24-hour activity window. The chat must have been active in the last 24 hours. If the last message in the chat is older, this call will return a 400 error. There is no way to retroactively mark messages in inactive chats.
  • chat_id is always an Integer here. Unlike many other methods, readBusinessMessage accepts only numeric chat IDs — not @username strings. Use ctx.chat.id directly from the business message context.
  • Order matters if you need delivery confirmations. Call readBusinessMessage only after you are sure your bot has fully processed the message. Marking a message as read before processing it may signal to the customer that their query was handled even if your bot subsequently fails.
  • Business messages arrive via the business_message update type. Make sure allowed_updates includes "business_message" in your webhook or getUpdates configuration, otherwise you will never receive the messages to mark as read.

See Also