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
getMe — Get the bot user
Returns the bot as a User object.
Parameters
No parameters.
Returns:
User
curl "https://minchatapp.com/bot$BOT_TOKEN/getMe"
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/getMe`);
const data = await res.json();
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
print(requests.get(f"{API}/getMe", timeout=10).json()['result'])
{
"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
}
}
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/sendChatAction" \
-H 'Content-Type: application/json' \
-d '{"chat_id": 1, "action": "typing"}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/sendChatAction`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"chat_id": 1, "action": "typing"}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/sendChatAction", json={'chat_id': 1, 'action': 'typing'}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"ok": true,
"result": true
}
Messages
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 -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"}]]}}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/sendMessage`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"chat_id": 1, "text": "Pick a city:", "reply_markup": {"inline_keyboard": [[{"text": "Moscow", "callback_data": "city:moscow"}]]}}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/sendMessage", json={'chat_id': 1, 'text': 'Pick a city:', 'reply_markup': {'inline_keyboard': [[{'text': 'Moscow', 'callback_data': 'city:moscow'}]]}}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"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"
}
]
]
}
}
}
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 -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 ☁️"}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/editMessageText`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"chat_id": 1, "message_id": 50, "text": "Moscow: +5°C, cloudy ☁️"}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/editMessageText", json={'chat_id': 1, 'message_id': 50, 'text': 'Moscow: +5°C, cloudy ☁️'}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"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"
}
]
]
}
}
}
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 -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": []}}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/editMessageReplyMarkup`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"chat_id": 1, "message_id": 50, "reply_markup": {"inline_keyboard": []}}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/editMessageReplyMarkup", json={'chat_id': 1, 'message_id': 50, 'reply_markup': {'inline_keyboard': []}}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"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 ☁️"
}
}
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/deleteMessage" \
-H 'Content-Type: application/json' \
-d '{"message_id": 50}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/deleteMessage`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"message_id": 50}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/deleteMessage", json={'message_id': 50}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"ok": true,
"result": true
}
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/pinChatMessage" \
-H 'Content-Type: application/json' \
-d '{"chat_id": -42, "message_id": 50}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/pinChatMessage`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"chat_id": -42, "message_id": 50}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/pinChatMessage", json={'chat_id': -42, 'message_id': 50}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"ok": true,
"result": true
}
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/unpinChatMessage" \
-H 'Content-Type: application/json' \
-d '{"chat_id": -42, "message_id": 50}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/unpinChatMessage`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"chat_id": -42, "message_id": 50}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/unpinChatMessage", json={'chat_id': -42, 'message_id': 50}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"ok": true,
"result": true
}
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/unpinAllChatMessages" \
-H 'Content-Type: application/json' \
-d '{"chat_id": -42}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/unpinAllChatMessages`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"chat_id": -42}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/unpinAllChatMessages", json={'chat_id': -42}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"ok": true,
"result": true
}
Files and media
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 -F chat_id=1 -F caption='Forecast map' -F photo=@file.png \
"https://minchatapp.com/bot$BOT_TOKEN/sendPhoto"
import { readFile } from 'node:fs/promises';
const form = new FormData();
form.append('chat_id', '1');
form.append('caption', 'Forecast map');
form.append('photo', new Blob([await readFile('file.png')]), 'file.png');
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/sendPhoto`, { method: 'POST', body: form });
const data = await res.json();
if (!data.ok) throw new Error(data.description);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
with open('file.png', 'rb') as fh:
r = requests.post(f"{API}/sendPhoto", data={'chat_id': 1, 'caption': 'Forecast map'}, files={'photo': fh}, timeout=60)
r.raise_for_status()
print(r.json()['result'])
{
"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
}
]
}
}
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 -F chat_id=1 -F caption='Forecast map' -F document=@file.pdf \
"https://minchatapp.com/bot$BOT_TOKEN/sendDocument"
import { readFile } from 'node:fs/promises';
const form = new FormData();
form.append('chat_id', '1');
form.append('caption', 'Forecast map');
form.append('document', new Blob([await readFile('file.pdf')]), 'file.pdf');
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/sendDocument`, { method: 'POST', body: form });
const data = await res.json();
if (!data.ok) throw new Error(data.description);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
with open('file.pdf', 'rb') as fh:
r = requests.post(f"{API}/sendDocument", data={'chat_id': 1, 'caption': 'Forecast map'}, files={'document': fh}, timeout=60)
r.raise_for_status()
print(r.json()['result'])
{
"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
}
}
}
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 -F chat_id=1 -F caption='Forecast map' -F video=@file.mp4 \
"https://minchatapp.com/bot$BOT_TOKEN/sendVideo"
import { readFile } from 'node:fs/promises';
const form = new FormData();
form.append('chat_id', '1');
form.append('caption', 'Forecast map');
form.append('video', new Blob([await readFile('file.mp4')]), 'file.mp4');
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/sendVideo`, { method: 'POST', body: form });
const data = await res.json();
if (!data.ok) throw new Error(data.description);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
with open('file.mp4', 'rb') as fh:
r = requests.post(f"{API}/sendVideo", data={'chat_id': 1, 'caption': 'Forecast map'}, files={'video': fh}, timeout=60)
r.raise_for_status()
print(r.json()['result'])
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 -F chat_id=1 -F caption='Forecast map' -F audio=@file.mp3 \
"https://minchatapp.com/bot$BOT_TOKEN/sendAudio"
import { readFile } from 'node:fs/promises';
const form = new FormData();
form.append('chat_id', '1');
form.append('caption', 'Forecast map');
form.append('audio', new Blob([await readFile('file.mp3')]), 'file.mp3');
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/sendAudio`, { method: 'POST', body: form });
const data = await res.json();
if (!data.ok) throw new Error(data.description);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
with open('file.mp3', 'rb') as fh:
r = requests.post(f"{API}/sendAudio", data={'chat_id': 1, 'caption': 'Forecast map'}, files={'audio': fh}, timeout=60)
r.raise_for_status()
print(r.json()['result'])
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/getFile" \
-H 'Content-Type: application/json' \
-d '{"file_id": "dc16f474-b747-4b41-9ba4-f61593ff883e"}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/getFile`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"file_id": "dc16f474-b747-4b41-9ba4-f61593ff883e"}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/getFile", json={'file_id': 'dc16f474-b747-4b41-9ba4-f61593ff883e'}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"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
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/answerCallbackQuery" \
-H 'Content-Type: application/json' \
-d '{"callback_query_id": "1", "text": "Moscow: +5°C, cloudy"}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/answerCallbackQuery`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"callback_query_id": "1", "text": "Moscow: +5°C, cloudy"}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/answerCallbackQuery", json={'callback_query_id': '1', 'text': 'Moscow: +5°C, cloudy'}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"ok": true,
"result": true
}
Getting updates
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/getUpdates" \
-H 'Content-Type: application/json' \
-d '{"offset": 0, "timeout": 30}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/getUpdates`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"offset": 0, "timeout": 30}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/getUpdates", json={'offset': 0, 'timeout': 30}, timeout=60)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"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"
}
]
]
}
}
}
}
]
}
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/setWebhook" \
-H 'Content-Type: application/json' \
-d '{"url": "https://example.com/minchat-webhook"}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/setWebhook`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"url": "https://example.com/minchat-webhook"}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/setWebhook", json={'url': 'https://example.com/minchat-webhook'}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"ok": true,
"result": true
}
deleteWebhook — Remove the webhook
Switch back to getUpdates.
Parameters
No parameters.
Returns:
True
curl "https://minchatapp.com/bot$BOT_TOKEN/deleteWebhook"
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/deleteWebhook`);
const data = await res.json();
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
print(requests.get(f"{API}/deleteWebhook", timeout=10).json()['result'])
{
"ok": true,
"result": true
}
getWebhookInfo — Webhook status
url is empty when no webhook is set. Includes pending_update_count, last error.
Parameters
No parameters.
Returns:
WebhookInfo
curl "https://minchatapp.com/bot$BOT_TOKEN/getWebhookInfo"
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/getWebhookInfo`);
const data = await res.json();
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
print(requests.get(f"{API}/getWebhookInfo", timeout=10).json()['result'])
{
"ok": true,
"result": {
"url": "https://example.com/minchat-webhook",
"has_custom_certificate": false,
"pending_update_count": 0,
"max_connections": 40
}
}
Commands
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 -X POST "https://minchatapp.com/bot$BOT_TOKEN/setMyCommands" \
-H 'Content-Type: application/json' \
-d '{"commands": [{"command": "start", "description": "Start the bot"}]}'
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/setMyCommands`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"commands": [{"command": "start", "description": "Start the bot"}]}),
});
const data = await res.json();
if (!data.ok) throw new Error(`${data.error_code}: ${data.description}`);
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
r = requests.post(f"{API}/setMyCommands", json={'commands': [{'command': 'start', 'description': 'Start the bot'}]}, timeout=10)
data = r.json()
if not data['ok']:
raise RuntimeError(data['description'])
print(data['result'])
{
"ok": true,
"result": true
}
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 "https://minchatapp.com/bot$BOT_TOKEN/getMyCommands"
const res = await fetch(`https://minchatapp.com/bot${process.env.BOT_TOKEN}/getMyCommands`);
const data = await res.json();
console.log(data.result);
import os, requests
API = f"https://minchatapp.com/bot{os.environ['BOT_TOKEN']}"
print(requests.get(f"{API}/getMyCommands", timeout=10).json()['result'])
{
"ok": true,
"result": [
{
"command": "start",
"description": "Start the bot"
},
{
"command": "weather",
"description": "Current weather"
}
]
}
Types#
Update #
update_id | Integer |
message | Message? |
edited_message | Message? |
callback_query | CallbackQuery? |
User #
id | Integer |
is_bot | Boolean |
first_name | String |
last_name | String? |
username | String? |
can_join_groups | Boolean? (bots) |
can_read_all_group_messages | Boolean? (bots) |
supports_inline_queries | Boolean? (bots) |
Chat #
id | Integer — user id (private) or -conversation_id |
type | private | group | channel |
title | String? (group/channel) |
first_name | String? (private) |
username | String? |
Message #
message_id | Integer |
date | Integer (Unix time) |
chat | Chat |
from | User? |
sender_chat | Chat? (channels) |
reply_to_message | Message? |
text | String? |
caption | String? |
photo | PhotoSize[]? |
video | Video? |
audio | Audio? |
document | Document? |
reply_markup | InlineKeyboardMarkup? |
CallbackQuery #
id | String |
from | User |
chat_instance | String (conversation id) |
data | String |
message | Message |
InlineKeyboardMarkup #
inline_keyboard | InlineKeyboardButton[][] |
LinkPreviewOptions #
is_disabled | Boolean? |
PhotoSize / Document / Video / Audio #
file_id | String (UUID) |
file_unique_id | String |
file_size | Integer |
width, height | Integer (photo, video) |
duration | Integer (video, audio) |
mime_type | String? |
file_name | String? (document, audio) |
File #
file_id | String |
file_unique_id | String |
file_size | Integer |
file_path | String — use /file/bot<token>/<file_path> |
BotCommand #
command | String, ≤ 32 |
description | String, ≤ 256 |
WebhookInfo #
url | String (empty if none) |
has_custom_certificate | Boolean (always false) |
pending_update_count | Integer |
last_error_date | Integer? |
last_error_message | String? |
max_connections | Integer? |
allowed_updates | String[]? |