TelegramAPI
Send Telegram messages from your code
Post to a Telegram channel through a bot you own. A connection is one channel, threads work up to 24 replies, and the 4096 character limit is checked before anything is sent.
What you can build
Announce a release to the channel
The bot posts as itself, so the channel stays tidy.
import { yeetpost } from "yeetpost";
await yeetpost({
connection: "telegram",
text: `release ${version} is out`,
});Post a message with a screenshot
With mediaIds set the text becomes the photo's caption, so it has to fit in 1024 characters.
const response = await fetch("https://api.yeetpost.com/api/v2/posts", {
method: "POST",
headers: {
"x-api-key": process.env.YEETPOST_API_KEY,
"content-type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
text: "the new dashboard shipped today",
connectionSlugs: ["telegram"],
mediaIds: [screenshotMediaId],
}),
});Send the detail as a reply
Keep the head short and put the long text in the thread, one entry per reply.
body: JSON.stringify({
text: "release 2.4.0 is out",
connectionSlugs: ["telegram"],
thread: ["changelog: https://yeetpost.com/changelog"],
})Related features
- Post to a Telegram channel from your terminal
- Automate LinkedIn posts from your code
- Post to X programmatically
- Post to Bluesky from your code
Explore the full catalog on the features hub.
Related resources
Ready to get started?
Start posting to Telegram in minutes.