API Documentation

Build bots, integrate ZlmaChat into your applications, and create amazing experiences.

Bot API

Getting Started

Create a bot by talking to @BotFather on ZlmaChat. You'll receive an API token to authenticate your bot.

API Token: 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ

Base URL

https://api.zlmachat.org/bot{token}/{method}

Example: Send Message

curl -X POST https://api.zlmachat.org/bot{token}/sendMessage \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": 123456789,
    "text": "Hello from ZlmaChat Bot API!"
  }'

Available Methods

getMe

Get bot information

sendMessage

Send text messages

sendPhoto

Send photos

sendDocument

Send files

getUpdates

Long polling for updates

setWebhook

Configure webhooks

Client API

Overview

The Client API allows you to build full-featured ZlmaChat clients. Register your application to get API credentials.

Authentication

Obtain your api_id and api_hash from the developer portal.

const client = new ZlmaClient({
  apiId: YOUR_API_ID,
  apiHash: 'YOUR_API_HASH'
});

await client.connect();
await client.signIn(phoneNumber);

SDKs

🟨
JavaScript
zlmachat-js
🐍
Python
zlmachat-py
🔷
Go
zlmachat-go

Webhooks

Setting Up Webhooks

Receive real-time updates via HTTPS callbacks instead of polling.

curl -X POST https://api.zlmachat.org/bot{token}/setWebhook \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhook"
  }'

Webhook Update Format

{
  "update_id": 123456789,
  "message": {
    "message_id": 1,
    "from": {
      "id": 123456789,
      "first_name": "John",
      "username": "john_doe"
    },
    "chat": {
      "id": 123456789,
      "type": "private"
    },
    "date": 1640000000,
    "text": "Hello!"
  }
}

Rate Limits

Bot API

  • • 30 messages/second to different chats
  • • 1 message/second to same chat
  • • 20 messages/minute in groups

Client API

  • • Fair use policy applies
  • • Flood wait on excessive requests
  • • Contact support for high-volume apps

Need Help?

Join our developer community or contact our support team.