API v1RESTJSON

Developer Documentation

Send messages across WhatsApp, Telegram, Line, Kakao, Viber, Zalo, and SMS with a single API. Built for developers who need reliable, scalable messaging.

7 Channels

WhatsApp, Telegram, Line, Kakao, Viber, Zalo, and SMS. One API for all.

Smart Fallback

Auto-retry failed messages on alternative channels. WhatsApp to Telegram to SMS.

Secure by Default

Scoped API keys, IP allowlists, rate limiting, and full audit logging.

Supported Channels
Use the channel code in your API requests
whatsappWhatsApp
telegramTelegram
lineLine
kakaoKakao Talk (NHN Cloud)
viberViber
zaloZalo
smsSMS
Quick Start
Send your first message in under 2 minutes

1Get your API key

Sign up and create an API key from the API Keys dashboard.

2Send a message

bash
curl -X POST https://your-domain.com/api/v1/messages/send \
  -H "Authorization: Bearer cpk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "channel": "whatsapp",
    "content": "Hello from MessageHub API!"
  }'

3Check delivery status

bash
curl https://your-domain.com/api/v1/messages/msg_abc123 \
  -H "Authorization: Bearer cpk_live_your_api_key"

# Response:
# { "data": { "id": "msg_abc123", "status": "delivered", "channel": "whatsapp" } }
Authentication

All API requests require a Bearer token in the Authorization header.

bash
Authorization: Bearer cpk_live_your_api_key

Key Format

API keys start with cpk_live_ for production or cpk_test_ for sandbox.

Scopes

messages:sendmessages:readcontacts:readcontacts:writecontent:distribute

Security Best Practices

  • Store keys in environment variables, never in code
  • Use IP allowlists for production keys
  • Assign minimum required scopes per key
  • Rotate keys every 90 days
API Endpoints
All available endpoints
POST/api/v1/messages/sendmessages:send
POST/api/v1/messages/batchmessages:send
GET/api/v1/messages/:messageIdmessages:read
POST/api/v1/content/distributecontent:distribute
POST/api/v1/webhooks/deliverypublic
POST/api/v1/messages/send
Send a single message via any configured channel

Request Body

tostringrequiredRecipient phone number or platform ID (e.g. +919876543210)
channelstringrequiredChannel: whatsapp, telegram, line, kakao, viber, zalo, sms
contentstringText content of the message
contentTypestringMessage type: text (default), template, media
templateIdstringTemplate name (required if contentType is template)
templateParamsobjectTemplate parameters as key-value pairs
mediaUrlstringURL of media to attach
fallbackobjectSmart fallback configuration (see Fallback Chains tab)

JavaScript / Node.js

javascript
const response = await fetch('https://your-domain.com/api/v1/messages/send', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer cpk_live_your_api_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    to: '+919876543210',
    channel: 'whatsapp',
    content: 'Hello! Your order #1234 has been shipped.',
  }),
});

const data = await response.json();
console.log(data);
// { data: { messageId: "msg_abc123", channel: "whatsapp", status: "sent" } }

Python

python
import requests

response = requests.post(
    'https://your-domain.com/api/v1/messages/send',
    headers={
        'Authorization': 'Bearer cpk_live_your_api_key',
        'Content-Type': 'application/json',
    },
    json={
        'to': '+919876543210',
        'channel': 'whatsapp',
        'content': 'Hello! Your order #1234 has been shipped.',
    }
)

print(response.json())

WhatsApp Template Message

javascript
await fetch('https://your-domain.com/api/v1/messages/send', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer cpk_live_your_api_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    to: '+919876543210',
    channel: 'whatsapp',
    contentType: 'template',
    templateId: 'order_confirmation',
    templateParams: {
      customer_name: 'Rajesh',
      order_id: '1234',
      delivery_date: '2026-02-15',
    },
  }),
});

Kakao AlimTalk (Korea via NHN Cloud BSP)

javascript
// AlimTalk - Transactional notification (requires Kakao-approved template)
await fetch('https://your-domain.com/api/v1/messages/send', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer cpk_live_your_api_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    to: '+821012345678',
    channel: 'kakao',
    contentType: 'template',
    templateId: 'order_confirm_001',
    templateParams: {
      '고객명': 'Kim Minjun',
      '주문번호': 'ORD-5678',
      '상품명': 'Galaxy Watch 7',
      '금액': '399,000',
    },
  }),
});

// Brand Message - Marketing (replaced FriendTalk, Dec 2025)
await fetch('https://your-domain.com/api/v1/messages/send', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer cpk_live_your_api_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    to: '+821012345678',
    channel: 'kakao',
    content: '특별 할인! 30% 쿠폰을 지금 받아가세요.',
    contentType: 'brandmessage',
  }),
});
Error Codes
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Key revoked or insufficient scope
404Not Found - Resource does not exist
429Rate Limited - Too many requests
500Server Error - Contact support
Rate Limits
Free60 req/min
Pro600 req/min
Enterprise6,000 req/min

Rate limit headers are included in every response:

bash
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 594
X-RateLimit-Reset: 1707400800

Ready to start building?

Create your free account and get your API key in under a minute.