Use this method to copy messages of any kind

POST /copyMessage

Use this method to copy messages of any kind. The method is analogous to the method forwardMessages, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

Body Required

  • chat_id integer | string Required

    Any of:

    Unique identifier for the target chat or username of the target channel (in the format @channelusername)

    Unique identifier for the target chat or username of the target channel (in the format @channelusername)

  • from_chat_id integer | string Required

    Any of:

    Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

    Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

  • message_id integer Required

    Message identifier in the chat specified in from_chat_id

  • caption string

    New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept

  • parse_mode string

    Mode for parsing entities in the new caption. See formatting options for more details.

  • caption_entities array[object]

    This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

    Hide caption_entities attributes Show caption_entities attributes array[object]
    • type string Required

      Type of the entity. Can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)

      Values are mention, hashtag, cashtag, bot_command, url, email, phone_number, bold, italic, underline, strikethrough, code, pre, text_link, or text_mention.

    • offset integer Required

      Offset in UTF-16 code units to the start of the entity

    • length integer Required

      Length of the entity in UTF-16 code units

    • url string

      Optional. For “text_link” only, url that will be opened after user taps on the text

    • user object

      This object represents a Telegram user or bot.

      Hide user attributes Show user attributes object
      • id integer Required

        Unique identifier for this user or bot

      • is_bot boolean Required

        True, if this user is a bot

      • first_name string Required

        User's or bot's first name

      • last_name string

        Optional. User's or bot's last name

      • username string

        Optional. User's or bot's username

      • language_code string

        Optional. IETF language tag of the user's language

      • can_join_groups boolean

        Optional. True, if the bot can be invited to groups. Returned only in getMe.

      • can_read_all_group_messages boolean

        Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.

      • supports_inline_queries boolean

        Optional. True, if the bot supports inline queries. Returned only in getMe.

    • language string

      Optional. For “pre” only, the programming language of the entity text

  • disable_notification boolean

    Sends the message silently. Users will receive a notification with no sound.

  • reply_to_message_id integer

    If the message is a reply, ID of the original message

  • allow_sending_without_reply boolean

    Pass True, if the message should be sent even if the specified replied-to message is not found

  • reply_markup object

    Any of:

Responses

  • default
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is false.

    • error_code integer Required
    • description string Required
    • parameters object

      Contains information about why a request was unsuccessful.

      Hide parameters attributes Show parameters attributes object
      • migrate_to_chat_id integer

        Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

      • retry_after integer

        Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

  • 200
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is true.

    • result object Required

      This object represents a unique message identifier.

      Hide result attribute Show result attribute object
      • message_id integer Required

        Unique message identifier

POST /copyMessage
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/copyMessage \
 -H "Content-Type: application/json" \
 -d '{"chat_id":42,"from_chat_id":42,"message_id":42,"caption":"string","parse_mode":"string","caption_entities":[{"type":"mention","offset":42,"length":42,"url":"string","user":{"id":42,"is_bot":true,"first_name":"string","last_name":"string","username":"string","language_code":"string","can_join_groups":true,"can_read_all_group_messages":true,"supports_inline_queries":true},"language":"string"}],"disable_notification":true,"reply_to_message_id":42,"allow_sending_without_reply":true,"reply_markup":{"":[[{}]]}}'
Request example
{
  "chat_id": 42,
  "from_chat_id": 42,
  "message_id": 42,
  "caption": "string",
  "parse_mode": "string",
  "caption_entities": [
    {
      "type": "mention",
      "offset": 42,
      "length": 42,
      "url": "string",
      "user": {
        "id": 42,
        "is_bot": true,
        "first_name": "string",
        "last_name": "string",
        "username": "string",
        "language_code": "string",
        "can_join_groups": true,
        "can_read_all_group_messages": true,
        "supports_inline_queries": true
      },
      "language": "string"
    }
  ],
  "disable_notification": true,
  "reply_to_message_id": 42,
  "allow_sending_without_reply": true,
  "reply_markup": {
    "": [
      [
        {}
      ]
    ]
  }
}
Request examples
{
  "chat_id": 42,
  "from_chat_id": 42,
  "message_id": 42,
  "caption": "string",
  "parse_mode": "string",
  "caption_entities": [
    {
      "type": "mention",
      "offset": 42,
      "length": 42,
      "url": "string",
      "user": {
        "id": 42,
        "is_bot": true,
        "first_name": "string",
        "last_name": "string",
        "username": "string",
        "language_code": "string",
        "can_join_groups": true,
        "can_read_all_group_messages": true,
        "supports_inline_queries": true
      },
      "language": "string"
    }
  ],
  "disable_notification": true,
  "reply_to_message_id": 42,
  "allow_sending_without_reply": true,
  "reply_markup": {
    "": [
      [
        {}
      ]
    ]
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": {
    "message_id": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": {
    "message_id": 42
  }
}