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. 1.
    Get API Key
    Sign up for free and get your API key in seconds.
  2. 2.
    Connect Account
    Use our OAuth flow to connect Telegram accounts.
  3. 3.
    Start Posting
    Make API calls to post content to Telegram.
Post to Telegram
JavaScript
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

POST/v1/posts

Create or schedule a Telegram post (text, photos, videos, or albums)

GET/v1/posts/{id}

Get status and details of a Telegram post

DELETE/v1/posts/{id}

Cancel a scheduled Telegram post or delete a published message

GET/v1/profiles

List all connected Telegram channels and groups

GET/v1/connect/telegram

Generate access code to connect a Telegram channel or group

POST/v1/connect/telegram

Direct connection using chat ID (for power users)

PATCH/v1/connect/telegram

Check connection status for a pending access code

Media Requirements

TypeFormatMax SizeNotes
PhotoJPEG, PNG, GIF, WebP10 MBUp to 10 photos per album
VideoMP4, MOV50 MBUp to 10 videos per album
TextUTF-84096 charsHTML/Markdown supported
DocumentAny file type50 MBPDF, 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

Response
JSON
{
  "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

SOC 2 CompliantGDPR Compliant