Telegram Bot icon

Telegram Bot

Interact with the Telegram Bot API – send messages, manage chats, handle payments, and more

Actions101

Message → Send Document

AI-generated

Summary

Uploads and sends a file to a specified Telegram chat as a document.

Inputs

  • chat_id (required) — Unique identifier for the target chat or username (@channelusername).
  • fileSource — How to provide the file (fileId, url, or binary).
  • fileId — File ID of the file to send (required if fileSource is fileId).
  • fileUrl — URL of the file to send (required if fileSource is url).
  • binaryPropertyName — Name of the binary property containing the file (required if fileSource is binary).
  • caption — Caption for the file.
  • parse_mode — How to parse the caption (none, Markdown, MarkdownV2, or HTML).
  • reply_markup — Inline keyboard, reply keyboard, or other reply markup as JSON.
  • additionalFields — Additional message parameters such as disable_notification, protect_content, reply_to_message_id, message_thread_id, disable_web_page_preview, and allow_sending_without_reply.

Output shape

A single record containing the sent message object (chat_id, message_id, date, from, chat).

The operation returns the API response for the sent message, which includes the unique message ID. If multiple items are processed, the output is a list of these records.

Examples

Example 1: Send a PDF document from a File ID to a channel.

File Source: File ID; Chat ID: @mychannel; Caption: 'Monthly Report'.

Example 2: Upload a file from a URL to a personal chat.

File Source: URL; File URL: https://example.com/document.pdf; Chat ID: 123456789.

Example 3: Send a document without creating a notification.

File Source: Binary; Binary Property: data; Additional Fields: disable_notification = true.

Links

Discussion