Build flexible workflows with our API

Add Viber messaging to your apps, CRM, or marketing tools with the MSG PLS API. Keep full control while making integration straightforward.

Benefits of Using Our API

Authentication & Security

JWT Tokens

Expire in 15 minutes, can be refreshed with a valid refresh token.

API Tokens

Never expire (until revoked), perfect for automation.

IP Whitelisting

For security, only authorized IP addresses can send requests.

Immediate Revocation

Compromised tokens can be revoked instantly.

KEY FEATURES

Deliver text, images, or text+image messages to your customers via their phone numbers.

Include dynamic variables like {{first_name}} or {{last_name}} to personalize each message.

If you send a message to a new phone number, the system automatically creates a recipient record.

Retrieve detailed delivery reports - see if your messages were sent, delivered, or read.

• JWT Tokens for short-term access with refresh capabilities.

• API Tokens for long-term server-to-server integrations.

Send Direct Messages
Personalization with Placeholders
Automatic Recipient Creation
Message Status Tracking
Multiple Authentication Options

API Endpoints Overview

POST /auth/login, POST /auth/refresh

# Login to obtain an access token
curl -X POST https://api.msgpls.com/api/auth/login/ \
  -F "email=you@example.com" \
  -F "password=your_password"

# Refresh your token
curl -X POST https://api.msgpls.com/api/auth/refresh/ \
  -H "Authorization: Bearer <your_refresh_token>"

Response example:
{
  "message": "Login successful",
  "is_admin": false,
  "access_token": "eyJhbGciOiJIUzI1...",
  "refresh_token": "eyJ0eXAiOiJK..."
}

POST /api-tokens, GET /api-tokens, DELETE /api-tokens/:id

# Create a new API token
curl -X POST https://api.msgpls.com/api/tokens/ \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-integration"}'

# List all tokens
curl https://api.msgpls.com/api/tokens/ \
  -H "Authorization: Bearer <access_token>"

Response example:
{
  "tokens": [
    {"id": 1, "name": "my-integration", "created": "2025-01-15"}
  ]
}

POST /messages/send, GET /messages/:id

# Send a Viber message
curl -X POST https://api.msgpls.com/api/messages/send/ \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "41793026727",
    "from": "MSGPLS",
    "text": "Hello from our API!"
  }'

Response example:
{
  "message_id": "abc123",
  "status": "sent",
  "timestamp": "2025-01-15T12:00:00Z"
}

Error codes and responses

# Common error responses

# 401 Unauthorized
{
  "error": "Invalid or expired token",
  "code": 401
}

# 429 Too Many Requests
{
  "error": "Rate limit exceeded",
  "code": 429,
  "retry_after": 60
}

# 400 Bad Request
{
  "error": "Missing required field: 'to'",
  "code": 400
}

Interactive API Documentation

Explore and test every endpoint in real time using our integrated Swagger interface. Get instant responses and see how the MSG PLS API works under the hood.

Go to Swagger

DEVELOPER TOOLS

Build solutions around your business

Add Viber messaging to your platform with just a few lines of code. Whether you send transactional notifications, run marketing campaigns, or build intelligent chatbots, the MSG PLS API gives you the flexibility and control to shape the experience around your needs.

See Documentation
const axios = require("axios");

async function sendViberMessage() {
  const response = await axios.post(
    "https://api.msgpls.com/api/messages/",
    {
      phone_num: "359888123456",
      text: "Hello from MSG PLS API 🚀",
    },
    {
      headers: {
        Authorization: "Bearer YOUR_ACCESS_TOKEN",
      },
    }
  );

  console.log(response.data);
}

sendViberMessage();

Launch campaigns at scale

Create and send promotional Viber campaigns to thousands of users with a single API call. Schedule messages, segment audiences, and track delivery — all programmatically.

See Documentation
const axios = require("axios");

async function sendCampaign() {
  const response = await axios.post(
    "https://api.msgpls.com/api/campaigns/",
    {
      name: "Summer Sale 2025",
      audience: "segment_vip_customers",
      message: {
        text: "🎉 Exclusive 30% off just for you!",
        button: {
          text: "Shop Now",
          url: "https://example.com/sale",
        },
      },
      scheduled_at: "2025-07-01T10:00:00Z",
    },
    {
      headers: {
        Authorization: "Bearer YOUR_ACCESS_TOKEN",
      },
    }
  );

  console.log(response.data);
}

sendCampaign();

Build intelligent chatbots

Connect your chatbot logic to Viber through our webhook-based API. Handle user messages, send rich replies, and manage conversation state — your bot, your rules.

See Documentation
const express = require("express");
const app = express();

app.post("/webhook", (req, res) => {
  const { event, message, sender } = req.body;

  if (event === "message") {
    const reply = generateReply(message.text);

    axios.post(
      "https://api.msgpls.com/api/messages/",
      {
        phone_num: sender.phone,
        text: reply,
      },
      {
        headers: {
          Authorization: "Bearer YOUR_ACCESS_TOKEN",
        },
      }
    );
  }

  res.sendStatus(200);
});

app.listen(3000);

IN ACTION

CRM Integration

Trigger personalized Viber notifications based on customer actions.

Automated Alerts

Send instant delivery updates or payment confirmations.

Marketing Campaigns

Schedule and send bulk promotional messages.

How to get started?

Sign Agreement

with us to activate your account.

Log In (No Install)

From your browser, no install needed.

Send Your First Campaign

Create your first message, and send.

Track performance

and optimize for your next campaign.