Resources Overview

Viber Messaging resources overview

Available Resources

MethodPathDescriptionReference Link
POST/viber/campaignSend a Viber campaign.Send a Viber Campaign
GET/viber/tracking/campaign/{campaignTrackingId}Retrieve tracking information for a Viber campaign.Retrieve Viber Tracking by Campaign
DELETE/viber/campaign/{campaignTrackingId}Delete a scheduled Viber campaign.Delete a Scheduled Viber Campaign
POST/viber/sessionRetrieve all Viber session messages by phone number.Get All Viber Session Messages by Phone Number
GET/viber/session/{sessionId}Retrieve Viber session messages by session ID.Get Viber Session Messages by Session ID
POST/viberSend a Viber message to a single recipient. This is a paid service.Send a Viber Single Message
GET/viber/tracking/{trackingId}Retrieve tracking information for a Viber single message.Retrieve Viber Single Message by Tracking ID
POST/viber/otpSend a legacy Viber OTP message. This endpoint remains available for older integrations.Send Viber OTP Message
GET/viber/transactional/templatesList Viber transactional templates. If senderInfoTrackingId is omitted, templates for all eligible senders on the account may be returned.List Viber Transactional Templates
POST/viber/transactional/templatesCreate a new Viber transactional or OTP-category template for moderation. Requires senderInfoTrackingId as a query parameter.Create Viber Transactional Template
PATCH/viber/transactional/templates/{templateId}Update the lifecycle callback URL for a transactional template. The request body must explicitly include callbackUrl or lifecycleCallbackUrl.Update Viber Transactional Template Callback
DELETE/viber/transactional/templates/{templateId}Delete a Viber transactional template. Once deleted, the template ID can no longer be used for sending.Delete Viber Transactional Template
POST/viber/transactional/messagesSend an approved Viber transactional template message, including OTP-category templates. Use templateId, templateLang, and templateParams in the request body.Send Viber Transactional Template Message

Viber Transactional Template Resources

From July 1, 2026, every transactional Viber Business Message must be sent using a pre-approved template.

The transactional template API allows you to:

  • Create templates for Viber moderation
  • List templates and their moderation status
  • Update lifecycle callback URLs
  • Delete templates
  • Send approved transactional and OTP-category templates
📘

Important

OTP-category templates are sent through:

POST /viber/transactional/messages

There is no greenfield:

POST /viber/transactional/otp

Legacy:

POST /viber/otp

remains available for older integrations only.


Template Management Endpoints

List Viber Transactional Templates

GET /viber/transactional/templates

Retrieves Viber transactional templates available for the account.

You can optionally filter the response by sender.

Optional Query Parameter

ParameterTypeRequiredDescription
senderInfoTrackingIdstringNoFilters templates by a specific Viber sender. If omitted, templates for all eligible senders on the account may be returned.

Create Viber Transactional Template

POST /viber/transactional/templates

Creates a new Viber transactional or OTP-category template and submits it for moderation.

Required Query Parameter

ParameterTypeRequiredDescription
senderInfoTrackingIdstringYesIdentifies the Viber sender for which the template is created.

Notes

  • One template belongs to one Viber sender.
  • One template has one locale.
  • Templates cannot be edited after submission.
  • If wording or variables must change, delete the existing template and create a new one.
  • Routee supports up to 2,000 transactional templates per Viber sender.

Update Viber Transactional Template Callback

PATCH /viber/transactional/templates/{templateId}

Updates Routee’s stored lifecycle callback URL for template moderation status events.

This endpoint is used only for the template lifecycle webhook URL.

It does not update the template text, language, category, or variables.

Path Parameter

ParameterTypeRequiredDescription
templateIdstringYesUUID of the transactional template.

Request Body

Use callbackUrl:

{
  "callbackUrl": "https://example.com/viber-template-status"
}

Or use the alternate field name lifecycleCallbackUrl:

{
  "lifecycleCallbackUrl": "https://example.com/viber-template-status"
}

To clear the callback URL:

{
  "callbackUrl": null
}

Strict request body

An empty request body is rejected on the greenfield endpoint:

{}

The callback update must be explicit.


Delete Viber Transactional Template

DELETE /viber/transactional/templates/{templateId}

Deletes a Viber transactional template.

Path Parameter

ParameterTypeRequiredDescription
templateIdstringYesUUID of the transactional template to delete.

Important

Once deleted, the template ID can no longer be used for sending.


Send Endpoint

Send Viber Transactional Template Message

POST /viber/transactional/messages

Sends an approved Viber transactional template message.

This endpoint is used for both:

  • Transactional templates
  • OTP-category templates

Request Body Highlights

FieldTypeRequiredDescription
senderInfoTrackingIdstringYesIdentifies the Viber sender in Routee.
tostringYesRecipient mobile number in E.164 format with leading +.
templateIdstringYesUUID of the approved template.
templateLangstringYesTemplate locale, using ISO 639-1 format, for example en.
templateParamsobjectYesKey-value object containing the placeholder values required by the approved template.
deliveryScopestringNoPRIMARY_DEVICE or ALL_DEVICES. Defaults to PRIMARY_DEVICE when omitted.
seqnumberNoOptional partner correlation ID. If omitted, Routee assigns one.
ttlnumberNoMessage time-to-live in seconds.
callbackUrlstringNoPer-message delivery callback URL. This is different from the template lifecycle callback URL.
inboundUrlstringNoURL for inbound replies, where applicable.
labelstringNoOptional label for reporting or grouping.
sessionMessagebooleanNoIndicates whether the message is related to a Viber session flow, where applicable.

Example — Transactional Template Message

{
  "senderInfoTrackingId": "your-viber-sender-tracking-id",
  "to": "+972500000000",
  "ttl": 86400,
  "templateId": "2c017482-2f44-41d6-adad-2d6af725fdbe",
  "templateLang": "en",
  "templateParams": {
    "name": "John",
    "time_start": "10:00",
    "time_end": "14:00"
  },
  "deliveryScope": "PRIMARY_DEVICE",
  "sessionMessage": false
}

Example — OTP-Category Template Message

{
  "senderInfoTrackingId": "your-viber-sender-tracking-id",
  "to": "+972500000000",
  "templateId": "APPROVED_OTP_TEMPLATE_UUID",
  "templateLang": "en",
  "templateParams": {
    "pin": "482910",
    "minutes": "5"
  },
  "deliveryScope": "PRIMARY_DEVICE",
  "ttl": 86400
}
📘

OTP templates

OTP-category templates must include a non-empty pin value in templateParams.


Send-Time Validation

Before a transactional template message is queued, Routee validates the request against the approved template.

Routee checks:

  • Template ID
  • Template language
  • Required parameters
  • OTP pin, where applicable
  • Parameter length
  • Invalid URLs in parameter values
  • File-extension-like parameter values, for example test.pdf

If validation fails, Routee returns:

HTTP 400

With error code:

400019029

And a validationIssues array.

Example Error Response

{
  "code": "400019029",
  "validationIssues": [
    {
      "code": "OTP_PIN_REQUIRED",
      "message": "OTP template messages must include a non-empty pin parameter."
    }
  ]
}

Typical validation issue codes include:

CodeMeaning
OTP_PIN_REQUIREDThe OTP template requires a non-empty pin value.
TEMPLATE_LANG_MISMATCHThe provided templateLang does not match the approved template locale.
PARAM_CONTAINS_URLA template parameter contains a URL.
PARAM_CONTAINS_FILE_EXTENSIONA template parameter contains a file-extension-like value, such as test.pdf.
PARAM_VALUE_TOO_LONGA template parameter value exceeds the allowed length.
PARAM_MISSINGA required template parameter is missing.
PARAM_NOT_ALLOWEDThe request contains a parameter not defined in the approved template.

Tracking and Callbacks

Transactional template sends use the standard Viber tracking and callback concepts.

Polling

Use the existing Viber tracking endpoint:

GET /viber/tracking/{trackingId}

Delivery Callback

Set callbackUrl on the send request to receive per-message delivery status updates.

Delivery callbacks may include transactional template information such as:

  • messageKind
  • transactionalTemplate
  • transactionalTemplate.seq

Lifecycle Callback

Set or update the template lifecycle callback URL using:

PATCH /viber/transactional/templates/{templateId}

Lifecycle callbacks are for moderation events such as:

  • Pending moderation
  • Approved
  • Rejected

Do not confuse callback types

The template lifecycle callback is not the same as the per-message delivery callback.

Use separate URLs unless you intentionally merge them behind your own gateway.


What’s Next

After reviewing the Viber Messaging resources, continue with: