Skip to content

Telegram API

Telegram is a bring-your-own-bot integration: each connected profile is one bot (created via @BotFather) that publishes to any channel where it’s an administrator. The same bot also powers two-way direct messages. See the Telegram BYO bot guide for setup.

Every request below uses the base URL https://api.postproxy.dev and an Authorization: Bearer YOUR_API_KEY header. Replace YOUR_API_KEY and the example IDs with your own.

Platform IDtelegram
Formatspost (channel post)
Character limit4,096
MediaOptional
PlacementsChannels — selected with chat_id (required)
CommentsNo
Direct messagesYes — text, media, edits, keyboards
Post chainsNo
ParameterTypeRequiredDescription
chat_idstringYesDestination channel/group — fetch from placements
parse_modestringNoHTML or MarkdownV2. Omit for plain text
disable_link_previewbooleanNoDon’t render link previews
disable_notificationbooleanNoSend silently (no notification sound)
MediaMax sizeFormatsCountDuration
Image10 MBjpg, png, webp, gif10
Video50 MBmp4, mov10
Document50 MBpdf, doc, docx, zip, mp3, wav1
  • Text-only posts are allowed; media is optional.
  • Images and video can be mixed in one media group.
Terminal window
# HTML-formatted channel post with an image, link preview off
curl -X POST "https://api.postproxy.dev/api/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post": { "body": "<b>New release</b> — read the changelog: https://example.com/changelog" },
"profiles": ["prof_abc123"],
"media": ["https://example.com/image.jpg"],
"platforms": {
"telegram": {
"chat_id": "-1001234567890",
"parse_mode": "HTML",
"disable_link_preview": true
}
}
}'

Each placement is a channel the bot has been added to as administrator. List them with the placements endpoint — each placement’s id is the chat_id you pass when creating a post. chat_id is always required.

Terminal window
# List channels (placements) the bot can post to
curl "https://api.postproxy.dev/api/profiles/prof_abc123/placements" \
-H "Authorization: Bearer YOUR_API_KEY"

The list is empty until the bot is added as a channel admin — Telegram pushes a my_chat_member event for each one, which Postproxy records. Poll the endpoint after connecting until the expected channels appear.

Not supported through the API.

Telegram DMs use the Bot API and offer richer features than the Meta networks in some areas. Supported through the Direct Messages API.

CapabilitySupported
Send / receive textYes
AttachmentsYes — photo, video, document, GIF, audio, voice, sticker
Edit outbound messageYes
Reply threadingYes — reply_to_external_id
Inline / reply keyboardsYes — reply_markup
ReactionsNo
Private reply to a commentNo
Delivery / read receiptsNo
Inbound deliveryWebhook
  • Bot must be DM’d first. A bot can only message a user after that user has messaged it at least once (typically via /start); otherwise the send returns 422.
  • No messaging window — once a user has DM’d the bot, it can reply at any time.
  • Callback queries from inline-button taps arrive as inbound messages (platform_data.kind == "callback_query"); subscribe to message.received to react.
Terminal window
# Create or find a chat by the user's Telegram ID
curl -X POST "https://api.postproxy.dev/api/profiles/prof_abc123/chats" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "participant_external_id": "8000000000" }'
Terminal window
# Send a text message with an inline keyboard
curl -X POST "https://api.postproxy.dev/api/chats/chat_abc123/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"body": "Pick an option:",
"reply_markup": {
"inline_keyboard": [[
{ "text": "Plans", "callback_data": "plans" },
{ "text": "Docs", "url": "https://postproxy.dev" }
]]
}
}'
Terminal window
# Send a single media attachment
curl -X POST "https://api.postproxy.dev/api/chats/chat_abc123/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "media": ["https://example.com/invoice.pdf"] }'
Terminal window
# Edit a previously sent message (Telegram only)
curl -X PATCH "https://api.postproxy.dev/api/messages/msg_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "body": "Updated: the sale ends tonight!" }'

Subscribe with the Webhooks API:

Terminal window
curl -X POST "https://api.postproxy.dev/api/webhooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/postproxy",
"events": ["platform_post.published", "message.received", "message.edited"]
}'

Events relevant to Telegram:

EventWhen
post.processedA post is ready to publish
platform_post.publishedA post was published to the platform
platform_post.failedA post failed to publish (retries exhausted)
platform_post.failed_waiting_for_retryA publish attempt failed; will retry
platform_post.insightsNew analytics snapshot
message.received / .sentInbound / outbound DM
message.editedA message was edited (inbound, or outbound via the API)
message.failed_waiting_for_retryAn outbound DM failed; will retry
message.failedAn outbound DM failed permanently
profile.connected / .disconnectedConnection state changed
profile.statsNew profile stats snapshot — fires once per channel placement
media.failedA media attachment failed to process

Telegram does not expose delivery/read receipts, deletion events, or reactions.

  • Create the bot with @BotFather and add it as an administrator to each channel — see the Telegram BYO bot guide.
  • chat_id is required on every post; one bot can publish to many channels.
  • Use parse_mode (HTML / MarkdownV2) for rich formatting.