Telegram Bot API
🌐 English

editEphemeralMessageCaption

Category: Ephemeral · Bot API 10.3 · Official documentation

Edits the caption of an ephemeral message (Bot API 10.2).

Returns: On success, returns True.

Parameters

ParameterTypeRequiredDescription
chat_idInteger or StringYesChat ID or @username
receiver_user_idIntegerYesIdentifier of the user who received the message
ephemeral_message_idIntegerYesEphemeral message ID
captionStringOptionalNew caption (0-1024)
parse_modeStringOptionalHTML, Markdown, MarkdownV2
caption_entitiesArray of MessageEntityOptionalJSON MessageEntity array for caption
show_caption_above_mediaBooleanOptionalShow caption above media (Bot API 10.3)
reply_markupInlineKeyboardMarkupOptionalJSON: InlineKeyboardMarkup

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/editEphemeralMessageCaption" \
  -H "Content-Type: application/json" \
  -d '{
  "chat_id": 123456789,
  "receiver_user_id": 123456789,
  "ephemeral_message_id": 1
}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/editEphemeralMessageCaption",
    json={
        "chat_id": 123456789,
        "receiver_user_id": 123456789,
        "ephemeral_message_id": 1
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/editEphemeralMessageCaption`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chat_id": 123456789,
    "receiver_user_id": 123456789,
    "ephemeral_message_id": 1
  }),
});
console.log(await res.json());

Step-by-step guide: Telegram Bot API 10.0–10.3: Rich Messages, Ephemeral Messages, Guest Mode and More