API Reference
Telegram API
Telegram's Bot API requires self-hosted bot management, separate methods for each media type, and manual rate limit handling. Zernio unifies it into one endpoint for channels and groups.
Quick Start
- 1.Get API KeySign up for free and get your API key in seconds.
- 2.Connect AccountUse our OAuth flow to connect Telegram accounts.
- 3.Start PostingMake API calls to post content to Telegram.
const response = await fetch('https://zernio.com/api/v1/posts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: 'Just launched our new API! Check it out ๐',
mediaItems: [{ type: 'image', url: 'https://example.com/launch.png' }],
platforms: [{
platform: 'telegram',
accountId: 'acc_abc123'
}],
publishNow: true
})
});
const post = await response.json();
console.log(post.post._id); // '65f1c0a9e2b5af0012ab34cd'Telegram Endpoints
Create or schedule a Telegram post (text, photos, videos, or albums)
Get status and details of a Telegram post
Cancel a scheduled Telegram post or delete a published message
List all connected Telegram channels and groups
Generate access code to connect a Telegram channel or group
Direct connection using chat ID (for power users)
Check connection status for a pending access code
Media Requirements
| Type | Format | Max Size | Notes |
|---|---|---|---|
| Photo | JPEG, PNG, GIF, WebP | 10 MB | Up to 10 photos per album |
| Video | MP4, MOV | 50 MB | Up to 10 videos per album |
| Text | UTF-8 | 4096 chars | HTML/Markdown supported |
| Document | Any file type | 50 MB | PDF, ZIP, etc. |
Zernio automatically transcodes and optimizes media for Telegram's requirements.
API Limits
Telegram has strict flood control limits. Zernio handles these automatically with intelligent queuing and retries for reliable posting.
Zernio handles all rate limiting automatically. We queue and retry requests as needed.
Features
- โPost text, photos, videos, and documents
- โSchedule posts for optimal times
- โMedia albums (up to 10 items)
- โHTML and Markdown formatting
- โSilent notifications option
- โChannel and group support
- โMessage deletion support
- โWebhook notifications for post status
Response Example
{
"post": {
"_id": "65f1c0a9e2b5af0012ab34cd",
"status": "published",
"content": "Just launched our new API! Check it out ๐",
"platforms": [{
"platform": "telegram",
"accountId": { "_id": "acc_abc123", "username": "My Channel" },
"status": "published",
"platformPostId": "123456",
"platformPostUrl": "https://t.me/c/1234567890/123456"
}],
"publishedAt": "2025-01-10T10:30:00Z"
},
"message": "Post published successfully"
}Start building with Telegram API
Free tier available ยท No credit card required ยท 99.97% uptime

