Skip to main content

Telegram Bot Profile and Commands

Change how the bot you connected to a profile looks and which commands it offers. These changes are seen by every user of your bot, also outside Upload-Post.

  • Authentication: API Key — Authorization: Apikey <YOUR_API_KEY>
  • Every request takes user (the profile username).

Read the profile​

GET /api/uploadposts/telegram/bot-profile?user=my-profile[&language_code=es]

Returns bot (getMe), name, description, short_description, menu_button, default_administrator_rights (groups) and default_administrator_rights_channels. If one of the reads fails, it comes back as null with partial: true and the names in unavailable.

Update the profile​

PATCH /api/uploadposts/telegram/bot-profile — JSON or multipart/form-data.

FieldTypeDescriptionTelegram method
namestring0-64 characters.setMyName
descriptionstring0-512 characters, shown in an empty chat with the bot.setMyDescription
short_descriptionstring0-120 characters, shown on the bot's profile and when shared.setMyShortDescription
language_codestringTwo-letter ISO 639-1 code: the texts above apply to that language only. Empty = every language without its own text.
photo / photo_urlfile / URLStatic profile photo (.jpg).setMyProfilePhoto (static)
animation / animation_urlfile / URLAnimated profile photo (.mp4), with optional main_frame_timestamp (seconds).setMyProfilePhoto (animated)
remove_photobooleanRemove the profile photo. Needs confirm: true.removeMyProfilePhoto
menu_buttonobjectMenuButton: {"type": "commands"}, {"type": "default"} or {"type": "web_app", "text": "Open", "web_app": {"url": "https://…"}}. menu_chat_id sets it for one private chat only.setChatMenuButton
default_administrator_rightsobject / nullChatAdministratorRights suggested when someone adds the bot as admin; null clears them. for_channels: true for channels.setMyDefaultAdministratorRights

To remove a text for a language send "" in a JSON body, or clear_name / clear_description / clear_short_description = true in a form (blank form fields are ignored on purpose).

curl -X PATCH https://api.upload-post.com/api/uploadposts/telegram/bot-profile \
-H 'Authorization: Apikey your-api-key-here' -H 'Content-Type: application/json' \
-d '{"user": "my-profile", "language_code": "es", "name": "Mi Bot", "short_description": "Noticias cada día"}'
{ "success": true, "updated": ["name", "short_description"], "language_code": "es", "message": "Telegram bot profile updated." }

Commands​

MethodEndpointBodyTelegram method
GET/api/uploadposts/telegram/bot-commandsscope, language_codegetMyCommands
POST (or PUT)/api/uploadposts/telegram/bot-commandscommands (1-100 {"command", "description"}; command 1-32 lowercase letters, digits or _, description 1-256), scope, language_codesetMyCommands
DELETE/api/uploadposts/telegram/bot-commandsscope, language_code, confirm: truedeleteMyCommands

scope is a BotCommandScope: default, all_private_chats, all_group_chats, all_chat_administrators, chat / chat_administrators (with chat_id) or chat_member (with chat_id and user_id).

curl -X POST https://api.upload-post.com/api/uploadposts/telegram/bot-commands \
-H 'Authorization: Apikey your-api-key-here' -H 'Content-Type: application/json' \
-d '{"user": "my-profile", "commands": [{"command": "start", "description": "Start"}, {"command": "news", "description": "Latest posts"}]}'

Errors follow the chat management table.