Skip to content

Bots

Bot API reference

Every Bot API method supported by Min with parameters and example results.

Base URL: https://minchatapp.com/bot<token>/<method>. All methods accept GET and POST. Parameters below are the only ones the server reads.

Basics

BOT /bot<token>/getMe #

getMe — Get the bot user

Returns the bot as a User object.

Parameters

No parameters.

Returns: User

curl
curl "https://minchatapp.com/bot$BOT_TOKEN/getMe"
HTTP 200
{
  "ok": true,
  "result": {
    "id": 5,
    "is_bot": true,
    "first_name": "Weather",
    "last_name": "Bot",
    "username": "weather_bot",
    "can_join_groups": true,
    "can_read_all_group_messages": false,
    "supports_inline_queries": false
  }
}
BOT /bot<token>/sendChatAction #

sendChatAction — Chat action (no-op)

Accepted for compatibility and returns true; nothing is shown to users yet.

Parameters

Name Type Description
chat_id
required
Integer
Target chat: a user id (> 0) for a private chat, or -conversation_id (< 0) for a group/channel the bot is a member of. @username is not supported.
action
required
String
e.g. typing.

Returns: True

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/sendChatAction" \
  -H 'Content-Type: application/json' \
  -d '{"chat_id": 1, "action": "typing"}'
HTTP 200
{
  "ok": true,
  "result": true
}

Messages

BOT /bot<token>/sendMessage #

sendMessage — Send a text message

Text up to 4096 characters. Entities / parse_mode are not supported (sent as plain text; clients render the MinChat markup such as **bold**). Links in the text get a preview card unless disable_web_page_preview or link_preview_options.is_disabled is true.

Parameters

Name Type Description
chat_id
required
Integer
Target chat: a user id (> 0) for a private chat, or -conversation_id (< 0) for a group/channel the bot is a member of. @username is not supported.
text
required
String
Message text, 1–4096 chars.
reply_to_message_id
optional
Integer
Reply to a message of the same chat.
disable_web_page_preview
optional
Boolean
true disables the link preview for links in the text (Telegram's legacy parameter).
link_preview_options
optional
LinkPreviewOptions
Object or JSON string, e.g. {"is_disabled": true}. Only is_disabled is supported; other fields are ignored.
reply_markup
optional
InlineKeyboardMarkup
Inline keyboard (object or JSON string). Only InlineKeyboardMarkup is supported.

Returns: Message

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/sendMessage" \
  -H 'Content-Type: application/json' \
  -d '{"chat_id": 1, "text": "Pick a city:", "reply_markup": {"inline_keyboard": [[{"text": "Moscow", "callback_data": "city:moscow"}]]}}'
HTTP 200
{
  "ok": true,
  "result": {
    "message_id": 50,
    "date": 1792660008,
    "chat": {
      "id": 1,
      "type": "private",
      "first_name": "Anna",
      "username": "anna_s"
    },
    "from": {
      "id": 5,
      "is_bot": true,
      "first_name": "Weather",
      "last_name": "Bot",
      "username": "weather_bot",
      "can_join_groups": true,
      "can_read_all_group_messages": false,
      "supports_inline_queries": false
    },
    "text": "Pick a city:",
    "reply_markup": {
      "inline_keyboard": [
        [
          {
            "text": "Moscow",
            "callback_data": "city:moscow"
          },
          {
            "text": "Berlin",
            "callback_data": "city:berlin"
          }
        ],
        [
          {
            "text": "Open website",
            "url": "https://minchatapp.com"
          }
        ]
      ]
    }
  }
}
BOT /bot<token>/editMessageText #

editMessageText — Edit message text

Only messages sent by this bot. Passing reply_markup replaces the keyboard; an empty string removes it. A changed text regenerates the link preview; disable_web_page_preview / link_preview_options.is_disabled removes it.

Parameters

Name Type Description
chat_id
optional
Integer
Accepted for compatibility; the message is located by message_id.
message_id
required
Integer
Message id.
text
required
String
New text, 1–4096 chars.
disable_web_page_preview
optional
Boolean
true disables the link preview for links in the text (Telegram's legacy parameter).
link_preview_options
optional
LinkPreviewOptions
Object or JSON string, e.g. {"is_disabled": true}. Only is_disabled is supported; other fields are ignored.
reply_markup
optional
InlineKeyboardMarkup
Inline keyboard (object or JSON string). Only InlineKeyboardMarkup is supported.

Returns: Message

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/editMessageText" \
  -H 'Content-Type: application/json' \
  -d '{"chat_id": 1, "message_id": 50, "text": "Moscow: +5°C, cloudy ☁️"}'
HTTP 200
{
  "ok": true,
  "result": {
    "message_id": 50,
    "date": 1792660008,
    "chat": {
      "id": 1,
      "type": "private",
      "first_name": "Anna",
      "username": "anna_s"
    },
    "from": {
      "id": 5,
      "is_bot": true,
      "first_name": "Weather",
      "last_name": "Bot",
      "username": "weather_bot",
      "can_join_groups": true,
      "can_read_all_group_messages": false,
      "supports_inline_queries": false
    },
    "text": "Moscow: +5°C, cloudy ☁️",
    "reply_markup": {
      "inline_keyboard": [
        [
          {
            "text": "Refresh",
            "callback_data": "refresh:moscow"
          }
        ]
      ]
    }
  }
}
BOT /bot<token>/editMessageReplyMarkup #

editMessageReplyMarkup — Edit the inline keyboard

{"inline_keyboard":[]} or no reply_markup removes the keyboard.

Parameters

Name Type Description
chat_id
optional
Integer
Accepted for compatibility.
message_id
required
Integer
Message id.
reply_markup
optional
InlineKeyboardMarkup
Inline keyboard (object or JSON string). Only InlineKeyboardMarkup is supported.

Returns: Message

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/editMessageReplyMarkup" \
  -H 'Content-Type: application/json' \
  -d '{"chat_id": 1, "message_id": 50, "reply_markup": {"inline_keyboard": []}}'
HTTP 200
{
  "ok": true,
  "result": {
    "message_id": 50,
    "date": 1792660008,
    "chat": {
      "id": 1,
      "type": "private",
      "first_name": "Anna",
      "username": "anna_s"
    },
    "from": {
      "id": 5,
      "is_bot": true,
      "first_name": "Weather",
      "last_name": "Bot",
      "username": "weather_bot",
      "can_join_groups": true,
      "can_read_all_group_messages": false,
      "supports_inline_queries": false
    },
    "text": "Moscow: +5°C, cloudy ☁️"
  }
}
BOT /bot<token>/deleteMessage #

deleteMessage — Delete a message

Deletes a message sent by this bot for everyone.

Parameters

Name Type Description
chat_id
optional
Integer
Accepted for compatibility.
message_id
required
Integer
Message id.

Returns: True

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/deleteMessage" \
  -H 'Content-Type: application/json' \
  -d '{"message_id": 50}'
HTTP 200
{
  "ok": true,
  "result": true
}
BOT /bot<token>/pinChatMessage #

pinChatMessage — Pin a message

Adds a message to the chat's pinned messages (up to 5 per chat). Pinning an already pinned message returns true. In groups, members see a "pinned a message" service message unless disable_notification is set. The bot must be the owner or an administrator of the group/channel (in a private chat with a user it may always pin). Errors: 403 Forbidden: not enough rights to manage pinned messages in the chat, 400 Bad Request: message not found (unknown, deleted or another chat's message). 400 Bad Request: too many pinned messages (limit 5) when the limit is reached.

Parameters

Name Type Description
chat_id
required
Integer
Chat id: user id for a private chat, -<conversation id> for a group or channel.
message_id
required
Integer
Id of the message to pin.
disable_notification
optional
Boolean
Pass true to pin silently (no service message in groups).

Returns: True

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/pinChatMessage" \
  -H 'Content-Type: application/json' \
  -d '{"chat_id": -42, "message_id": 50}'
HTTP 200
{
  "ok": true,
  "result": true
}
BOT /bot<token>/unpinChatMessage #

unpinChatMessage — Unpin a message

Removes a message from the chat's pinned messages. Without message_id, the most recently pinned message is unpinned; if nothing is pinned, returns true. The bot must be the owner or an administrator of the group/channel (in a private chat with a user it may always pin). Errors: 403 Forbidden: not enough rights to manage pinned messages in the chat, 400 Bad Request: message not found (unknown, deleted or another chat's message).

Parameters

Name Type Description
chat_id
required
Integer
Chat id: user id for a private chat, -<conversation id> for a group or channel.
message_id
optional
Integer
Id of the message to unpin. Omit to unpin the most recent one.

Returns: True

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/unpinChatMessage" \
  -H 'Content-Type: application/json' \
  -d '{"chat_id": -42, "message_id": 50}'
HTTP 200
{
  "ok": true,
  "result": true
}
BOT /bot<token>/unpinAllChatMessages #

unpinAllChatMessages — Unpin all messages

Clears the list of pinned messages in a chat. The bot must be the owner or an administrator of the group/channel (in a private chat with a user it may always unpin). Error: 403 Forbidden: not enough rights to manage pinned messages in the chat.

Parameters

Name Type Description
chat_id
required
Integer
Chat id: user id for a private chat, -<conversation id> for a group or channel.

Returns: True

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/unpinAllChatMessages" \
  -H 'Content-Type: application/json' \
  -d '{"chat_id": -42}'
HTTP 200
{
  "ok": true,
  "result": true
}

Files and media

BOT /bot<token>/sendPhoto #

sendPhoto — Send a photo

photo is a multipart upload, an HTTPS/HTTP URL the server downloads (≤ 50 MB), or a file_id received earlier by this bot. MIME must be image/*. No link preview is generated for links in the caption (as in Telegram); disable_web_page_preview / link_preview_options are accepted for compatibility.

Parameters

Name Type Description
chat_id
required
Integer
Target chat: a user id (> 0) for a private chat, or -conversation_id (< 0) for a group/channel the bot is a member of. @username is not supported.
photo
required
InputFile | String
File, URL or file_id.
caption
optional
String
Caption, 0–1024 chars.
reply_to_message_id
optional
Integer
Reply to a message of the same chat.
disable_web_page_preview
optional
Boolean
true disables the link preview for links in the text (Telegram's legacy parameter).
link_preview_options
optional
LinkPreviewOptions
Object or JSON string, e.g. {"is_disabled": true}. Only is_disabled is supported; other fields are ignored.
reply_markup
optional
InlineKeyboardMarkup
Inline keyboard (object or JSON string). Only InlineKeyboardMarkup is supported.

Returns: Message

curl
curl -F chat_id=1 -F caption='Forecast map' -F photo=@file.png \
  "https://minchatapp.com/bot$BOT_TOKEN/sendPhoto"
HTTP 200
{
  "ok": true,
  "result": {
    "message_id": 52,
    "date": 1792660008,
    "chat": {
      "id": 1,
      "type": "private",
      "first_name": "Anna",
      "username": "anna_s"
    },
    "from": {
      "id": 5,
      "is_bot": true,
      "first_name": "Weather",
      "last_name": "Bot",
      "username": "weather_bot",
      "can_join_groups": true,
      "can_read_all_group_messages": false,
      "supports_inline_queries": false
    },
    "caption": "Forecast map",
    "photo": [
      {
        "file_id": "dc16f474-b747-4b41-9ba4-f61593ff883e",
        "file_unique_id": "3802d3007f292b24",
        "width": 64,
        "height": 40,
        "file_size": 146
      }
    ]
  }
}
BOT /bot<token>/sendDocument #

sendDocument — Send a file

document is a multipart upload, an HTTPS/HTTP URL the server downloads (≤ 50 MB), or a file_id received earlier by this bot. MIME must be any type.

Parameters

Name Type Description
chat_id
required
Integer
Target chat: a user id (> 0) for a private chat, or -conversation_id (< 0) for a group/channel the bot is a member of. @username is not supported.
document
required
InputFile | String
File, URL or file_id.
caption
optional
String
Caption, 0–1024 chars.
reply_to_message_id
optional
Integer
Reply to a message of the same chat.
reply_markup
optional
InlineKeyboardMarkup
Inline keyboard (object or JSON string). Only InlineKeyboardMarkup is supported.

Returns: Message

curl
curl -F chat_id=1 -F caption='Forecast map' -F document=@file.pdf \
  "https://minchatapp.com/bot$BOT_TOKEN/sendDocument"
HTTP 200 · byFileId
{
  "ok": true,
  "result": {
    "message_id": 53,
    "date": 1792660008,
    "chat": {
      "id": 1,
      "type": "private",
      "first_name": "Anna",
      "username": "anna_s"
    },
    "from": {
      "id": 5,
      "is_bot": true,
      "first_name": "Weather",
      "last_name": "Bot",
      "username": "weather_bot",
      "can_join_groups": true,
      "can_read_all_group_messages": false,
      "supports_inline_queries": false
    },
    "caption": "Same file, re-sent by file_id",
    "document": {
      "file_id": "009953e4-f1d2-466f-aea9-b94328ecec7a",
      "file_unique_id": "3802d3007f292b24",
      "file_name": "map.png",
      "mime_type": "image/png",
      "file_size": 146
    }
  }
}
BOT /bot<token>/sendVideo #

sendVideo — Send a video

video is a multipart upload, an HTTPS/HTTP URL the server downloads (≤ 50 MB), or a file_id received earlier by this bot. MIME must be video/*. No link preview is generated for links in the caption (as in Telegram); disable_web_page_preview / link_preview_options are accepted for compatibility.

Parameters

Name Type Description
chat_id
required
Integer
Target chat: a user id (> 0) for a private chat, or -conversation_id (< 0) for a group/channel the bot is a member of. @username is not supported.
video
required
InputFile | String
File, URL or file_id.
caption
optional
String
Caption, 0–1024 chars.
reply_to_message_id
optional
Integer
Reply to a message of the same chat.
disable_web_page_preview
optional
Boolean
true disables the link preview for links in the text (Telegram's legacy parameter).
link_preview_options
optional
LinkPreviewOptions
Object or JSON string, e.g. {"is_disabled": true}. Only is_disabled is supported; other fields are ignored.
reply_markup
optional
InlineKeyboardMarkup
Inline keyboard (object or JSON string). Only InlineKeyboardMarkup is supported.

Returns: Message

curl
curl -F chat_id=1 -F caption='Forecast map' -F video=@file.mp4 \
  "https://minchatapp.com/bot$BOT_TOKEN/sendVideo"
BOT /bot<token>/sendAudio #

sendAudio — Send audio

audio is a multipart upload, an HTTPS/HTTP URL the server downloads (≤ 50 MB), or a file_id received earlier by this bot. MIME must be audio/* or application/ogg.

Parameters

Name Type Description
chat_id
required
Integer
Target chat: a user id (> 0) for a private chat, or -conversation_id (< 0) for a group/channel the bot is a member of. @username is not supported.
audio
required
InputFile | String
File, URL or file_id.
caption
optional
String
Caption, 0–1024 chars.
reply_to_message_id
optional
Integer
Reply to a message of the same chat.
reply_markup
optional
InlineKeyboardMarkup
Inline keyboard (object or JSON string). Only InlineKeyboardMarkup is supported.

Returns: Message

curl
curl -F chat_id=1 -F caption='Forecast map' -F audio=@file.mp3 \
  "https://minchatapp.com/bot$BOT_TOKEN/sendAudio"
BOT /bot<token>/getFile #

getFile — Get file info

Returns file_path for files sent by this bot (file_id is bot-scoped). Download with GET /file/bot<token>/<file_path>.

Parameters

Name Type Description
file_id
required
String
File id.

Returns: File

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/getFile" \
  -H 'Content-Type: application/json' \
  -d '{"file_id": "dc16f474-b747-4b41-9ba4-f61593ff883e"}'
HTTP 200
{
  "ok": true,
  "result": {
    "file_id": "dc16f474-b747-4b41-9ba4-f61593ff883e",
    "file_unique_id": "3802d3007f292b245acabbcc606f7e00",
    "file_size": 146,
    "file_path": "media/cc/fc/ccfcc4cd72fa42b444b4c2c4837bb847ae6897be6fc4ad9a59eb63cce11df4f8.png"
  }
}

Inline keyboards

BOT /bot<token>/answerCallbackQuery #

answerCallbackQuery — Answer a button press

Stores the answer for the callback query (first answer wins). text ≤ 200 chars.

Parameters

Name Type Description
callback_query_id
required
String
callback_query.id from the update.
text
optional
String
Notification text.
show_alert
optional
Boolean
Show as an alert instead of a toast.

Returns: True

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/answerCallbackQuery" \
  -H 'Content-Type: application/json' \
  -d '{"callback_query_id": "1", "text": "Moscow: +5°C, cloudy"}'
HTTP 200
{
  "ok": true,
  "result": true
}

Getting updates

BOT /bot<token>/getUpdates #

getUpdates — Long-poll for updates

Returns pending updates in order. Pass offset = last update_id + 1 to confirm (older updates are deleted). Fails with 409 while a webhook is set.

Parameters

Name Type Description
offset
optional
Integer
First update id to return; confirms all earlier ones.
limit
optional
Integer
1–100, default 100.
timeout
optional
Integer
Long-poll seconds, 0–50 (default 0 = short poll).

Returns: Array of Update

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/getUpdates" \
  -H 'Content-Type: application/json' \
  -d '{"offset": 0, "timeout": 30}'
HTTP 200
{
  "ok": true,
  "result": [
    {
      "update_id": 1,
      "message": {
        "message_id": 51,
        "date": 1792660008,
        "chat": {
          "id": 1,
          "type": "private",
          "first_name": "Anna",
          "username": "anna_s"
        },
        "from": {
          "id": 1,
          "is_bot": false,
          "first_name": "Anna",
          "last_name": "Smith",
          "username": "anna_s"
        },
        "text": "/weather Moscow"
      }
    },
    {
      "update_id": 3,
      "callback_query": {
        "id": "1",
        "from": {
          "id": 1,
          "is_bot": false,
          "first_name": "Anna",
          "last_name": "Smith",
          "username": "anna_s"
        },
        "chat_instance": "8",
        "data": "city:moscow",
        "message": {
          "message_id": 50,
          "date": 1792660008,
          "chat": {
            "id": 1,
            "type": "private",
            "first_name": "Anna",
            "username": "anna_s"
          },
          "from": {
            "id": 5,
            "is_bot": true,
            "first_name": "Weather",
            "last_name": "Bot",
            "username": "weather_bot",
            "can_join_groups": true,
            "can_read_all_group_messages": false,
            "supports_inline_queries": false
          },
          "text": "Pick a city:",
          "reply_markup": {
            "inline_keyboard": [
              [
                {
                  "text": "Moscow",
                  "callback_data": "city:moscow"
                },
                {
                  "text": "Berlin",
                  "callback_data": "city:berlin"
                }
              ],
              [
                {
                  "text": "Open website",
                  "url": "https://minchatapp.com"
                }
              ]
            ]
          }
        }
      }
    }
  ]
}
BOT /bot<token>/setWebhook #

setWebhook — Set a webhook

HTTPS only. Each update is POSTed as JSON; a 2xx response marks it delivered, otherwise it is retried (3 attempts, 30 s apart). With secret_token the header X-Telegram-Bot-Api-Secret-Token is sent. Pending updates are delivered right away. An empty url removes the webhook.

Parameters

Name Type Description
url
required
String
HTTPS URL.
secret_token
optional
String
Sent back in X-Telegram-Bot-Api-Secret-Token.
max_connections
optional
Integer
Stored and reported (default 40).
allowed_updates
optional
Array of String
Stored and reported; filtering is not applied yet.

Returns: True

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/setWebhook" \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://example.com/minchat-webhook"}'
HTTP 200
{
  "ok": true,
  "result": true
}
BOT /bot<token>/deleteWebhook #

deleteWebhook — Remove the webhook

Switch back to getUpdates.

Parameters

No parameters.

Returns: True

curl
curl "https://minchatapp.com/bot$BOT_TOKEN/deleteWebhook"
HTTP 200
{
  "ok": true,
  "result": true
}
BOT /bot<token>/getWebhookInfo #

getWebhookInfo — Webhook status

url is empty when no webhook is set. Includes pending_update_count, last error.

Parameters

No parameters.

Returns: WebhookInfo

curl
curl "https://minchatapp.com/bot$BOT_TOKEN/getWebhookInfo"
HTTP 200
{
  "ok": true,
  "result": {
    "url": "https://example.com/minchat-webhook",
    "has_custom_certificate": false,
    "pending_update_count": 0,
    "max_connections": 40
  }
}

Commands

BOT /bot<token>/setMyCommands #

setMyCommands — Set the command list

Replaces commands for the given scope.type (default default) and language_code. command ≤ 32, description ≤ 256 chars.

Parameters

Name Type Description
commands
required
Array of BotCommand
[{"command":"start","description":"…"}] (object or JSON string).
scope
optional
BotCommandScope
Only type is stored.
language_code
optional
String
Language code, empty = all.

Returns: True

curl
curl -X POST "https://minchatapp.com/bot$BOT_TOKEN/setMyCommands" \
  -H 'Content-Type: application/json' \
  -d '{"commands": [{"command": "start", "description": "Start the bot"}]}'
HTTP 200
{
  "ok": true,
  "result": true
}
BOT /bot<token>/getMyCommands #

getMyCommands — Get the command list

Parameters

Name Type Description
scope
optional
BotCommandScope
Scope (type).
language_code
optional
String
Language code.

Returns: Array of BotCommand

curl
curl "https://minchatapp.com/bot$BOT_TOKEN/getMyCommands"
HTTP 200
{
  "ok": true,
  "result": [
    {
      "command": "start",
      "description": "Start the bot"
    },
    {
      "command": "weather",
      "description": "Current weather"
    }
  ]
}

Types#

Update #

update_idInteger
messageMessage?
edited_messageMessage?
callback_queryCallbackQuery?

User #

idInteger
is_botBoolean
first_nameString
last_nameString?
usernameString?
can_join_groupsBoolean? (bots)
can_read_all_group_messagesBoolean? (bots)
supports_inline_queriesBoolean? (bots)

Chat #

idInteger — user id (private) or -conversation_id
typeprivate | group | channel
titleString? (group/channel)
first_nameString? (private)
usernameString?

Message #

message_idInteger
dateInteger (Unix time)
chatChat
fromUser?
sender_chatChat? (channels)
reply_to_messageMessage?
textString?
captionString?
photoPhotoSize[]?
videoVideo?
audioAudio?
documentDocument?
reply_markupInlineKeyboardMarkup?

CallbackQuery #

idString
fromUser
chat_instanceString (conversation id)
dataString
messageMessage

InlineKeyboardMarkup #

inline_keyboardInlineKeyboardButton[][]

InlineKeyboardButton #

textString, ≤ 64
callback_dataString? ≤ 64 bytes
urlString?

LinkPreviewOptions #

is_disabledBoolean?

PhotoSize / Document / Video / Audio #

file_idString (UUID)
file_unique_idString
file_sizeInteger
width, heightInteger (photo, video)
durationInteger (video, audio)
mime_typeString?
file_nameString? (document, audio)

File #

file_idString
file_unique_idString
file_sizeInteger
file_pathString — use /file/bot<token>/<file_path>

BotCommand #

commandString, ≤ 32
descriptionString, ≤ 256

WebhookInfo #

urlString (empty if none)
has_custom_certificateBoolean (always false)
pending_update_countInteger
last_error_dateInteger?
last_error_messageString?
max_connectionsInteger?
allowed_updatesString[]?