Telegram Bot API
🌐 English

copyMessages

Category: Messages · Bot API 10.3 · Official documentation

Copies multiple messages.

Returns: On success, returns Array of MessageId.

Parameters

ParameterTypeRequiredDescription
chat_idInteger or StringYesTarget chat ID
message_thread_idIntegerOptionalForum topic ID
direct_messages_topic_idIntegerOptionalDirect messages topic ID (Bot API 10.0)
from_chat_idInteger or StringYesSource chat ID
message_idsArray of IntegerYesJSON array of message IDs [1,2,3]
disable_notificationBooleanOptionalSend silently
protect_contentBooleanOptionalProtect content
remove_captionBooleanOptionalRemove captions

Parameter descriptions are concise summaries; see the official documentation for the full text.

Example request

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/copyMessages" \
  -H "Content-Type: application/json" \
  -d '{"chat_id":123456789,"from_chat_id":123456789,"message_ids":[42,43]}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/copyMessages",
    json={
        "chat_id": 123456789,
        "from_chat_id": 123456789,
        "message_ids": [
            42,
            43
        ]
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/copyMessages`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chat_id": 123456789,
    "from_chat_id": 123456789,
    "message_ids": [
      42,
      43
    ]
  }),
});
console.log(await res.json());

Step-by-step guide: How to Create a Telegram Bot: Step by Step with BotFather and Python