---
title: "OTP template messages"
description: "Templates are predefined messages stored on Viber side which allows you to define specific values upon sending the message. Templates are used for sending one time password (OTP) messages."
canonical: "https://docs.cm.com/messaging/viber/otp-template-messages"
---

# OTP template messages

> Templates are predefined messages stored on Viber side which allows you to define specific values upon sending the message. Templates are used for sending one time password (OTP) messages.

Source: https://docs.cm.com/messaging/viber/otp-template-messages

# Overview

Templates are predefined messages stored on Viber side which allows you to define specific values upon sending the message. Templates are used for sending one time password (OTP) messages.

:::danger[Deprecated: effective July 15, 2026]
OTP template messages are deprecated and will no longer be supported after July 15, 2026. From that date, OTP and all other transactional messages must use the new [Transactional template messages format](https://docs.cm.com/messaging/viber/transactional-templates), which includes a dedicated OTP category with an "Copy" button for recipients.

**Contact your account manager to get your new templates set up ahead of the deadline.**
:::

## Rules and restrictions

The following template types are supported by Viber:

| Template | Template ID |
| :- | :- |
| Basic OTP | 0aac888f-2ee2-4112-9659-1755a951966a |
| Basic OTP valid for 5 min | c2cdc028-a48b-4187-bbaf-3aaa137b6e23 |
| OTP with business/platform | c33cccaf-735f-4d62-8383-a76bf4999e2d |
| Basic OTP with code validity time | bed0942f-e07e-4879-834b-29cc4cf3ec35 |
| OTP with code type & validity time | 60d67b38-b9fb-444a-80e6-754447e010c6 |
| OTP with details on OTP action/platform | 210ee8a9-1ed5-43cd-96e4-65bba311ab40 |
| OTP with business/platform name & validity time | 6c929cef-29b4-4349-bc9d-2a07bdbb6e43 |
| OTP with type of code | 82ba31a3-db42-4e87-82e8-33fa92b9e5ed |
| OTP with business/platform name & code reason | be56d97b-2a33-4c89-ac5f-f555a2c827d9 |

The following restrictions apply for using (OTP) templates:

| Field | Required | Remarks |
| :- | :- | :- |
| templateId | Yes | One of the given template ids. |
| templateLanguage | Yes | Default: en (English) |
| templateParams | Yes | See examples below for the required params per template type. |

## Basic OTP

In the example below we send a basic OTP template:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "0aac888f-2ee2-4112-9659-1755a951966a",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```

## Basic OTP valid for 5 minutes

In the example below we send a basic OTP template that's valid for 5 minutes:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "c2cdc028-a48b-4187-bbaf-3aaa137b6e23",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```

## OTP with business/platform name

In the example below we send an OTP template with a business/platform name:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "c33cccaf-735f-4d62-8383-a76bf4999e2d",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]",
                                        "business_platform_name": "[business_platform_name]"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```

## Basic OTP with code validity time

In the example below we send a basic OTP template with a given validity time:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "bed0942f-e07e-4879-834b-29cc4cf3ec35",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]",
                                        "code_validity_time": 2
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```

## OTP with code type & validity time

In the example below we send an OTP template with a given validity time and pin type:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "60d67b38-b9fb-444a-80e6-754447e010c6",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]",
                                        "code_validity_time": 2,
                                        "pin_type": "[pin_type]"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```

## OTP with business/platform name & validity time

In the example below we send an OTP template with a given validity time and business platform name:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "6c929cef-29b4-4349-bc9d-2a07bdbb6e43",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]",
                                        "business_platform_name": "[business_platform_name]",
                                        "code_validity_time": 2
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```

## OTP with type of code

In the example below we send an OTP template with a given pin/code type:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "82ba31a3-db42-4e87-82e8-33fa92b9e5ed",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]",
                                        "pin_type": "[pin_type]"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```

## OTP with details on OTP action/platform

In the example below we send an OTP template with a given business/platform action:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "210ee8a9-1ed5-43cd-96e4-65bba311ab40",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]",
                                        "business_platform_action_name": "[business_platform_action_name]"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```

## OTP with business/platform name & code reason

In the example below we send an OTP template with a given reason and business/platform name:

```json
{
    "messages": {
        "msg": [
            {
                "from": "",
                "to": [
                    {
                        "number": ""
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Viber"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "template": {
                                "viber": {
                                    "template_id": "be56d97b-2a33-4c89-ac5f-f555a2c827d9",
                                    "template_language": "en",
                                    "template_params": {
                                        "pin": "[pin]",
                                        "business_platform_name": "[business_platform_name]",
                                        "code_reason": "[code_reason]"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
```
