Streamline your business

Enable voice-calls at scale. Integrate Dexatel’s Voice API and start engaging instantly.

Home
Separator
Blog
Separator

How to Send Viber Messages to a Phone Number Via API

Staff Writer
Staff Writer

Published: Dec 30, 2025

Send Viber messages

Emails get ignored, and SMS feels limited. So what’s the alternative? 

In many regions, Viber is the primary app your customers use throughout the day, making it a natural and highly effective channel for brand communication and promotion.

In fact, you can use a Viber API to reach users instantly through a trusted, high-engagement messaging app that supports rich content and verified business identities. It’s a direct, reliable way to deliver alerts, updates, and promotions without competing for attention in overcrowded inboxes.

In this article, we’ll show you how to send Viber messages via API step by step, covering prerequisites, message flow, API request examples, and best practices to help you get the most out of Viber business messaging.

What Is Viber API Messaging?

Viber API messaging allows businesses to send messages to customers on Viber programmatically, using an application programming interface instead of the Viber app itself. 

In practice, this means your systems, such as a website, backend service, CRM, or ecommerce platform, can automatically send Viber messages to a user’s phone number when a specific event occurs.

With the Viber messaging API, your business can communicate from a verified brand profile directly with users who have Viber installed and active on their devices. Messages are delivered inside the Viber app rather than as SMS, which allows you to have richer content, stronger branding, and higher engagement.

Unlike person-to-person messaging, Viber API messaging is built specifically for business use cases. Messages are triggered by logic in your application, for example, when an order is placed, a login attempt happens, or an appointment reminder is due. 

The message is sent through an API request, while routing, delivery tracking, and status updates are handled automatically. This allows teams to scale messaging without manual intervention.

When to Use Viber Messaging API

Today’s messaging landscape is dominated by platforms where customers already spend significant portions of their day. Viber stands out with more than 820 million active users engaging in over 70 million interactions every hour and average daily time in the app exceeding 35 minutes, putting brands in front of users in a space where they are highly attentive rather than interrupting them in another channel.

With that backdrop, knowing when to use tools like Viber API and send messages becomes a strategic advantage rather than a technical option.

Authentication and Login Alerts

In business systems today, security alerts are expected. Studies show that messaging channels like Viber and SMS are opened far more frequently than email, often within minutes of receipt, making them ideal for time‑sensitive notifications.

Sending an authentication message or login alert via Viber turns a routine security step into a seamless experience. Because most people glance at messenger notifications faster than any other channel, users are less likely to ignore alerts about unusual login attempts or one‑time codes. Very few other channels combine speed with the personal feel of a chat message, so real‑time alerts really stand out when sent through Viber.

Order Confirmations and Delivery Updates

Keeping customers informed at every step of their order builds trust and encourages engagement.

  • High visibility and delivery: Viber’s branded messages have strong delivery and read rates.

  • Less transactional feel: Notifications appear as part of a familiar chat interface rather than a generic alert.

  • Interactive elements: Include live tracking links, customer support options, or clickable CTAs directly in the message.

  • Enhanced engagement: Messages sent via Viber encourage users to interact and take action faster than plain text alerts.

  • Customer satisfaction: Real-time updates reduce inbound inquiries and improve the post-purchase experience.

Appointment Reminders

Appointment reminders cut no‑show rates and improve operational flow. Text‑based reminders can reduce no‑shows because people see the message quickly and act on it. Reaching users where they already communicate every day accelerates response times, and delivering these reminders via Viber’s interface helps messages feel relevant rather than intrusive.

Customer Support Notifications  

Real-time messaging is becoming the preferred way for customers to interact with brands.

  • Preferred channel: Over half of consumers prefer messaging a brand rather than making a phone call.

  • Instant updates: Send ticket updates, service resolutions, or follow-ups directly via Viber.

  • Two-way conversations: Messages feel like chat threads, enabling users to respond quickly and naturally.

  • Improved satisfaction: Faster responses and easy access to support reduce friction and enhance customer experience.

  • Higher engagement: Customers are more likely to read and act on messages sent through Viber compared to email or voice calls.

Promotions

Promotional messaging has historically been dominated by bulk SMS or email. However, messaging platforms like Viber combine immediacy with personalization that email often lacks. Some business case studies show that messaging apps can reduce delivery costs while increasing engagement compared to traditional SMS campaigns when tailored content is used.

Viber also supports rich media, CTAs, and interactive elements. This makes promotional messages feel less like interruptions and more like invitations, which can lead to higher response and conversion rates compared to generic campaigns. 

Prerequisites Before You Can Send Viber Messages

Before you can send Viber messages to a phone number via API, there are a few preliminary steps to complete. These include:

Viber Sender Setup

To send business messages on Viber, you need an approved Viber Business account with a sender ID or brand profile. Viber reviews and approves the data you provide to verify your identity and protect users from spam. Once approved, your messages appear as coming from a trusted, verified business.

Depending on your messaging use case, you may need to submit message templates for approval. This is common for transactional messaging such as authentication alerts, order confirmations, and service notifications. 

You must also define whether your messages are transactional or promotional. Transactional messages include essential updates such as login alerts and receipts, while promotional messages cover marketing campaigns and special offers. Message category affects approval requirements, pricing, and how messages are delivered, so this distinction should be made early in your setup.

Dexatel Setup

After creating your Dexatel account, generate an API key or access token in the dashboard. This credential is used to authenticate all API requests and should be stored securely. Anyone with access to this key can send messages on your behalf, so it must be protected carefully.

Dexatel typically offers a sandbox or test environment and a production environment. The sandbox is used to test request formatting, message flow, and delivery status callbacks without sending live messages. Once testing is complete, you switch to the production environment to begin real Viber messaging.

For added security, you may enable IP allowlisting or other access controls if available. This restricts API access to specific servers and reduces the risk of unauthorized usage, which is especially important for production systems.

Customer Prerequisites

Customers must explicitly opt in to receive messages from your business, particularly for promotional communication. Proper consent is essential for regulatory compliance and helps maintain long-term trust with your audience.

Needless to say, recipients must also have Viber installed and active on their device for the message to be delivered through the Viber channel. If the phone number is not reachable on Viber, delivery will fail, which is why many businesses configure an automatic SMS fallback for full message coverage.

Viber Message Flow

When using a messaging system to send Viber messages via API, each message follows a clear, structured sequence from the initial trigger in your application to final delivery or fallback. 

1. Your App Triggers Event

Everything starts inside your application. An event occurs that requires customer communication, such as a user logging in, placing an order, or booking an appointment. This activates your messaging logic and prepares the required data for the Viber message, including the recipient’s phone number, message content, and channel selection.

2. Your Server Calls Dexatel API

Once the event is triggered, your server sends an API request to Dexatel. This request includes the formatted phone number, message body, and Viber channel parameters, along with optional fields such as a callback URL or reference ID. This step is a typical Viber API send message example, where the message is accepted for processing but not yet delivered to the end user.

3. Dexatel Routes to Viber

Dexatel processes the request and routes the message to the Viber network. The system verifies whether the recipient’s phone number is reachable on Viber and applies the correct sender profile and message category. If the number is eligible, the message is forwarded to Viber for delivery.

4. Delivery Status Callbacks Update Your System

As the message moves through the delivery lifecycle, Dexatel sends real-time status updates back to your system via webhooks or callbacks. These may include statuses such as queued, sent, delivered, read, or failed. Your application can use this data for analytics, reporting, customer support, or retry logic.

5. Optional Fallback to SMS if Viber Is Not Reachable

If the recipient does not have Viber installed or the message cannot be delivered through the Viber channel, an optional fallback can be triggered. In this scenario, the same message or a simplified version is sent as an SMS, ensuring message continuity and maximum reach for critical transactional communication.

Sending a Viber Message to a Phone Number Via Dexatel’s API

Now that we’ve covered the basics, here’s how to send a Viber message to a phone number using Dexatel’s API: 

1. Format the Phone Number Correctly (E.164)

All phone numbers must be formatted using the international E.164 standard before being sent via the API. This format allows for correct routing across countries and carriers.

The E.164 format follows three simple rules:

  • It starts with a plus sign

  • It includes the country code

  • It excludes spaces, brackets, and leading zeros

Common mistakes to avoid

  • Missing the plus sign

  • Keeping a leading zero from the local format

  • Using the wrong country code

  • Adding spaces or special characters

2. Choose the Message Type

Dexatel’s Viber API supports multiple message types depending on your sender setup and approvals.

  • Text messages: Plain text messages are the simplest and most widely supported option. They work well for authentication alerts, confirmations, and short notifications.

  • Rich media messages: If enabled for your sender, you can send messages that include images, files, or interactive buttons with a call to action. Rich messages are commonly used for promotions, delivery updates, or customer engagement flows.

  • Templates: In some cases, especially for transactional messaging, pre-approved templates may be required. Templates help standardize message structure and ensure compliance with Viber policies.

Your choice of message type should match the message category and the user’s expectations.

3. Build the API Request

Once the phone number and message type are defined, you can build the API request.

Endpoint

Use the Dexatel messaging endpoint. The exact URL depends on your environment and is shown here as a placeholder.

POST https://api.dexatel.com/messages

Required fields

  • Sender ID or brand name

  • Recipient phone number in E.164 format

  • Message content

  • Channel set to Viber

  • Callback URL for delivery statuses

Optional fields

  • Client reference ID for internal tracking

  • Scheduled send time

  • Message TTL or expiry time

  • Fallback settings for SMS

These optional parameters help you control timing, traceability, and delivery reliability.

4. Send the Request

Below are example requests using different tools and languages.

cURL example

curl -X POST https://api.dexatel.com/messages \

  -H "Authorization: Bearer YOUR_API_KEY" \

  -H "Content-Type: application/json" \

  -d '{

    "sender": "YourBrand",

    "to": "+374XXXXXXXX",

    "channel": "viber",

    "message": {

      "type": "text",

      "text": "Your order has been confirmed"

    },

    "callback_url": "https://yourdomain.com/webhook"

  }'

Node.js example using fetch

fetch("https://api.dexatel.com/messages", {

  method: "POST",

  headers: {

    "Authorization": "Bearer YOUR_API_KEY",

    "Content-Type": "application/json"

  },

  body: JSON.stringify({

    sender: "YourBrand",

    to: "+374XXXXXXXX",

    channel: "viber",

    message: {

      type: "text",

      text: "Your order has been confirmed"

    },

    callback_url: "https://yourdomain.com/webhook"

  })

})

.then(response => response.json())

.then(data => console.log(data))

.catch(error => console.error(error));

Python example using requests

import requests

url = "https://api.dexatel.com/messages"

headers = {

    "Authorization": "Bearer YOUR_API_KEY",

    "Content-Type": "application/json"

}

payload = {

    "sender": "YourBrand",

    "to": "+374XXXXXXXX",

    "channel": "viber",

    "message": {

        "type": "text",

        "text": "Your order has been confirmed"

    },

    "callback_url": "https://yourdomain.com/webhook"

}

response = requests.post(url, json=payload, headers=headers)

print(response.json())

These examples show a basic text message. Rich media or template messages follow the same structure with additional message fields.

5. Handle the API Response

After sending the request, the API returns an immediate response indicating whether the message was accepted for processing.

Typically, the response includes:

  • A unique message ID

  • The initial processing status

Keep in mind that immediate acceptance does not mean final delivery. The message ID should be stored in your system and linked to a client reference ID if provided. This allows you to match later delivery status callbacks to the original request.

For proper logging and traceability, every message should be recorded with its message ID, recipient number, channel, and timestamp. This makes it easier to debug issues, analyze delivery performance, and support customer inquiries.

Delivery Statuses and Webhooks

Once your Viber message is sent, knowing what happens next is just as important as sending it in the first place. Delivery statuses give you real visibility into each message, helping you understand whether it was queued, delivered, or needs attention.

Why Delivery Receipts Matter

Statuses are essential for debugging issues, tracking performance, and supporting your customers. They also let you build smart retry logic, so failed messages can be handled automatically instead of slipping through the cracks.

Common Delivery Status Lifecycle

Most messages move through a simple flow: queued → sent → delivered → read (when available). In some cases, a message may be marked as failed or rejected, often due to invalid numbers, unavailable Viber users, or channel restrictions.

Setting Up Webhooks

To receive these updates in real-time, you’ll need a secure webhook endpoint in your system. Make sure to verify incoming requests using a shared secret or signature if supported, and implement idempotency to prevent double-processing the same status update. This keeps your data accurate and your messaging flow reliable.

What if the User Doesn’t Have Viber? 

Not every customer will be reachable on Viber, and that’s where smart fallback comes in. By automatically switching channels, you make sure important messages still get delivered without breaking the customer experience.

  • Smart fallback: Automatically detect when a user is unreachable on Viber

  • Better reach and conversions: Messages still arrive, even if Viber isn’t available

  • Simple logic: Try Viber → if undelivered or unreachable after X minutes → send SMS

  • Consistent messaging: Keep the same message content and tone across Viber and SMS

Best Practices for Viber API Messaging

Keep the First Line Clear

The first line of your message is the most important. Users often decide whether to open or read a message based solely on the opening text. Start with a clear statement of purpose or value, such as confirming an order, delivering a verification code, or highlighting a special offer. Avoid unnecessary filler and make your intent immediately obvious.

Use Short Messages and a Strong Call to Action

Concise messages are easier to read and more likely to be acted upon. Focus on delivering key information quickly and include a strong call to action. For example, ask the user to confirm an appointment, track an order, or redeem an offer. When using rich media, pair it with text that clearly explains the action the user should take.

Respect Local Quiet Hours

Sending messages at inappropriate times can annoy users and damage trust. Respect local time zones and quiet hours when scheduling messages. For example, avoid sending marketing content late at night or early in the morning. Transactional messages such as login alerts can be sent anytime, but marketing and promotional messages should be timed considerately.

Set Frequency Caps

Limit the number of messages sent to a single user within a given time period. High frequency can lead to user fatigue, opt-outs, or spam complaints. Establish sensible limits based on message type, urgency, and user preferences. Frequency caps help maintain engagement and protect your brand reputation.

Do A/B Testing for Promotional Content

If you send promotional or marketing messages, use A/B testing to optimize performance. Experiment with different headlines, call to actions, images, and message length. Analyze open rates, click rates, and conversions to determine which variations resonate best with your audience. Iterative testing helps you improve engagement and keeps your messaging data-driven.

Security, Compliance, and Deliverability Tips

Sending Viber messages isn’t just about getting them out the door, it’s also about keeping your data safe, staying compliant, and making sure your messages actually reach your users.

  • Secure API keys: Treat your API keys like passwords. Store them securely, rotate them regularly, and never expose them in client-side code or public repositories.

  • Rate limiting and retry strategy: Respect rate limits to avoid throttling or failed requests. When messages fail temporarily, use controlled retries with backoff logic instead of sending repeated requests all at once.

  • Handling PII safely: Phone numbers and message content often include personal data. Encrypt sensitive information, limit access internally, and store only what you truly need for delivery and reporting.

  • Consent, opt-outs, and regulatory basics: Make sure your recipients have given consent to receive messages. Always support opt-out mechanisms and follow local messaging regulations to avoid compliance issues.

  • Brand trust and sender consistency: Use a verified sender profile and keep your brand name consistent across messages. This builds recognition, improves deliverability, and reassures users that the message is genuinely from you.

Troubleshooting Common Issues

Common issues can occur even with a correctly configured Viber API setup. Addressing them quickly keeps messaging reliable and reduces failed deliveries.

Invalid Phone Number

Numbers must be in E.164 format with the plus sign and correct country code. Avoid extra spaces or leading zeros. Confirm the number belongs to an active Viber user to prevent delivery failures.

Sender Not Approved

Messages may be rejected if your sender ID or brand profile is not approved. Check the approval status in your Viber Business account and confirm compliance with branding and template policies.

Delivered Status Missing

Delivery receipts may not appear if webhooks are misconfigured or the recipient device is offline. Verify your webhook endpoint is active, uses HTTPS, and is correctly registered in Dexatel.

High Failure Rate

Frequent failures can indicate formatting errors, an unapproved sender, or network issues. Review API response codes, confirm valid numbers, check sender approvals, and monitor rate limits. Consider fallback to SMS for undeliverable messages.

Queue Delays

High traffic or exceeded rate limits can delay messages in the queue. Monitor queued messages, implement retries with backoff, and set appropriate TTL values to prevent messages from expiring.

Quick Start Checklist

  • Sender approved: Confirm that your Viber Business sender ID or brand profile has been reviewed and approved by Viber.

  • API key created: Generate an API key or token in Dexatel and store it securely.

  • Phone number in E.164: Make sure all recipient numbers are formatted in E.164, including the plus sign and correct country code.

  • Webhook receiving statuses: Set up a secure webhook endpoint to receive delivery and read status updates.

  • Fallback configured (optional): Configure SMS fallback for users not reachable on Viber to maximize delivery.

  • Logging and reference IDs enabled: Enable logging and use reference IDs for traceability and troubleshooting of messages.

To Conclude

Sending messages via the Viber API involves a clear and structured process. First, set up your Viber sender and Dexatel account with the proper approvals, API keys, and phone number formatting. 

Next, build and send your API requests while selecting the right message type. Monitor delivery statuses through webhooks and handle fallback to SMS for users who are unreachable on Viber. Make sure you follow best practices for message clarity, timing, frequency, and compliance to maintain trust and engagement.

Ready to start sending Viber messages? Use the Dexatel API to reach your customers with rich, reliable, and branded messaging today.

DexatelSchedule a DemoArrow

Subscribe to OurNewsletter

Never miss out on our latest news and exclusive offers.